feat: add shots on goal bar to live game cards, clean up gitignore
All checks were successful
CI / Lint (push) Successful in 5s
CI / Test (push) Successful in 5s
CI / Build & Push (push) Successful in 13s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-29 13:19:59 -04:00
parent def491a4d4
commit 9ad563ed3f
7 changed files with 81 additions and 1 deletions

View File

@@ -40,6 +40,8 @@ function renderLiveGame(game) {
const dot = running ? `<span class="live-dot"></span>` : '';
const shots = !intermission ? shotsBar(game['Away Shots'], game['Home Shots']) : '';
const hype = !intermission ? `
<div class="hype-meter">
<span class="hype-label">Hype Meter</span>
@@ -59,6 +61,7 @@ function renderLiveGame(game) {
</div>
${teamRow(game, 'Away', 'live')}
${teamRow(game, 'Home', 'live')}
${shots}
${hype}
</div>`;
}
@@ -101,7 +104,7 @@ function teamRow(game, side, state) {
const pp = game[`${side} Power Play`];
const record = game[`${side} Record`];
const sogHtml = (state !== 'pre' && sog !== undefined)
const sogHtml = (state === 'final' && sog !== undefined)
? `<span class="team-sog">${sog} SOG</span>` : '';
const ppHtml = pp ? `<span class="team-pp">${pp}</span>` : '';
@@ -120,6 +123,26 @@ function teamRow(game, side, state) {
</div>`;
}
// ── Shots Bar ────────────────────────────────────────
function shotsBar(away, home) {
const total = (away || 0) + (home || 0);
const awayPct = total > 0 ? (away / total) * 100 : 50;
const homePct = total > 0 ? (home / total) * 100 : 50;
return `
<div class="shots-bar">
<div class="shots-row">
<span class="shots-num">${away}</span>
<div class="shots-track">
<div class="shots-fill shots-fill-away" style="width:${awayPct}%"></div>
<div class="shots-fill shots-fill-home" style="width:${homePct}%"></div>
</div>
<span class="shots-num">${home}</span>
</div>
<span class="shots-label">Shots on Goal</span>
</div>`;
}
// ── Gauge ────────────────────────────────────────────
function updateGauges() {