From 244c8cb4d4cd8bc35979ddd0d4e5fdb14d190aa6 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 30 Oct 2024 09:38:35 -0500 Subject: [PATCH] feat(web): scrubber label and animation (#13815) * feat(web): scrubber label and animation * tune x fly in distance * refactor * lint and minor fix * fly height --- .../components/photos-page/asset-grid.svelte | 11 +++++++++ .../scrubber/scrubber.svelte | 24 +++++++++++++++---- web/src/lib/stores/timeline.store.ts | 3 +++ 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 web/src/lib/stores/timeline.store.ts diff --git a/web/src/lib/components/photos-page/asset-grid.svelte b/web/src/lib/components/photos-page/asset-grid.svelte index 5795ed04ce..ba9d79df71 100644 --- a/web/src/lib/components/photos-page/asset-grid.svelte +++ b/web/src/lib/components/photos-page/asset-grid.svelte @@ -36,6 +36,7 @@ import { page } from '$app/stores'; import type { UpdatePayload } from 'vite'; import { generateId } from '$lib/utils/generate-id'; + import { isTimelineScrolling } from '$lib/stores/timeline.store'; export let isSelectionMode = false; export let singleSelect = false; @@ -331,7 +332,17 @@ } }; + let scrollObserverTimer: NodeJS.Timeout; + const _handleTimelineScroll = () => { + $isTimelineScrolling = true; + if (scrollObserverTimer) { + clearTimeout(scrollObserverTimer); + } + scrollObserverTimer = setTimeout(() => { + $isTimelineScrolling = false; + }, 1000); + leadout = false; if ($assetStore.timelineHeight < safeViewport.height * 2) { // edge case - scroll limited due to size of content, must adjust - use the overall percent instead diff --git a/web/src/lib/components/shared-components/scrubber/scrubber.svelte b/web/src/lib/components/shared-components/scrubber/scrubber.svelte index e2cc638650..f76cb50f6b 100644 --- a/web/src/lib/components/shared-components/scrubber/scrubber.svelte +++ b/web/src/lib/components/shared-components/scrubber/scrubber.svelte @@ -1,9 +1,12 @@