forked from sent/waves
86 lines
1.9 KiB
HTML
86 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-us">
|
|
|
|
<head>
|
|
<script src="/js/all.min.js"></script>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Deepest Sword</title>
|
|
<style>
|
|
html,
|
|
body {
|
|
background: #000;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: visible;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
div#gameContainer {
|
|
background: transparent !important;
|
|
position: absolute;
|
|
}
|
|
|
|
div#gameContainer canvas {
|
|
position: absolute;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="gameContainer">
|
|
<canvas id="unity-canvas"></canvas>
|
|
<script src="Build/WebBuilds.loader.js"></script>
|
|
<script>
|
|
createUnityInstance(document.querySelector("#unity-canvas"), {
|
|
dataUrl: "Build/WebBuilds.data",
|
|
frameworkUrl: "Build/WebBuilds.framework.js",
|
|
codeUrl: "Build/WebBuilds.wasm",
|
|
streamingAssetsUrl: "StreamingAssets",
|
|
companyName: "Cosmic Adventure Squad",
|
|
productName: "Deepest Sword",
|
|
productVersion: "0.1.5c",
|
|
}).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 = 540 / 960;
|
|
|
|
if (w * r > window.innerHeight) {
|
|
w = Math.min(w, Math.ceil(h / r));
|
|
}
|
|
h = Math.floor(w * r);
|
|
} else {
|
|
w = 960;
|
|
h = 540;
|
|
}
|
|
|
|
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>
|