-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
81 lines (76 loc) · 2.92 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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | Tracona</title>
<!-- Favicon-->
<link rel="icon" href="logo.jpeg" type="image/png" sizes="16x16">
<link rel="stylesheet" href="TemplateData/style.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="unity-container" class="unity-desktop">
<h2 class="slogan">Stay Safe, Stay Home</h2>
<canvas id="unity-canvas"></canvas>
<div id="unity-loading-bar">
<div id="unity-logo"></div>
<div id="unity-progress-bar-empty">
<div id="unity-progress-bar-full"></div>
</div>
</div>
<div id="unity-footer">
<div id="unity-webgl-logo"></div>
<div id="unity-fullscreen-button"></div>
<div id="unity-build-title">Tracona</div>
<h2 style="padding-top: 1%;" > Move right and left to dodge the coronavirus!</h2>
</div>
<h4 class="foot">Designed with ♥ by <a href="https://hack-the-mountains.vercel.app/" style="color: #36d8c3;">HackDonald's</a></h4>
</div>
<div class="custom-cursor cursor"></div>
<div class="custom-cursor cursor-follower"></div>
<script src="TweenMax.min.js" ></script>
<script src="app.js"></script>
<script>
var buildUrl = "Build";
var loaderUrl = buildUrl + "/web2.loader.js";
var config = {
dataUrl: buildUrl + "/web2.data",
frameworkUrl: buildUrl + "/web2.framework.js",
codeUrl: buildUrl + "/web2.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "HackDonald's",
productName: "Tracona",
productVersion: "1.1",
};
var container = document.querySelector("#unity-container");
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBarFull = document.querySelector("#unity-progress-bar-full");
var fullscreenButton = document.querySelector("#unity-fullscreen-button");
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
config.devicePixelRatio = 1;
} else {
canvas.style.width = "960px";
canvas.style.height = "600px";
}
loadingBar.style.display = "block";
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
progressBarFull.style.width = 100 * progress + "%";
}).then((unityInstance) => {
loadingBar.style.display = "none";
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}).catch((message) => {
alert(message);
});
};
document.body.appendChild(script);
</script>
</body>
</html>