mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00

The reason why we need to have a `_lib` prefix in the printerdemo and the too example is because the binary name must be different from the library name. But in the case of the weather-demo, since there is a dash, it doesn't need the _lib suffix to be different. Having a different name than the package name doesn't work with the `xbuild` tool: fixes #5731 (we use cargo apk for our own build which doesn't have this limitation anyway)
38 lines
1 KiB
HTML
38 lines
1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
#loading {
|
|
margin-top: 20px;
|
|
text-align: center;
|
|
}
|
|
.overlay {
|
|
position: absolute;
|
|
display: flex;
|
|
top: 0;
|
|
width: 100%;
|
|
}
|
|
canvas {
|
|
top: 0;
|
|
padding-left: 0;
|
|
padding-right: 0;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
margin-top: 20px;
|
|
display: block;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="loading">Loading...</div>
|
|
<div class="overlay">
|
|
<!-- canvas required by the Slint runtime -->
|
|
<canvas id="canvas" data-slint-auto-resize-to-preferred="true" unselectable="on"></canvas>
|
|
<script type="module">
|
|
// import the generated file.
|
|
import init from "./pkg/weather_demo.js";
|
|
init();
|
|
</script>
|
|
</div>
|
|
</body>
|
|
</html>
|