-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
120 lines (111 loc) · 2.06 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
function hero(){
let time = gsap.timeline();
time.from("nav h1,nav div a,nav div button",{
y:-30,
duration:0.5,
delay:1,
opacity:0,
stagger:0.15
})
time.from("section h1",{
x:-100,
opacity:0,
duration:0.6,
})
time.from("section p",{
x:-50,
opacity:0,
duration:0.4,
})
time.from("section button",{
x:-30,
opacity:0,
duration:0.6,
},"-=0.2")
time.from(".image video",{
opacity:0,
duration:3
},"-=1.5")
}
hero();
function icons(){
let logos = document.querySelectorAll(".companies img")
logos.forEach((img,index)=>{
if(index%2==0){
gsap.from(img,{
y:-60,
duration:1,
opacity:0,
scrollTrigger:{
trigger:img,
scoller:"body",
start:"top 42%",
// end:"top 50%",
// markers:true,
}
})
}else{
gsap.from(img,{
y:60,
duration:1,
opacity:0,
scrollTrigger:{
trigger:img,
scoller:"body",
start:"top 58.5%",
// end:"top 50%",
// markers:true,
}
})
}
})
}
icons();
function services(){
gsap.from("article",{
y:30,
duration:1,
opacity:0,
delay:0.5,
scrollTrigger:{
trigger:"article",
scroller:"body",
start:"top 75%",
// markers:true
}
})
}
services();
function cards(){
let time3 = gsap.timeline({
scrollTrigger:{
trigger:".cards",
scroller:"body",
start:"top 60%",
end:"top -20%",
// markers:true,
scrub:2
}
})
time3.from("#card1",{
x:-300,
duration:0.7,
opacity:0
},"anime1")
time3.from("#card2",{
x:300,
duration:0.7,
opacity:0
},"anime1")
time3.from("#card3",{
x:-300,
duration:0.7,
opacity:0
},"anime2")
time3.from("#card4",{
x:300,
duration:0.7,
opacity:0
},"anime2")
}
cards();