1
0

Refactor animeCat.js to include commit count glow animation

This commit is contained in:
2025-05-26 06:41:00 +02:00
parent 538d88de46
commit 342f261cca

View File

@@ -1,6 +1,7 @@
// animeCat.js
// miau!
window.AnimeCat = class AnimeCat {
/**
* @param {HTMLElement} container
@@ -107,6 +108,18 @@ window.AnimeCat = class AnimeCat {
this.wrapper.appendChild(this.bubble);
this.container.appendChild(this.wrapper);
// Zeigt Progress der täglichen Commits an
animateCatGlow(commitCount) {
if (!this.cat) return;
const factor = Math.min(commitCount / 10, 1);
const glowStrength = 3 + factor * 22;
const glowColor = `rgba(255,230,100,${0.2 + factor * 0.7})`;
this.cat.style.filter = `drop-shadow(0 0 ${glowStrength}px ${glowColor})`;
this.cat.classList.add('glow');
}
// Emitter für Herzen (abgekoppelt!)
this.heartEmitter = document.createElement('div');
Object.assign(this.heartEmitter.style, {