fix init of seasonals

This commit is contained in:
MLH
2024-12-22 01:51:51 +01:00
parent 0071be6570
commit d5c697afdf
8 changed files with 55 additions and 70 deletions

View File

@ -136,7 +136,6 @@ function initLeaves() {
} }
// initialize leaves and add random leaves after the DOM is loaded // initialize leaves and add random leaves after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!leaves) return; // exit if leaves are disabled if (!leaves) return; // exit if leaves are disabled
initLeaves(); initLeaves();
toggleAutumn(); toggleAutumn();
@ -145,4 +144,3 @@ document.addEventListener('DOMContentLoaded', () => {
if (randomLeaves && (screenWidth > 768 || randomLeavesMobile)) { // add random leaves only on larger screens, unless enabled for mobile devices if (randomLeaves && (screenWidth > 768 || randomLeavesMobile)) { // add random leaves only on larger screens, unless enabled for mobile devices
addRandomLeaves(leafCount); addRandomLeaves(leafCount);
} }
});

View File

@ -110,7 +110,6 @@ function initChristmas() {
} }
// initialize christmas and add random christmas symbols after the DOM is loaded // initialize christmas and add random christmas symbols after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!christmas) return; // exit if christmas is disabled if (!christmas) return; // exit if christmas is disabled
initChristmas(); initChristmas();
toggleChristmas(); toggleChristmas();
@ -119,4 +118,3 @@ document.addEventListener('DOMContentLoaded', () => {
if (randomChristmas && (screenWidth > 768 || randomChristmasMobile)) { // add random christmas only on larger screens, unless enabled for mobile devices if (randomChristmas && (screenWidth > 768 || randomChristmasMobile)) { // add random christmas only on larger screens, unless enabled for mobile devices
addRandomChristmas(christmasCount); addRandomChristmas(christmasCount);
} }
});

View File

@ -152,8 +152,6 @@ function startFireworks() {
} }
// Initialize fireworks and add random fireworks after the DOM is loaded // Initialize fireworks and add random fireworks after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!fireworks) return; // exit if fireworks are disabled if (!fireworks) return; // exit if fireworks are disabled
startFireworks(); startFireworks();
toggleFirework(); toggleFirework();
});

View File

@ -123,7 +123,6 @@ function createHalloween() {
} }
// initialize halloween after the DOM is loaded // initialize halloween after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!halloween) return; // exit if halloween is disabled if (!halloween) return; // exit if halloween is disabled
createHalloween(); createHalloween();
toggleHalloween(); toggleHalloween();
@ -132,4 +131,3 @@ document.addEventListener('DOMContentLoaded', () => {
if (randomSymbols && (screenWidth > 768 || randomSymbolsMobile)) { // add random halloweens only on larger screens, unless enabled for mobile devices if (randomSymbols && (screenWidth > 768 || randomSymbolsMobile)) { // add random halloweens only on larger screens, unless enabled for mobile devices
addRandomSymbols(halloweenCount); addRandomSymbols(halloweenCount);
} }
});

View File

@ -112,7 +112,6 @@ function createHearts() {
// initialize hearts after the DOM is loaded // initialize hearts after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!hearts) return; // exit if hearts is disabled if (!hearts) return; // exit if hearts is disabled
createHearts(); createHearts();
toggleHearts(); toggleHearts();
@ -121,4 +120,3 @@ document.addEventListener('DOMContentLoaded', () => {
if (randomSymbols && (screenWidth > 768 || randomSymbolsMobile)) { // add random heartss only on larger screens, unless enabled for mobile devices if (randomSymbols && (screenWidth > 768 || randomSymbolsMobile)) { // add random heartss only on larger screens, unless enabled for mobile devices
addRandomSymbols(heartsCount); addRandomSymbols(heartsCount);
} }
});

View File

@ -100,7 +100,5 @@ function animateSnowflake(snowflake) {
} }
// initialize snowfall after the DOM is loaded // initialize snowfall after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!snowfall) return; // exit if snowfall is disabled if (!snowfall) return; // exit if snowfall is disabled
createSnowflakes(); createSnowflakes();
});

View File

@ -118,7 +118,6 @@ function initSnowflakes() {
} }
// initialize snowflakes and add random snowflakes after the DOM is loaded // initialize snowflakes and add random snowflakes after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!snowflakes) return; // exit if snowflakes are disabled if (!snowflakes) return; // exit if snowflakes are disabled
initSnowflakes(); initSnowflakes();
toggleSnowflakes(); toggleSnowflakes();
@ -127,4 +126,3 @@ document.addEventListener('DOMContentLoaded', () => {
if (randomSnowflakes && (screenWidth > 768 || randomSnowflakesMobile)) { // add random snowflakes only on larger screens, unless enabled for mobile devices if (randomSnowflakes && (screenWidth > 768 || randomSnowflakesMobile)) { // add random snowflakes only on larger screens, unless enabled for mobile devices
addRandomSnowflakes(snowflakeCount); addRandomSnowflakes(snowflakeCount);
} }
});

View File

@ -98,7 +98,6 @@ function animateSnowflake(snowflake) {
} }
// initialize snowstorm after the DOM is loaded // initialize snowstorm after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!snowstorm) return; // exit if snowstorm is disabled if (!snowstorm) return; // exit if snowstorm is disabled
createSnowstorm(); createSnowstorm();
});