forked from gn-math/html
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path160.html
More file actions
97 lines (90 loc) · 3.78 KB
/
160.html
File metadata and controls
97 lines (90 loc) · 3.78 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
<!DOCTYPE html>
<html lang="en-us">
<head>
<base href="https://cdn.jsdelivr.net/gh/bubbls/youtube-playables@ec4484a07a5d576d25b4bc577df6801b2e8ffb84/race-master-3d/">
<script src="https://cdn.jsdelivr.net/gh/bubbls/youtube-playables@main/ytgame.js" nonce="iH8vk5Vi8mSlBgXOoMnQMw"></script>
<meta charset="utf-8">
<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>Race Master</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css" nonce="iH8vk5Vi8mSlBgXOoMnQMw">
</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>
<div id="unity-fullscreen-button" style="display: none;"></div>
<script nonce="iH8vk5Vi8mSlBgXOoMnQMw">
const hideFullScreenButton = true;
const buildUrl = "Build";
const loaderUrl = buildUrl + "/race-master-v2022.3.18f1-store-v1_0_0-build106.loader.js";
const config = {
dataUrl: buildUrl + "/24af8e230d4b39a588eed98fd7c97997.data.br",
frameworkUrl: buildUrl + "/ac7cde0406281967cab2ece3e099e769.js",
codeUrl: buildUrl + "/c8d72698ca65169f91d16efee609f484.wasm.br",
streamingAssetsUrl: "StreamingAssets",
companyName: "EasyGames",
productName: "Race Master",
productVersion: "1.0.0",
};
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 fullscreenButton = document.querySelector("#unity-fullscreen-button");
const spinner = document.querySelector('.spinner');
const canFullscreen = (function() {
for (const key of [
'exitFullscreen',
'webkitExitFullscreen',
'webkitCancelFullScreen',
'mozCancelFullScreen',
'msExitFullscreen',
]) {
if (key in document) {
return true;
}
}
return false;
}());
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
config.devicePixelRatio = Math.min(config.devicePixelRatio, 2);
}
loadingCover.style.display = "";
const script = document.createElement("script");
script.src = loaderUrl;
script.onload = () => {
createUnityInstance(canvas, config, (progress) => {
spinner.style.display = "none";
progressBarEmpty.style.display = "";
progressBarFull.style.width = `${100 * progress}%`;
}).then((unityInstance) => {
loadingCover.style.display = "none";
if (canFullscreen) {
if (!hideFullScreenButton) {
fullscreenButton.style.display = "";
}
fullscreenButton.onclick = () => {
unityInstance.SetFullscreen(1);
};
}
}).catch((message) => {
alert(message);
});
};
document.body.appendChild(script);
</script>
</body>
</html>