mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-31 05:46:46 -06:00
wasm32 can't catch a panic, so the command and frame guards do nothing in the browser and a panic ended the page with its unsaved changes. The page now follows its files with unsaved changes after every frame; its panic hook writes them to local storage as .figcraft copies (as many as fit) and says on the page that it stopped. The next page opens them again as unsaved files: file.recover also takes the copy as base64 data. The recovery-copy helpers move from the desktop app into figcraft_engine::branches so both share them.
28 lines
1.7 KiB
HTML
28 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, viewport-fit=cover">
|
|
<title>FigCraft</title>
|
|
<link data-trunk rel="rust" data-bin="figcraft-web" data-cargo-profile="web-release" data-wasm-opt="z" data-wasm-opt-params="--enable-bulk-memory --enable-bulk-memory-opt --enable-nontrapping-float-to-int --enable-sign-ext --enable-reference-types --enable-multivalue --enable-simd" data-weak-refs />
|
|
<style>
|
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; background: #f5f5f5; }
|
|
#figcraft_canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
|
|
#figcraft_loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
color: #6b6b6b; font: 14px system-ui, sans-serif; pointer-events: none; }
|
|
/* Shown once the page stopped on an internal error (web.rs: show_stopped). */
|
|
#figcraft_stopped { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
|
|
padding: 16px; text-align: center; color: #1e1e1e; background: rgba(245, 245, 245, 0.92); font: 14px/1.5 system-ui, sans-serif; }
|
|
@media (prefers-color-scheme: dark) {
|
|
html, body { background: #2c2c2c; }
|
|
#figcraft_loading { color: #b8b8b8; }
|
|
#figcraft_stopped { color: #f0f0f0; background: rgba(44, 44, 44, 0.92); }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="figcraft_canvas"></canvas>
|
|
<div id="figcraft_loading">Loading FigCraft…</div>
|
|
</body>
|
|
</html>
|