Compare commits
No commits in common. "2ee2f7286bd6c15882f964f8adfd4e197a21037b" and "cc453863e34d8d814ce2dac76e71333182e09941" have entirely different histories.
2ee2f7286b
...
cc453863e3
5 changed files with 9 additions and 36 deletions
4
bun.lock
4
bun.lock
|
@ -6,8 +6,8 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bun-plugin-svelte": "^0.0.6",
|
"bun-plugin-svelte": "^0.0.6",
|
||||||
"bun-plugin-tailwind": "^0.0.15",
|
"bun-plugin-tailwind": "^0.0.15",
|
||||||
"svelte": "^5.25.7",
|
"svelte": "^5.25.6",
|
||||||
"tailwindcss": "^4.1.3",
|
"tailwindcss": "^4.1.2",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
const { children }: { children?: Snippet } = $props();
|
const { children }: { children?: Snippet } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main id="main-content" class="content grid min-h-(--main-min-height) py-4">
|
<main id="main-content" class="content grid min-h-(--main-min-height) pt-4 pb-20">
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { fade } from 'svelte/transition';
|
|
||||||
import { cubicInOut } from 'svelte/easing';
|
|
||||||
import { fetchEntries, formatter } from '../util';
|
import { fetchEntries, formatter } from '../util';
|
||||||
|
|
||||||
let entriesPromise = $state(fetchEntries());
|
let entriesPromise = $state(fetchEntries());
|
||||||
|
|
||||||
let interval: Parameters<typeof clearInterval>[0] = undefined;
|
let interval: Parameters<typeof clearInterval>[0] = undefined;
|
||||||
|
|
||||||
let scrolled = $state(false);
|
|
||||||
let container: HTMLDivElement;
|
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
|
||||||
|
@ -34,17 +28,7 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div class="col-[content]">
|
||||||
bind:this={container}
|
|
||||||
class="relative col-[content] max-h-[calc(var(--main-min-height)---spacing(8))] overflow-y-auto pr-0.5"
|
|
||||||
onscroll={(e) => {
|
|
||||||
const scrollTop = container.scrollTop;
|
|
||||||
const scrollHeight = container.scrollHeight;
|
|
||||||
const clientHeight = container.clientHeight;
|
|
||||||
|
|
||||||
scrolled = scrollTop > 32;
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{#await entriesPromise}
|
{#await entriesPromise}
|
||||||
<p class="text-center">Loading entries...</p>
|
<p class="text-center">Loading entries...</p>
|
||||||
{:then entries}
|
{:then entries}
|
||||||
|
@ -52,9 +36,6 @@
|
||||||
<p class="text-center">No entries.</p>
|
<p class="text-center">No entries.</p>
|
||||||
{:else}
|
{:else}
|
||||||
{@render table(entries)}
|
{@render table(entries)}
|
||||||
<div
|
|
||||||
class="sticky inset-x-0 bottom-0 h-16 bg-gradient-to-t from-gray-950 to-transparent"
|
|
||||||
></div>
|
|
||||||
{/if}
|
{/if}
|
||||||
{:catch error}
|
{:catch error}
|
||||||
<p class="mx-auto max-w-md text-center">
|
<p class="mx-auto max-w-md text-center">
|
||||||
|
@ -68,30 +49,21 @@
|
||||||
class="@container grid w-full grid-cols-[auto,1fr,auto,auto,auto] gap-1 font-light @lg:gap-3"
|
class="@container grid w-full grid-cols-[auto,1fr,auto,auto,auto] gap-1 font-light @lg:gap-3"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="sticky top-0 col-span-5 grid grid-cols-[subgrid] gap-1 bg-gray-950 py-2 text-gray-400 capitalize"
|
class="sticky top-(--header-height) col-span-5 grid grid-cols-[subgrid] gap-1 bg-gray-950 py-2 text-gray-400 capitalize"
|
||||||
>
|
>
|
||||||
<div>id</div>
|
<div>id</div>
|
||||||
<div class="px-1">name</div>
|
<div class="px-1">name</div>
|
||||||
<div class="hidden px-1 @3xl:block">done</div>
|
<div class="hidden px-1 @3xl:block">done</div>
|
||||||
<div class="hidden px-1 @5xl:block">created</div>
|
<div class="hidden px-1 @5xl:block">created</div>
|
||||||
<div class="hidden px-1 @xl:block">updated</div>
|
<div class="hidden px-1 @xl:block">updated</div>
|
||||||
|
|
||||||
{#if scrolled}
|
|
||||||
<div
|
|
||||||
in:fade={{ duration: 500, easing: cubicInOut }}
|
|
||||||
out:fade={{ duration: 250, easing: cubicInOut }}
|
|
||||||
class="absolute inset-x-0 top-full h-16 bg-gradient-to-b from-gray-950 to-transparent"
|
|
||||||
></div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{#each entries as entry (entry.id)}
|
{#each entries as entry (entry.id)}
|
||||||
<div class="col-span-5 grid grid-cols-[subgrid] gap-1">
|
<div class="col-span-5 grid grid-cols-[subgrid] gap-1">
|
||||||
<div class="py-2 text-xs text-gray-400/50">{entry.id}</div>
|
<div class="py-2 text-xs text-gray-400/50">{entry.id}</div>
|
||||||
<a
|
<a
|
||||||
href={entry.href}
|
href={entry.href}
|
||||||
class="line-clamp-1 block px-2 py-1 text-nowrap text-ellipsis text-gray-200 capitalize transition-colors hover:text-pink-600 hover:underline"
|
class="block px-2 py-1 text-gray-200 capitalize transition-colors hover:text-pink-600 hover:underline"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
title={entry.name}
|
|
||||||
referrerpolicy="no-referrer">{entry.name}</a
|
referrerpolicy="no-referrer">{entry.name}</a
|
||||||
>
|
>
|
||||||
{@render done(entry.finished)}
|
{@render done(entry.finished)}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" class="min-h-dvh">
|
<html lang="en" class="min-h-dvh">
|
||||||
<head>
|
<head>
|
||||||
<title>Progress tracker</title>
|
<title>Progress tracker - skaarup.dev</title>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link
|
<link
|
||||||
|
|
|
@ -24,5 +24,6 @@
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noPropertyAccessFromIndexSignature": false
|
"noPropertyAccessFromIndexSignature": false
|
||||||
}
|
},
|
||||||
|
"exclude": ["node_modules", "dist", "build", "out", "coverage"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue