-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
72 lines (64 loc) · 1.14 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
var tl=gsap.timeline()
function time(){
var a=0
setInterval(function(){
a= a+ Math.floor(Math.random()*15)
if (a<100) {
document.querySelector("#loader h1").innerHTML=a+"%"
}
else{
a=100
document.querySelector("#loader h1").innerHTML=a+"%"
}
},100)
}
tl.to("#loader h1",{
delay:0.5,
duration:1,
onStart:time(),
})
tl.to("#loader",{
top:"-110%",
delay:0.1,
duration:1.2,
})
tl.from("nav img ,nav h3 , nav h4 , nav button ",{
y:-100,
duration:1,
delay:0.1,
opactiy:0,
stagger:0.2
})
tl.from("#item h1",{
x:-50,
opacity:0,
duration:1,
stagger:0.5
})
tl.to("#item h1",{
transform:"translateX(-100%)",
duration:1.5,
fontWeight:"99",
scrollTrigger:{
trigger:"#item",
scroller:"body",
start:"top 0",
end:"top -200%",
scrub:3,
pin:true
}
})
gsap.from("#page2 h1 ,#page2>img",{
scale:0,
duration:1,
delay:1,
rotate:360,
scrollTrigger:{
trigger:"#page2 h1",
scroller:"body",
// markers:true,
start:"top 90%",
end:"top 30%",
scrub:3
}
})