diff --git a/web/src/app.css b/web/src/app.css index b245ae0..35f364a 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -171,19 +171,20 @@ input { border-radius: var(--radius-sm); background: none; color: inherit; - font-size: var(--text-7); + font-size: var(--text-4); line-height: 1; } /* * A small link to the rules, used wherever a screen has room for one but not * for a button that would compete with the primary action beside it: the - * landing page, the game header and the lobby all point at the same route - * through the same class, so it reads as one control rather than three. + * landing page and the lobby point at the same route through the same class, + * so it reads as one control. The game header, with no room for the words, + * uses a "?" icon-button instead. */ .rules-link { color: var(--text-muted); - font-size: var(--text-4); + font-size: var(--text-2); text-decoration: underline; } @@ -224,7 +225,7 @@ input { border-radius: var(--radius-sm); background: var(--surface); color: var(--text); - font-size: var(--text-5); + font-size: var(--text-2); font-weight: 600; } diff --git a/web/src/lib/components/AlertBanner.svelte b/web/src/lib/components/AlertBanner.svelte new file mode 100644 index 0000000..a45932d --- /dev/null +++ b/web/src/lib/components/AlertBanner.svelte @@ -0,0 +1,52 @@ + + + + + diff --git a/web/src/lib/components/ArmedButton.svelte b/web/src/lib/components/ArmedButton.svelte index cc4be46..fd4f207 100644 --- a/web/src/lib/components/ArmedButton.svelte +++ b/web/src/lib/components/ArmedButton.svelte @@ -44,19 +44,20 @@ /** @type {ReturnType} */ let timer; + function disarm() { + clearTimeout(timer); + armed = false; + } + $effect(() => { - if (disabled) { - clearTimeout(timer); - armed = false; - } + if (disabled) disarm(); }); $effect(() => () => clearTimeout(timer)); function press() { if (armed) { - clearTimeout(timer); - armed = false; + disarm(); onconfirm(); return; } diff --git a/web/src/lib/components/ChatPanel.svelte b/web/src/lib/components/ChatPanel.svelte index 71ba1ec..7b7b456 100644 --- a/web/src/lib/components/ChatPanel.svelte +++ b/web/src/lib/components/ChatPanel.svelte @@ -1,4 +1,5 @@
@@ -134,15 +132,7 @@ {/if} {#if game.state.error} - + game.clearError()}>{game.state.error} {/if} {#if game.state.phase === 'over'} @@ -213,27 +203,19 @@ class="claim-dead-end" label={t.claimDeadEnd} confirmLabel={t.claimDeadEndSure} - disabled={!canClaimDeadEnd} + disabled={!canPlayInsteadOfAWord} onconfirm={onclaimdeadend} /> {#if game.state.claimError} - + game.clearClaimError()}>{game.state.claimError} {/if} {/if} @@ -338,26 +320,19 @@ line-height: 1.35; } - .error, + /* Not an AlertBanner: it is not announced (see the markup), and it + carries the one control that can do anything about it. */ .offline { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0; - padding: var(--space-3) var(--space-3); + padding: var(--space-3); border-radius: var(--radius-sm); - font-size: var(--text-2); - } - - .error { - background: var(--danger-soft); - color: var(--danger); - } - - .offline { background: var(--surface-alt); color: var(--warn); + font-size: var(--text-2); } .offline button { @@ -404,85 +379,63 @@ gap: var(--space-2); } - /* :global(): these are ArmedButton's own -

+ game.clearError()}>{s.error} {:else if actionHeld} - + {t.reconnecting} {/if}
@@ -333,10 +321,11 @@ * touch target is the full 44 all the same, expanded out of the flow by a * pseudo-element so the row keeps its height. * - * :global(): ArmedButton renders its own