forked from gn-math/assets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
103 lines (86 loc) · 3.6 KB
/
index.html
File metadata and controls
103 lines (86 loc) · 3.6 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
<!DOCTYPE html>
<html lang="en-us">
<head>
<base href="https://rawcdn.githack.com/gn-math/assets/main/120/">
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Fortzone Battle Royale</title>
<link rel="stylesheet" href="TemplateData/style.css">
<script>
const overlayBackgroundColor = "#555555";
const progressBarFillColor = "#f76426";
const progressBarBackgroundColor = "#000000";
const progressBarBorderColor = "#000000";
</script>
</head>
<body class="light">
<div id="unity-container" class="unity-desktop">
<canvas id="unity-canvas"></canvas>
</div>
<div id="loading-cover" style="display:none;">
<div id="unity-loading-bar">
<div id="unity-logo"><img src="logo.png"></div>
<div id="unity-progress-bar-empty" style="display: none;">
<div id="unity-progress-bar-full"></div>
</div>
<div class="spinner"></div>
</div>
</div>
<script>
const buildUrl = "Build";
const loaderUrl = buildUrl + "/Frenzy_WebGL.loader.js";
const config = {
dataUrl: buildUrl + "/Frenzy_WebGL.data.unityweb",
frameworkUrl: buildUrl + "/Frenzy_WebGL.framework.js.unityweb",
codeUrl: buildUrl + "/Frenzy_WebGL.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "Fahrenheit Dev",
productName: "Fortzone Battle Royale",
productVersion: "0.8.5",
};
const container = document.querySelector("#unity-container");
const canvas = document.querySelector("#unity-canvas");
const loadingCover = document.querySelector("#loading-cover");
const progressBarEmpty = document.querySelector("#unity-progress-bar-empty");
const progressBarFull = document.querySelector("#unity-progress-bar-full");
const spinner = document.querySelector('.spinner');
if (overlayBackgroundColor !== "-" && overlayBackgroundColor !== " " && overlayBackgroundColor !== "")
canvas.style.background = overlayBackgroundColor;
if (progressBarFillColor !== "-" && progressBarFillColor !== " " && progressBarFillColor !== "")
progressBarFull.style.background = progressBarFillColor;
if (progressBarBackgroundColor !== "-" && progressBarBackgroundColor !== " " && progressBarBackgroundColor !== "")
progressBarEmpty.style.background = progressBarBackgroundColor;
if (progressBarBorderColor !== "-" && progressBarBorderColor !== " " && progressBarBorderColor !== "")
progressBarEmpty.style.border.color = progressBarBorderColor;
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
}
loadingCover.style.display = "";
const unityLoader = document.createElement("script");
unityLoader.src = loaderUrl;
unityLoader.onload = async () => {
//await _gpAwaiter.ready;
createUnityInstance(canvas, config, (progress) => {
spinner.style.display = "none";
progressBarEmpty.style.display = "";
progressBarFull.style.width = `${100 * progress}%`;
}).then((unityInstance) => {
window.unityInstance = unityInstance;
//_unityAwaiter.done(unityInstance);
loadingCover.style.display = "none";
}).catch((message) => {
//_unityAwaiter.abort(message);
alert(message);
});
};
document.body.appendChild(unityLoader);
document.addEventListener("pointerdown", () => {
container.focus();
window.focus();
canvas.focus();
});
</script>
</body>
</html>