From 2ac8e530b8fb9ca4fa073e1e25a4230a83d99c5d Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 27 Oct 2026 10:48:03 +0100 Subject: web: W1 scaffold — Yew app with image display, pan and zoom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- crates/gipfel-web/Cargo.toml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 crates/gipfel-web/Cargo.toml (limited to 'crates/gipfel-web/Cargo.toml') diff --git a/crates/gipfel-web/Cargo.toml b/crates/gipfel-web/Cargo.toml new file mode 100644 index 0000000..b53fdaa --- /dev/null +++ b/crates/gipfel-web/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "gipfel-web" +version.workspace = true +edition.workspace = true +license.workspace = true +description = "gipfel web — browser front end (WASM)" + +[dependencies] +gipfel-core = { path = "../gipfel-core" } +js-sys = "0.3" +wasm-bindgen = "0.2" +wasm-bindgen-futures = "0.4" +yew = { version = "0.21", features = ["csr"] } + +[dependencies.web-sys] +version = "0.3" +features = [ + "Blob", + "CanvasRenderingContext2d", + "DataTransfer", + "Document", + "DomRect", + "DragEvent", + "Element", + "Event", + "EventTarget", + "File", + "FileList", + "HtmlCanvasElement", + "HtmlElement", + "HtmlInputElement", + "ImageBitmap", + "MouseEvent", + "PointerEvent", + "Window", + "WheelEvent", +] -- cgit v1.2.3