-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
53 lines (43 loc) · 939 Bytes
/
index.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
const startLoader = () => {
const counter = document.querySelector(".counter");
let currentCounterValue = 0;
const updateCounter = () => {
if (currentCounterValue === 100) return;
currentCounterValue += Math.floor(Math.random() * 10) + 1;
if (currentCounterValue > 100) currentCounterValue = 100;
counter.textContent = currentCounterValue;
const delay = Math.floor(Math.random() * 200) + 50;
setTimeout(updateCounter, delay);
};
updateCounter();
};
startLoader();
gsap.to(".counter", 0.25, {
delay: 3.5,
opacity: 0,
// css: {
// zIndex: 0,
// // display: "none",
// },
});
gsap.to(".bar", 1.5, {
delay: 3.5,
height: 0,
stagger: {
amount: 0.5,
},
ease: "power4.inOut",
});
gsap.from(".h1", 1.5, {
delay: 4,
y: 700,
stagger: {
amount: 0.5,
},
ease: "power4.inOut",
});
gsap.from(".hero", 2, {
delay: 4.5,
y: 400,
ease: "power4.inOut",
});