1
0

auto-git:

[change] animeCat.js
This commit is contained in:
2025-05-26 03:52:08 +02:00
parent c313b1e848
commit c77a1d6fb3

View File

@@ -169,8 +169,7 @@ window.AnimeCat = class AnimeCat {
); );
} }
_runJoyAnimation(onFinish) { _runJoyAnimation(onFinish) {
// Original-Pos und Style merken:
const wrapper = this.wrapper; const wrapper = this.wrapper;
const img = this.img; const img = this.img;
const origTransition = wrapper.style.transition; const origTransition = wrapper.style.transition;
@@ -184,23 +183,30 @@ window.AnimeCat = class AnimeCat {
wrapper.style.transform = 'translateY(-40px) rotate(12deg)'; wrapper.style.transform = 'translateY(-40px) rotate(12deg)';
// Herzchen-Explosion starten // Herzchen-Explosion starten
this._spawnHearts(12); // oder mehr/weniger this._spawnHearts(12);
// Nach 0.4s (Sprung oben), dann warten (stehen lassen) // Nach 0.4s (Sprung oben), dann warten (stehen lassen)
setTimeout(() => { 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(() => { setTimeout(() => {
// Rücksprung: nach unten // Rücksprung: nach unten
wrapper.style.transition = 'transform 0.8s cubic-bezier(.19,1,.22,1)'; wrapper.style.transition = 'transform 0.8s cubic-bezier(.19,1,.22,1)';
wrapper.style.transform = 'translateY(0) rotate(0deg)'; wrapper.style.transform = 'translateY(0) rotate(0deg)';
// Bild zurück
img.src = this.images.default; // → → → Hier: Bild auf mouth_open setzen!
// Reset nach 0.5s img.src = this.images.mouthOpen || this.images.default;
// Nach 3 Sekunden: Bild zurück zu default
setTimeout(() => { setTimeout(() => {
wrapper.style.transition = origTransition || ''; img.src = this.images.default;
wrapper.style.transform = origTransform || ''; // Reset nach 0.7s (Animation zu Ende)
if (typeof onFinish === 'function') onFinish(); setTimeout(() => {
}, 700); wrapper.style.transition = origTransition || '';
wrapper.style.transform = origTransform || '';
if (typeof onFinish === 'function') onFinish();
}, 700);
}, 3000);
}, 2200); }, 2200);
}, 400); }, 400);
} }