From 9815b04e350bece7054f5df3904324af0f1fbf12 Mon Sep 17 00:00:00 2001 From: Hans de Zwart Date: Tue, 11 Aug 2026 20:20:30 +0200 Subject: [PATCH] Hide play/pause once someone has run out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At a flag the game is over and togglePause is inert anyway — pauseNow needs RUN, resumeNow needs PAUSE — so the button was there without being able to do anything. It joins the other two visibility rules in render(): vacant at IDLE or FLAG. Reset stays, being the way out of a finished game, and the bar comes down to Reset, score and sound. Checked the whole state machine: shown while running and while paused, vacant before a game's first tap and at a flag, and pausing and resuming still work. Co-Authored-By: Claude Opus 5 --- README.md | 4 ++-- public_html/index.html | 4 +++- public_html/sw.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bdec074..fc1c11d 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ everything works except installation and the service worker. included. Opening either sheet pauses automatically. The settings sheet leaves it paused — everything in there resets the clocks anyway — while the score sheet picks the turn back up when you close it, so glancing at the score - doesn't cost you a tap on play. It's absent before each game's first tap, with - no clock running to freeze. + doesn't cost you a tap on play. It's absent whenever there's no clock running + to freeze: before each game's first tap, and once someone has run out of time. Both buttons keep their space in the bar while they're away, so nothing shifts under your thumb — the same as the gear. diff --git a/public_html/index.html b/public_html/index.html index 7a8974a..33c02db 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -811,7 +811,9 @@ var pristine = matchPristine(); btnSettings.classList.toggle("btn--vacant", !pristine); btnReset.classList.toggle("btn--vacant", pristine); // nothing played to reset - btnPlay.classList.toggle("btn--vacant", st.phase === IDLE); // nothing running to pause + // nothing running to pause: before a game's first tap, and after a flag, + // where togglePause is inert anyway — the game is over, Reset is the way out + btnPlay.classList.toggle("btn--vacant", st.phase === IDLE || st.phase === FLAG); } function loop(){ render(); requestAnimationFrame(loop); } diff --git a/public_html/sw.js b/public_html/sw.js index d16249f..92f5182 100644 --- a/public_html/sw.js +++ b/public_html/sw.js @@ -1,5 +1,5 @@ /* Cache-first: once installed the clock never touches the network again. */ -const CACHE = "bgclock-v16"; +const CACHE = "bgclock-v17"; const FILES = [ "./", "./index.html",