โœฆ StealThis .dev

Clip-path Reveal on Scroll

Images and sections that wipe into view using animated clip-path on scroll. Scrubbed by GSAP ScrollTrigger for frame-perfect control.

Open in Lab
gsap scrolltrigger css
Targets: JS HTML

Code

Clip-path Reveal on Scroll

Elements that wipe into view using clip-path animated by GSAP ScrollTrigger. Supports multiple wipe directions โ€” left, right, top, bottom โ€” and a diagonal reveal variant.

How it works

clip-path: inset() defines a rectangular clip mask with four inset values (top, right, bottom, left). Animating one value from 100% to 0% creates the wipe:

// Wipe from left
gsap.fromTo(el,
  { clipPath: "inset(0 100% 0 0)" },
  { clipPath: "inset(0 0% 0 0)",
    ease: "power2.inOut",
    scrollTrigger: { trigger: el, start: "top 80%", end: "top 30%", scrub: 1 }
  }
);

Variants included

  • Wipe left โ€” content sweeps in from the right
  • Wipe up โ€” content rises from the bottom
  • Diagonal โ€” polygon() clip from corner to corner
  • Split โ€” two halves reveal from center outward