Frontend: rozmery a farby dosky centralizovane do boardTheme

Sizing konstanty (seat/standings/guess/totals) presunute do boardTheme.ts a farebne odlisenie tipu v PlayerCircle (nad tip = terakota).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tim
2026-07-12 19:37:48 +02:00
co-authored by Claude Opus 4.8
parent 1636757217
commit 97c71cf6e1
4 changed files with 58 additions and 12 deletions
+9 -1
View File
@@ -12,6 +12,11 @@ interface Props {
export default function PlayerCircle({ name, won, guess, active, size = 52 }: Props) {
const nameFont = Math.max(9, Math.round(size * 0.17));
const valueFont = Math.round(size * 0.32);
// Bid status at a glance: terracotta once the player has taken more tricks
// than bid (the bid is already lost), gold while exactly on target, cream
// while still chasing. Scoring: exact match = 10 + bid, anything else = 0.
const guessColor =
guess === null ? '#d8cba6' : won > guess ? '#e08066' : won === guess ? '#e8c14a' : '#d8cba6';
// Oval: height a touch shorter than size so it reads as an ellipse. Width
// starts at `size` (a circle for short names) but grows with the name via
// fit-content + padding, up to a cap beyond which the name is ellipsised
@@ -58,7 +63,10 @@ export default function PlayerCircle({ name, won, guess, active, size = 52 }: Pr
}}
>
{won}
<span style={{ fontSize: valueFont * 0.6, color: '#b0a585' }}>/{guess ?? '?'}</span>
{/* The bid matters as much as the tricks won — keep it nearly as big
and in readable cream; only the slash separator stays muted. */}
<span style={{ fontSize: valueFont * 0.7, color: '#b0a585' }}>/</span>
<span style={{ fontSize: valueFont , color: guessColor }}>{guess ?? '?'}</span>
</span>
</div>
);