-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
87 lines (72 loc) · 1.64 KB
/
script.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
gsap.set("svg", { visibility: "visible" });
gsap.to("#headStripe", {
y: 0.5,
rotation: 1,
yoyo: true,
repeat: -1,
ease: "sine.inOut",
duration: 1 });
gsap.to("#spaceman", {
y: 0.5,
rotation: 1,
yoyo: true,
repeat: -1,
ease: "sine.inOut",
duration: 1 });
gsap.to("#craterSmall", {
x: -3,
yoyo: true,
repeat: -1,
duration: 1,
ease: "sine.inOut" });
gsap.to("#craterBig", {
x: 3,
yoyo: true,
repeat: -1,
duration: 1,
ease: "sine.inOut" });
gsap.to("#planet", {
rotation: -2,
yoyo: true,
repeat: -1,
duration: 1,
ease: "sine.inOut",
transformOrigin: "50% 50%" });
gsap.to("#starsBig g", {
rotation: "random(-30,30)",
transformOrigin: "50% 50%",
yoyo: true,
repeat: -1,
ease: "sine.inOut" });
gsap.fromTo(
"#starsSmall g",
{ scale: 0, transformOrigin: "50% 50%" },
{ scale: 1, transformOrigin: "50% 50%", yoyo: true, repeat: -1, stagger: 0.1 });
gsap.to("#circlesSmall circle", {
y: -4,
yoyo: true,
duration: 1,
ease: "sine.inOut",
repeat: -1 });
gsap.to("#circlesBig circle", {
y: -2,
yoyo: true,
duration: 1,
ease: "sine.inOut",
repeat: -1 });
gsap.set("#glassShine", { x: -68 });
gsap.to("#glassShine", {
x: 80,
duration: 2,
rotation: -30,
ease: "expo.inOut",
transformOrigin: "50% 50%",
repeat: -1,
repeatDelay: 8,
delay: 2 });
const burger = document.querySelector('.burger');
const nav = document.querySelector('nav');
burger.addEventListener('click', e => {
burger.dataset.state === 'closed' ? burger.dataset.state = "open" : burger.dataset.state = "closed";
nav.dataset.state === "closed" ? nav.dataset.state = "open" : nav.dataset.state = "closed";
});