From 3d8c47d3167d0f6cecdd82d98f0c4ef16d65e77c Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 27 Sep 2023 18:17:11 -0600 Subject: [PATCH] Integrate Ken's "monarch of the category" --- theme/scoreboard.css | 5 +++++ theme/scoreboard.mjs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/theme/scoreboard.css b/theme/scoreboard.css index 7381764..c95fa65 100644 --- a/theme/scoreboard.css +++ b/theme/scoreboard.css @@ -57,6 +57,11 @@ width: inherit; max-width: 100%; } +.topscore::before { + content: "✩"; + font-size: 75%; + vertical-align: top; +} @media only screen and (max-width: 450px) { #rankings span.teamname { diff --git a/theme/scoreboard.mjs b/theme/scoreboard.mjs index 5eaf0d3..e01a6a2 100644 --- a/theme/scoreboard.mjs +++ b/theme/scoreboard.mjs @@ -74,7 +74,8 @@ async function update() { continue } - let block = teampoints.appendChild(document.createElement("span")) + // XXX: Figure out how to do this properly with flexbox + let block = row.appendChild(document.createElement("span")) let points = scores.GetPoints(category, teamID) let width = MaxScoreWidth * score / topScore @@ -82,6 +83,7 @@ async function update() { block.title = `${points} points` block.style.width = `${width}%` block.classList.add("category", `cat${categoryNumber}`) + block.classList.toggle("topscore", score == 1) categoryNumber += 1 }