StealThis .dev

Interior — Before After

A warm editorial before/after comparison slider that reveals a designed room over its bare shell as you drag a thin brass divider. Switch between three room studies, snap to preset reveal points, and toggle the fully-designed view for a hands-free reveal — keyboard, pointer, and touch friendly with WCAG AA labelling throughout.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

A tactile before/after reveal built for interior design portfolios. Each study stacks the finished room above the empty shell inside a single frame; a draggable brass divider clips the top layer so the two states meet along a crisp seam. Grab the handle with a pointer, drag with touch, or nudge it in one-percent steps with the arrow keys — the seam, the position readout, and the two corner labels all update in lockstep.

A row of room tabs swaps the comparison between a living room, a kitchen, and a bedroom without leaving the page, each with its own caption and reveal position. Preset chips jump the divider to reveal thirds of the design, and a play toggle sweeps the seam across the frame so visitors can watch the transformation hands-free. A small toast confirms each action.

The layout is generous and editorial: thin rules, muted natural tones, and a Cormorant Garamond display serif over Inter body copy. Everything is responsive down to about 360px, controls stay keyboard reachable with visible focus rings, and the reveal position is announced through aria attributes for assistive technology.