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"
|
||||
];
|
||||
|
||||
let msgPrinted = false;
|
||||
|
||||
// Check visibility
|
||||
function toggleEaster() {
|
||||
@@ -44,13 +45,21 @@ function toggleEaster() {
|
||||
easterContainer.style.display = 'none';
|
||||
if (rabbitTimeout) {
|
||||
clearTimeout(rabbitTimeout);
|
||||
isAnimating = false; // Reset to allow restarting later
|
||||
isAnimating = false;
|
||||
}
|
||||
if (!msgPrinted) {
|
||||
console.log('Easter hidden');
|
||||
msgPrinted = true;
|
||||
}
|
||||
} else {
|
||||
easterContainer.style.display = 'block';
|
||||
if (!isAnimating && enableBunny) {
|
||||
animateRabbit(document.querySelector('#rabbit'));
|
||||
}
|
||||
if (msgPrinted) {
|
||||
console.log('Easter visible');
|
||||
msgPrinted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
const observer = new MutationObserver(toggleEaster);
|
||||
|
||||
Reference in New Issue
Block a user