diff options
| author | Fuwn <[email protected]> | 2026-06-04 09:28:32 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-06-04 09:28:32 +0000 |
| commit | f34de9760850489d8f08eddb9bd33a41beda4771 (patch) | |
| tree | 949f6b91e65980d0c2ff28141120d42261ad1696 /src/lib/List/ListTitle.svelte | |
| parent | fix(security): allow vercel.live and loosen font-src in CSP (diff) | |
| download | due.moe-f34de9760850489d8f08eddb9bd33a41beda4771.tar.xz due.moe-f34de9760850489d8f08eddb9bd33a41beda4771.zip | |
On revalidation the {#await} branch swaps and remounts CleanAnimeList,
resetting NumberTicker's tween to 0 so it always counted up. Persist the
last displayed count in AnimeListTemplate (which survives the remount) and
feed it as the ticker's start, so the count animates in the real
direction: down when an item leaves due/upcoming, up when one arrives.
Diffstat (limited to 'src/lib/List/ListTitle.svelte')
| -rw-r--r-- | src/lib/List/ListTitle.svelte | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/List/ListTitle.svelte b/src/lib/List/ListTitle.svelte index f24476fe..2ccb591d 100644 --- a/src/lib/List/ListTitle.svelte +++ b/src/lib/List/ListTitle.svelte @@ -6,6 +6,7 @@ import type { Title } from "./mediaTitle"; export let time: number | undefined = undefined; export let count = -1337; +export let start = 0; export let title: Title = { title: "Media List", hint: "This is a media list.", @@ -20,8 +21,9 @@ export let hideCount = false; {#if !hideCount} <span class="opaque list-title-count"> {#if count === -1337}...{:else}<NumberTicker + {start} end={count} - duration={Math.min(2500, Math.max(500, Math.abs(count) * 10))} + duration={Math.min(2500, Math.max(500, Math.abs(count - start) * 10))} />{/if} </span> {/if} |