fyrox-platformer/executor-wasm/index.html

88 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="user-scalable=no, height=device-height, width=device-width, initial-scale=1.0">
<title>Platformer</title>
<link rel="stylesheet" href="styles.css" />
<script type="module" defer src="main.js"></script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (m, e, t, r, i, k, a) {
m[i] = m[i] || function () { (m[i].a = m[i].a || []).push(arguments) };
m[i].l = 1 * new Date();
for (var j = 0; j < document.scripts.length; j++) { if (document.scripts[j].src === r) { return; } }
k = e.createElement(t), a = e.getElementsByTagName(t)[0], k.async = 1, k.src = r, a.parentNode.insertBefore(k, a)
})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(96918237, "init", {
clickmap: true,
trackLinks: true,
accurateTrackBounce: true
});
</script>
<noscript>
<div><img src="https://mc.yandex.ru/watch/96918237" style="position:absolute; left:-9999px;" alt="" /></div>
</noscript>
<!-- /Yandex.Metrika counter -->
</head>
<body>
<noscript>This page contains WebAssembly and JavaScript content, please enable JavaScript in your browser.</noscript>
<div class="lds-default" style="display: none;">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<main id="main">
<button class="button-3d" id="button-start" type="button" role="button" onclick="preloaderEnable()">
Start
</button>
</main>
</body>
<script>
function preloaderEnable() {
document.querySelector('.lds-default').style = null;
}
const intervalId = setInterval(function () {
if (document.querySelector('canvas') !== null) {
document.querySelector('canvas');
clearInterval(intervalId);
resize(document.querySelector('canvas'));
}
}, 1000);
new ResizeObserver(() => {
const canvasObj = document.querySelector('canvas')
if (canvasObj == null) {
return;
}
resize(canvasObj);
}).observe(document.body);
function resize(canvasObj) {
document.querySelector('.lds-default').style.display = "none";
canvasObj.style = null;
canvasObj.width = window.screen.width * window.devicePixelRatio;
canvasObj.height = window.screen.height * window.devicePixelRatio;
canvasObj.style.width = window.screen.width + "px";
canvasObj.style.height = window.screen.widheightth + "px";
}
</script>
</html>