From 4eed175e69a5a9ba317201f13f46f57cdad69970 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Thu, 5 Feb 2026 21:10:37 +0100 Subject: [PATCH] feat(settings): block interactions while animating --- .../Settings/BottomScreen/Menus/Menus.vue | 22 ++++++++++++++++--- .../Settings/TopScreen/Notifications.vue | 16 +++++++++++++- app/stores/settings.ts | 2 ++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/app/components/Settings/BottomScreen/Menus/Menus.vue b/app/components/Settings/BottomScreen/Menus/Menus.vue index a555667..c8cf337 100644 --- a/app/components/Settings/BottomScreen/Menus/Menus.vue +++ b/app/components/Settings/BottomScreen/Menus/Menus.vue @@ -147,7 +147,13 @@ const { select, selected, selectorPosition } = useButtonNavigation({ } return true; }, - disabled: computed(() => settingsStore.currentSubMenu !== null), + disabled: computed( + () => + settingsStore.currentSubMenu !== null || + settingsStore.isIntro || + settingsStore.isOutro || + settingsStore.animatingNotification, + ), selectorAnimation: { duration: 0.11, ease: "none", @@ -224,6 +230,16 @@ const selectorXOffset = computed(() => { return 0; } }); + +const handleActivateB = () => { + if (settingsStore.isIntro || settingsStore.isOutro) return; + settingsStore.animateOutro(); +}; + +const handleActivateA = () => { + if (settingsStore.isIntro || settingsStore.isOutro) return; + select(getParentMenu(selected.value)); +}; diff --git a/app/components/Settings/TopScreen/Notifications.vue b/app/components/Settings/TopScreen/Notifications.vue index f121aa9..75f0f3c 100644 --- a/app/components/Settings/TopScreen/Notifications.vue +++ b/app/components/Settings/TopScreen/Notifications.vue @@ -104,6 +104,7 @@ const animateNotification = ( if (prev !== null && curr === null) { // slide down visibleRef.value = prev; + store.animatingNotification = true; gsap.fromTo( offsetRef, { value: 0 }, @@ -113,16 +114,29 @@ const animateNotification = ( ease: "none", onComplete: () => { visibleRef.value = null; + setTimeout(() => { + store.animatingNotification = false; + }, 50); }, }, ); } else if (prev === null && curr !== null) { // slide up + store.animatingNotification = true; visibleRef.value = curr; gsap.fromTo( offsetRef, { value: 48 }, - { value: 0, duration: 0.2, ease: "none" }, + { + value: 0, + duration: 0.2, + ease: "none", + onComplete: () => { + setTimeout(() => { + store.animatingNotification = false; + }, 50); + }, + }, ); } }; diff --git a/app/stores/settings.ts b/app/stores/settings.ts index 1ff3fa9..aae6b80 100644 --- a/app/stores/settings.ts +++ b/app/stores/settings.ts @@ -38,6 +38,8 @@ export const useSettingsStore = defineStore("settings", { menuOffsets: [0, -48, -48, -48] as [number, number, number, number], menuYOffset: 72, + animatingNotification: false, + isIntro: true, isOutro: false, }),