From 6bd8abb1636c5977966c4e17f08ebf011c3b5e2a Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 26 May 2025 06:55:17 +0200 Subject: [PATCH] Refactor _animateCatGlow method in animeCat.js --- animeCat.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/animeCat.js b/animeCat.js index e5e0314..6325bd2 100644 --- a/animeCat.js +++ b/animeCat.js @@ -124,20 +124,27 @@ window.AnimeCat = class AnimeCat { } // Zeigt Progress der täglichen Commits an - animateCatGlow(commitCount) { - console.log('[CatGlow]', commitCount); - if (!this.cat) return; + _animateCatGlow(commitCount) { + const glow = this.slot.querySelector('#cat-glow'); + if (!glow) 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'); + // Beispiel: Größe skalieren + const minSize = 80, maxSize = 170; + const size = minSize + factor * (maxSize - minSize); + + glow.style.width = `${size}px`; + glow.style.height = `${size * 0.66}px`; + + // Optional: Opacity je nach Commits + glow.style.opacity = 0.2 + 0.8 * factor; + + // Optional: Farbe mit JS anpassen (geht auch über CSS-Variablen) + glow.style.background = `radial-gradient(circle, rgba(255,230,100,${0.7 + factor*0.3}) 0%, rgba(255,230,100,${0.10 + 0.5*factor}) 70%, rgba(0,0,0,0) 100%)`; } - // Bubble-Position absolut anpassen, wenn detached _positionBubbleDetached() { // Katze relativ im Container finden