diff --git a/.gitignore b/.gitignore index e0313ee..8d8fc97 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ nhl_standings.db **/__pycache__ .venv/ +.coverage +.pytest_cache/ diff --git a/app/static/script.js b/app/static/script.js index 19e87c5..1613a4b 100644 --- a/app/static/script.js +++ b/app/static/script.js @@ -40,6 +40,8 @@ function renderLiveGame(game) { const dot = running ? `` : ''; + const shots = !intermission ? shotsBar(game['Away Shots'], game['Home Shots']) : ''; + const hype = !intermission ? `
Hype Meter @@ -59,6 +61,7 @@ function renderLiveGame(game) {
${teamRow(game, 'Away', 'live')} ${teamRow(game, 'Home', 'live')} + ${shots} ${hype} `; } @@ -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) ? `${sog} SOG` : ''; const ppHtml = pp ? `${pp}` : ''; @@ -120,6 +123,26 @@ function teamRow(game, side, state) { `; } +// ── 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 ` +
+
+ ${away} +
+
+
+
+ ${home} +
+ Shots on Goal +
`; +} + // ── Gauge ──────────────────────────────────────────── function updateGauges() { diff --git a/app/static/styles.css b/app/static/styles.css index 101c35d..d114072 100644 --- a/app/static/styles.css +++ b/app/static/styles.css @@ -196,6 +196,61 @@ main { white-space: nowrap; } +/* ── Shots Bar ──────────────────────────────────── */ + +.shots-bar { + margin-top: 0.75rem; +} + +.shots-row { + display: flex; + align-items: center; + gap: 0.4rem; +} + +.shots-track { + flex: 1; + height: 5px; + border-radius: 99px; + overflow: hidden; + display: flex; + background: var(--badge-bg); +} + +.shots-fill { + height: 100%; + transition: width 0.5s ease; +} + +.shots-fill-away { + background: #4a90e2; + border-radius: 99px 0 0 99px; +} + +.shots-fill-home { + background: #f97316; + border-radius: 0 99px 99px 0; +} + +.shots-num { + font-size: 0.72rem; + font-weight: 700; + color: var(--text); + min-width: 1.25rem; + text-align: center; +} + +.shots-label { + display: block; + font-size: 0.6rem; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.1em; + color: var(--text-muted); + margin-top: 0.25rem; + text-align: center; +} + /* ── Hype Meter ─────────────────────────────────── */ .hype-meter { diff --git a/tests/__pycache__/__init__.cpython-313.pyc b/tests/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 1f5d8db..0000000 Binary files a/tests/__pycache__/__init__.cpython-313.pyc and /dev/null differ diff --git a/tests/__pycache__/conftest.cpython-313-pytest-8.3.4.pyc b/tests/__pycache__/conftest.cpython-313-pytest-8.3.4.pyc deleted file mode 100644 index 6eb554d..0000000 Binary files a/tests/__pycache__/conftest.cpython-313-pytest-8.3.4.pyc and /dev/null differ diff --git a/tests/__pycache__/test_process_data.cpython-313-pytest-8.3.4.pyc b/tests/__pycache__/test_process_data.cpython-313-pytest-8.3.4.pyc deleted file mode 100644 index fda81da..0000000 Binary files a/tests/__pycache__/test_process_data.cpython-313-pytest-8.3.4.pyc and /dev/null differ diff --git a/tests/__pycache__/test_routes.cpython-313-pytest-8.3.4.pyc b/tests/__pycache__/test_routes.cpython-313-pytest-8.3.4.pyc deleted file mode 100644 index 3947e89..0000000 Binary files a/tests/__pycache__/test_routes.cpython-313-pytest-8.3.4.pyc and /dev/null differ