Fix random animation delay for leaf shake and rotation effect

This commit is contained in:
CodeDevMLH
2026-02-24 18:22:56 +01:00
parent 589a360729
commit 23c5ab7e9d

View File

@@ -90,7 +90,7 @@ function addRandomLeaves(count) {
// set random horizontal position, animation delay and size(uncomment lines to enable)
const randomLeft = Math.random() * 100; // position (0% to 100%)
const randomAnimationDelay = Math.random() * 12; // delay for fall (0s to 12s)
const randomAnimationDelay2 = Math.random() * 4; // delay for shake+rotate (0s to 4s)
const randomAnimationDelay2 = -(Math.random() * 4); // delay for shake+rotate (-4s to 0s)
// apply styles
leaveDiv.style.left = `${randomLeft}%`;