Integrate Ken's "monarch of the category"

This commit is contained in:
Neale Pickett 2023-09-27 18:17:11 -06:00
parent 5dfcb6324f
commit 3d8c47d316
2 changed files with 8 additions and 1 deletions

View File

@ -57,6 +57,11 @@
width: inherit; width: inherit;
max-width: 100%; max-width: 100%;
} }
.topscore::before {
content: "✩";
font-size: 75%;
vertical-align: top;
}
@media only screen and (max-width: 450px) { @media only screen and (max-width: 450px) {
#rankings span.teamname { #rankings span.teamname {

View File

@ -74,7 +74,8 @@ async function update() {
continue 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 points = scores.GetPoints(category, teamID)
let width = MaxScoreWidth * score / topScore let width = MaxScoreWidth * score / topScore
@ -82,6 +83,7 @@ async function update() {
block.title = `${points} points` block.title = `${points} points`
block.style.width = `${width}%` block.style.width = `${width}%`
block.classList.add("category", `cat${categoryNumber}`) block.classList.add("category", `cat${categoryNumber}`)
block.classList.toggle("topscore", score == 1)
categoryNumber += 1 categoryNumber += 1
} }