Add console log messages for Easter visibility changes; improve debugging
This commit is contained in:
@@ -29,6 +29,7 @@ const easterEggImages = [
|
|||||||
"../Seasonals/Resources/easter_images/eggs.png"
|
"../Seasonals/Resources/easter_images/eggs.png"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
let msgPrinted = false;
|
||||||
|
|
||||||
// Check visibility
|
// Check visibility
|
||||||
function toggleEaster() {
|
function toggleEaster() {
|
||||||
@@ -44,13 +45,21 @@ function toggleEaster() {
|
|||||||
easterContainer.style.display = 'none';
|
easterContainer.style.display = 'none';
|
||||||
if (rabbitTimeout) {
|
if (rabbitTimeout) {
|
||||||
clearTimeout(rabbitTimeout);
|
clearTimeout(rabbitTimeout);
|
||||||
isAnimating = false; // Reset to allow restarting later
|
isAnimating = false;
|
||||||
|
}
|
||||||
|
if (!msgPrinted) {
|
||||||
|
console.log('Easter hidden');
|
||||||
|
msgPrinted = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
easterContainer.style.display = 'block';
|
easterContainer.style.display = 'block';
|
||||||
if (!isAnimating && enableBunny) {
|
if (!isAnimating && enableBunny) {
|
||||||
animateRabbit(document.querySelector('#rabbit'));
|
animateRabbit(document.querySelector('#rabbit'));
|
||||||
}
|
}
|
||||||
|
if (msgPrinted) {
|
||||||
|
console.log('Easter visible');
|
||||||
|
msgPrinted = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const observer = new MutationObserver(toggleEaster);
|
const observer = new MutationObserver(toggleEaster);
|
||||||
|
|||||||
Reference in New Issue
Block a user