forked from sent/waves
85 lines
2.4 KiB
HTML
85 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-us">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<link rel="stylesheet" href="TemplateData/style.css">
|
|
<script src="TemplateData/UnityProgress.js"></script>
|
|
<script src="Build/WebGL.loader.js"></script>
|
|
<script src="/js/all.min.js"></script>
|
|
|
|
<title>Super Auto Pets</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="custom-logo"></div>
|
|
|
|
<div id="custom-loader">
|
|
<div class="fill"></div>
|
|
<div class="label"></div>
|
|
<div class="help">
|
|
If the game isn't downloading or running properly, try to disable incognito-mode or use another browser than Brave.
|
|
</div>
|
|
</div>
|
|
|
|
<div id="gameContainer">
|
|
<canvas id="unity-canvas"></canvas>
|
|
<script>
|
|
var config = {
|
|
dataUrl: "Build/WebGL.data.gz",
|
|
frameworkUrl: "Build/WebGL.framework.js.gz",
|
|
codeUrl: "Build/WebGL.wasm.gz",
|
|
companyName: "Team Wood",
|
|
productName: "Super Auto Pets",
|
|
productVersion: "166",
|
|
};
|
|
var canvas = document.querySelector("#unity-canvas");
|
|
var loader = document.querySelector("#custom-loader");
|
|
var logo = document.querySelector("#custom-logo");
|
|
createUnityInstance(canvas, config, (progress) => UnityProgress(progress, loader, logo)).then(function(instance) {
|
|
var canvas = instance.Module.canvas;
|
|
var container = canvas.parentElement;
|
|
|
|
function onResize() {
|
|
var w;
|
|
var h;
|
|
|
|
if (scaleToFit) {
|
|
w = window.innerWidth;
|
|
h = window.innerHeight;
|
|
|
|
var r = 720 / 1280;
|
|
|
|
if (w * r > window.innerHeight) {
|
|
w = Math.min(w, Math.ceil(h / r));
|
|
}
|
|
h = Math.floor(w * r);
|
|
} else {
|
|
w = 1280;
|
|
h = 720;
|
|
}
|
|
|
|
container.style.width = canvas.style.width = w + "px";
|
|
container.style.height = canvas.style.height = h + "px";
|
|
container.style.top = Math.floor((window.innerHeight - h) / 2) + "px";
|
|
container.style.left = Math.floor((window.innerWidth - w) / 2) + "px";
|
|
}
|
|
|
|
var scaleToFit;
|
|
try {
|
|
scaleToFit = !!JSON.parse("");
|
|
} catch (e) {
|
|
scaleToFit = true;
|
|
}
|
|
window.addEventListener('resize', onResize);
|
|
onResize();
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|