100-project-100-days-website/100_projects/86-white-snow-rain/script.js
2023-05-18 17:29:11 +03:00
Ask

15 lines
384 B
JavaScript

{634f19ea0ea6379c54833e5bc7cd7fca9d12841a true 384 script.js 0xc002aa2c40}

function createSnow () {
const snow = document.createElement("div");
snow.classList.add("snow");
snow.style.left = Math.random() * 100 + "vw";
snow.style.animationDuration = Math.random() * 2 + 3 + "s";
snow.innerText = "❄️️";
document.body.appendChild(snow);
setTimeout(() => {
snow.remove();
}, 5000);
}
setInterval(createSnow, 300);