Skip to content

Commit a699d03

Browse files
Merge pull request #360 from nextcloud/feature/359/animate-assistant-icon
Add pulse animation to assistant icon
2 parents dd3e46b + a485671 commit a699d03

1 file changed

Lines changed: 39 additions & 3 deletions

File tree

src/components/icons/AssistantIcon.vue

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515
:height="size"
1616
enable-background="new 0 0 24 24"
1717
version="1.1"
18-
viewBox="0 0 24 24"
18+
viewBox="-4 -4 32 32"
1919
xml:space="preserve"
20-
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" />
20+
xmlns="http://www.w3.org/2000/svg"
21+
transform="scale(1.333)">
22+
<!-- Split each star into its own group for animation -->
23+
<g class="star star1">
24+
<path d="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75" />
25+
</g>
26+
<g class="star star2">
27+
<path d="M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5" />
28+
</g>
29+
<g class="star star3">
30+
<path d="M19,15L17.74,17.74L15,19L17.74,20.25L19,23L20.25,20.25L23,19L20.25,17.74" />
31+
</g>
2232
</svg>
2333
</span>
2434
</template>
@@ -31,14 +41,40 @@ export default {
3141
type: String,
3242
default: '',
3343
},
44+
3445
fillColor: {
3546
type: String,
3647
default: 'currentColor',
3748
},
49+
3850
size: {
3951
type: Number,
4052
default: 24,
4153
},
4254
},
4355
}
4456
</script>
57+
58+
<style scoped>
59+
.star {
60+
transform-origin: center center;
61+
}
62+
63+
.assistant-icon:hover .star1 {
64+
animation: pulse 0.6s ease forwards;
65+
}
66+
67+
.assistant-icon:hover .star2 {
68+
animation: pulse 0.6s ease 0.1s forwards;
69+
}
70+
71+
.assistant-icon:hover .star3 {
72+
animation: pulse 0.6s ease 0.2s forwards;
73+
}
74+
75+
@keyframes pulse {
76+
0% { transform: scale(1); }
77+
50% { transform: scale(1.4); }
78+
100% { transform: scale(1); }
79+
}
80+
</style>

0 commit comments

Comments
 (0)