aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Layout
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-05-19 02:40:22 +0000
committerFuwn <[email protected]>2026-05-19 02:40:22 +0000
commit7e2495bd7579a16151ef875b571989492d190985 (patch)
treeaa03bf0eacbb55ce9887fc476ac7fb0d5b5fd807 /src/lib/Layout
parentperf(load): font-display swap and content-visibility on badge wall (diff)
downloaddue.moe-7e2495bd7579a16151ef875b571989492d190985.tar.xz
due.moe-7e2495bd7579a16151ef875b571989492d190985.zip
feat(nav): direction-aware view transitions, header excluded
Wires SvelteKit's onNavigate hook into document.startViewTransition, with a callback that bypasses cleanly when the API is unavailable or the user prefers reduced motion. Direction is computed from navigation.from/to.pathname using the same navigationOrder logic as the existing fly slide (forward through the ordered routes, backward otherwise; entering /user is +1, leaving -1). Sign is written to --vt-direction on :root before the transition fires. ::view-transition-old(root) and -new(root) get explicit slide keyframes that read --vt-direction as a sign multiplier on translateX(200px), replacing the browser default crossfade with a direction-aware page-flip that matches the prior feel. .header carries view-transition-name: app-header so it is pulled out of the root snapshot and treated as a shared element. Since the header lives outside the {#key data.url} block and is the same DOM element on both sides, its morph is a visual no-op: only the body slides past it instead of the whole viewport. Svelte's existing fly transition in Root.svelte still runs hidden beneath the snapshot for browsers without View Transitions support, acting as a graceful fallback.
Diffstat (limited to 'src/lib/Layout')
0 files changed, 0 insertions, 0 deletions