diff --git a/frontend/src/routes/art/+page.svelte b/frontend/src/routes/art/+page.svelte
index 4f576b5..7f1cd55 100644
--- a/frontend/src/routes/art/+page.svelte
+++ b/frontend/src/routes/art/+page.svelte
@@ -27,12 +27,15 @@
// screens; desktop and portrait art stay upright). Aspect is read off the loaded image.
let landscape = $state(false);
- // Desktop zoom: inside the lightbox, magnify the artwork and pan by moving the cursor
- // (transform-origin tracks the pointer). Mobile keeps native pinch — the Zoom button is
- // hidden there. ox/oy are the transform-origin in %.
+ // Desktop zoom: a gallery inspector inside the lightbox. Variable 1×–4× via a floating
+ // toolbar (− / slider / + / % / Fit); moving the cursor pans (transform-origin tracks the
+ // pointer). Mobile keeps native pinch — the Zoom button + toolbar are hidden there.
let zoomed = $state(false);
- let ox = $state(50), oy = $state(50);
- function enterZoom() { ox = 50; oy = 50; zoomed = true; }
+ let zoomLevel = $state(1.5); // scale factor; enter at a gentle 1.5×
+ let ox = $state(50), oy = $state(50); // transform-origin (%) — the panned-to point
+ function enterZoom() { zoomLevel = 1.5; ox = 50; oy = 50; zoomed = true; }
+ function fit() { zoomed = false; } // back to the framed gallery view
+ function setZoom(v) { zoomLevel = Math.max(1, Math.min(4, Math.round(v * 10) / 10)); }
function panZoom(e) {
const r = e.currentTarget.getBoundingClientRect();
ox = Math.max(0, Math.min(100, ((e.clientX - r.left) / r.width) * 100));
@@ -41,11 +44,11 @@
function onKey(e) {
if (e.key !== 'Escape') return;
- if (zoomed) zoomed = false; // Escape steps out of zoom first, then closes
+ if (zoomed) zoomed = false; // Escape steps out of inspection first, then closes
else if (zoom) zoom = false;
}
- // Leaving the lightbox always drops zoom too, so re-opening starts framed.
- $effect(() => { if (!zoom) zoomed = false; });
+ // Leaving the lightbox always resets the inspector, so re-opening starts framed.
+ $effect(() => { if (!zoom) { zoomed = false; zoomLevel = 1.5; } });
// Move focus to the lightbox when it opens, so Escape/Enter work and focus is trapped sanely.
$effect(() => { if (zoom && lightboxEl) lightboxEl.focus(); });
@@ -241,12 +244,18 @@
{#if zoomed}
-
-