Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unnecessary Animation #255

Merged
merged 6 commits into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 16 additions & 23 deletions js/animation.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down