feat(settings): block interactions while animation is happening

This commit is contained in:
2026-02-08 20:19:40 +01:00
parent 4de10dd309
commit cfaf8c8d29
11 changed files with 83 additions and 2 deletions

View File

@@ -8,19 +8,24 @@ const BIRTHDAY_DAY = 25;
const BIRTHDAY_MONTH = 4;
const BIRTHDAY_YEAR = 2002;
const isAnimating = ref(true);
const monthRef = useTemplateRef<InstanceType<typeof NumberInput>>("month");
const dayRef = useTemplateRef<InstanceType<typeof NumberInput>>("day");
const yearRef = useTemplateRef<InstanceType<typeof NumberInput>>("year");
const animateIntro = async () => {
isAnimating.value = true;
await Promise.all([
monthRef.value?.animateIntro(),
dayRef.value?.animateIntro(),
yearRef.value?.animateIntro(),
]);
isAnimating.value = false;
};
const animateOutro = async () => {
isAnimating.value = true;
await Promise.all([
monthRef.value?.animateOutro(),
dayRef.value?.animateOutro(),
@@ -33,11 +38,13 @@ onMounted(() => {
});
const handleActivateB = async () => {
if (isAnimating.value) return;
await animateOutro();
store.closeSubMenu();
};
const handleActivateA = () => {
if (isAnimating.value) return;
const today = new Date();
const currentYear = today.getFullYear();