Delay turn shake hint by 5s, reduce to 300ms every 2s

Less aggressive draw hint: waits 5 seconds before first shake,
then shakes for 300ms every 2 seconds with slightly less movement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken 2026-02-22 19:13:40 -05:00
parent 9866fb8e92
commit 3e133b17c0

View File

@ -757,22 +757,28 @@ class CardAnimations {
anime({ anime({
targets: element, targets: element,
translateX: [0, -8, 8, -6, 4, 0], translateX: [0, -6, 6, -4, 3, 0],
duration: 400, duration: 300,
easing: 'easeInOutQuad' easing: 'easeInOutQuad'
}); });
}; };
// Do initial shake, then repeat every 3 seconds // Delay first shake by 5 seconds, then repeat every 2 seconds
doShake(); const timeout = setTimeout(() => {
const interval = setInterval(doShake, 3000); if (!this.activeAnimations.has(id)) return;
this.activeAnimations.set(id, { interval }); doShake();
const interval = setInterval(doShake, 2000);
const entry = this.activeAnimations.get(id);
if (entry) entry.interval = interval;
}, 5000);
this.activeAnimations.set(id, { timeout });
} }
stopTurnPulse(element) { stopTurnPulse(element) {
const id = 'turnPulse'; const id = 'turnPulse';
const existing = this.activeAnimations.get(id); const existing = this.activeAnimations.get(id);
if (existing) { if (existing) {
if (existing.timeout) clearTimeout(existing.timeout);
if (existing.interval) clearInterval(existing.interval); if (existing.interval) clearInterval(existing.interval);
if (existing.pause) existing.pause(); if (existing.pause) existing.pause();
this.activeAnimations.delete(id); this.activeAnimations.delete(id);