
N° 0972 · overlay
Zoom-from-thumbnail Lightbox is a modal animation. It responds to click, keyboard, swipe and dialog. Palettes: Basalt, Peat, Fjord, Field notes and Storm.
On open, dialog.showModal(), then the large img is laid out at its contain size F inside the stage; with the thumbnail's rect T, s = max(T.w / F.w, T.h / F.h), the img starts at translate(T centre − F centre) scale(s) with clip-path inset((F.h − T.h / s) / 2, (F.w − T.w / s) / 2) and animates to none and inset(0) over 340 ms (cubic-bezier(.2,.7,.2,1)); a scrim inside the dialog fades in over the same time. Close runs the same animation backwards to the current photo's thumbnail. The first frame is the thumbnail's cached file; the 1,800 px file replaces it after decode(). Next and previous cross-fade the photo in 160 ms.
Placeholder photos by Sebastian Boring, Georgi Kalaydzhiev, Regin Dalsgaard, Jake Hinds, Lachlan Gowen and Dylan Shaw on Unsplash. Replace them with your own before launch.
The preview is the shipped element inside a neutral demo page. Hover, click, focus: the one interaction it is about is live.
Token sets re-tint it live. The prompt carries the one you chose.
A paste-in snippet, or a component for Next.js, React, Vue, Astro, WordPress, Shopify or Webflow.
It quotes the markup, styles and script verbatim with the tokens and the rules that keep it self-contained.
It inherits your page's font and width; the tokens live on :root; several instances share one script.

N° 0972 · overlay

N° 0971 · overlay

N° 0970 · overlay

N° 0817 · overlay

N° 0816 · overlay

N° 0815 · overlay

N° 0814 · overlay

N° 0409 · overlay

N° 0822 · image

N° 0971 · overlay

N° 0952 · input

N° 0837 · text

N° 0817 · overlay

N° 0824 · image

N° 0816 · overlay

N° 0821 · nav