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.
This commit is contained in:
parent
10694c69bc
commit
b579941964
3 changed files with 14 additions and 6 deletions
|
|
@ -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 `<section class="panel side ${team === 3 ? "ct" : "t"}">
|
||||
<div class="panel-head"><h2>${name}</h2><b class="side-score">${score}</b></div>
|
||||
<div class="panel-head">
|
||||
<div><h2>${name}</h2><p>${humans} ${humans === 1 ? "player" : "players"}${list.length > humans ? `, ${list.length - humans} ${list.length - humans === 1 ? "bot" : "bots"}` : ""}</p></div>
|
||||
${s.warmup ? '<span class="side-warmup">Warmup</span>' : `<div class="side-score"><b>${score}</b><small>${score === 1 ? "round" : "rounds"} won</small></div>`}
|
||||
</div>
|
||||
${list.length ? `<table>
|
||||
<thead><tr><th>Player</th><th class="num">Kills</th><th class="num">Deaths</th><th class="num hide-sm">Ping</th></tr></thead>
|
||||
<tbody>
|
||||
|
|
@ -52,7 +56,7 @@ async function server() {
|
|||
</div>
|
||||
<div class="live-stats">
|
||||
<div><b>${s.count}<span class="faint">/${s.maxPlayers}</span></b><small>Players</small></div>
|
||||
<div><b><span class="team t score">${s.scoreT}</span> <span class="faint">:</span> <span class="team ct score">${s.scoreCt}</span></b><small>T vs CT</small></div>
|
||||
<div><b><span class="team t score">${s.scoreT}</span> <span class="faint">:</span> <span class="team ct score">${s.scoreCt}</span></b><small>${s.warmup ? "Warmup, no rounds yet" : "Rounds won, T vs CT"}</small></div>
|
||||
<div><b>${s.staffOnline}</b><small>Staff online</small></div>
|
||||
</div>
|
||||
${s.address ? `<div class="live-join">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue