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/www/index.html | 11 ++++++ crates/gipfel-web/www/style.css | 77 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 crates/gipfel-web/www/index.html create mode 100644 crates/gipfel-web/www/style.css (limited to 'crates/gipfel-web/www') diff --git a/crates/gipfel-web/www/index.html b/crates/gipfel-web/www/index.html new file mode 100644 index 0000000..c601fee --- /dev/null +++ b/crates/gipfel-web/www/index.html @@ -0,0 +1,11 @@ + + + + + + gipfel web + + + + + diff --git a/crates/gipfel-web/www/style.css b/crates/gipfel-web/www/style.css new file mode 100644 index 0000000..5ea080d --- /dev/null +++ b/crates/gipfel-web/www/style.css @@ -0,0 +1,77 @@ +* { + box-sizing: border-box; +} +html, +body { + margin: 0; + height: 100%; + font-family: system-ui, sans-serif; +} +.app { + display: flex; + height: 100vh; + background: #101014; + color: #e8e8ea; +} +.sidebar { + width: 300px; + padding: 16px; + background: #1a1a20; + border-right: 1px solid #2c2c34; + display: flex; + flex-direction: column; + gap: 8px; + overflow-y: auto; +} +.sidebar h1 { + margin: 0; + font-size: 22px; +} +.tag { + margin: 0 0 12px; + color: #8a8a94; + font-size: 12px; + text-transform: uppercase; + letter-spacing: 1px; +} +.sidebar button { + padding: 8px 12px; + background: #3b6fd4; + color: #fff; + border: 0; + border-radius: 6px; + font-size: 14px; + cursor: pointer; +} +.sidebar button:hover { + background: #4a7ee4; +} +.status { + font-size: 13px; + color: #c8c8d0; + word-break: break-word; +} +.hint { + font-size: 12px; + color: #8a8a94; +} +.dim { + opacity: 0.6; +} +.hidden-file { + display: none; +} +.main { + flex: 1; + position: relative; + min-width: 0; +} +canvas.viewport { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + display: block; + touch-action: none; + cursor: grab; +} -- cgit v1.2.3