diff --git a/package.json b/package.json index b305dae..d6424c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shelem", - "version": "1.0.0", + "version": "1.1.2", "description": "Shelem card game — multiplayer", "main": "server.js", "scripts": { diff --git a/public/app.js b/public/app.js index 62f2b97..664630f 100644 --- a/public/app.js +++ b/public/app.js @@ -1700,11 +1700,20 @@ async function validateAuth() { updateAuthBar(); } +// Show the running app version in the lobby footer (served from /api/config) +async function loadAppVersion() { + try { + const d = await fetch('/api/config').then(r => r.json()); + if (d.version) $('app-version').textContent = `v${d.version}`; + } catch { /* ignore */ } +} + // ─── Boot ───────────────────────────────────────────────────── document.addEventListener('DOMContentLoaded', async () => { initLobby(); wireGameEvents(); applyBarBottom(); + loadAppVersion(); // Drop any stale/corrupted auth token before we use it to connect await validateAuth(); diff --git a/public/index.html b/public/index.html index 4413da6..62460dc 100644 --- a/public/index.html +++ b/public/index.html @@ -91,6 +91,7 @@

+
diff --git a/public/style.css b/public/style.css index 771ea8e..7169878 100644 --- a/public/style.css +++ b/public/style.css @@ -1033,6 +1033,15 @@ input:focus { border-color: var(--gold); } .lb-table td { border-bottom: 1px solid rgba(255,255,255,.05); } .lb-table tr:hover td { background: rgba(255,255,255,.04); } +/* ── App version footer ───── */ +.app-version { + text-align: center; + margin-top: 14px; + font-size: .72rem; + color: rgba(255,255,255,.35); + letter-spacing: .5px; +} + /* ── Round-by-round breakdown ───── */ .round-breakdown-wrap { margin: 6px 0 2px; } .rb-scroll { max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch; } diff --git a/public/sw.js b/public/sw.js index 3d6ca4d..15e06fb 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,5 +1,5 @@ 'use strict'; -const CACHE_NAME = 'shelem-v2'; +const CACHE_NAME = 'shelem-v3'; // ── Generate all 55 card paths ────────────────────────────────── const SUITS = ['CLUB', 'DIAMOND', 'HEART', 'SPADE']; diff --git a/server.js b/server.js index f573897..e8124ce 100644 --- a/server.js +++ b/server.js @@ -132,8 +132,10 @@ app.use(express.static(path.join(__dirname, 'public'), { })); // ─── Auth API ───────────────────────────────────────────────── +const APP_VERSION = require('./package.json').version; + app.get('/api/config', (_req, res) => { - res.json({ signupsOpen: config.signupsOpen }); + res.json({ signupsOpen: config.signupsOpen, version: APP_VERSION }); }); // Validate the stored auth token; the client uses this at startup to detect a