-
Notifications
You must be signed in to change notification settings - Fork 7
/
chat.html
executable file
·572 lines (572 loc) · 24 KB
/
chat.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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
<!DOCTYPE html>
<html>
<head>
<title>Gametime.js Multiplayer Chat</title>
<style>
body {
background: #444;
margin: 0;
padding-bottom: 3rem;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#form {
position: fixed !important;
background: #444;
padding: 0.25rem;
display: flex;
left: 2%;
right: 2%;
bottom: 3%;
}
#input {
border-radius: 0;
margin: 20px;
border: none;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24);
outline: none;
width: 350px;
}
#input:focus {
outline: none;
}
#form button {
background: #555;
border: none;
padding: 10px;
margin: 20px;
border-radius: 0;
outline: none;
color: #eee;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24);
}
#messages {
list-style-type: none;
margin: 0;
padding: 0;
overflow-y: scroll !important;
}
#messages > li {
padding: 10px;
margin: 2%;
background: #eee;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24);
}
a { color: #38b6ff; font-weight: lighter; text-decoration: underline; }
.wrapper {
width: 98%;
height: 97%;
margin: 0;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.3);
padding: 0 !important;
border: 5px solid #ddd;
border-image: linear-gradient(to top, #222, #ddd) 1 / 20px;
background: #333;
}
[id^="NotiflixNotify-"] {
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.24);
background: transparent !important;
backdrop-filter: blur(5px);
border-bottom: .5px solid #fff;
}
#NotiflixNotifyWrap {
z-index: 99999999999999999 !important;
}
#NotiflixNotifyWrap * {
color: #fff !important;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes spin-reverse {
0% {
transform: rotate(360deg);
}
100% {
transform: rotate(0deg);
}
}
.spin {
border: 2px solid #333;
display: inline-block;
border-top: 2px solid #eee;
border-radius: 50%;
width: 10px;
height: 10px;
margin-left: 15px;
animation: spin 2s linear infinite;
}
.spin-reverse {
animation: spin-reverse 2s linear infinite;
}
.spin.spin-large {
width: 100px;
height: 100px;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.loader {
background: #444;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: 0;
z-index: 999999999;
}
.center-origin {
display: inline-flex;
text-align: center;
align-items: center;
justify-content: center;
}
.swal-overlay {
z-index: 999 !important;
}
[class^="swal"] {
animation: none !important;
transition: none !important;
}
.swal-button {
background: #333 !important;
color: #fff;
border-radius: 2px;
box-shadow: none !important;
}
.swal-modal {
border-radius: 1px;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.24) !important;
}
.swal-overlay {
background: rgba(10, 10, 10, .3);
}
.swal-content {
height: 200px;
overflow-y: scroll;
border-bottom: 2px solid #333;
}
code {
padding: 2px;
background: #ddd;
border-radius: 2px;
font-size: 16px;
}
pre {
padding: 8px 5px;
width: 100%;
background: #ddd;
border-radius: 2px;
font-size: 16px;
overflow-x: scroll !important;
white-space: nowrap;
}
blockquote {
border-left: 2px solid #ddd;
color: #999;
margin-left: 5px !important;
padding: 3px 0;
padding-left: 10px !important;
}
a.column-link {
display: block;
text-decoration: none !important;
color: #333;
border-bottom: 2px solid #efefef;
}
a.column-link:nth-child(odd) {
background: #efefef;
}
.keyword-holder a {
background: #333;
border-radius: 3px;
padding: 3px;
color: #eee;
text-align: center;
white-space: nowrap;
}
a .close {
text-decoration: none !important;
}
.keyword-holder {
margin-left: 10px;
display: inline-flex;
pointer-events: none !important;
}
.context-menu a {
border-bottom: 1px solid #ddd;
display: block;
color: #333;
margin: 3px;
text-decoration: none;
}
.user-selector1 {
overflow-y: scroll;
}
.swal-content button {
background: #efefef;
border: none;
color: #333;
padding: 10px;
margin: 10px;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24);
border-radius: 0;
}
</style>
<script src="https://cdn.jsdelivr.net/gh/Parking-Master/Gametime.js-2.0@latest/gametime.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/notiflix/Notiflix@latest/dist/notiflix-aio-3.2.7.min.js"></script>
<script type="text/javascript" src="https://npmcdn.com/[email protected]/dist/parse.min.js"></script>
<script src="js/user/chat.js"></script>
<script src="js/user/user.js"></script>
<script src="js/user/mailer.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Parking-Master/Date.js@latest/date.min.js"></script>
<script src="js/analytics.js"></script>
</head>
<body>
<div class="loader">
<div class="spin spin-large center-origin" style="position: absolute; left: 50%; top: 50%; margin-left: -50px; margin-top: -50px; padding: 0 !important">
<p class="spin-reverse" style="display: inline-block"><img src="images/html/chat.png" style="width: 50%"></p>
</div>
</div>
<div class="wrapper">
<ul id="messages" style="margin-top: 55px"></ul>
<form id="form" action="">
<div id="input" style="display: inline-flex; align-items: center; justify-content: center; text-align: center; background: #fff">
<div class="keyword-holder" style="position: relative; width: auto; text-align: left; display: inline-block"></div>
<input id="input" autocomplete="off" placeholder="Type your message here..." style="width: 100%; height: 100%; margin: 0; box-shadow: none; padding: 0" />
</div>
<button class="send" onclick="event.preventDefault(); sendMessage(document.querySelector('input#input').value) && (document.querySelector('input#input').value = '')">Send</button>
<span style="margin-left: 100px"></span>
<button class="mention" onclick="event.preventDefault(), mention()"><svg style="fill: #fff" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm.021 17.824c-3.907 0-6.021-2.438-6.021-5.586 0-3.363 2.381-6.062 6.638-6.062 3.107 0 5.362 2.019 5.362 4.801 0 4.356-5.165 5.506-4.906 3.021-.354.555-.927 1.177-2.026 1.177-1.257 0-2.04-.92-2.04-2.403 0-2.222 1.461-4.1 3.19-4.1.829 0 1.399.438 1.638 1.11l.232-.816h1.169c-.122.416-1.161 4.264-1.161 4.264-.323 1.333.675 1.356 1.562.648 1.665-1.29 1.75-4.664-.499-6.071-2.411-1.445-7.897-.551-7.897 4.347 0 2.806 1.976 4.691 4.914 4.691 1.719 0 2.771-.465 3.648-.974l.588.849c-.856.482-2.231 1.104-4.391 1.104zm-1.172-7.153c-.357.67-.588 1.538-.588 2.212 0 1.805 1.761 1.816 2.626.12.356-.697.586-1.586.586-2.265 0-1.458-1.748-1.717-2.624-.067z"/></svg></button>
<button class="download" onclick="event.preventDefault(), exportChat()"><svg style="fill: #fff" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 24c6.627 0 12-5.373 12-12s-5.373-12-12-12-12 5.373-12 12 5.373 12 12 12zm0-22c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm2 14h-4v-1h4v1zm0 1v1h-4v-1h4zm-4-6h-4l6-6 6 6h-4v3h-4v-3z"/></svg></button>
<button class="settings" onclick=""><svg style="fill: #fff" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-10 12c0-5.514 4.486-10 10-10s10 4.486 10 10c0 1.679-.421 3.26-1.155 4.651l-1.377-1.377c-.662-.661-1.002-1.581-.93-2.514.137-1.767-.471-3.58-1.82-4.93-1.226-1.224-2.825-1.83-4.428-1.83-.603 0-1.206.086-1.79.257l3.77 3.771c.41 1.889-2.33 4.66-4.242 4.242l-3.77-3.77c-.172.584-.259 1.188-.259 1.792 0 1.602.606 3.202 1.829 4.426 1.352 1.351 3.164 1.958 4.932 1.821.932-.072 1.852.269 2.514.931l1.377 1.376c-1.391.734-2.972 1.154-4.651 1.154-5.514 0-10-4.486-10-10z"/></svg></button>
<span style="margin-left: 100px"></span>
<button class="help" onclick="event.preventDefault(), help()">?</button>
<button class="options" onclick=""><img src="images/icons/hamburger.png" style="right: 2%; width: 20px; height: 20px; filter: drop-shadow(3px 3px 3px rgba(255, 255, 255, .3)) invert(100%); cursor: pointer; pointer-events: all !important" onclick="dropdown(this)"></button>
<p style="white-space: nowrap; margin: 20px; padding: 10px; color: #999; font-size: 12px">All messages expire after 48 hours.</p>
</form>
<script>
Notiflix.Notify.init({
position: "right-bottom",
timeout: 2000,
info: {
width: "300px",
background: "transparent",
textColor: "#fff",
notiflixIconColor: "#fff"
}
});
availableModes = ["Slayer", "Teams", "Fiesta", "Snipers", "Oddball", "Fistfight", "CTF", "KOTH"];
availableMaps = ["Cargo", "Storage", "Complex", "Lihid", "Aero"];
words = [];
fetch("words.json").then((e) => e.json()).then((e) => words = (e.words));
gametime.set("key", "pub-c-672a6dd1-3655-4331-8913-891ad95df31f", "sub-c-6dc7d441-fc41-40f0-94b5-e0357ade8856");
gametime.set("channel", "world");
gametime.make("message");
function sendMessage(msg = "", isInvite = false) {
if (!msg.trim()) return false;
if (selectedUser) {
msg = "From :bold:" + (userMan.isLoggedIn ? userMan.get("username") : "Guest") + ":endbold:, to :bold:" + selectedUser + ":endbold: at " + date.js.time() + ": " + msg;
} else {
msg = ":bold:" + (userMan.isLoggedIn ? userMan.get("username") : "Guest") + ":endbold: at " + date.js.time() + ": " + msg;
}
let oldmsg = msg.toLowerCase();
let i = oldmsg;
if (!isInvite) {
words.forEach((x) => {
x = x.toLowerCase();
let newi = i.replace(new RegExp((x.replace(/[\(\)\*\@\!\$\-]/gi, "\\$1")).toString().toLowerCase(), "g"), (t => {
let g = "";
t.forEach(() => g += "*");
return g;
})(x.toString().toLowerCase().split("")));
i = newi;
});
if (i.toLowerCase() != oldmsg) return Notiflix.Notify.info("For everyones safety, we block inaproppriate messages. We're trying to make the chat a safer place.\n\nError: Could not submit message.");
}
if (document.querySelectorAll("li").length >= 6) {
document.querySelector("li").remove();
chat.truncate(6);
}
msg = msg.replace(/[\<\>]/gi, "");
msg = msg.replace(/(\:bold\:)/g, "<b>").replace(/(\:endbold\:)/g, "</b>").replace(/(\:italic\:)/g, "<i>").replace(/(\:enditalic\:)/g, "</i>").replace(/(\:link (.*))/g, "<a $1").replace(/(\:endlink\:)/g, "</a>").replace(/(href\=.(.*).\:)/, "href=\"$2\">").replace(":link", "").trim();
var item = document.createElement("li");
messages.appendChild(item);
window.scrollTo(0, document.body.scrollHeight);
msg = msg.replace("<b>", "<a href='#' onclick='userOptions(this, btoa(encodeURIComponent(this.textContent.trim())), event)' style='color: #000 !important; font-weight: bold'>").replace("</b>", "</a>").replace("javascript:", "");
item.innerHTML = msg.replace(/\<\>/gi,"").split("(|-star-|)").join("*");
chat.add(msg);
gametime.run("message", [gametime.user.position + "," + btoa(encodeURIComponent(msg))]);
return true;
}
var messages = document.getElementById("messages");
var form = document.getElementById("form");
var input = document.querySelector("input#input");
chat.get((chat) => {
for (let i = 0; i < chat.split(",").length; i++) {
var item = document.createElement("li");
let msg = decodeURIComponent(chat.split(",")[i]);
item.innerHTML = msg;
msg && messages.appendChild(item);
window.scrollTo(0, document.body.scrollHeight);
}
});
gametime.on("message", function(data) {
let msg = decodeURIComponent(atob(data.split(",")[1]));
if (data.split(",")[0] == gametime.user.position) return;
if (document.querySelectorAll("li").length >= 6) {
document.querySelector("li").remove();
}
msg = msg.replace(/(\:bold\:)/g, "<b>").replace(/(\:endbold\:)/g, "</b>");
var item = document.createElement("li");
item.innerHTML = msg;
msg && messages.appendChild(item);
window.scrollTo(0, document.body.scrollHeight);
});
gametime.connected = true;
function help() {
let content = document.createElement("div");
content.className = "swal-text";
content.innerHTML = `
Welcome to the chat! Here's some tips:
<br>
<br>
<b>Text styling</b>
<br>
<br>
Use <code>:bold:</code> and <code>:endbold:</code> to make text bold.
<br>
<br>
Example:
<br>
<br>
<pre>My message is :bold:very bold:endbold:</pre>
<br>
<br>
Output:
<br>
<br>
<blockquote>My message is <b>very bold</b></blockquote>
<br>
<br>
You can do the same thing with <code>:italic:</code> and <code>:enditalic:</code> to make text <i>italic</i>.
<br>
<br>
Example:
<br>
<br>
<pre>My message is :italic:very italic:enditalic:</pre>
<br>
<br>
Output:
<br>
<br>
<blockquote>My message is <i>very italic</i></blockquote>
<br>
<br>
<b>Sending messages</b>
<br>
<br>
Remember to keep the chat clean when sending messages, as the whole world can see it!
<br>
<br>
To type a message, select the input box on the bottom of the screen.
<br>
<br>
Type your message.
<br>
<br>
Send it via the "Enter" key or clicking "Send" on the right.
<br>
<br>
Viola! You sent a message in the world chat.
<br>
<br>
<b>Inviting players</b>
<br>
<br>
To invite someone, click the "@" button next to the input box.
<br>
<br>
In the popup, type the users name.
<br>
<br>
Once you select them, close the popup and click the username in the input box.
<br>
<br>
Select "Invite player" via the context menu.
<br>
<br>
Wait for the player to join.
`;
swal({
title: "Chat documentation",
content: content
});
}
users = [];
let init = setInterval(() => {
if (typeof Parse != "undefined") {
(async () => {
let e = !1;
const t = Parse.Object.extend("User");
const n = new Parse.Query(t);
const s = await n.find();
let lobbies = [];
let pause = false;
for (let t = 0; t < s.length; t++) {
let ot = t;
const n = Parse.Object.extend("User");
new Parse.Query(n).get(s[t].id).then((t => {
Parse.User.logIn(t.get("username"), t.get("tpass")).then((user) => {
users.push(user);
});
}));
}
})();
document.querySelectorAll(".my-username").forEach(x => x.textContent = userMan.get("username"));
document.querySelectorAll(".my-picture").forEach(x => x.src = userMan.get("picture") || "https://cdn.jsdelivr.net/gh/Parking-Master/Parking-Master@latest/img/profile-picture.png");
clearInterval(init);
}
});
function searchUser(name) {
document.querySelectorAll(".user-selector1 a").forEach(x => x.remove());
users.forEach(i => {
if (i.get('username').toLowerCase().trim().startsWith(name.toLowerCase().trim())) {
document.querySelector('.user-selector1').innerHTML += `
<a onclick="event.preventDefault(), selectUser('${btoa(encodeURIComponent(i.get("username")))}')" href="#" class="column-link">${i.get("username")}</a>
`;
}
});
}
function mention() {
let content = document.createElement("div");
content.className = "user-selector1";
content.innerHTML = `
<input style="margin: 0; padding: 5px; border-radius: 0; border: 3px solid #efefef" placeholder="Search for users..." onkeyup="searchUser(this.value)">
`;
users.forEach(user => {
content.innerHTML += `
<a onclick="event.preventDefault(), selectUser('${btoa(encodeURIComponent(user.get("username")))}')" href="#" class="column-link">${user.get("username")}</a>
`;
});
swal({
title: "Select a user",
content: content,
button: "Cancel"
});
content.parentElement.classList.add("user-selector");
}
selectedUser = null;
function selectUser(name) {
swal.close();
name = decodeURIComponent(atob(name)).trim();
selectedUser = name;
document.querySelector(".keyword-holder a") && document.querySelector(".keyword-holder a").remove();
document.querySelector(".keyword-holder").innerHTML += `
<a href="#" style="pointer-events: all !important" onclick="userOptions(this, '${btoa(encodeURIComponent(name))}', event)"><span onclick="event.preventDefault(), removeUser(this.parentElement.textContent.trim())" class="close">×</span>  ${("@" + name).trim()}</a>
`;
document.querySelector(".keyword-holder").style.paddingRight = "10px";
}
function removeUser(name) {
selectedUser = null;
document.querySelector(".keyword-holder a") && document.querySelector(".keyword-holder a").remove();
document.querySelector(".keyword-holder").style.paddingRight = "0";
}
function userOptions(element, name, event) {
name = decodeURIComponent(atob(name));
if (event.target.className == "close") return;
let contextMenu = document.createElement("div");
contextMenu.className = "context-menu";
contextMenu.style = `
position: absolute;
width: 100px;
text-align: left;
background: #fff;
z-index: 999999999999;
padding: 5px;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24);
`;
contextMenu.innerHTML = `
<a href="#" onclick="event.preventDefault(), contextAction('add', '${btoa(encodeURIComponent(name))}')">Add friend</a>
<a href="#" onclick="event.preventDefault(), contextAction('info', '${btoa(encodeURIComponent(name))}')">User info</a>
<a href="#" onclick="event.preventDefault(), contextAction('invite', '${btoa(encodeURIComponent(name))}')">Invite to</a>
`;
contextMenu.style.top = event.clientY + "px";
contextMenu.style.left = event.clientX + "px";
document.body.appendChild(contextMenu);
document.addEventListener("mouseup", function(e) {
if (e.target != contextMenu) {
setTimeout(() => contextMenu.remove(), 50);
}
});
}
function exportChat() {
let content = document.createElement("div");
content.innerHTML = `
<button class="export-html">HTML</button> <button class="export-json">JSON</button> <button class="export-text">Text</button>
`;
swal({
title: "Export chat as",
content: content,
button: "Cancel"
});
let download = document.createElement("a");
document.querySelector(".export-html").addEventListener("click", function() {
let html = Object.values(document.querySelectorAll("#messages li")).map(x => x.innerHTML);
download.setAttribute("href", "data:text/html;base64," + btoa(html));
download.setAttribute("download", "FPS World Chat.html");
download.click();
});
document.querySelector(".export-json").addEventListener("click", function() {
let json = JSON.parse("{" + Object.values(document.querySelectorAll("#messages li")).map(x => "\"" + x.textContent.split(": ")[0] + "\": \"" + encodeURIComponent(x.textContent.split(": ").splice(1).join(": ").trim()) + "\"").join(", ") + "}");
download.setAttribute("href", "data:application/json," + JSON.stringify(json));
download.setAttribute("download", "FPS World Chat.json");
download.click();
});
document.querySelector(".export-text").addEventListener("click", function() {
let text = Object.values(document.querySelectorAll("#messages li")).map(x => x.textContent);
download.setAttribute("href", "data:text/plain," + text);
download.setAttribute("download", "FPS World Chat.txt");
download.click();
});
}
function contextAction(type, username) {
username = decodeURIComponent(atob(username));
if (type == "add") {
let mail = new Mail(username.trim(), "Friend request", userMan.get("username").trim() + " wants to add you as friend", () => {
swal({
text: "Friend request sent!"
});
});
mail.send();
}
if (type == "info") {
let link = "/user.html?b=1&q=" + encodeURIComponent(username);
location.assign(link);
}
if (type == "invite") {
let link = "/src.html?lobby=" + btoa(Math.random() * Math.random()) + "&map=" + availableMaps[Math.floor(Math.random() * availableMaps.length)] + "&mode=" + availableModes[Math.floor(Math.random() * availableModes.length)];
sendMessage(":link href='" + link + "':Game invite:endlink:", true);
}
}
window.addEventListener("load", () => setTimeout(() => document.querySelector(".loader").remove(), 1000));
</script>
</div>
</body>
</html>