GarGerry commited on
Commit
26a3c52
·
verified ·
1 Parent(s): dd4ebb4

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +6 -0
index.html CHANGED
@@ -117,6 +117,12 @@
117
  };
118
 
119
  let resetBall = () => {
 
 
 
 
 
 
120
  ballY = -30; // Reset ball to start position
121
  ballX = Math.floor(Math.random() * (window.innerWidth - 30)); // New random X position
122
  ball.style.top = ballY + "px";
 
117
  };
118
 
119
  let resetBall = () => {
120
+ // Stop the animation when ball is reset
121
+ ball.style.animation = 'none';
122
+ setTimeout(() => {
123
+ ball.style.animation = `fall ${fallSpeed}s linear infinite`;
124
+ }, 50); // Delay to restart the animation
125
+
126
  ballY = -30; // Reset ball to start position
127
  ballX = Math.floor(Math.random() * (window.innerWidth - 30)); // New random X position
128
  ball.style.top = ballY + "px";