43 lines
1.3 KiB
HTML
43 lines
1.3 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>My Game</title>
|
|
|
|
<link rel="stylesheet" href="styles.css" />
|
|
<script type="module" defer src="main.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<noscript>This page contains WebAssembly and JavaScript content, please enable JavaScript in your browser.</noscript>
|
|
<main id="main">
|
|
<button class="button-3d" id="button-start" type="button" role="button">
|
|
Start
|
|
</button>
|
|
</main>
|
|
</body>
|
|
<script>
|
|
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) {
|
|
canvasObj.style = null;
|
|
canvasObj.width = window.screen.width;
|
|
canvasObj.height = window.screen.height;
|
|
}
|
|
</script>
|
|
</html>
|