From 6039b6c2481c4bdcc118e2d8894a41981ebee4cb Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Mon, 28 Sep 2026 13:52:15 -0400 Subject: [PATCH] Tabs.svelte: the about panel's strip, shared with long reading pages Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG --- CONVENTIONS.md | 4 +- template/src/lib/components/About.svelte | 79 +++-------------- template/src/lib/components/Tabs.svelte | 104 +++++++++++++++++++++++ 3 files changed, 118 insertions(+), 69 deletions(-) create mode 100644 template/src/lib/components/Tabs.svelte diff --git a/CONVENTIONS.md b/CONVENTIONS.md index a7c4f68..c45311b 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -13,7 +13,9 @@ README. is and unread talk), *your reports to the keeper*, and *about this game — a labor of love*, which opens the about panel: a dialog of tabs (The game, The tally, More games, Send word; a game may add its own, as Dip's - Playing here), `About.svelte`, with each game's words in its hall. + Playing here), `About.svelte`, with each game's words in its hall. Its + strip is `Tabs.svelte`, which also serves a long reading page such as the + guide or the rules, where `address` lets a #fragment open a tab. - **A table** is a room. Its code is four letters or digits from an alphabet with no look-alikes, and its link is `/join/CODE`. The masthead button reads *invite friends · room CODE* and copies the link. Whoever opened diff --git a/template/src/lib/components/About.svelte b/template/src/lib/components/About.svelte index 505b7ab..d706126 100644 --- a/template/src/lib/components/About.svelte +++ b/template/src/lib/components/About.svelte @@ -1,12 +1,8 @@ @@ -47,24 +30,8 @@

{title}

-
- {#each tabs as t, i (t.id)} - - {/each} -
-
- {@render shown.body()} +
+
@@ -110,39 +77,15 @@ cursor: pointer; padding: 0.2rem 0.4rem; } - .tabs { - display: flex; - flex-wrap: wrap; - gap: 0.2rem 0.4rem; - border-bottom: 1px solid var(--rule-strong); - margin-bottom: 0.8rem; - } - .tabs button { - background: none; - border: none; - border-bottom: 3px solid transparent; - color: inherit; - opacity: 0.75; - font: inherit; - padding: 0.35rem 0.5rem 0.4rem; - cursor: pointer; - } - .tabs button.on { - opacity: 1; - border-bottom-color: currentColor; - } .body { overflow: auto; min-height: 12rem; } - .body :global(p + p) { - margin-top: 0.7rem; - } - .body :global(h3) { - font-size: 1.05rem; - margin: 1rem 0 0.4rem; - } - .body :global(h3:first-child) { - margin-top: 0; + /* The tab strip stays in view while a long tab scrolls beneath it. */ + .body :global([role='tablist']) { + position: sticky; + top: 0; + z-index: 1; + background: var(--slate); } diff --git a/template/src/lib/components/Tabs.svelte b/template/src/lib/components/Tabs.svelte new file mode 100644 index 0000000..a513968 --- /dev/null +++ b/template/src/lib/components/Tabs.svelte @@ -0,0 +1,104 @@ + + + + +
+ {#each tabs as t, i (t.id)} + + {/each} +
+
+ {@render shown.body()} +
+ +