forked from MrSnailman/Happy-Wheels-Source-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hwjs.html
148 lines (126 loc) · 4.95 KB
/
hwjs.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
https://totaljerkface.com/get_level.hw
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<style>
body {
overflow: hidden;
background-color: black;
}
/* width */
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: #666666;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #CCCCCC;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #CCCCCC;
}
/* stupid firefox */
html {scrollbar-color: #CCCCCC #666666; scrollbar-width: thin; background-color: black;}
</style>
</head>
<body oncontextmenu="return false;">
<script>
function get_url_parameter(sParam) {
var sPageURL = window.parent.location.search.substring(1),
sURLVariables = sPageURL.split("&"),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split("=");
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
};
function report_loading_issue() {
var el = document.createElement("img");
el.src = "/DEBUG2/wrong-ref.png?wl=" + window.location + "&wpl=" + window.parent.location + "&wlh=" + window.location.host + "&wplh=" + window.parent.location.host;
el.style.position = "absolute";
el.style.left = "-9999px";
el.style.top = "-9999px";
document.body.appendChild(el);
el.onerror = function() {
while(true) {
eval("debugger");
}
}
}
(function() {
function getTitleLabel() {
var labels = [
"JS Edition",
"HTML5 Edition",
"Flashless Version",
"RIP Flash Edition",
"Flash Is Dead!",
"Farewell Flash...",
"Without that plugin",
"Does Jim know I put this here?"
]
return labels[Math.floor(Math.random() * labels.length)];
}
window["HW_SETTINGS"] = {
fps: 30,
resolution: 1,
resolutionFullscreen: 2,
siteURL: "https://totaljerkface.com/",
// assetsURL: "http://hwjs.totaljerkface.com/",
pathPrefix: '',
titleLabel: getTitleLabel(),
titleLabelX: 645,
titleLabelY: 250,
titleLabelRotation: 0,
titleLabelSize: 20,
titleLabelColor: 0xfdfd65,
resolutionZoomIncreaseRatio: 0.5,
tesselation: "tess2",
};
if(!(window.location != window.parent.location && window.location.host === "totaljerkface.com" && window.parent.location.host === "totaljerkface.com")) {
report_loading_issue();
} else {
// Set variables
if(!isNaN(get_url_parameter("replay_id"))) {
window["HW_SETTINGS"]["replay_id"] = get_url_parameter("replay_id");
}
if(!isNaN(get_url_parameter("level_id"))) {
window["HW_SETTINGS"]["level_id"] = get_url_parameter("level_id");
}
Object.freeze(window["HW_SETTINGS"]);
try {
window.parent.console.debug("HW_SETTINGS:");
window.parent.console.debug(window["HW_SETTINGS"]);
} catch(e) {
};
var d_el = document.createElement("script");
d_el.src = "js/dependencies.cee8cde6a4f5c6c550b4697c48ca45de.js";
d_el.onload = function() {
var i_el = document.createElement("script");
i_el.src = "js/index.aef1185ca2166a2790af1034e27f4c80.js";
i_el.onload = function() {
document.getElementById("loading-indicator").remove();
}
document.body.appendChild(i_el);
}
document.body.appendChild(d_el);
}
})();
</script>
<div id="og-game-holder">
<p style="color:white" id="loading-indicator">Loading...</p>
</div>
</body>
</html>