feat(settings/user/birthday): intro and outro animation
This commit is contained in:
@@ -8,7 +8,32 @@ const BIRTHDAY_DAY = 25;
|
|||||||
const BIRTHDAY_MONTH = 4;
|
const BIRTHDAY_MONTH = 4;
|
||||||
const BIRTHDAY_YEAR = 2002;
|
const BIRTHDAY_YEAR = 2002;
|
||||||
|
|
||||||
const handleActivateB = () => {
|
const monthRef = useTemplateRef<InstanceType<typeof NumberInput>>("month");
|
||||||
|
const dayRef = useTemplateRef<InstanceType<typeof NumberInput>>("day");
|
||||||
|
const yearRef = useTemplateRef<InstanceType<typeof NumberInput>>("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 handleActivateB = async () => {
|
||||||
|
await animateOutro();
|
||||||
store.closeSubMenu();
|
store.closeSubMenu();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -42,7 +67,10 @@ const handleActivateA = () => {
|
|||||||
|
|
||||||
confirmationModal.open({
|
confirmationModal.open({
|
||||||
text,
|
text,
|
||||||
onClosed: () => store.closeSubMenu(),
|
onClosed: async () => {
|
||||||
|
await animateOutro();
|
||||||
|
store.closeSubMenu();
|
||||||
|
},
|
||||||
timeout: 2000,
|
timeout: 2000,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -53,18 +81,21 @@ defineOptions({ render: () => null });
|
|||||||
<template>
|
<template>
|
||||||
<!-- date format may change based on the language (d/m/y is superior btw) -->
|
<!-- date format may change based on the language (d/m/y is superior btw) -->
|
||||||
<NumberInput
|
<NumberInput
|
||||||
|
ref="month"
|
||||||
:model-value="BIRTHDAY_MONTH"
|
:model-value="BIRTHDAY_MONTH"
|
||||||
:title="$t('settings.user.birthday.month')"
|
:title="$t('settings.user.birthday.month')"
|
||||||
:x="1 * 16"
|
:x="1 * 16"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
/>
|
/>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
|
ref="day"
|
||||||
:model-value="BIRTHDAY_DAY"
|
:model-value="BIRTHDAY_DAY"
|
||||||
:title="$t('settings.user.birthday.day')"
|
:title="$t('settings.user.birthday.day')"
|
||||||
:x="5 * 16"
|
:x="5 * 16"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
/>
|
/>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
|
ref="year"
|
||||||
:model-value="BIRTHDAY_YEAR"
|
:model-value="BIRTHDAY_YEAR"
|
||||||
:title="$t('settings.user.birthday.year')"
|
:title="$t('settings.user.birthday.year')"
|
||||||
:digits="4"
|
:digits="4"
|
||||||
|
|||||||
Reference in New Issue
Block a user