diff --git a/frontend/app.vue b/frontend/app.vue index c1b55b0..180919e 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -2287,6 +2287,12 @@ function waitCalendarZoom() { }); } +function waitMs(ms: number) { + return new Promise((resolve) => { + setTimeout(() => resolve(), ms); + }); +} + async function animateCalendarZoomIn(sourceElement: HTMLElement | null, apply: () => void) { const fromRect = getElementRectInCalendar(sourceElement); const viewportRect = getCalendarViewportRect(); @@ -2299,12 +2305,13 @@ async function animateCalendarZoomIn(sourceElement: HTMLElement | null, apply: ( calendarZoomBusy.value = true; try { primeCalendarRect(fromRect); + morphCalendarRect(viewportRect); + const switchLag = 260; + await waitMs(Math.max(0, CALENDAR_ZOOM_DURATION_MS - switchLag)); calendarSceneMasked.value = true; - await nextTick(); apply(); await nextTick(); - morphCalendarRect(viewportRect); - await waitCalendarZoom(); + await waitMs(switchLag); } finally { calendarSceneMasked.value = false; calendarZoomBusy.value = false;