116

Before / After Slider

Drag the middle handle to compare two images

Image & mediaDrag & gestureHover & clickUI interactionCSSclip-path · Drag

Hannah's Motion Library
Web motion effects × AI prompts

AI prompt

Two images of the same size overlap, with a vertical line and a round handle (with left/right arrows) in the middle, labeled BEFORE at top left and AFTER at top right. Dragging the handle moves the divider left and right, showing the original on the left and the edited image on the right for easy comparison; when idle it can sway slowly to hint that it's draggable. (How: the top image uses clip-path:inset(0 0 0 var(--p)), pointerdown/pointermove compute the cursor's ratio within the frame and write --p; the handle uses setPointerCapture so dragging continues outside the frame; set touch-action:pan-y on mobile)

When you copy it, a note to “match the site’s existing theme colors” is added automatically, so you don’t need to specify colors.

How to use it

  1. Tap “Copy AI prompt”.
  2. Paste it into an AI such as ChatGPT or Claude, and tell it which element on your site to apply it to (for example, the homepage headline or a buy button).
  3. The AI writes code that matches your site’s colors. Paste it into your project, then fine-tune the timing and distances.

More image & media effects

346 more motion effectsText, buttons, cards, backgrounds, cursors… preview them all and copy AI prompts

Browse all effects →