Skip to content

Commit 74a7fdd

Browse files
committed
feat: Add app opening animation
1 parent 75dd7bf commit 74a7fdd

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

src/renderer/views/Apps.vue

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,11 @@
192192
v-for="app of computedApps"
193193
:key="app.id"
194194
class="flex relative flex-row gap-2 justify-between items-center p-2 my-0 backdrop-blur-xl backdrop-brightness-150 cursor-pointer generic-hover bg-neutral-800/20"
195-
:class="{ 'bg-gradient-to-r from-yellow-600/20 bg-neutral-800/20': app.Source === 'custom' }"
196-
@click="winboat.launchApp(app)"
195+
:class="{
196+
'bg-gradient-to-r from-yellow-600/20 bg-neutral-800/20': app.Source === 'custom',
197+
'app-launching': launchingAppId === app.id,
198+
}"
199+
@click="handleLaunchApp(app)"
197200
@contextmenu="openContextMenu($event, app)"
198201
>
199202
<div class="flex flex-row items-center gap-2 w-[85%]">
@@ -400,6 +403,16 @@ const customAppAddErrors = computed(() => {
400403
return errors;
401404
});
402405
406+
const launchingAppId = ref<string | null>(null);
407+
408+
function handleLaunchApp(app: WinApp) {
409+
launchingAppId.value = app.id!;
410+
winboat.launchApp(app);
411+
setTimeout(() => {
412+
launchingAppId.value = null;
413+
}, 1200);
414+
}
415+
403416
const contextMenuRef = ref();
404417
const contextMenuTarget = ref<WinApp | null>(null);
405418
@@ -547,7 +560,30 @@ x-menu .qualifier {
547560
display: none;
548561
}
549562
550-
x-menu
563+
@keyframes launch-pulse {
564+
0% {
565+
transform: scale(1);
566+
box-shadow: 0 0 0 0 rgba(167, 138, 249, 0);
567+
}
568+
10% {
569+
transform: scale(0.97);
570+
}
571+
30% {
572+
transform: scale(1);
573+
box-shadow: 0 0 14px 3px rgba(167, 138, 249, 0.4);
574+
}
575+
65% {
576+
box-shadow: 0 0 20px 5px rgba(167, 138, 249, 0.15);
577+
}
578+
100% {
579+
transform: scale(1);
580+
box-shadow: 0 0 0 0 rgba(167, 138, 249, 0);
581+
}
582+
}
583+
584+
.app-launching {
585+
animation: launch-pulse 1.2s ease-out;
586+
}
551587
552588
.apps-move, /* apply transition to moving elements */
553589
.apps-enter-active,

0 commit comments

Comments
 (0)