zoom and shake

This commit is contained in:
2026-07-02 13:45:13 +02:00
parent 44be07c461
commit 262199e31a
2 changed files with 31 additions and 0 deletions

11
app.js
View File

@@ -360,6 +360,16 @@
}
const stopTicks = () => (ticking = false);
// ZOOM sulla macchina + shake mentre gira
const slot = $(".slot");
slot.classList.add("zoom");
const shakeTimer = setTimeout(() => slot.classList.add("shake"), 460); // dopo lo zoom-in
const endZoom = () => {
clearTimeout(shakeTimer);
slot.classList.remove("shake"); // torna a scale(1.14) senza tremolio
requestAnimationFrame(() => slot.classList.remove("zoom")); // poi zoom-out fluido
};
const stopRiser = Audio.riser(wantTease ? 4.6 : 4.2);
startTicks();
@@ -409,6 +419,7 @@
await sleep(260);
}
stopRiser();
endZoom(); // fine scroll: la macchina torna allo stato normale
}
/* ---------- Stato di gioco ---------- */