Skip to content

Commit a2c11f8

Browse files
Add pulse animation to assistant icon
Signed-off-by: Marco Ambrosini <marcoambrosini@proton.me>
1 parent 2b838d0 commit a2c11f8

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

src/components/icons/AssistantIcon.vue

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@
1515
:height="size"
1616
enable-background="new 0 0 24 24"
1717
version="1.1"
18-
viewBox="0 0 24 24"
18+
viewBox="-5 -5 34 34"
1919
xml:space="preserve"
2020
xmlns="http://www.w3.org/2000/svg">
21-
<path d="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5M19,15L17.74,17.74L15,19L17.74,20.25L19,23L20.25,20.25L23,19L20.25,17.74" />
21+
<!-- Split each star into its own group for animation -->
22+
<g class="star star1">
23+
<path d="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75" />
24+
</g>
25+
<g class="star star2">
26+
<path d="M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5" />
27+
</g>
28+
<g class="star star3">
29+
<path d="M19,15L17.74,17.74L15,19L17.74,20.25L19,23L20.25,20.25L23,19L20.25,17.74" />
30+
</g>
2231
</svg>
2332
</span>
2433
</template>
@@ -31,14 +40,40 @@ export default {
3140
type: String,
3241
default: '',
3342
},
43+
3444
fillColor: {
3545
type: String,
3646
default: 'currentColor',
3747
},
48+
3849
size: {
3950
type: Number,
4051
default: 24,
4152
},
4253
},
4354
}
4455
</script>
56+
57+
<style scoped>
58+
.star {
59+
transform-origin: center center;
60+
}
61+
62+
.assistant-icon:hover .star1 {
63+
animation: pulse 0.6s ease forwards;
64+
}
65+
66+
.assistant-icon:hover .star2 {
67+
animation: pulse 0.6s ease 0.1s forwards;
68+
}
69+
70+
.assistant-icon:hover .star3 {
71+
animation: pulse 0.6s ease 0.2s forwards;
72+
}
73+
74+
@keyframes pulse {
75+
0% { transform: scale(1); }
76+
50% { transform: scale(1.4); }
77+
100% { transform: scale(1); }
78+
}
79+
</style>

0 commit comments

Comments
 (0)