From: Carl Worth Date: Sun, 8 Mar 2026 13:54:31 +0000 (-0400) Subject: Use a full tile's worth of space between words in the score display. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=3504e216f4ffbea4977fa1fb1b869239eb7cc45b;p=lmno.games Use a full tile's worth of space between words in the score display. Previously, the inter-word display was a tiny gap and things all ran together. Both the tile size and the gap between tiles are variables for consistent computation. --- diff --git a/anagrams/anagrams.css b/anagrams/anagrams.css index 2c7304f..2999555 100644 --- a/anagrams/anagrams.css +++ b/anagrams/anagrams.css @@ -1,3 +1,8 @@ +:root { + --word-tile-size: 32px; + --word-tile-gap: 2px; +} + .game-info { margin-bottom: 1em; } @@ -187,10 +192,16 @@ font-size: 1em; } +.player-words-row { + display: flex; + flex-wrap: wrap; + row-gap: 2px; + column-gap: calc(var(--word-tile-size) + var(--word-tile-gap)); +} + .word-display { display: inline-flex; - gap: 2px; - margin: 2px 4px 2px 0; + gap: var(--word-tile-gap); cursor: default; } @@ -199,8 +210,8 @@ } .word-display .tile { - width: 32px; - height: 32px; + width: var(--word-tile-size); + height: var(--word-tile-size); font-size: 16px; cursor: inherit; } diff --git a/anagrams/anagrams.jsx b/anagrams/anagrams.jsx index b647686..ede6c2e 100644 --- a/anagrams/anagrams.jsx +++ b/anagrams/anagrams.jsx @@ -1033,14 +1033,16 @@ class Game extends React.Component { {pw.words.length === 0 ? ( No words yet ) : ( - pw.words.map(w => ( - this.steal_word(sid, w) : null} - /> - )) +
+ {pw.words.map(w => + this.steal_word(sid, w) : null} + /> + )} +
)} ); @@ -1074,13 +1076,15 @@ class Game extends React.Component { {sorted.map(entry => (

{entry.name}

- {entry.words.map((w, i) => ( - - {w.split("").map((ch, j) => ( - - ))} - - ))} +
+ {entry.words.map((w, i) => + + {w.split("").map((ch, j) => ( + + ))} + + )} +
))}