document.addEventListener("scroll", function () { let drop = document.createElement("div"); drop.classList.add("drop"); drop.style.left = Math.random() * window.innerWidth + "px"; drop.style.animationDuration = (Math.random() * 2 + 1) + "s"; document.body.appendChild(drop); setTimeout(() => { drop.remove(); }, 2000); }); @keyframes fall { 0% { transform: translateY(-100px) scale(1); opacity: 1; } 100% { transform: translateY(100vh) scale(0.5); opacity: 0; } } .drop { position: fixed; top: 0; left: 50%; width: 5px; height: 10px; background: rgba(173, 216, 230, 0.7); border-radius: 50%; animation: fall 2s linear infinite; }