File size: 6,716 Bytes
2d69ca9 94a2862 2d69ca9 94a2862 2d69ca9 e96ec9b |
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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
<!-- Zappar WebGL template for Unity 2020 and above versions -->
<!-- NFYNT -->
<!DOCTYPE html>
<html lang="en-us">
<head>
<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">
<link rel="shortcut icon" href="favicon.ico">
<title>HuggingFace</title>
<style>
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
html,
body {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
}
canvas {
display: block;
}
body {
margin: 0;
}
#unity-container {
width: 100%;
height: 100%;
}
#unity-canvas {
width: 100%;
height: 100%;
background: #231F20;
}
#loading-cover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#unity-loading-bar {
flex: 1 1 auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#unity-progress-bar-empty {
width: 80%;
height: 24px;
margin: 10px 20px 20px 10px;
text-align: left;
border: 1px solid white;
padding: 2px;
}
#unity-progress-bar-full {
width: 0%;
height: 100%;
background: white;
}
.light #unity-progress-bar-empty {
border-color: black;
}
.light #unity-progress-bar-full {
background: black;
}
.spinner,
.spinner:after {
border-radius: 50%;
width: 5em;
height: 5em;
}
.spinner {
margin: 10px;
font-size: 10px;
position: relative;
text-indent: -9999em;
border-top: 1.1em solid rgba(255, 255, 255, 0.2);
border-right: 1.1em solid rgba(255, 255, 255, 0.2);
border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
border-left: 1.1em solid #ffffff;
transform: translateZ(0);
animation: spinner-spin 1.1s infinite linear;
}
@keyframes spinner-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body class="dark">
<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-progress-bar-empty" style="display: none;">
<div id="unity-progress-bar-full"></div>
</div>
<div class="spinner"></div>
</div>
</div>
<script type="text/javascript" src="zappar-cv.js"></script>
<script>
var db = indexedDB.open("dummy_indexdb", 1); // iOS 14.6 fix; the call to open indexdb hangs forever otherwise
const buildUrl = "Build";
const loaderUrl = buildUrl + "/5b3bdb21c5cb625c6c98dd9a72b111f7.loader.js";
const config = {
dataUrl: buildUrl + "/800e74400f9d3039e820fa266ef9003f.data",
frameworkUrl: buildUrl + "/0a6dbba8be411d7f6228f90d15e0dab8.framework.js",
codeUrl: buildUrl + "/78382544034c8fc66b782a307390d891.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "HuggingFace",
productVersion: "0.1",
//Useful when used along with Filename as Hashes option
cacheControl: function (url) {
// typically includes: .data, .bundle, .zpt
if (url.match(/\.data/) || url.match(/\.bundle/) || url.match(/\.zpt/)) {
return "immutable";
}
if (url.match(/\.mp4/) || url.match(/\.custom/) || url.match(/\.zbin/)) {
return "immutable";
}
// Disable explicit caching for all other files.
// Note: the default browser cache may cache them anyway.
return "no-store";
},
};
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 (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
container.className = "unity-mobile";
//config.matchWebGLToCanvasSize = false;
//set devicePixelRatio=1; to avoid draining fillrate performance on mobile and override low DPI mode
config.devicePixelRatio = window.devicePixelRatio;
}
loadingCover.style.display = "";
window.zappar = ZCV.initialize();
const script = document.createElement("script");
script.src = loaderUrl;
//script.onload = () => { CreateUnityLoader(); };
document.body.appendChild(script);
window.zappar.permission_request_ui_promise().then(WaitForZCVLoad);
function WaitForZCVLoad() {
if (zappar.loaded()) {
CreateUnityLoader();
return;
}
setTimeout(WaitForZCVLoad, 500);
}
function CreateUnityLoader() {
createUnityInstance(canvas, config, (progress) => {
spinner.style.display = "none";
progressBarEmpty.style.display = "";
progressBarFull.style.width = `${100 * progress}%`;
}).then((unityInstance) => {
loadingCover.style.display = "none";
window.uarGameInstance = unityInstance;
}).catch((message) => {
alert(message);
});
}
</script>
</body>
</html>
|