feat: inline power play indicator as compact badge in card header
CI / Lint (push) Successful in 45s
CI / Test (push) Successful in 8s
CI / Build & Push (push) Successful in 1m8s

Moves the PP team + countdown into the badges row next to period and
clock, freeing up a full line of vertical space on each live card.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 11:05:38 -04:00
parent 61202b2a70
commit 108b77ed39
2 changed files with 7 additions and 44 deletions
+3 -8
View File
@@ -69,12 +69,12 @@ function renderLiveGame(game) {
<div class="badges">
${periodLabel}
<span class="badge" ${clockAttrs}>${time}</span>
${ppBadge(game)}
</div>
${dot}
</div>
${teamRow(game, 'Away', 'live')}
${teamRow(game, 'Home', 'live')}
${ppIndicator(game)}
${hype}
</div>`;
}
@@ -134,7 +134,7 @@ function teamRow(game, side, state) {
</div>`;
}
function ppIndicator(game) {
function ppBadge(game) {
const awayPP = game['Away Power Play'];
const homePP = game['Home Power Play'];
const pp = awayPP || homePP;
@@ -145,12 +145,7 @@ function ppIndicator(game) {
const seconds = timeToSeconds(timeStr);
const attrs = `data-seconds="${seconds}" data-received-at="${Date.now()}" data-pp-clock`;
return `
<div class="pp-indicator">
<span class="pp-label">PP</span>
<span class="pp-team">${team}</span>
<span class="pp-clock" ${attrs}>${timeStr}</span>
</div>`;
return `<span class="badge badge-pp">PP ${team} <span ${attrs}>${timeStr}</span></span>`;
}
// ── Gauge ────────────────────────────────────────────