StealThis .dev

Construction — Before / After Slider

A draggable before and after image-comparison slider for renovation and trades work, with a grab handle, full arrow-key support, a toggle to show or hide the corner labels, and a gallery of project pairs below that swap into the main viewer on click.

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

Code

Before / After Slider

A rugged image-comparison slider for showing off renovation and trades work. Drag the steel handle across to wipe between the Before and After states, or click anywhere on the frame to jump the divider there. The whole control is keyboard-driven: focus the handle and use the left/right arrows to nudge, Home/End to snap to either edge.

A hi-vis toggle shows or hides the corner labels for clean presentation screenshots, and a live percentage read-out tracks the split. Below the viewer sits a gallery of project pairs — kitchen remodel, deck rebuild, driveway pour and roof replacement — and clicking any thumbnail loads that pair into the main frame and resets the divider.

The “images” here are CSS gradients and texture placeholders so the snippet is fully self-contained; swap them for real <img> photos in production. Everything is vanilla JS with pointer + keyboard support and a responsive layout that collapses cleanly on phones.

Illustrative UI only — swap the placeholder gradients for real project photos before shipping.