Skip to content

Commit bd40b02

Browse files
committed
feat(favoriates) add css wobble animation to icon hover and tool drag for better user experience
1 parent 0b1b98f commit bd40b02

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

src/pages/Home.page.vue

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function onUpdateFavoriteTools() {
7676
<h3 class="mb-5px mt-25px font-500 text-neutral-400">
7777
{{ $t('home.categories.favoriteTools') }}
7878
<c-tooltip :tooltip="$t('home.categories.favoritesDndToolTip')">
79-
<n-icon :component="IconDragDrop" size="18" />
79+
<n-icon :component="IconDragDrop" size="18" class="icon-wobble" />
8080
</c-tooltip>
8181
</h3>
8282
<Draggable
@@ -133,18 +133,36 @@ function onUpdateFavoriteTools() {
133133
background-color: #ccc;
134134
border: 2px dashed #666;
135135
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
136-
transform: scale(1.1);
137-
animation: ghost-favorites-draggable-animation 0.2s ease-out;
136+
animation: ghost-favorites-draggable-animation 0.1s ease-out;
138137
}
139-
140138
@keyframes ghost-favorites-draggable-animation {
141139
0% {
142140
opacity: 0;
143-
transform: scale(0.9);
141+
transform: scale(0.9) rotate(-1deg);
142+
}
143+
50% {
144+
opacity: 0.4;
145+
transform: scale(1.0) rotate(2deg);
144146
}
145147
100% {
146148
opacity: 0.4;
147-
transform: scale(1.0);
149+
transform: scale(1.0) rotate(-1deg);
150+
}
151+
}
152+
153+
.icon-wobble:hover {
154+
transform: scale(1.3);
155+
animation: icon-wobble-animation 0.2s ease-in-out;
156+
}
157+
@keyframes icon-wobble-animation {
158+
0% {
159+
transform: scale(1.3) rotate(-10deg);
160+
}
161+
50% {
162+
transform: scale(1.3) rotate(20deg);
163+
}
164+
100% {
165+
transform: scale(1.3) rotate(-10deg);
148166
}
149167
}
150168
</style>

0 commit comments

Comments
 (0)