From ba4c0b3d4eee0cb1c379452e8e37db967c4d432a Mon Sep 17 00:00:00 2001 From: VijaySamant4368 Date: Thu, 6 Jun 2024 21:52:01 +0530 Subject: [PATCH 1/3] Corrected Labels --- index.html | 8 ++++---- js/app.js | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 5fa20c7..32cd685 100644 --- a/index.html +++ b/index.html @@ -230,9 +230,9 @@
- Rewind + Slow Down
- Fast Forward + Speed Up
diff --git a/js/app.js b/js/app.js index 67b70e4..954e957 100644 --- a/js/app.js +++ b/js/app.js @@ -349,7 +349,7 @@ function randomGrid() { function clearGrid() { // if the game is paused // then allow user to clear the grid - if (!isAnimating) { + if (true) { aliveCount = 0; for (let i = 0; i < HEIGHT; i++) { for (let j = 0; j < WIDTH; j++) { @@ -358,11 +358,14 @@ function clearGrid() { } drawCells(); } - isStarted = false; if (!areEventListenersAdded) { addEventListenersToCells(); areEventListenersAdded = true; } + isAnimating = false; + isStarted = false; + const playPauseIcon = document.getElementById("play-pause-icon"); + playPauseIcon.src ="./images/Pause-Button.svg" } function toggleWarp() { From 1680b95ff2a2a02d413b95eee441294f588b3b5c Mon Sep 17 00:00:00 2001 From: VijaySamant4368 Date: Thu, 6 Jun 2024 21:55:00 +0530 Subject: [PATCH 2/3] Corrected Labeling --- js/app.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index 2c76389..55354b2 100644 --- a/js/app.js +++ b/js/app.js @@ -406,7 +406,7 @@ function randomGrid() { function clearGrid() { // if the game is paused // then allow user to clear the grid - if (true) { + if (!isAnimating) { aliveCount = 0; for (let i = 0; i < HEIGHT; i++) { for (let j = 0; j < WIDTH; j++) { @@ -415,14 +415,11 @@ function clearGrid() { } drawCells(); } + isStarted = false; if (!areEventListenersAdded) { addEventListenersToCells(); areEventListenersAdded = true; } - isAnimating = false; - isStarted = false; - const playPauseIcon = document.getElementById("play-pause-icon"); - playPauseIcon.src ="./images/Pause-Button.svg" } function toggleWarp() { @@ -645,4 +642,4 @@ document.querySelectorAll('.tooltip-container').forEach(container => { }); -const gridContainer = document.getElementById("main-grid"); +const gridContainer = document.getElementById("main-grid"); \ No newline at end of file From 70d601136c9bb209b6a914e4bcb51dcfdc724643 Mon Sep 17 00:00:00 2001 From: VijaySamant4368 Date: Mon, 10 Jun 2024 22:29:28 +0530 Subject: [PATCH 3/3] Correct the unrequired animation --- js/animation.js | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/js/animation.js b/js/animation.js index 9ea1b7d..8e98584 100644 --- a/js/animation.js +++ b/js/animation.js @@ -1,36 +1,29 @@ -// used to animate side navbar +// Animate side navbar on page load gsap.from(".game-settings .sidenav .animate", { duration: 1, x: -500, ease: "power1.inOut", - stagger: 0.2 + stagger: 0.1 }); -document.getElementById("toggleButton").addEventListener("click", function animateNav() { - gsap.set(".game-settings .sidenav .animate", { x: -500 }); - gsap.to(".game-settings .sidenav .animate", { - duration: 1, - x: 0, - ease: "power1.inOut", - stagger: 0.3 - }); -}); -// used to animate the heading +// Animate the heading on page load gsap.from(".heading", { duration: 1, - y: -500, + y: -500, + ease: "power1.inOut", + stagger: 0.2, + onComplete: function() { + // Start the yoyo bouncing effect after the initial animation + gsap.to(".heading", { + duration: 1, + y: -5, ease: "power1.inOut", - stagger: 0.2, - onComplete: function() { - // After the initial animation, start the yoyo bouncing effect - gsap.to(".heading", { - duration: 1, - y: -5, - ease: "power1.inOut", - yoyo: true, - repeat: -1 - });} + yoyo: true, + repeat: -1 + }); + } }); + // used to animate the grid gsap.from(".grid-container", { duration: 1,