From d37c95a46de34f0f5886595bb7bc7a90a269c895 Mon Sep 17 00:00:00 2001 From: Vincent van der Wal Date: Sat, 25 Jul 2026 16:30:58 +0200 Subject: [PATCH] perf enhancements --- .../[location]/HistoricalMeteograms.svelte | 20 +++-- .../weather/week/[location]/+page.svelte | 2 +- .../week/[location]/DailyStripSticky.svelte | 89 ++++++++++++------- .../week/[location]/MeteogramCharts.svelte | 40 +++++---- 4 files changed, 89 insertions(+), 62 deletions(-) diff --git a/src/routes/weather/historical/[location]/HistoricalMeteograms.svelte b/src/routes/weather/historical/[location]/HistoricalMeteograms.svelte index c475657..bc0c02f 100644 --- a/src/routes/weather/historical/[location]/HistoricalMeteograms.svelte +++ b/src/routes/weather/historical/[location]/HistoricalMeteograms.svelte @@ -131,15 +131,6 @@ > + scroll to zoom - {#if zoomActive} - - {/if} + + {#if zoomActive} + + {/if} diff --git a/src/routes/weather/week/[location]/+page.svelte b/src/routes/weather/week/[location]/+page.svelte index 3ec0d4a..0670cc2 100644 --- a/src/routes/weather/week/[location]/+page.svelte +++ b/src/routes/weather/week/[location]/+page.svelte @@ -154,7 +154,7 @@
-
+
Math.min(hi, Math.max(lo, v)); - const lerp = (a: number, b: number) => a + (b - a) * progress; function findScrollParent(el: HTMLElement | null): HTMLElement | Window { let node = el?.parentElement ?? null; @@ -107,34 +106,21 @@ }); }); - // ─── Derived sizing ───────────────────────────────────────────────────────── - const CELL_W = 64; - // Full height fits the whole stack (weekday, label, icon, temps, precip+wind) - // without clipping; the horizontal scroll container also clips vertically, so - // the content must fit inside the cell. - let cellH = $derived(lerp(134, 64)); - let iconSize = $derived(lerp(40, 20)); - // Top padding eases from pt-1.5 (6px) when full to pt-0.5 (2px) when compact. - let padTop = $derived(lerp(6, 1)); - // The secondary rows collapse (height + opacity together) faster than the - // overall shrink, so the cell reaches a clean square before it stops shrinking. - let detailFactor = $derived(clamp(1 - progress * 1.6)); - let relFactor = $derived(clamp(1 - progress * 2)); - // Bar background/divider/shadow fade in promptly once it starts collapsing. - let chromeOpacity = $derived(clamp(progress / 0.35)); + // All progress-driven sizing lives in CSS (via the single `--p` custom property + // set on the strip), so a scroll frame writes ONE value instead of re-patching + // height/padding/opacity inline styles on every cell. -
+
{#if daily} {#if canExtendPast && onExtendPast}