About this set
Two lens-style comparisons, where the second version appears only inside a circle that follows the pointer. Reveal lens over an unprocessed photo shows a dark, grey night sky with a ring that reveals the processed Milky Way at the same scale. The processed photo sits on top with clip-path: circle() positioned by two custom properties, –lx and –ly, so the lens is a single CSS rule and the ring is drawn separately for the border and shadow. Zoom loupe showing the edit at 2.5 times shows a soft, dull coffee board, and the loupe shows the sharpened version magnified, with the point under the pointer kept in the centre. The loupe image is sized with container query units, 100cqw times the zoom, so it needs no measuring in JavaScript. A short script sets –lx and –ly from the pointer, mouse or touch, and from the arrow keys when the photo has keyboard focus, with Shift for bigger steps, so the lens is usable without a mouse. Use the reveal lens for astrophotography, retouching and restoration, and the loupe for detail work such as sharpening, fabric, food or print quality.
What’s included
- Reveal lens built with clip-path: circle()
- Zoom loupe at 2.5 times that keeps the pointed spot centred
- Loupe sized with container query units, no measuring script
- Arrow keys move the lens, Shift for larger steps
- Starting position set with --lx and --ly in CSS
Accessibility
Each photo area is a focusable group with an aria-label and an aria-describedby hint explaining the pointer and arrow-key controls, and it shows a 3px blue outline on keyboard focus. Both versions of each photo are described in alt text, so the comparison is not only visual; the zoomed copy inside the loupe is decorative and has empty alt. Nothing moves on its own, so there is no motion to reduce.
Customise it
Change --lens for the lens size, --z for the zoom factor, the starting --lx and --ly, and the filters on .lz-base-raw and .lz-base-soft. In Bootstrap the stage is a .ratio with .badge labels; in Tailwind edit [--lens:150px], [--z:2.5] and the clip-path arbitrary value.






