Fix random animation delay for leaf shake and rotation effect
This commit is contained in:
@@ -90,7 +90,7 @@ function addRandomLeaves(count) {
|
|||||||
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
||||||
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
||||||
const randomAnimationDelay = Math.random() * 12; // delay for fall (0s to 12s)
|
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
|
// apply styles
|
||||||
leaveDiv.style.left = `${randomLeft}%`;
|
leaveDiv.style.left = `${randomLeft}%`;
|
||||||
|
|||||||
Reference in New Issue
Block a user