-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.js
127 lines (110 loc) · 2.65 KB
/
main.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
gsap.registerPlugin(ScrollTrigger);
if (screen.width > 414) {
let t = gsap.timeline({
scrollTrigger: {
trigger: "#main",
start: "top top",
scrub: 2,
pin: "#main",
},
});
let t1 = gsap.timeline({
scrollTrigger: {
trigger: "#main",
start: "top top",
scrub: 2,
pin: "#main",
},
});
console.log("OK" + " " + screen.width);
t.to("#videoplayer", { width: "100%", ease: "Expo.easeInOut" });
t1.to(
".videoplayer-center-text",
{ opacity: "1", ease: "Expo.easeInOut", visibility: "visible" },
0.3
);
}
// gsap.to(
// ".videoplayer-center-text",
// {
// scrollTrigger: {
// trigger: "#main",
// start: "top top",
// scrub: 1,
// },
// opacity: 1,
// ease: "Expo.easeInOut",
// },
// 1000
// );
gsap.to("#one", {
scrollTrigger: {
trigger: "#main",
start: "top top",
scrub: 3,
},
left: "-600%",
ease: "Expo.easeInOut",
opacity: 0,
});
gsap.to("#holder1", {
scrollTrigger: {
trigger: "#main",
start: "top top",
scrub: 3,
},
left: "-300%",
ease: "Expo.easeInOut",
opacity: 0,
});
gsap.to("#six", {
scrollTrigger: {
trigger: "#main",
start: "top top",
scrub: 3,
},
right: "-600%",
ease: "Expo.easeInOut",
opacity: 0,
});
gsap.to("#holder2", {
scrollTrigger: {
trigger: "#main",
start: "top top",
scrub: 3,
},
right: "-300%",
ease: "Expo.easeInOut",
opacity: 0,
});
anime.timeline().add({
targets: [".header, .header-sec", ".header-text"],
opacity: [0, 1],
translateY: [80, 0],
translateZ: 0,
easing: "easeOutExpo",
duration: 2000,
delay: (el, i) => 300 + 40 * i,
});
document.getElementById("vid").play();
var countDownDate = new Date("Jan 22, 2022 15:37:25").getTime();
// Update the count down every 1 second
var x = setInterval(function () {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result in the element with id="timer"
document.getElementById("timer").innerHTML =
days + "d " + hours + "h " + minutes + "m " + seconds + "s ";
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("timer").innerHTML = "EXPIRED";
}
}, 1000);