From b579941964dc0cd9a21dda4918caf15583f2d753 Mon Sep 17 00:00:00 2001 From: Astra Date: Sun, 27 Sep 2026 15:37:37 +0100 Subject: [PATCH] Scoreboard: label warmup and round scores, count players and bots per team The score caption says "Warmup, no rounds yet" during warmup and "Rounds won, T vs CT" otherwise. Each team panel on the public page shows its player and bot count, and its score as rounds won, or a Warmup label during warmup. The top navigation scrolls sideways on narrow screens instead of overflowing. --- internal/web/assets/admin.js | 2 +- internal/web/assets/public.js | 8 ++++++-- internal/web/assets/styles.css | 10 +++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/internal/web/assets/admin.js b/internal/web/assets/admin.js index 2130f84..a9baff5 100644 --- a/internal/web/assets/admin.js +++ b/internal/web/assets/admin.js @@ -51,7 +51,7 @@ function liveHeader(s) {
${s.count}/${s.maxPlayers}Players
-
${s.scoreT} : ${s.scoreCt}T vs CT
+
${s.scoreT} : ${s.scoreCt}${s.warmup ? "Warmup, no rounds yet" : "Rounds won, T vs CT"}
${s.staffOnline}Staff online
`; diff --git a/internal/web/assets/public.js b/internal/web/assets/public.js index 44ff170..1ffec26 100644 --- a/internal/web/assets/public.js +++ b/internal/web/assets/public.js @@ -28,8 +28,12 @@ async function server() { } const side = (team, name, score) => { const list = s.players.filter((p) => p.team === team).sort((a, b) => b.kills - a.kills); + const humans = list.filter((p) => !p.bot).length; return `
-

${name}

${score}
+
+

${name}

${humans} ${humans === 1 ? "player" : "players"}${list.length > humans ? `, ${list.length - humans} ${list.length - humans === 1 ? "bot" : "bots"}` : ""}

+ ${s.warmup ? 'Warmup' : `
${score}${score === 1 ? "round" : "rounds"} won
`} +
${list.length ? ` @@ -52,7 +56,7 @@ async function server() {
${s.count}/${s.maxPlayers}Players
-
${s.scoreT} : ${s.scoreCt}T vs CT
+
${s.scoreT} : ${s.scoreCt}${s.warmup ? "Warmup, no rounds yet" : "Rounds won, T vs CT"}
${s.staffOnline}Staff online
${s.address ? `
diff --git a/internal/web/assets/styles.css b/internal/web/assets/styles.css index 5bce718..184fffe 100644 --- a/internal/web/assets/styles.css +++ b/internal/web/assets/styles.css @@ -950,9 +950,12 @@ dialog::backdrop { background: rgba(5, 6, 9, 0.65); } .side { overflow: hidden; } .side.ct { box-shadow: inset 0 3px 0 #6fa3e8; } .side.t { box-shadow: inset 0 3px 0 #e3b353; } -.side-score { font: 700 32px/1 var(--display); } -.side.ct .side-score { color: #6fa3e8; } -.side.t .side-score { color: #e3b353; } +.side-score { display: grid; justify-items: end; gap: 2px; } +.side-score b { font: 700 32px/1 var(--display); } +.side-score small { color: var(--muted); font-size: 13px; } +.side.ct .side-score b { color: #6fa3e8; } +.side.t .side-score b { color: #e3b353; } +.side-warmup { color: var(--muted); font: 600 17px/1 var(--display); letter-spacing: 0.01em; } .side .who .rank { display: flex; margin-top: 2px; font-size: 13px; } @media (max-width: 900px) { @@ -966,6 +969,7 @@ dialog::backdrop { background: rgba(5, 6, 9, 0.65); } .topbar-inner { gap: 8px; padding: 0 12px; } .tabs { gap: 0; } .tabs a { padding: 0 6px; font-size: 15px; } + .topbar nav { min-width: 0; overflow-x: auto; scrollbar-width: none; } .signin { padding: 0 8px; } .hide-xs { display: none; } .show-xs { display: inline; }
PlayerKillsDeathsPing