v2.1 — guide statique (pas de clignotement), voix sans 'majuscule', énonce le mot à épeler + rappel si inactif
This commit is contained in:
24
game.js
24
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);
|
||||
}
|
||||
|
||||
/* ================================================================== */
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user