fix wrong variable declaration

This commit is contained in:
MLH
2025-01-14 02:01:15 +01:00
parent c286e7a529
commit b95c0bc78a
5 changed files with 111 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
const snowfall = true; // enable/disable snowfall
const snowflakesCount = 500; // count of snowflakes (recommended values: 300-600)
let snowflakesCount = 500; // count of snowflakes (recommended values: 300-600)
const snowflakesCountMobile = 250; // count of snowflakes on mobile devices
const snowFallSpeed = 3; // speed of snowfall (recommended values: 0-5)
@@ -127,6 +127,7 @@ function initializeSnowfall() {
if (container) {
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
if (screenWidth < 768) { // lower count of snowflakes on mobile devices
console.log('Mobile device detected. Reducing snowflakes count.');
snowflakesCount = snowflakesCountMobile;
}

View File

@@ -1,5 +1,5 @@
const snowstorm = true; // enable/disable snowstorm
const snowflakesCount = 500; // count of snowflakes (recommended values: 300-600)
let snowflakesCount = 500; // count of snowflakes (recommended values: 300-600)
const snowflakesCountMobile = 250; // count of snowflakes on mobile devices
const snowFallSpeed = 6; // speed of snowfall (recommended values: 4-8)
const horizontalWind = 4; // horizontal wind speed (recommended value: 4)
@@ -130,6 +130,7 @@ function initializeSnowstorm() {
if (container) {
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
if (screenWidth < 768) { // lower count of snowflakes on mobile devices
console.log('Mobile device detected. Reducing snowflakes count.');
snowflakesCount = snowflakesCountMobile;
}