diff --git a/template/src/lib/components/Hall.svelte b/template/src/lib/components/Hall.svelte index ed061b8..5a3264a 100644 --- a/template/src/lib/components/Hall.svelte +++ b/template/src/lib/components/Hall.svelte @@ -168,12 +168,16 @@ {#if game.options?.length}
{#each game.options as o (o.key)} - + {@const chosen = o.choices.find((c) => c.value === options[o.key])} +
+ + {#if chosen?.note}

{chosen.note}

{/if} +
{/each}
{/if} @@ -601,6 +605,11 @@ gap: 0.5rem; font-size: 0.9rem; } + + .option-note { + margin: 0.2rem 0 0; + max-width: 22em; + } .tally { display: grid; grid-template-columns: max-content 1fr; diff --git a/template/src/lib/game/spec.ts b/template/src/lib/game/spec.ts index 5be71f4..dd5c4fe 100644 --- a/template/src/lib/game/spec.ts +++ b/template/src/lib/game/spec.ts @@ -25,7 +25,8 @@ export interface Outcome { export interface TableOption { key: string; label: string; - choices: { value: string; label: string }[]; + /** A choice's note is shown under the selector while it is chosen: the one line a player needs to pick. */ + choices: { value: string; label: string; note?: string }[]; /** The value a table gets when the host chooses nothing. */ default: string; } diff --git a/template/src/routes/join/[code]/+page.svelte b/template/src/routes/join/[code]/+page.svelte index f48dd1a..c304c9e 100644 --- a/template/src/routes/join/[code]/+page.svelte +++ b/template/src/routes/join/[code]/+page.svelte @@ -121,7 +121,7 @@ {/if} {/if} How to play - Rules + Rules {#if room} {/if} diff --git a/template/src/routes/rules/+page.svelte b/template/src/routes/rules/+page.svelte index c6e18c0..a69dea2 100644 --- a/template/src/routes/rules/+page.svelte +++ b/template/src/routes/rules/+page.svelte @@ -2,6 +2,10 @@ // The rules page: the game's own text, structured for reading mid-game. // Keep the original rules text verbatim in docs/ and render from it // where you can, so the page and the engine follow one source. + import { page } from '$app/state'; + + /** Opened from a table, the page offers the way back to it. */ + const room = $derived((page.url.searchParams.get('room') ?? '').toUpperCase()); @@ -10,7 +14,7 @@
- Back to the hall · How to play + {#if room}Back to your game · {/if}Back to the hall · How to play

The rules

One paragraph on where these rules come from and which edition or text this page follows.