Learn How to Write an Essay Conclusion | With Examples

snowflake.textContent = ['❄', '❅', '❆'][Math.floor(Math.random() * 3)]; // Random snowflake symbol // Randomize snowflake position, animation duration, and size snowflake.style.animationDuration = `${Math.random() * 5 + 5}s`; // Between 5 to 10 seconds snowflake.style.opacity = `${Math.random() * 0.5 + 0.5}`; // Opacity between 0.5 and 1 snowflake.style.fontSize = `${Math.random() * 1.5 + 1}em`; // Random size // Append snowflake to body // Remove the snowflake after animation ends }, 10000); // Match the maximum animation duration // Generate snowflakes continuously setInterval(createSnowflake, 200); // Add a new snowflake every 200ms