egui/docs/index.html

82 lines
2.6 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2019-01-17 23:34:01 +00:00
<!-- Disable zooming: -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<head>
<title>egui An experimental immediate mode GUI written in Rust</title>
<style>
2020-04-12 10:07:51 +00:00
html {
/* Remove touch delay: */
touch-action: manipulation;
}
body {
/* Background color for what is not covered by the egui canvas,
or where the egui canvas is translucent. */
background: #404040;
2020-04-12 10:07:51 +00:00
}
2020-04-23 20:08:42 +00:00
/* Allow canvas to fill entire web page: */
2020-04-12 10:07:51 +00:00
html,
body {
overflow: hidden;
2020-04-23 20:08:42 +00:00
margin: 0 !important;
padding: 0 !important;
2020-04-12 10:07:51 +00:00
}
/* Position canvas in center-top: */
canvas {
margin-right: auto;
margin-left: auto;
display: block;
position: absolute;
top: 0%;
left: 50%;
transform: translate(-50%, 0%);
}
</style>
</head>
<body>
<!-- The WASM code will resize this dynamically -->
2020-11-17 22:24:14 +00:00
<canvas id="the_canvas_id"></canvas>
2020-07-18 08:54:31 +00:00
<script>
2020-04-12 10:07:51 +00:00
// 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>
2019-02-09 22:00:07 +00:00
<!-- this is the JS generated by the `wasm-bindgen` CLI tool -->
<script src="egui_demo_app.js"></script>
2019-02-09 22:00:07 +00:00
<script>
// We'll defer our execution until the wasm is ready to go.
// Here we tell bindgen the path to the wasm file so it can start
// initialization and return to us a promise when it's done.
wasm_bindgen("./egui_demo_app_bg.wasm")
.then(on_wasm_loaded)
.catch(console.error);
2020-04-12 10:07:51 +00:00
function on_wasm_loaded() {
// This call installs a bunch of callbacks and then returns.
console.log("loaded wasm, starting egui app");
2020-11-17 22:24:14 +00:00
wasm_bindgen.start("the_canvas_id");
2020-04-29 19:25:49 +00:00
}
</script>
</body>
</html>
2021-01-17 09:52:01 +00:00
<!-- Powered by egui: https://github.com/emilk/egui/ -->