slint/examples/todo/rust/index.html
2022-02-08 08:26:21 +01:00

91 lines
2.3 KiB
HTML

<!DOCTYPE html>
<!-- Copyright © SixtyFPS GmbH <info@sixtyfps.io> -->
<!-- SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial) -->
<html>
<!--
This is a static html file used to display the wasm build.
In order to generate the build
- uncomment the #wasm# lines in Cargo.toml
- Run `wasm-pack build --release --target web` in this directory.
-->
<head>
<meta charset="UTF-8">
<title>Slint Todo Demo (Web Assembly version)</title>
<style>
* {
box-sizing: border-box;
}
body {
background: radial-gradient(108.19% 165.77% at 1.67% -32.72%, #2C2F36 10%, #040708 96.35%);
color: white;
text-align: center;
max-width: 1100px;
margin: 0px auto;
min-height: 100vh;
}
p:not(.links) {
text-align: left;
padding: 1ex 5ex;
}
h1 {
text-align: left;
padding: 0.5ex 1ex
}
a {
color: #DBFF00
}
a:not(:hover) {
text-decoration: none;
}
canvas:focus {
outline: none;
touch-action: none;
}
/* beautify ignore:start */
.spinner:before {
content: ''; box-sizing: border-box; position: absolute;
top: 50%; left: 50%; width: 100px; height: 100px;
margin-top: -10px; margin-left: -10px;
border-radius: 50%; border: 2px solid transparent;
border-top-color: #07d; border-bottom-color: #07d;
animation: spinner 1s ease infinite;
}
@keyframes spinner { to { transform: rotate(360deg); } }
/* beautify ignore:end */
</style>
</head>
<body>
<p>This is the <a href="https://sixtyfps.io">Slint</a> Todo Demo compiled to WebAssembly.</p>
<div id="spinner" style="position: relative;">
<div class="spinner">Loading...</div>
</div>
<canvas id="canvas" width="640" height="480" unselectable="on"></canvas>
<p class="links">
<a href="https://github.com/slint-ui/slint/blob/master/examples/todo/">
View Source Code on GitHub</a> -
<a
href="https://sixtyfps.io/editor?load_url=https://raw.githubusercontent.com/slint-ui/slint/master/examples/todo/ui/todo.slint">
Edit in the online code editor
</a>
</p>
<script type="module">
import init from './pkg/todo.js';
init().finally(() => {
document.getElementById("spinner").remove();
});
</script>
</body>
</html>