From 85c046571f215416273292b2d3f0a978cb864bb4 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 25 Nov 2026 10:22:18 +0000 Subject: [PATCH] Tint color-blind ownership symbols and center turn-order badges --- web-client/src/board.ts | 10 ++++++---- web-client/src/style.css | 14 +++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/web-client/src/board.ts b/web-client/src/board.ts index 9cd56904..5ba990b2 100644 --- a/web-client/src/board.ts +++ b/web-client/src/board.ts @@ -863,18 +863,19 @@ export class World { } } } - private ownershipBadge(index: number, symbols?: string[], barbarian = false) { + private ownershipBadge(index: number, symbols?: string[], barbarian = false, color = '#25372e') { const canvas = document.createElement('canvas'); canvas.width = canvas.height = 64; const context = canvas.getContext('2d')!; + const ink = barbarian ? '#25372e' : color; context.fillStyle = '#fff7e6'; - context.strokeStyle = '#2d392f'; - context.lineWidth = 3; + context.strokeStyle = barbarian ? '#2d392f' : color; + context.lineWidth = 3.5; context.beginPath(); context.arc(32, 32, 29, 0, Math.PI * 2); context.fill(); context.stroke(); - context.fillStyle = '#25372e'; + context.fillStyle = ink; context.font = 'bold 42px system-ui'; context.textAlign = 'center'; context.textBaseline = 'middle'; @@ -1400,6 +1401,7 @@ export class World { player.id, s.playerSymbols, player.civilization === 'Barbarians', + playerColor(player.id, s.colorBlind, s.playerColors), ); badge.position.set(markers.badge.x, markers.badge.y, markers.pole.z); cityModel.add(badge); diff --git a/web-client/src/style.css b/web-client/src/style.css index 1eb037c8..2ef5b0aa 100644 --- a/web-client/src/style.css +++ b/web-client/src/style.css @@ -429,10 +429,13 @@ small { position: absolute; right: -3px; bottom: -3px; - display: grid; - place-items: center; - min-width: 14px; + display: flex; + align-items: center; + justify-content: center; + width: 14px; height: 14px; + padding: 0 0 0.5px; + box-sizing: border-box; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); @@ -440,6 +443,7 @@ small { font: 600 9px / 1 'DM Sans', sans-serif; + font-variant-numeric: tabular-nums; } .player-emblem img { width: 32px; @@ -814,8 +818,8 @@ small { align-items: center; justify-content: center; background: #fff8e8; - color: #1f2e2b; - border: 1px solid #23332f48; + color: var(--medallion-bg, #1f2e2b); + border: 1px solid color-mix(in srgb, var(--medallion-bg, #23332f) 65%, #23332f); font: 700 7px/1 'DM Sans', sans-serif;