-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
224 lines (208 loc) · 5.86 KB
/
Copy pathmain.js
File metadata and controls
224 lines (208 loc) · 5.86 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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/////////////////////////////////////////////////////////////////////////////
//////////////slidenav///////////
if (mobile === true) {
//console.log("off");
var loader = document.getElementById("loader");
var loadText = document.getElementById("load");
var icon = document.getElementById("icon");
var overlay = document.getElementsByClassName("overlay");
var lbt = document.getElementById("lbt");
var rbt = document.getElementById("rbt");
var sign = document.getElementById("sign");
var load = document.getElementsByClassName("loader");
loadText.innerText = "";
icon.style = "none";
icon.src = "TRACK(2).png";
icon.style.filter = "opacity(0.8) drop-shadow(white 2px 4px 6px)";
icon.style.width = "75%";
icon.style.position = "absolute";
icon.style.top = "40%";
icon.style.left = "calc((100% - 75%)/2)";
document.body.style.background = "#ffffff";
for (var i = 0; i < overlay.length; i++) {
overlay[i].style.background = "rgb(228 250 234)";
}
lbt.style.border = "black 1px solid";
lbt.style.color = "black";
rbt.style.border = "black 1px solid";
rbt.style.color = "black";
for (var u = 0; u < load.length; u++) {
load[u].style.color = "black";
}
sign.style.color = "black";
}
var slideIndex = 1;
showDivs(slideIndex);
function divcon(n) {
showDivs2((slideIndex += n));
btncon();
}
function showDivs(n) {
var i;
var x = document.getElementsByClassName("mySlides");
if (n > x.length) {
slideIndex = 1;
}
if (n < 1) {
slideIndex = x.length;
}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[slideIndex - 1].style.display = "block";
}
if (mobile === false) {
document.addEventListener("keypress", function (event) {
var key = event.keyCode;
if (key === 116 || key === 84) {
slideIndex = 2;
window.dispatchEvent(
new KeyboardEvent("keydown", {
key: "t"
})
);
lowernav(0);
} else if (key === 114 || key === 82) {
slideIndex = 3;
window.dispatchEvent(
new KeyboardEvent("keydown", {
key: "r"
})
);
lowernav(2);
} else if (key === 97 || key === 65) {
slideIndex = 4;
window.dispatchEvent(
new KeyboardEvent("keydown", {
key: "a"
})
);
lowernav(2);
} else if (key === 99 || key === 67) {
slideIndex = 5;
window.dispatchEvent(
new KeyboardEvent("keydown", {
key: "c"
})
);
lowernav(2);
} else if (key === 107 || key === 75) {
slideIndex = 6;
window.dispatchEvent(
new KeyboardEvent("keydown", {
key: "k"
})
);
lowernav(1);
}
showDivs(slideIndex);
//alert(key);
});
}
function showDivs2(n) {
var i;
var x = document.getElementsByClassName("mySlides");
if (n > x.length) {
slideIndex = 1;
}
if (n < 1) {
slideIndex = x.length;
}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[slideIndex - 1].style.display = "block";
if (mobile === false) {
var list = ["t", "r", "a", "c", "k"];
var list2 = ["84", "82", "65", "67", "75"];
document.dispatchEvent(
new KeyboardEvent("keydown", {
key: list[slideIndex - 2],
keyCode: list2[slideIndex - 2],
which: list2[slideIndex - 2],
type: "keydown"
})
);
//alert(list[slideIndex - 2] + list2[slideIndex - 2]);
}
}
function btncon() {
console.log(slideIndex);
if (slideIndex < 3) {
lowernav(0);
} else if (slideIndex > 5) {
lowernav(1);
} else {
lowernav(2);
}
}
function lowernav(x) {
if (x === 0) {
document.getElementById("lbt").style.display = "none";
document.getElementById("sign").style.display = "none";
}
if (x === 1) {
document.getElementById("rbt").style.display = "none";
document.getElementById("sign").style.display = "block";
}
if (x === 2) {
document.getElementById("lbt").style.display = "block";
document.getElementById("rbt").style.display = "block";
document.getElementById("sign").style.display = "none";
}
}
function mencon(n) {
slideIndex = n;
showDivs2(slideIndex);
btncon();
}
/////////////////////////////////////////////////////////////////////////////
//////////////watermark removal///////////
const removeWatermark = () => {
const ids = [];
const iframes = document.body.querySelectorAll("iframe");
for (const iframe of iframes) {
if (iframe.id.startsWith("sb__open-sandbox")) ids.push(iframe.id);
}
for (const id of ids) {
const node = document.createElement("div");
node.style.setProperty("display", "none", "important");
node.id = id;
document.getElementById(id).remove();
document.body.appendChild(node);
}
};
setTimeout(removeWatermark, 500);
/*@codesandbox devs, sorry for removing your anti-phising watermark. Yet the "Open Sandbox" button floats right ontop of my UI, I have no other choice. Sorry UwU*/
/////////////////////////////////////////////////////////////////////////////
//////////////Blur loading//////////
if (mobile === false) {
var canvas = document.getElementById("canvas3d");
var loader = document.getElementById("loader");
var loadText = document.getElementById("load");
var mesdiv = document.getElementById("mesdiv");
var mescon = document.getElementById("mescon");
let load = 0;
let int = setInterval(blurring, 100);
const scale = (num, in_min, in_max, out_min, out_max) => {
return ((num - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min;
};
function blurring() {
load++;
if (load > 99) {
clearInterval(int);
message();
}
loadText.innerText = `${load}%`;
loader.style.opacity = scale(load, 0, 100, 1, 0);
canvas.style.filter = `blur(${scale(load, 0, 100, 30, 0)}px)`;
}
function message() {
loader.style.display = "none";
mesdiv.style.display = "block";
mescon.style.filter = "opacity(0.8) drop-shadow(2px 4px 6px black)";
}
/*window.onresize = function () {
mesdiv.style.display = "none";
};*/
}