diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-10-27 10:48:03 +0100 |
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-10-27 10:48:03 +0100 |
| commit | 2ac8e530b8fb9ca4fa073e1e25a4230a83d99c5d (patch) | |
| tree | 573b6745d9c7d8d3cb884c955009f6deaadedd87 /crates/gipfel-web/README.md | |
| parent | 236fcded5e7302c4b99f4626b4e8cbc35896ceee (diff) | |
web: W1 scaffold — Yew app with image display, pan and zoom
First milestone of wasm-plan.md:
- new crate gipfel-web: Yew 0.21 (csr), canvas 2D viewport
- file input + drag-and-drop; browser-native decode via createImageBitmap
(faster than image-crate decode in wasm, GPU-backed blitting)
- pan (pointer drag with capture, touch-ready) and cursor-anchored
wheel zoom, DPR-aware canvas sizing, fit-to-window
- dark sidebar shell: open/fit buttons, status line
- Trunk.toml + www/ (index.html, style.css); README with dev setup
Verified: cargo check clean (native and wasm32-unknown-unknown),
release wasm builds (5.3 MB pre-wasm-opt), all 38 native tests pass.
Runtime behavior to be confirmed with trunk serve on a desktop browser.
Diffstat (limited to 'crates/gipfel-web/README.md')
| -rw-r--r-- | crates/gipfel-web/README.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/crates/gipfel-web/README.md b/crates/gipfel-web/README.md new file mode 100644 index 0000000..2442e67 --- /dev/null +++ b/crates/gipfel-web/README.md @@ -0,0 +1,46 @@ +# gipfel-web + +Browser front end for gipfel (WASM, Yew + canvas 2D). See +[`/wasm-plan.md`](../../wasm-plan.md) for the overall plan and milestones. + +**Status: W1 (scaffold + image display) done** — open/drag-drop a JPEG, +pan (drag) and zoom (wheel, cursor-anchored). Peak identification, +fitting and saving arrive in W2/W3. + +## Development + +Prerequisites: [rustup](https://rustup.rs) and trunk: + +```sh +cargo install --locked trunk +``` + +Serve with hot reload: + +```sh +cd crates/gipfel-web +trunk serve --port 8090 # then open http://localhost:8090 +``` + +Release build (static output in `dist/`, serveable by any web server): + +```sh +trunk build --release +``` + +## Layout + +| File | Purpose | +|---|---| +| `src/main.rs` | entry point | +| `src/app.rs` | root component: sidebar, file loading, state | +| `src/canvas_view.rs` | viewport canvas: bitmap blit, pan/zoom | +| `src/bridge.rs` | JS glue: image decode, blob read, canvas ctx | +| `www/` | index.html, style.css (trunk assets) | + +## Notes + +- The base image is decoded by the browser (`createImageBitmap`), not + by the `image` crate — faster decode and GPU-backed blitting. +- The crate compiles natively (`cargo check -p gipfel-web`) so it can + be checked in CI without a wasm toolchain; runtime is wasm-only. |
