151 lines
3.8 KiB
HTML
151 lines
3.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-us">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="theme-color" content="#101010">
|
|
<link href="https://fonts.googleapis.com/css?family=Roboto:100&subset=latin-ext" rel="stylesheet">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<title>Client</title>
|
|
<script src="%UNITY_WEBGL_LOADER_URL%"></script>
|
|
<script>
|
|
|
|
function goFS() {
|
|
gameInstance.SetFullscreen(1);
|
|
//document.getElementById("gameContainer").style["z-index"] = 100;
|
|
}
|
|
function onUnityLoaded() {
|
|
document.getElementById("fullscreen").style.display = "block";
|
|
document.getElementById("loading").style.display = "none";
|
|
|
|
}
|
|
setInterval(function() {
|
|
if (typeof TOTAL_MEMORY !== 'undefined') {
|
|
try {
|
|
var totalMem = TOTAL_MEMORY/1024.0/1024.0;
|
|
var usedMem = (TOTAL_STACK + (STATICTOP - STATIC_BASE) +
|
|
(DYNAMICTOP - DYNAMIC_BASE))/1024.0/1024.0;
|
|
console.log('Memory stats - used: ' + Math.ceil(usedMem) + 'M' +
|
|
' free: ' + Math.floor(totalMem - usedMem) + 'M');
|
|
} catch(e) {}
|
|
}
|
|
}, 5000);
|
|
|
|
//no popup
|
|
UnityLoader.compatibilityCheck = function(e, t, r) { t(); }
|
|
|
|
var gameInstance = UnityLoader.instantiate("gameContainer", "%UNITY_WEBGL_BUILD_URL%", {
|
|
Module: {
|
|
onRuntimeInitialized: onUnityLoaded
|
|
}
|
|
});
|
|
|
|
window.onresize = function(){
|
|
var canvas = gameInstance.Module.canvas;
|
|
var container = gameInstance.container;
|
|
|
|
var w = window.innerWidth;
|
|
var h = window.innerHeight;
|
|
var r = 9/16;
|
|
if(w * r > window.innerHeight){
|
|
w = Math.min(w, Math.ceil(h / r));
|
|
}
|
|
h = Math.floor(w * r);
|
|
|
|
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";
|
|
}
|
|
</script>
|
|
<style>
|
|
html,body{
|
|
background: #000;
|
|
background: ;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow:visible;
|
|
padding:0;
|
|
margin:0;
|
|
}
|
|
#gameContainer{
|
|
background: transparent!important;
|
|
position: absolute;
|
|
z-index: -1;
|
|
}
|
|
#gameContainer canvas{
|
|
position: absolute;
|
|
image-rendering: optimizeSpeed;
|
|
image-rendering: -webkit-crisp-edges;
|
|
image-rendering: -moz-crisp-edges;
|
|
image-rendering: -o-crisp-edges;
|
|
image-rendering: crisp-edges;
|
|
image-rendering: -webkit-optimize-contrast;
|
|
image-rendering: optimize-contrast;
|
|
image-rendering: pixelated;
|
|
-ms-interpolation-mode: nearest-neighbor;
|
|
}
|
|
|
|
#blocker {
|
|
height: 100vh;
|
|
width: 100vw;
|
|
|
|
z-index: 0;
|
|
display: flex;
|
|
align-content: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background-color: #111;
|
|
}
|
|
|
|
h1 {
|
|
font-family: "Roboto", sans-serif;
|
|
font-weight: 100;
|
|
font-size: 4em;
|
|
color: #EEE;
|
|
|
|
margin: 0;
|
|
|
|
-webkit-touch-callout: none;
|
|
-webkit-user-select: none;
|
|
-khtml-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
|
|
text-shadow: 5px 5px 5px black;
|
|
}
|
|
|
|
#fullscreen {
|
|
position: fixed;
|
|
top: 0
|
|
right: 0;
|
|
|
|
z-index: 1;
|
|
|
|
display: none;
|
|
|
|
border: solid 2px #EEE;
|
|
border-radius: 20px;
|
|
padding: 1em 2em;
|
|
|
|
cursor: pointer;
|
|
}
|
|
|
|
#fullscreen:hover {
|
|
text-shadow: none;
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
<body onload="window.onresize();">
|
|
<div id="blocker">
|
|
<h1 id="loading">Your application is loading.</h1>
|
|
<div id="fullscreen" onclick="goFS();">
|
|
<h1>Start</h1>
|
|
</div>
|
|
</div>
|
|
<div id="gameContainer"></div>
|
|
</body>
|
|
</html>
|