zoom and shake
This commit is contained in:
11
app.js
11
app.js
@@ -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 ---------- */
|
||||
|
||||
Reference in New Issue
Block a user