It's nice to know when a player (or group of players) did as well as
could be done.
transition-duration: 2s;
transition-delay: 1s;
}
+
+.label {
+ border-radius: 4px;
+ background-color: var(--accent-color-bright);
+ color: var(--text-fg-on-accent-bright);
+ font-size: 72%;
+ font-weight: bold;
+ padding: 0.25em;
+ text-transform: uppercase;
+}
const players_total = 1 + state.other_players.length;
if (state.scores) {
+
+ let perfect_score = 0;
+ for (let i = 0;
+ i < state.active_prompt.items &&
+ i < state.scores.words.length;
+ i++)
+ {
+ perfect_score += state.scores.words[i].players.length;
+ }
+
return (
<div className="scores">
<h2>{state.active_prompt.prompt}</h2>
<h2>Scores</h2>
<ul>
{state.scores.scores.map(score => {
+ let perfect = null;
+ if (score.score == perfect_score) {
+ perfect = <span className="label">Perfect!</span>;
+ }
return (
<li key={score.players[0]}>
{score.players.join("/")}: {score.score} {perfect}