Skip to content

Commit

Permalink
feat: add sweep animation for founder membership icon
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jul 20, 2024
1 parent 0632647 commit e5eef48
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions apps/client/components/Home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
<div class="text-3xl font-medium">{{ userStore.user?.username }}</div>
<span
v-if="userStore.isFounderMembership()"
class="i-ph-crown-simple-fill bg-yellow-400"
class="i-ph-crown-simple-fill relative overflow-hidden bg-yellow-400"
title="尊贵的创始会员,感谢您对 Earthworm 的大力支持!"
></span>
>
<div class="glimmer"></div>
</span>
</div>
<div class="text-md text-gray-400">
{{ userStore.user?.name }}
Expand Down Expand Up @@ -83,4 +85,42 @@ function useCalendarGraph() {
}
</script>

<style scoped></style>
<style scoped>
.glimmer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(139, 0, 0, 0.5) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: glimmer 2s infinite;
}
@keyframes glimmer {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(100%);
}
}
/* 添加浏览器前缀 做浏览器的兼容 */
@-webkit-keyframes glimmer {
0% {
-webkit-transform: translateX(-100%);
}
100% {
-webkit-transform: translateX(100%);
}
}
.glimmer {
-webkit-animation: glimmer 2s infinite;
}
</style>

0 comments on commit e5eef48

Please sign in to comment.