From 29deac7a955efa8a62f9646e033974f39280f256 Mon Sep 17 00:00:00 2001 From: Poulpe Date: Wed, 17 Jun 2026 17:11:19 +0000 Subject: [PATCH] =?UTF-8?q?v2.1=20=E2=80=94=20guide=20statique=20(pas=20de?= =?UTF-8?q?=20clignotement),=20voix=20sans=20'majuscule',=20=C3=A9nonce=20?= =?UTF-8?q?le=20mot=20=C3=A0=20=C3=A9peler=20+=20rappel=20si=20inactif?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.js | 24 +++++++++++++----------- style.css | 5 +++-- sw.js | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/game.js b/game.js index beb1e62..5933ff7 100644 --- a/game.js +++ b/game.js @@ -287,7 +287,7 @@ function recomputeFocus(announce = false) { state.focus = f; renderClue(); applyGuide(); - if (announce && changed && f && state.cat.kind === "imagier") { + if (announce && changed && f) { setTimeout(() => mascotSay("Écris : " + f + " ! ✏️", "happy"), 250); } } @@ -313,7 +313,7 @@ function inputLetter(ch) { state.current += ch; renderWord(true); sndType(); - if (data.guided) say(ch, { interrupt: true }); // lit la lettre + if (data.guided) say(ch.toLowerCase(), { interrupt: true }); // lit la lettre (minuscule = pas de "majuscule") spawnBubbles(window.innerWidth / 2, window.innerHeight * 0.32, 6); checkWord(); recomputeFocus(); @@ -375,16 +375,18 @@ function clearHint() { document.querySelectorAll(".chip.hint").forEach(c => c.cl function checkIdle() { if (!state.running || state.miniGame) return; const idle = (now() - state.lastAction) / 1000; - if (idle > 5 && !state.hintShown) { - state.hintShown = true; - const w = state.focus || state.targets.find(x => !state.found.has(x)); - if (w) { - const chip = elWordList.querySelector(`.chip[data-word="${w}"]`); - if (chip) chip.classList.add("hint"); - mascotSay("Essaie d'écrire " + w + " ! 💡", "happy"); + if (idle > 5) { + const sinceHint = (now() - (state.lastHint || 0)) / 1000; + if (sinceHint > 6) { + state.lastHint = now(); + const w = state.focus || state.targets.find(x => !state.found.has(x)); + if (w) { + const chip = elWordList.querySelector(`.chip[data-word="${w}"]`); + if (chip) chip.classList.add("hint"); + mascotSay("Écris : " + w + " ! 💡", "happy"); + } } } - if (idle > 13) { mascotSet("sleep"); elSpeech.textContent = "Zzz… joue avec moi ! 😴"; elSpeech.classList.add("show"); } } /* ================================================================== */ @@ -555,7 +557,7 @@ function startCategory(cat) { blinkLoop(); try { ac().resume(); } catch (e) {} mascotSay(greeting(), "happy"); - if (cat.kind === "imagier") recomputeFocus(true); + recomputeFocus(true); } /* ================================================================== */ diff --git a/style.css b/style.css index dc6f9e6..0bbf79c 100644 --- a/style.css +++ b/style.css @@ -364,12 +364,13 @@ html, body { /* ---------- Lettre guidée ---------- */ .key.guide { - animation: guidePulse .8s ease infinite; outline: 4px solid #fff; outline-offset: -2px; + transform: scale(1.08); + filter: brightness(1.25); + box-shadow: 0 0 0 4px rgba(106,92,255,.45), 0 8px 18px rgba(0,0,0,.25); z-index: 1; } -@keyframes guidePulse { 0%,100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.12); filter: brightness(1.35); } } /* ---------- Espace parents ---------- */ .parent-card { max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; text-align: left; } diff --git a/sw.js b/sw.js index 1b13b08..10e00a5 100644 --- a/sw.js +++ b/sw.js @@ -1,5 +1,5 @@ /* Service worker — network-first (frais en ligne, cache en secours hors-ligne) */ -const CACHE = "lettres-magiques-v3"; +const CACHE = "lettres-magiques-v4"; const ASSETS = [ ".", "index.html",