forked from EternoSeeker/gameoflife
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.js
40 lines (39 loc) · 1.07 KB
/
animation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// used to animate side navbar
gsap.from(".game-settings .sidenav .animate", {
duration: 1,
x: -500,
ease: "power1.inOut",
stagger: 0.2
});
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
gsap.from(".heading", {
duration: 1,
y: -500,
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
});}
});
// used to animate the grid
gsap.from(".grid-container", {
duration: 1,
x: 1000,
ease: "power1.inOut",
stagger: 0.2
});