extra snowflakes only on non mobile screens

This commit is contained in:
MLH
2024-11-25 01:48:37 +01:00
parent 28be8a64ad
commit 57523921a2

View File

@ -76,7 +76,9 @@ function addRandomSnowflakes(count) {
// initialize snowflakes and add random snowflakes after the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
toggleSnowflakes();
if (randomSnowflakes) {
const screenWidth = window.innerWidth;
if (randomSnowflakes && screenWidth > 768) { // add random snowflakes only on larger screens
addRandomSnowflakes(snowflakeCount);
}
});