From c32a5301a02eef180ffe9ebff02a82c16bad5ec3 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Tue, 23 Jul 2024 10:32:18 +0000 Subject: [PATCH] web/updates: make page scrollable on navigation sides on desktop --- web/src/routes/updates/+page.svelte | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/web/src/routes/updates/+page.svelte b/web/src/routes/updates/+page.svelte index c1e0f907..5e624e6d 100644 --- a/web/src/routes/updates/+page.svelte +++ b/web/src/routes/updates/+page.svelte @@ -19,6 +19,7 @@ page: Promise; }>; let currentIndex = 0; + let wrapper: HTMLDivElement; { const hash = $page.url.hash.replace("#", ""); @@ -57,6 +58,17 @@ else if (e.key === "ArrowRight") loadNext(); }; + const handleScroll = (e: WheelEvent) => { + if (!(e.target instanceof HTMLElement)) { + return; + } + + if (!wrapper.contains(e.target)) { + wrapper.scrollTop += e.deltaY; + e.preventDefault(); + } + } + $: prev = versions[currentIndex - 1]; $: next = versions[currentIndex + 1]; $: currentIndex, loadChangelog(); @@ -68,9 +80,17 @@ - + -
+
{#if changelog}
{#if prev} @@ -80,7 +100,7 @@ {/if}
-
+
{#await changelog.page} {#key changelog.version}