-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
102 lines (84 loc) · 1.32 KB
/
Copy pathscript.js
File metadata and controls
102 lines (84 loc) · 1.32 KB
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
gsap.registerPlugin(ScrollTrigger);
ScrollTrigger.defaults({
toggleActions:"play none none reverse"
})
gsap.to('.img-container',{
scale:52,
ease:"ease",
scrollTrigger:{
trigger:'.video-section',
scrub:1,
start:"top top",
end:"bottom",
pin:true
}
})
gsap.to('.right' ,{
autoAlpha:0,
x:500,
duration:1.5,
scrollTrigger:{
start:1
}
})
gsap.to('.left' ,{
autoAlpha:0,
x:-500,
duration:1.5,
scrollTrigger:{
start:1
}
})
gsap.to('.txt-bottom',{
autoAlpha:0,
letterSpacing:-10,
duration:2,
scrollTrigger:{
start:2
}
})
const tl = gsap.timeline();
tl.from('.left-side div',{
y:150,
opacity:0,
stagger:{
amount:.4
},
delay:.5
}).from('.right-side',{opacity:0,duration:2},.5)
.to('.wrapper' ,{x:-window.innerWidth})
ScrollTrigger.create({
animation:tl,
trigger:'.wrapper',
start:"top top",
end:"+=600",
scrub:1,
pin:true,
ease:"ease"
})
gsap.utils.toArray('.col').forEach(image=>{
gsap.fromTo(image,{
opacity:.3,
x:0
},{
opacity:1,
x:-50,
scrollTrigger:{
trigger:image,
start:"10%",
stagger:{
amount:.4
}
}
})
})
const timeline = gsap.timeline();
timeline.from('.title span' ,{
y:150,
skewY:7,
duration:3
}).from('.txt-bottom',{
letterSpacing:-10,
opacity:0,
duration:3
})