-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
79 lines (71 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
let quotes = [
"You must do the things you think you cannot do.",
"Leave no stone unturned.",
"If it matters to you, you’ll find a way.",
"All limitations are self-imposed.",
"Everything you can imagine is real.",
];
let p = document.querySelector(".quote p");
let count = 0;
setTimeout(() => {
setInterval(changeQuote, 2000);
}, 3000);
function changeQuote() {
text();
p.innerText = quotes[count];
count++;
if (count >= quotes.length) {
count = 0;
console.log("0");
}
}
function text() {
gsap.from(p, {
y: 10,
ease: "slow(0.7, 0.7, false)",
});
}
let tl = gsap.timeline();
tl.from("#nav", {
y: 10,
opacity: 0,
onStart: () => {
$("#nav > h2:first-child").textillate({ in: { effect: "fadeIn" } });
$("#nav .quote p").textillate({ in: { effect: "fadeIn" } });
},
})
.from("#content", {
y: 10,
opacity: 0,
delay: 0.5,
onStart: () => {
$("#content #left #text h2").textillate({ in: { effect: "fadeIn" } });
$("#content #left #text p").textillate({
in: { effect: "fadeIn", delay: 5 },
});
$("#content #left #text button").textillate({ in: { effect: "fadeIn" } });
},
})
.from("#footer", {
y: 10,
opacity: 0,
delay: 0.5,
onComplete: () => {
$("#content #left #text h2").textillate({ in: { effect: "bounceIn" } });
},
})
.from("#right svg", {
opacity: 0,
duration: 2,
});
let sym = document.querySelectorAll("#footer #symbols p");
gsap.from(sym, {
y: 5,
yoyo: true,
repeat: -1,
stagger: 0.4,
ease: "slow(0.7, 0.7, false)",
});
setInterval(() => {
$("#content #left #text h2").textillate("start");
}, 5000);