Add glow effect to animeCat.js
This commit is contained in:
12
animeCat.js
12
animeCat.js
@@ -49,6 +49,16 @@ window.AnimeCat = class AnimeCat {
|
|||||||
zIndex: '1'
|
zIndex: '1'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// --- Glow ---
|
||||||
|
if (!this.wrapper.querySelector('#cat-glow')) {
|
||||||
|
this.glow = document.createElement('div');
|
||||||
|
this.glow.id = 'cat-glow';
|
||||||
|
this.wrapper.appendChild(this.glow);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.img = document.createElement('img');
|
||||||
|
this.img.src = this.images.default;
|
||||||
|
|
||||||
// --- Cat image ---
|
// --- Cat image ---
|
||||||
this.img = document.createElement('img');
|
this.img = document.createElement('img');
|
||||||
this.img.src = this.images.default;
|
this.img.src = this.images.default;
|
||||||
@@ -131,7 +141,7 @@ window.AnimeCat = class AnimeCat {
|
|||||||
|
|
||||||
// Zeigt Progress der täglichen Commits an
|
// Zeigt Progress der täglichen Commits an
|
||||||
_animateCatGlow(commitCount) {
|
_animateCatGlow(commitCount) {
|
||||||
const glow = this.slot.querySelector('#cat-glow');
|
this.glow = this.wrapper.querySelector('#cat-glow');
|
||||||
if (!glow) return;
|
if (!glow) return;
|
||||||
|
|
||||||
const factor = Math.min(commitCount / 10, 1);
|
const factor = Math.min(commitCount / 10, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user