Refactor animeCat.js to include commit count glow animation
This commit is contained in:
13
animeCat.js
13
animeCat.js
@@ -1,6 +1,7 @@
|
|||||||
// animeCat.js
|
// animeCat.js
|
||||||
// miau!
|
// miau!
|
||||||
|
|
||||||
|
|
||||||
window.AnimeCat = class AnimeCat {
|
window.AnimeCat = class AnimeCat {
|
||||||
/**
|
/**
|
||||||
* @param {HTMLElement} container
|
* @param {HTMLElement} container
|
||||||
@@ -107,6 +108,18 @@ window.AnimeCat = class AnimeCat {
|
|||||||
this.wrapper.appendChild(this.bubble);
|
this.wrapper.appendChild(this.bubble);
|
||||||
this.container.appendChild(this.wrapper);
|
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!)
|
// Emitter für Herzen (abgekoppelt!)
|
||||||
this.heartEmitter = document.createElement('div');
|
this.heartEmitter = document.createElement('div');
|
||||||
Object.assign(this.heartEmitter.style, {
|
Object.assign(this.heartEmitter.style, {
|
||||||
|
|||||||
Reference in New Issue
Block a user