43 lines
1.4 KiB
HTML
43 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<head>
|
||
<title>Emgui – A experiment in an Immediate Mode GUI written in Rust</title>
|
||
|
||
<style>
|
||
html {
|
||
/* Remove touch delay: */
|
||
touch-action: manipulation;
|
||
}
|
||
|
||
body {
|
||
background: #000000;
|
||
color: #bbbbbb;
|
||
max-width: 1024px;
|
||
margin: auto;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<script>
|
||
// The `--no-modules`-generated JS from `wasm-bindgen` attempts to use
|
||
// `WebAssembly.instantiateStreaming` to instantiate the wasm module,
|
||
// but this doesn't work with `file://` urls. This example is frequently
|
||
// viewed by simply opening `index.html` in a browser (with a `file://`
|
||
// url), so it would fail if we were to call this function!
|
||
//
|
||
// Work around this for now by deleting the function to ensure that the
|
||
// `no_modules.js` script doesn't have access to it. You won't need this
|
||
// hack when deploying over HTTP.
|
||
delete WebAssembly.instantiateStreaming;
|
||
</script>
|
||
|
||
<!-- this is the JS generated by the `wasm-bindgen` CLI tool -->
|
||
<script src="emgui.js"></script>
|
||
|
||
<script src="frontend.js" type="module"></script>
|
||
|
||
<!-- TODO: make this cover the entire screen, with resize and all -->
|
||
<canvas id="canvas" width="1024" height="768"></canvas>
|
||
</body>
|
||
</html>
|