Add glow wobble animation to AnimeCat
This commit is contained in:
@@ -30,6 +30,7 @@ window.AnimeCat = class AnimeCat {
|
|||||||
this._createElements();
|
this._createElements();
|
||||||
this._bindMouseHold();
|
this._bindMouseHold();
|
||||||
this._startBlinking();
|
this._startBlinking();
|
||||||
|
this.startGlowWobble();
|
||||||
}
|
}
|
||||||
|
|
||||||
_createElements() {
|
_createElements() {
|
||||||
@@ -158,7 +159,7 @@ window.AnimeCat = class AnimeCat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
startGlowWobble() {
|
_startGlowWobble() {
|
||||||
let t = 0;
|
let t = 0;
|
||||||
const loop = () => {
|
const loop = () => {
|
||||||
// z.B. sanft die Opazität und evtl. blur modifizieren
|
// z.B. sanft die Opazität und evtl. blur modifizieren
|
||||||
@@ -173,7 +174,6 @@ window.AnimeCat = class AnimeCat {
|
|||||||
stopGlowWobble() {
|
stopGlowWobble() {
|
||||||
if (this._glowWobbleId) cancelAnimationFrame(this._glowWobbleId);
|
if (this._glowWobbleId) cancelAnimationFrame(this._glowWobbleId);
|
||||||
}
|
}
|
||||||
this.startGlowWobble();
|
|
||||||
|
|
||||||
// Hilfsfunktionen zur Farbinterpolation
|
// Hilfsfunktionen zur Farbinterpolation
|
||||||
_lerp(a, b, t) { return a + (b - a) * t; }
|
_lerp(a, b, t) { return a + (b - a) * t; }
|
||||||
|
|||||||
Reference in New Issue
Block a user