diff --git a/app/components/Settings/BottomScreen/Menus/Clock/Date.vue b/app/components/Settings/BottomScreen/Menus/Clock/Date.vue index ea0701b..ca7cb41 100644 --- a/app/components/Settings/BottomScreen/Menus/Clock/Date.vue +++ b/app/components/Settings/BottomScreen/Menus/Clock/Date.vue @@ -12,11 +12,37 @@ useIntervalFn(() => { now.value = new Date(); }, 1000); -const handleCancel = () => { +const monthRef = useTemplateRef>("month"); +const dayRef = useTemplateRef>("day"); +const yearRef = useTemplateRef>("year"); + +const animateIntro = async () => { + await Promise.all([ + monthRef.value?.animateIntro(), + dayRef.value?.animateIntro(), + yearRef.value?.animateIntro(), + ]); +}; + +const animateOutro = async () => { + await Promise.all([ + monthRef.value?.animateOutro(), + dayRef.value?.animateOutro(), + yearRef.value?.animateOutro(), + ]); +}; + +onMounted(() => { + animateIntro(); +}); + +const handleCancel = async () => { + await animateOutro(); store.closeSubMenu(); }; -const handleConfirm = () => { +const handleConfirm = async () => { + await animateOutro(); store.closeSubMenu(); }; @@ -29,18 +55,21 @@ defineOptions({ render: () => null });