From c77a1d6fb3ccbbc7af8d95b627a3d50a0829171d Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 26 May 2025 03:52:08 +0200 Subject: [PATCH] auto-git: [change] animeCat.js --- animeCat.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/animeCat.js b/animeCat.js index fb420e4..5b2bd26 100644 --- a/animeCat.js +++ b/animeCat.js @@ -169,8 +169,7 @@ window.AnimeCat = class AnimeCat { ); } - _runJoyAnimation(onFinish) { - // Original-Pos und Style merken: + _runJoyAnimation(onFinish) { const wrapper = this.wrapper; const img = this.img; const origTransition = wrapper.style.transition; @@ -184,23 +183,30 @@ window.AnimeCat = class AnimeCat { wrapper.style.transform = 'translateY(-40px) rotate(12deg)'; // Herzchen-Explosion starten - this._spawnHearts(12); // oder mehr/weniger + this._spawnHearts(12); // Nach 0.4s (Sprung oben), dann warten (stehen lassen) setTimeout(() => { - // Nach weiteren 2.6s zurückfallen (gesamt ca. 3s joy-mode) + // Nach weiteren 2.2s zurückfallen (gesamt ca. 2.6s joy-mode) setTimeout(() => { // Rücksprung: nach unten wrapper.style.transition = 'transform 0.8s cubic-bezier(.19,1,.22,1)'; wrapper.style.transform = 'translateY(0) rotate(0deg)'; - // Bild zurück - img.src = this.images.default; - // Reset nach 0.5s + + // → → → Hier: Bild auf mouth_open setzen! + img.src = this.images.mouthOpen || this.images.default; + + // Nach 3 Sekunden: Bild zurück zu default setTimeout(() => { - wrapper.style.transition = origTransition || ''; - wrapper.style.transform = origTransform || ''; - if (typeof onFinish === 'function') onFinish(); - }, 700); + img.src = this.images.default; + // Reset nach 0.7s (Animation zu Ende) + setTimeout(() => { + wrapper.style.transition = origTransition || ''; + wrapper.style.transform = origTransform || ''; + if (typeof onFinish === 'function') onFinish(); + }, 700); + }, 3000); + }, 2200); }, 400); }