From a805cc265c23f17de1c48b0ccd51f30cb851844a Mon Sep 17 00:00:00 2001 From: Niki Wix Skaarup Date: Sat, 5 Apr 2025 21:40:49 +0200 Subject: [PATCH 1/2] scroll --- src/components/main.svelte | 2 +- src/components/progress-table.svelte | 9 +++++++-- src/index.html | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/main.svelte b/src/components/main.svelte index bc64388..bade871 100644 --- a/src/components/main.svelte +++ b/src/components/main.svelte @@ -4,6 +4,6 @@ const { children }: { children?: Snippet } = $props(); -
+
{@render children?.()}
diff --git a/src/components/progress-table.svelte b/src/components/progress-table.svelte index 4c46317..55d86c7 100644 --- a/src/components/progress-table.svelte +++ b/src/components/progress-table.svelte @@ -28,7 +28,9 @@ }); -
+
{#await entriesPromise}

Loading entries...

{:then entries} @@ -36,6 +38,9 @@

No entries.

{:else} {@render table(entries)} +
{/if} {:catch error}

@@ -49,7 +54,7 @@ class="@container grid w-full grid-cols-[auto,1fr,auto,auto,auto] gap-1 font-light @lg:gap-3" >

id
name
diff --git a/src/index.html b/src/index.html index fd62144..640ea0b 100644 --- a/src/index.html +++ b/src/index.html @@ -1,7 +1,7 @@ - Progress tracker - skaarup.dev + Progress tracker Date: Sat, 5 Apr 2025 22:10:30 +0200 Subject: [PATCH 2/2] scroll --- bun.lock | 4 ++-- src/components/progress-table.svelte | 25 ++++++++++++++++++++++++- tsconfig.json | 3 +-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/bun.lock b/bun.lock index def43e6..42b4bed 100644 --- a/bun.lock +++ b/bun.lock @@ -6,8 +6,8 @@ "dependencies": { "bun-plugin-svelte": "^0.0.6", "bun-plugin-tailwind": "^0.0.15", - "svelte": "^5.25.6", - "tailwindcss": "^4.1.2", + "svelte": "^5.25.7", + "tailwindcss": "^4.1.3", }, "devDependencies": { "@types/bun": "latest", diff --git a/src/components/progress-table.svelte b/src/components/progress-table.svelte index 55d86c7..0ac9330 100644 --- a/src/components/progress-table.svelte +++ b/src/components/progress-table.svelte @@ -1,9 +1,15 @@
{ + const scrollTop = container.scrollTop; + const scrollHeight = container.scrollHeight; + const clientHeight = container.clientHeight; + + scrolled = scrollTop > 32; + }} > {#await entriesPromise}

Loading entries...

@@ -61,14 +75,23 @@ + + {#if scrolled} +
+ {/if}
{#each entries as entry (entry.id)}
{entry.id}
{entry.name} {@render done(entry.finished)} diff --git a/tsconfig.json b/tsconfig.json index f3f358a..9c62f74 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,5 @@ "noUnusedLocals": false, "noUnusedParameters": false, "noPropertyAccessFromIndexSignature": false - }, - "exclude": ["node_modules", "dist", "build", "out", "coverage"] + } }