option to enable/disable

This commit is contained in:
MLH
2024-11-26 02:33:22 +01:00
parent 0c1b0b377a
commit a3d8c9d9aa

View File

@@ -1,3 +1,4 @@
const snowflakes = true; // enable/disable snowflakes
const randomSnowflakes = true; // enable random Snowflakes
const snowflakeCount = 25; // count of random extra snowflakes
@@ -75,6 +76,7 @@ function addRandomSnowflakes(count) {
// initialize snowflakes and add random snowflakes after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
if (!snowflakes) return; // exit if snowflakes are disabled
toggleSnowflakes();
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices