-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
193 lines (154 loc) · 5.3 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
let animeParent = document.querySelector("#Open-Anime");
let anime = document.querySelector("#Open-Anime #Anime");
setTimeout(function () {
anime.style.width = "100%";
anime.style.height = "100%";
setTimeout(function () {
animeParent.style.backgroundColor = "transparent";
animeParent.style.display = "none";
anime.style.backgroundColor = "transparent";
anime.style.display = "none";
}, 750)
}, 7500)
setTimeout(function () {
HoverBox.style.bottom = "2.5%";
setTimeout(function () {
HoverBox.style.right = "10.5%";
}, 1000)
}, 7500)
let page1Container = document.querySelector("#Page1 #Page1Container");
setTimeout(function () {
page1Container.style.top = "0%";
}, 8000)
let container = document.querySelector("#Container");
let cursor = document.querySelector("#Cursor");
container.addEventListener("mousemove", function (details) {
cursor.style.left = details.x + "px";
cursor.style.top = details.y + "px";
});
let h1Pen = document.querySelector("#Page1Container span svg");
setTimeout(function () {
h1Pen.style.transform = "rotate(0deg) scale(1)";
}, 8700)
h1Pen.addEventListener("mouseover", function () {
h1Pen.style.transform = "rotate(-30deg) scale(0.85)";
});
h1Pen.addEventListener("mouseleave", function () {
h1Pen.style.transform = "rotate(0deg) scale(1)";
});
let navbottom = document.querySelector("#NavBottom");
let navtalk = document.querySelector("#NavTalk");
navtalk.addEventListener("mouseover", function () {
navtalk.style.width = "2.75vw";
navtalk.style.marginLeft = "6vw";
})
navtalk.addEventListener("mouseleave", function () {
navtalk.style.width = "9vw";
navtalk.style.marginLeft = "0vw";
})
let page2 = document.querySelector("#Page2");
page2.addEventListener("mouseenter", function () {
rightPart[0].style.left = "0%";
setTimeout(function () {
rightPart[1].style.left = "0%";
}, 500)
setTimeout(function () {
rightPart[2].style.left = "0%";
}, 700)
setTimeout(function () {
rightPart[3].style.left = "0%";
}, 900)
setTimeout(function () {
rightPart[4].style.left = "0%";
}, 1100)
})
let rightPart = document.querySelectorAll("#Right .Part");
rightPart.forEach(function (part) {
part.addEventListener("mouseenter", function () {
part.childNodes[1].style.scale = "1";
part.childNodes[1].style.opacity = "1";
})
part.addEventListener("mouseleave", function () {
part.childNodes[1].style.scale = "0";
part.childNodes[1].style.opacity = "0";
})
part.addEventListener("mousemove", function (mousedets) {
gsap.to(part.childNodes[1], {
x: mousedets.x - part.getBoundingClientRect().x - 50,
y: mousedets.y - part.getBoundingClientRect().y - 100,
})
})
})
let Page1 = document.querySelector("#Page1");
let nav = document.querySelector("nav");
let navbottomA = document.querySelectorAll("#NavBottomContainer a");
Page1.addEventListener("mouseenter", function () {
cursor.style.display = "flex";
nav.style.height = "7.25vw";
})
Page1.addEventListener("mouseleave", function () {
cursor.style.display = "none";
nav.style.height = "3.25vw";
navbottomA.forEach(function (a) {
a.style.display = "none";
})
})
nav.addEventListener("mouseover", function () {
nav.style.height = "7.25vw";
navbottomA.forEach(function (a) {
a.style.display = "block";
})
})
nav.addEventListener("mouseleave", function () {
nav.style.height = "3.25vw";
navbottomA.forEach(function (a) {
a.style.display = "none";
})
})
let page3Design = document.querySelector("#Design");
let page3Watch = document.querySelector("#Design #Watch");
let page3Svg = document.querySelector("#Design svg");
let Video = document.querySelector("#Page3Container video");
let HoverBox = document.querySelector("#Container #HoverBox");
page3Design.addEventListener("mouseover", function () {
page3Watch.style.opacity = "1";
})
page3Design.addEventListener("mouseleave", function () {
page3Watch.style.opacity = "0";
})
page3Svg.addEventListener("click", function () {
Video.play();
HoverBox.style.display = "none";
Video.style.zIndex = "999";
Video.style.opacity = "1";
Video.style.transform = "scaleX(1) scaleY(1)";
})
Video.addEventListener("click", function () {
Video.pause();
HoverBox.style.display = "flex";
Video.style.zIndex = "0";
Video.style.opacity = "0";
Video.style.transform = "scaleX(0.7) scaleY(0)";
})
let Right = document.querySelector("#Container-Right");
let RightHover = document.querySelector("#Right-Hover");
let RightVideo = document.querySelector("#Right-Video video");
let RightImg = document.querySelector("#Right-Video img");
Right.addEventListener("mouseover", function () {
RightHover.style.display = "flex";
RightHover.style.scale = "1";
RightHover.style.opacity = "1";
RightVideo.play();
RightImg.style.display = "none";
})
Right.addEventListener("mouseleave", function () {
RightHover.style.display = "none";
RightHover.style.scale = "0";
RightHover.style.opacity = "0";
RightVideo.pause();
RightImg.style.display = "block";
})
Right.addEventListener("mousemove", function (HoverDets) {
RightHover.style.left = HoverDets.x + "px";
RightHover.style.top = HoverDets.y + "px";
})