From cbb3a4a1263d565b1135a1d81b37263d4b9b18f6 Mon Sep 17 00:00:00 2001 From: David Da Silva Date: Mon, 13 Oct 2025 15:41:15 +0200 Subject: [PATCH] :sparkles: timer is started only by clicking start button --- css/style.css | 19 +++++++++++++------ index.html | 2 +- js/app.js | 9 +-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/css/style.css b/css/style.css index d1ce1af..ab890fb 100644 --- a/css/style.css +++ b/css/style.css @@ -63,15 +63,22 @@ body { bottom: 10%; left: 50%; transform: translate(-50%, -50%); - font-size: 3em; - font-weight: bold; - color: white; - text-align: center; z-index: 20; - user-select: none; - pointer-events: none; animation: pulse 1.2s infinite alternate; transition: opacity 0.6s ease; + user-select: none; + + button { + border: none; + background-color: inherit; + cursor: pointer; + display: inline-block; + color: white; + font-size: 3em; + font-weight: bold; + text-align: center; + padding: 0.2em; + } } /* Animation de pulsation */ diff --git a/index.html b/index.html index 617c7de..4931934 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@ -
START
+
00:00
made with ❤️ by Zenika
diff --git a/js/app.js b/js/app.js index bfc866c..1cffe4c 100644 --- a/js/app.js +++ b/js/app.js @@ -108,7 +108,7 @@ async function requestWakeLock() { function playBeep() { if (!soundEnabled) return; - + const AudioContext = window.AudioContext || window.webkitAudioContext; const audioCtx = new AudioContext(); @@ -126,13 +126,6 @@ function playBeep() { oscillator.stop(audioCtx.currentTime + 0.3); // play for 0.3s } -// --- Démarrage au clic --- -function onFirstClick() { - startAnimation(); - document.removeEventListener('click', onFirstClick); -} -document.addEventListener('click', onFirstClick); - // Wakelock: réactiver si la page revient au premier plan document.addEventListener('visibilitychange', () => { if (wakeLock !== null && document.visibilityState === 'visible') {