-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanim.js
58 lines (48 loc) · 2.11 KB
/
anim.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
document.addEventListener("DOMContentLoaded", (event) => {
gsap.registerPlugin(ScrollTrigger, EaselPlugin, TextPlugin);
let tlWelcome = gsap.timeline({repeat: -1})
tlWelcome.to('.welcome-description', {text: "Сохраняйте удаленные сообщения", duration: 2}, ">2")
tlWelcome.to('.welcome-description', {text: "Ставьте уникальные статусы", duration: 2}, ">2")
tlWelcome.to('.welcome-description', {text: "Инструменты для вашей гиперуникальности в Телеграме", duration: 2}, ">2")
statusAnimation = () => {
let tlStatus = gsap.timeline()
tlStatus.fromTo("#about_status", {y:-70}, {opacity: 1, y: 0, duration: 1, ease: "power"}, "")
tlStatus.fromTo("#example_status", {y:-70}, {opacity: 1, y: 0, duration: 1, ease: "power"}, "<0.5")
tlStatus.fromTo("#possibly_statuses", {y:-70}, {opacity: 1, y: 0, duration: 1, ease: "power"}, "<0.5")
tlStatus.to('.interesting', {opacity: 0.8, duration: 0.5, ease: "power"}, ">")
}
msgAnimation = () => {
let tlMessage = gsap.timeline()
tlMessage.fromTo(".deleted", {x:-70}, {opacity: 1, x: 0, duration: 1.4, ease: "power"}, "")
tlMessage.fromTo(".gpt", {x:70}, {opacity: 1, x: 0, duration: 1.4, ease: "power"}, "<0.5")
}
endAnimation = () => {
let tlEnd = gsap.timeline()
tlEnd.to(".btn-start", {scale: 1, opacity: 1, duration: 1}, "")
tlEnd.to(".btn-tg", {scale: 1, opacity: 0.7, duration: 1,}, "<")
}
ScrollTrigger.create({
trigger: '#s2',
start: "top center",
end: "bottom center",
//markers: true,
once: true,
onEnter: statusAnimation
});
ScrollTrigger.create({
trigger: '#s3',
start: "top center",
end: "bottom center",
//markers: true,
once: true,
onEnter: msgAnimation
});
ScrollTrigger.create({
trigger: '#s4',
start: "top center",
end: "bottom center",
//markers: true,
once: true,
onEnter: endAnimation
});
});