-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmajor.js
145 lines (123 loc) · 2.83 KB
/
major.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
function init(){
gsap.registerPlugin(ScrollTrigger);
const locoScroll = new LocomotiveScroll({
el: document.querySelector("#main"),
smooth: true
});
locoScroll.on("scroll", ScrollTrigger.update);
ScrollTrigger.scrollerProxy("#main", {
scrollTop(value) {
return arguments.length ? locoScroll.scrollTo(value, 0, 0) : locoScroll.scroll.instance.scroll.y;
},
getBoundingClientRect() {
return {top: 0, left: 0, width: window.innerWidth, height: window.innerHeight};
},
pinType: document.querySelector("#main").style.transform ? "transform" : "fixed"
});
ScrollTrigger.addEventListener("refresh", () => locoScroll.update());
ScrollTrigger.refresh();
}
var a = -200
setInterval(function(){
if(a >= -1200){
gsap.to("#inner h1",{
opacity:1
})
gsap.to("#inner h1",{
opacity:1,
delay:1,
y:a+"%"
})
} else{
a = 0
gsap.to("#inner h1",{
opacity:0,
duration:0,
y:"0%"
})
}
a -= 200
},2000)
init()
gsap.from("#nav",{
y:-100,
duration:0.8,
delay:0.2,
opacity:0
})
gsap.from("#gola",{
y:-500,
duration:1.2,
delay:0.6,
opacity:0
})
gsap.from("#platform",{
y:200,
duration:0.9,
delay:0,
opacity:0
})
gsap.from("#page1>h1",{
y:15,
duration:1,
delay:0.2,
opacity:0
})
var tl = gsap.timeline({
scrollTrigger:{
trigger:"#page1",
scroller:"#main",
// markers:true,
start:"top -5%",
scrub:3
}
})
var tl2 = gsap.timeline({
scrollTrigger:{
trigger:"#page1",
scroller:"#main",
// markers:true,
start:"top -525%",
end:"top -545%",
// 600 625
scrub:3
}
})
tl.to("#gola",{
left:"90%",
rotate:540,
top:"70vh",
duration:2
},"anim1")
tl.to("#platform",{
rotate: 18,
},"anim1")
tl.to("#page2-in h1",{
delay:0.7,
onUpdate:function(){
$('#page2-in h1').textillate({ in: { effect: 'fadeInUp' } });
}
},"anim1")
tl2.to("#platform",{
rotate:0
},"anim1")
tl.to("#page2-circle svg .snake__text-path",{
onStart:function snake(){
var a = document.querySelector("#page2-circle svg .snake__text-path")
var b = 100
if(b>0){
setInterval(() => {
a.setAttribute("startOffset",`${b--}%`)
},50);
}
}
},"anim1")
tl2.to("#safed-gola",{
scale:10
},"anim2")
tl2.to("#page5 h1",{
delay:3,
onUpdate:function(){
$('#page5 h1').textillate({ in: { effect: 'fadeInUp' } });
}
},"anim2")