Refactored Studio + impl App into lib.rs (was main.rs). Added a #[wasm_bindgen] start_in_canvas entry plus index.html/Trunk.toml so the same code runs in a browser tab via: rustup target add wasm32-unknown-unknown cargo install trunk cd road_parceling_studio && trunk serve Native still builds with `cargo run -p road_parceling_studio`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
46 lines
1.2 KiB
HTML
46 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>road_parceling_studio</title>
|
|
<link data-trunk rel="rust" data-bin="road_parceling_studio" data-wasm-opt="z" />
|
|
<style>
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
height: 100%;
|
|
background: #1a1a1a;
|
|
color: #ddd;
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
}
|
|
#studio_canvas {
|
|
display: block;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
}
|
|
#loading {
|
|
position: fixed;
|
|
inset: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 14px;
|
|
color: #888;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="studio_canvas"></canvas>
|
|
<div id="loading">loading WASM…</div>
|
|
<script type="module">
|
|
import init, { start_in_canvas } from "./road_parceling_studio.js";
|
|
(async () => {
|
|
await init();
|
|
document.getElementById("loading").remove();
|
|
await start_in_canvas("studio_canvas");
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|