100% size canvas, add loading text

This commit is contained in:
Lauri Räsänen 2023-11-04 22:37:01 +02:00
parent 60d0f64356
commit 7aa70cd564

View file

@ -9,15 +9,29 @@
<style> <style>
canvas { canvas {
background-color: black; background-color: black;
display: block;
width: 100%;
height: 100%;
min-width: 4px;
min-height: 4px;
}
#loading {
color: white;
position: absolute;
top: 50%;
right: 50%;
z-index: 100;
} }
</style> </style>
</head> </head>
<body style="margin: 0; padding: 0"> <body style="margin: 0; padding: 0">
<h1 id="loading">Loading...</h1>
<script type="module"> <script type="module">
import init from "./pkg/wgpu_renderer.js"; import init from "./pkg/wgpu_renderer.js";
init().then(() => { init().then(() => {
console.log("WASM Loaded"); console.log("WASM Loaded");
document.getElementById("loading")?.remove();
}); });
</script> </script>
</body> </body>