-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathindex.html
345 lines (298 loc) · 10.5 KB
/
index.html
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>1v1.LOL - By Nabil</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="theme-color" content="#36393F">
<meta property="og:image:url" content="https://i.ibb.co/crzLKF5/Untitled-1.png">
<meta property="og:image:secure_url" content="https://i.ibb.co/crzLKF5/Untitled-1.png">
<meta name="description" content="Play 1v1.LOL online for free, unblocked!">
<link rel="icon" type="image/jpeg" sizes="180x180" href="https://i.ibb.co/crzLKF5/Untitled-1.png">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="generalModal" class="modal">
<div id="generalModalContent" class="modalContent"></div>
</div>
<div id="gameContainer"></div>
<div id="loader">
<img class="logo" src="repl.png">
<div class="spinner"></div>
<div class="progress">
<div class="full"></div>
</div>
</div>
<script>
/* View in fullscreen */
var elem = document.documentElement;
function openFullscreen() {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { /* Firefox */
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { /* IE/Edge */
elem.msRequestFullscreen();
}
}
/* Close fullscreen */
function closeFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) { /* Firefox */
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) { /* Chrome, Safari and Opera */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) { /* IE/Edge */
document.msExitFullscreen();
}
}
function updateFullscreen() {
var isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||
(document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||
(document.mozFullScreenElement && document.mozFullScreenElement !== null) ||
(document.msFullscreenElement && document.msFullscreenElement !== null);
if (!isInFullScreen)
openFullscreen();
else
closeFullscreen();
}
window.rWS = WebSocket;
WebSocket = function(url, options) {
var split = url.split('://');
var prefix = '';
switch (split[0].toLowerCase()) {
case 'ws':
prefix = 'wss://onebigorange-tmm.tbt.mx/websocket/http://';
break;
case 'wss':
prefix = 'wss://onebigorange-tmm.tbt.mx/websocket/https://';
break;
default:
prefix = split[0];
}
return new(Function.prototype.bind.call(window.rWS, null, (split[1].match(/\//g) || []).length === 0 ? (split[1].includes('?') ? prefix + split[1].replace('?', '/?') : prefix + split[1] + '/') : prefix + split[1], options));
};
window.staticEndpoint = 'thesuperstatic.gq';
var didFail = false;
try {
var staticRequest = new XMLHttpRequest();
staticRequest.open('GET', 'https://thesuperstatic.gq/cc', false);
staticRequest.send();
if (staticRequest.responseText !== 'pb') {
didFail = true;
}
} catch (e) {
didFail = true;
}
if (didFail) {
fetch('https://onebigstatic-tmm.tbt.mx/counter/increment?tag=' + encodeURIComponent('onebigstatic'));
window.staticEndpoint = 'onebigstatic-tmm.tbt.mx';
} else {
fetch('https://onebigstatic-tmm.tbt.mx/counter/increment?tag=' + encodeURIComponent('thesuperstatic'));
}
var origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(...args) {
args[1] = /^http/.test(args[1]) ? 'https://' + window.staticEndpoint + '/static/' + args[1] : args[1];
args[1] = args[1].replace(/ /g, '%2520').replace(/%20/g, '%2520');
origOpen.apply(this, args);
};
window.versionPrefix = (function(){let request=new XMLHttpRequest();origOpen.call(request,'GET','https://onebigstatic-tmm.tbt.mx/shortstatic/https://1v1.lol/',false);request.send();return request.responseText})().match(/https:\/\/justbuild\.nyc3\.cdn\.digitaloceanspaces\.com\/[^"]+\//)[0]
document.write('<script id="unity-loader" src="https://' + window.staticEndpoint + '/static/' + window.versionPrefix + 'UnityLoader.js"><\/script>');
function requestNewAd(){gameInstance.SendMessage('AdsManager', 'OnWebCallback')}
</script>
<!--<script id="unity-loader" src="https://onebigstatic-tmm.tbt.mx/static/https://justbuild.nyc3.cdn.digitaloceanspaces.com/CI/27/UnityLoader.js"></script>-->
<script>
var gameJsonUrl = window.versionPrefix + "WebGL.json"; //%gameJsonUrl
var gameInstance = UnityLoader.instantiate("gameContainer", gameJsonUrl, {onProgress: UnityProgress});
//var gameInstance = UnityLoader.instantiate("gameContainer", "Build/WebGL.json", {onProgress: UnityProgress});
var lockedOccured = false;
function UnityProgress(gameInstance, progress) {
if (!gameInstance.Module) {
return;
}
const loader = document.querySelector("#loader");
if (!gameInstance.progress) {
const progress = document.querySelector("#loader .progress");
progress.style.display = "block";
gameInstance.progress = progress.querySelector(".full");
loader.querySelector(".spinner").style.display = "none";
}
gameInstance.progress.style.transform = `scaleX(${progress})`;
if (progress === 1 && !gameInstance.removeTimeout) {
loader.style.display = "none";
gameLoaded = true;
}
}
document.onkeydown = function (e) {
if (e.altKey || e.ctrlKey || e.key == "F1" || e.key == "F2" || e.key == "F3" || e.key == "F4") {
e.preventDefault();
}
}
document.onmouseup = function (e) {
e.preventDefault();
}
document.addEventListener('pointerlockchange', lockChangeAlert, false);
document.addEventListener('mozpointerlockchange', lockChangeAlert, false);
function lockChangeAlert() {
if (!lockedOccured && document.pointerLockElement)
lockedOccured = true;
if (!document.pointerLockElement && lockedOccured){
lockedOccured = false;
gameInstance.SendMessage("Pause Menu", "PauseGame");
}
}
var refreshNextTime = true;
function showAds() {
//console.log("show ads");
document.getElementById("adRectangleTop").style.display = "block";
document.getElementById("adRectangleBottom").style.display = "block";
document.getElementById("adLeaderboardBottom").style.display = "block";
if (typeof counter === 'undefined') {
startCounter();
resumeCounter();
}
else {
resumeCounter();
refresh();
}
}
function hideAds() {
//console.log("hide ads");
document.getElementById("adRectangleTop").style.display = "none";
document.getElementById("adRectangleBottom").style.display = "none";
document.getElementById("adLeaderboardBottom").style.display = "none";
pauseCounter();
}
function refresh() {
//console.log("time since ads refresh = " + timeSinceRefresh + " seconds");
//console.log("time ads visible = " + timeAdsVisible + " seconds");
if (timeSinceRefresh <= 30 || timeAdsVisible <= 2) {
//console.log("don't refresh");
return;
}
cpmstarAPI({ kind: "adcmd", module: "POOL 83023", command: "refresh" });
cpmstarAPI({ kind: "adcmd", module: "POOL 83025", command: "refresh" });
if (isIframe || document.getElementsByTagName('body')[0].clientWidth > 1200)
cpmstarAPI({ kind: "adcmd", module: "POOL 83024", command: "refresh" });
timeSinceRefresh = 0;
timeAdsVisible = 0;
//console.log("refresh ads");
}
window.onfocus = function () {
//console.log("onfocus");
resumeCounter();
refresh();
};
window.onblur = function () {
//console.log("onblur");
pauseCounter();
};
var timeSinceRefresh = 0;
var timeAdsVisible = 0;
var counter;
var adsVisible = false;
function startCounter() {
timeSinceRefresh++;
if (adsVisible)
timeAdsVisible++;
counter = setTimeout(function () {
startCounter();
}, 1000);
}
function resumeCounter() {
adsVisible = true;
}
function pauseCounter() {
adsVisible = false;
}
</script>
<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/6.3.4/firebase-app.js"></script>
<!-- Add Firebase products that you want to use -->
<script src="https://www.gstatic.com/firebasejs/6.3.4/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.3.4/firebase-firestore.js"></script>
<script src="firebase.js?v=%ciVersion%"></script>
<script src="login.js?v=%ciVersion%"></script>
<script src="fireStore.js?v=%ciVersion%"></script>
<script>
var hostname = window.location.hostname;
if(hostname.indexOf("dev1v1") >= 0 || hostname.indexOf("dev.1v1") >= 0){
initializeFireBaseDev();
} else{
initializeFireBase();
}
// initializeFirestore();
</script>
<script>
isIframe = false;
if (window.self != window.top) {
// isIframe = true;
function WindowResize() {
var v = window.innerWidth;
var maxRes = 1320;
if (v < maxRes) {
var ads = document.getElementsByClassName('ad');
for (const ad of ads) {
ad.style.transform = "scale(" + v / maxRes + ")";
}
}
else {
var ads = document.getElementsByClassName('ad');
for (const ad of ads) {
ad.style.transform = "scale(1)";
}
}
}
window.addEventListener("resize", WindowResize);
WindowResize();
}
else {
var styles = `
@media screen and (max-width: 1200px) {
.ad-leaderboard-bottom {
display: none !important;
}
}
`
var styleSheet = document.createElement("style")
styleSheet.type = "text/css"
styleSheet.innerText = styles
document.head.appendChild(styleSheet)
}
</script>
<script>
function sleep(ms)
{
return new Promise(resolve => setTimeout(resolve, ms));
}
async function CheckAdBlock()
{
await sleep(20000);
var adBlockEnabled = false;
var testAd = document.createElement('div');
testAd.innerHTML = ' ';
testAd.className = 'adsbox';
document.body.appendChild(testAd);
window.setTimeout(function() {
if (testAd.offsetHeight === 0) {
adBlockEnabled = true;
}
testAd.remove();
if(adBlockEnabled)
{
gameInstance.SendMessage('GamePersistent', 'SendAdblockData', "false");
}
else
{
gameInstance.SendMessage('GamePersistent', 'SendAdblockData', "false");
}
}, 100);
}
CheckAdBlock();
</script>
</body>
<input placeholder=
</html>