diff --git a/index.html b/index.html index 62cc848..3de2371 100644 --- a/index.html +++ b/index.html @@ -64,6 +64,8 @@ #intro .how p { margin: 0; } #intro .how span { display: inline-block; width: 30px; } #intro em { color: #8a96ab; font-style: normal; font-size: 12px; } + /* which build is served — filled in by main.js, empty (and invisible) if the header is missing */ + #build { margin: 10px 0 0; font-size: 9px; color: #5a6270; letter-spacing: 0.5px; } #intro .start { margin-top: 18px; color: #e0cc72; font-weight: bold; letter-spacing: 1px; animation: blink 1.1s step-end infinite; } @keyframes blink { 50% { opacity: 0.25; } } @@ -84,8 +86,9 @@

⌨️ WASD / arrows + SPACE

TAP TO START

+

- + diff --git a/main.js b/main.js index 5ae3acf..950ea98 100644 --- a/main.js +++ b/main.js @@ -32,6 +32,13 @@ function dismissIntro() { intro.remove(); ambient(); voice('quiet_please'); // low atmosphere bed starts with the first gesture } intro.addEventListener('pointerdown', e => { e.preventDefault(); dismissIntro(); }); +// which build am I looking at? Push = deploy and the browser cannot see git, so the served file's +// own timestamp IS the version marker — it changes on every deploy, with nothing to remember to bump. +// Match it against `git log -1 --format=%cd` when a phone looks suspiciously out of date. +fetch('main.js', { method: 'HEAD' }) + .then(r => { const t = r.headers.get('last-modified'); if (!t) return; + document.getElementById('build').textContent = 'BUILD ' + new Date(t).toLocaleString('en-GB').replace(',', ''); }) + .catch(() => {}); // no header, no line — never a broken start screen addEventListener('keydown', () => dismissIntro(), { once: true }); // eaten: any tap or key restarts — but only once the death animation has played out, so a