on mobile less snowflakes

This commit is contained in:
MLH
2025-01-13 23:53:34 +01:00
parent 88f378bd5d
commit 8ec21f646d

View File

@ -141,6 +141,11 @@ function initializeSnowfall() {
}
const container = document.querySelector('.snowfall-container');
if (container) {
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
if (screenWidth < 768) { // lower count of snowflakes on mobile devices
snowflakesCount = snowflakesCountMobile;
}
console.log('Snowfall enabled.');
initializeCanvas();
snowflakes = createSnowflakes(container);