diff options
| author | Adam Malczewski <[email protected]> | 2026-04-09 20:52:18 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-04-09 20:52:18 +0900 |
| commit | b5a5ea8d300284e0f473df0e514cdc642857b03c (patch) | |
| tree | e791331edfcb3e75885a420d4f7e8bfe9a5f0506 /src/lib/components | |
| parent | cbf41c0e495367bb3f582ea22aabdc03bd2d046d (diff) | |
| download | flashair-speedsync-b5a5ea8d300284e0f473df0e514cdc642857b03c.tar.gz flashair-speedsync-b5a5ea8d300284e0f473df0e514cdc642857b03c.zip | |
auto-polling of new photos
Diffstat (limited to 'src/lib/components')
| -rw-r--r-- | src/lib/components/ImageList.svelte | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/components/ImageList.svelte b/src/lib/components/ImageList.svelte index 532cd3b..5048e1b 100644 --- a/src/lib/components/ImageList.svelte +++ b/src/lib/components/ImageList.svelte @@ -7,9 +7,15 @@ images: FlashAirFileEntry[]; selectedPath: string | undefined; onSelect: (file: FlashAirFileEntry) => void; + newImagePaths: Set<string>; + onAnimationDone: (path: string) => void; } - let { images, selectedPath, onSelect }: Props = $props(); + let { images, selectedPath, onSelect, newImagePaths, onAnimationDone }: Props = $props(); + + function handleRevealEnd(path: string) { + onAnimationDone(path); + } </script> <div class="h-full overflow-y-auto bg-base-100"> @@ -22,7 +28,11 @@ {#each images as file (file.path)} {@const thumbUrl = flashair.thumbnailUrl(file.path)} {@const isSelected = file.path === selectedPath} - <li> + {@const isNew = newImagePaths.has(file.path)} + <li + class="image-reveal overflow-hidden {isNew ? 'image-reveal-enter' : ''}" + onanimationend={() => handleRevealEnd(file.path)} + > <button class="flex flex-col w-full rounded-lg p-1.5 text-left transition-colors {isSelected ? 'bg-primary text-primary-content' |
