Spaces:
Running
Running
Upload index.html
Browse files- index.html +180 -21
index.html
CHANGED
@@ -1,24 +1,183 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
<
|
17 |
-
|
18 |
-
<
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
</div>
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html lang="en-us">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
6 |
+
<title>XR Digital City</title>
|
7 |
+
<link rel="shortcut icon" href="TemplateData/img/favicon.ico">
|
8 |
+
<link rel="stylesheet" href="TemplateData/css/style.css">
|
9 |
+
</head>
|
10 |
+
<body>
|
11 |
+
|
12 |
+
<div class="keepRatio">
|
13 |
+
<div id="gameContainer" class="unity-desktop webgl-content">
|
14 |
+
<button id="fullScreenButton" onclick="ToggleFullScreen()"></button>
|
15 |
+
<canvas id="gameCanvas"></canvas>
|
16 |
+
<div id="loadingBlock">
|
17 |
+
<img class="logo" src="TemplateData/img/Logo.png"></img>
|
18 |
+
<span class="subtitle"> CATCHPHRASE <br>
|
19 |
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
20 |
+
</span>
|
21 |
+
|
22 |
+
<div id="progressBar">
|
23 |
+
<div>LOADING ...</div>
|
24 |
+
<div class="centered">
|
25 |
+
<div id="emptyBar"></div>
|
26 |
+
<div id="fullBar"></div>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<div id="warningBrowserBlock" style="display:none;">
|
31 |
+
<div class="warningBrowserText">
|
32 |
+
Your browser may not be compatible with this website. For an optimal experience, we suggest you to download one of this popular web browsers.
|
33 |
+
</div>
|
34 |
+
<div class="browserIcons">
|
35 |
+
<a href="https://www.mozilla.org/firefox" target="_blank"><img src="TemplateData/img/browser-firefox.png" alt="Firefox browser"></a>
|
36 |
+
<a href="https://www.google.com/chrome" target="_blank"><img src="TemplateData/img/browser-chrome.png" alt="Chrome browser"></a>
|
37 |
+
<a href="https://www.apple.com/safari/" target="_blank"><img src="TemplateData/img/browser-safari.png" alt="Safari browser"></a>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
<div id="warningMobileBlock" style="display:none;">
|
41 |
+
<div class="warningBrowserText">
|
42 |
+
Please note that Unity WebGL is not currently supported on mobiles.
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<div id="errorBrowserBlock" style="display:none;">
|
48 |
+
<img class="logo" src="TemplateData/img/Logo.png"></img>
|
49 |
+
<span class="subtitle"> CATCHPHRASE <br>
|
50 |
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
51 |
+
</span>
|
52 |
+
|
53 |
+
<div id="errorContent" style="display:none;">
|
54 |
+
<div class="errorBrowserText">
|
55 |
+
Your browser does not support WebGL. <br> You can download one of this popular web browsers.
|
56 |
+
</div>
|
57 |
+
<div class="browserIcons">
|
58 |
+
<a href="https://www.mozilla.org/firefox" target="_blank"><img src="TemplateData/img/browser-firefox.png" alt="Firefox browser"></a>
|
59 |
+
<a href="https://www.google.com/chrome" target="_blank"><img src="TemplateData/img/browser-chrome.png" alt="Chrome browser"></a>
|
60 |
+
<a href="https://www.apple.com/safari/" target="_blank"><img src="TemplateData/img/browser-safari.png" alt="Safari browser"></a>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
|
65 |
</div>
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<script>
|
69 |
+
function ToggleFullScreen() {
|
70 |
+
var isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||
|
71 |
+
(document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||
|
72 |
+
(document.msFullscreenElement && document.msFullscreenElement !== null);
|
73 |
+
|
74 |
+
var element = document.body.getElementsByClassName("webgl-content")[0];
|
75 |
+
|
76 |
+
if (!isInFullScreen) {
|
77 |
+
document.getElementById("fullScreenButton").style.backgroundImage="url('TemplateData/img/fullScreen_off.png')";
|
78 |
+
if (element.webkitRequestFullscreen) {
|
79 |
+
element.webkitRequestFullscreen();
|
80 |
+
} else if (element.msRequestFullscreen) {
|
81 |
+
element.msRequestFullscreen();
|
82 |
+
} else if (element.requestFullscreen) {
|
83 |
+
element.requestFullscreen();
|
84 |
+
}
|
85 |
+
}
|
86 |
+
else {
|
87 |
+
document.getElementById("fullScreenButton").style.backgroundImage="url('TemplateData/img/fullScreen_on.png')";
|
88 |
+
if (document.exitFullscreen) {
|
89 |
+
document.exitFullscreen();
|
90 |
+
} else if (document.webkitExitFullscreen) { //Chrome, Safari and Opera
|
91 |
+
document.webkitExitFullscreen();
|
92 |
+
} else if (document.msExitFullscreen) { //IE/Edge
|
93 |
+
document.msExitFullscreen();
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
function CheckCompatibility()
|
99 |
+
{
|
100 |
+
if (!hasWebGL()){
|
101 |
+
document.getElementById("errorBrowserBlock").style.display = "inherit";
|
102 |
+
}
|
103 |
+
else if ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
|
104 |
+
{
|
105 |
+
document.getElementById("warningMobileBlock").style.display = "inherit";
|
106 |
+
}
|
107 |
+
else if (!isFirefox&&!isSafari&&!isChrome) {
|
108 |
+
document.getElementById("warningBrowserBlock").style.display = "inherit";
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
function hasWebGL() {
|
113 |
+
var supported;
|
114 |
+
try {
|
115 |
+
var canvas = document.createElement('canvas');
|
116 |
+
supported = !! window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'));
|
117 |
+
} catch(e) { supported = false; }
|
118 |
+
|
119 |
+
try {
|
120 |
+
// let is by no means required, but will help us rule out some old browsers/devices with potentially buggy implementations: http://caniuse.com/#feat=let
|
121 |
+
eval('let foo = 123;');
|
122 |
+
} catch (e) { supported = false; }
|
123 |
+
canvas = undefined;
|
124 |
+
return supported;
|
125 |
+
}
|
126 |
+
|
127 |
+
var isFirefox = typeof InstallTrigger !== 'undefined';
|
128 |
+
var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification));
|
129 |
+
|
130 |
+
var isChromium = window.chrome;
|
131 |
+
var winNav = window.navigator;
|
132 |
+
var vendorName = winNav.vendor;
|
133 |
+
var isOpera = typeof window.opr !== "undefined";
|
134 |
+
var isIEedge = winNav.userAgent.indexOf("Edge") > -1;
|
135 |
+
var isIOSChrome = winNav.userAgent.match("CriOS");
|
136 |
+
var isChrome = isIOSChrome || (isChromium !== null && typeof isChromium !== "undefined" && vendorName === "Google Inc." && isOpera === false && isIEedge === false);
|
137 |
+
|
138 |
+
var buildUrl = "Build";
|
139 |
+
var loaderUrl = buildUrl + "/c4c07f153778d8abf1842ac44b3ff052.js";
|
140 |
+
var config = {
|
141 |
+
dataUrl: buildUrl + "/001c52bdff2d026bf96010d609ff9d11.data",
|
142 |
+
frameworkUrl: buildUrl + "/0d343d2d6a85b10bff5a18cd9d60d9d8.js",
|
143 |
+
codeUrl: buildUrl + "/fbc9d91b0effc450e63aec7cce3769d8.wasm",
|
144 |
+
streamingAssetsUrl: "StreamingAssets",
|
145 |
+
companyName: "DefaultCompany",
|
146 |
+
productName: "ANIKO",
|
147 |
+
productVersion: "0.1",
|
148 |
+
};
|
149 |
+
|
150 |
+
var container = document.querySelector("#gameContainer");
|
151 |
+
var canvas = document.querySelector("#gameCanvas");
|
152 |
+
var loadingBar = document.querySelector("#loadingBlock");
|
153 |
+
var progressBarFull = document.querySelector("#fullBar");
|
154 |
+
var progressBarEmpty = document.querySelector("#emptyBar");
|
155 |
+
var fullscreenButton = document.querySelector("#fullScreenButton");
|
156 |
+
|
157 |
+
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
|
158 |
+
container.className = "unity-mobile";
|
159 |
+
config.devicePixelRatio = 1;
|
160 |
+
}
|
161 |
+
CheckCompatibility();
|
162 |
+
|
163 |
+
var script = document.createElement("script");
|
164 |
+
script.src = loaderUrl;
|
165 |
+
script.onload = () => {
|
166 |
+
createUnityInstance(canvas, config, (progress) => {
|
167 |
+
progressBarFull.style.width = 100 * progress + "%";
|
168 |
+
progressBarEmpty.style.width = (100 * (1 - progress)) + "%";
|
169 |
+
}).then((unityInstance) => {
|
170 |
+
loadingBar.style.display = "none";
|
171 |
+
fullscreenButton.onclick = () => {
|
172 |
+
ToggleFullScreen();
|
173 |
+
};
|
174 |
+
}).catch((message) => {
|
175 |
+
alert(message);
|
176 |
+
});
|
177 |
+
};
|
178 |
+
document.body.appendChild(script);
|
179 |
+
|
180 |
+
</script>
|
181 |
+
|
182 |
+
</body>
|
183 |
</html>
|