-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
82 lines (76 loc) · 2.23 KB
/
index.html
File metadata and controls
82 lines (76 loc) · 2.23 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
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<style>
body {
background: gray;
}
#Info {
padding: 10px 10px;
font-weight: bold;
font-family: arial;
background: white;
color: black;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
border-radius: 5px;
}
</style>
<div id="Info">Loading...</div>
<noscript>Your browser does not support javascript, or it is disabled, please enable it.</noscript>
<div id="Player"></div>
<script>
var InfoDiv = document.getElementById("Info");
var isLoading = false;
function loadGame () {
if (isLoading) {return;}
isLoading = true;
var script = document.createElement("script");
script.src = "https://github.com/Random-Rants-Chat/taco-shoot-minigame/releases/download/4/gm2player.js";
script.onload = function () {
var script = document.createElement("script");
script.src = "project.js?n=1";
script.onload = function () {
Info.remove();
};
script.onerror = function () {
InfoDiv.textContent = `Unable to load, try again later.`;
InfoDiv.style.color = "red";
};
document.body.append(script);
InfoDiv.textContent = `Loading startup code...`;
};
script.onerror = function () {
InfoDiv.textContent = `Unable to load, try again later.`;
InfoDiv.style.color = "red";
};
document.body.append(script);
InfoDiv.textContent = `Loading Gvbvdxx Mod 2 Project Player...`;
}
var count = 5;
var interval = setInterval(() => {
if (count == 0) {
clearInterval(interval);
loadGame();
return;
}
InfoDiv.textContent = `Waiting for Random Rants + to send user info... (${count} seconds remaining)`;
count -= 1;
},1000);
window.addEventListener("message", (event) => {
var data = event.data;
if (data.type == "RRUserInfo") { //Random Rants + will send an special message containing the users display name and username.
window.UserInfo = data;
clearInterval(interval);
loadGame();
}
});
</script>
</body>
</html>