196

Image and Video Reveal Kit

£7
or the whole Vault, £99

Twelve scroll reveals for images and video on one data-reveal attribute: zoom-clip, shutter, 3D fold, pixelate, slices, blinds, tiles, iris and more, scrubbed in and out with the wheel, with live video inside every slice.

ScrollTrigger Lenis beginner
11 more details
scroll-revealimage-slicingvideo-playbackcanvasscrubclip-pathmask-reveal3d-transformsvelocity-reactivelenisprogressive-enhancement

Released

About this effect

A set of scroll reveals for photographs and video. Put data-reveal="<preset>" on the frame around an img, picture or video and the media is revealed as it enters the viewport. The script reads no class names, so it works on any gallery, portfolio or product grid you already have.

Read the full effect overview

There are twelve presets. zoom-clip opens a small rounded window to the full frame while the picture counter-zooms. shutter splits it at a centre seam and slides the halves apart. fold unfolds accordion panels in 3D, and pixelate sharpens it from a coarse mosaic. slices brings strips in from alternate ends, blinds opens strips in place, and tiles uncovers it in a diagonal wave of cells. iris, curve, diagonal, block-wipe and clip cover the classic masks.

Every preset can follow the scroll wheel instead of firing once, and with data-reveal-scrub="out" the media reveals out again as it leaves, so scrolling back and forth plays it every time. Videos are first-class: the layered presets draw the live video into their strips and cells, and clips play only while revealed and on screen. The demo is an exhibition gallery of photographs and three short films, with a scrubbed full-bleed hero, a scrubbed in-and-out room, one-shot reveals on video, and a dense row that visibly reacts to scroll speed.

Image and Video Reveal Kit - GSAP animation effect preview

What's included

12 items
  • Twelve media presets on one attribute: zoom-clip, shutter, fold, pixelate, slices, blinds, tiles, iris, curve, diagonal, block-wipe and clip
  • Scrub any preset to the scroll wheel in both directions, with optional smoothing; strips, cells and folds spread across the scroll range so they follow the wheel one after another
  • data-reveal-scrub="out" reveals media out again as it leaves the top of the viewport, so a gallery plays in and out every time you scroll through it
  • Video works with every preset: layered presets draw the live frame into canvas copies from a single decoder, so strips and cells never drift, and pixelate mosaics the moving picture
  • Videos play muted and inline only while revealed and on screen, pause when they leave, and never autoplay under reduced motion
  • Speed-aware arrivals: a fast scroll or fling adds travel and a settling skew, clamped; a calm scroll gives the clean reveal
  • Direction-aware replay: frames re-entering from above reveal from above
  • Strip, panel and grid counts, window size, origin, block colour, arch depth, blur and scale are all attributes
  • Works with Lenis: the demo ships the standard ScrollTrigger-synced wiring as a separate optional file with ?smooth=off and reduced-motion opt-outs
  • Generated copies are aria-hidden and removed when a reveal settles; the original img or video keeps its place, alt text and layout
  • refresh() picks up frames added later; revert() removes every animation, canvas and layer and restores the markup
  • No-JS visitors, blocked CDNs and reduced-motion visitors see every image and poster, unsliced

Perfect for

5 use cases
  • Photography and art portfolios where each image deserves its own entrance
  • Exhibition, museum and gallery sites mixing stills and short films
  • Architecture, interiors and product studios with large project imagery
  • E-commerce lookbooks and product grids with video loops
  • Editorial features and case studies that alternate full-bleed images and clips

How it works

2 sections

Each frame carrying data-reveal gets its preset's start state, and a ScrollTrigger either plays the reveal when the frame crosses its start line or, when scrubbed, ties its progress to the scroll position. Mask presets shape a clip over the frame while the media inside settles. Layered presets build temporary aria-hidden copies of the picture, clipped to strips, cells, halves or 3D panels, animate them into one image, then remove them. For a video those copies are canvases redrawn from the playing video on every frame, and pixelate draws a coarse-to-fine mosaic of the live frame.

An exit range plays the same reveal backwards as the frame leaves, which is what makes a scrubbed gallery repeat. The kit also reads how fast and which way the page is scrolling, so a fling adds travel and skew and an upward entry mirrors the reveal. A synchronous has-js class in the head pre-hides only data-reveal frames, and is removed if GSAP or ScrollTrigger fail to load. Reduced-motion visitors see every image and poster at once.

Plugins ScrollTrigger
Difficulty Beginner
Smooth scroll Lenis integration
Includes HTML + JS + CSS source, documentation, AI setup prompt, lifetime updates

Lighthouse, as measured

Google Lighthouse on this effect's demo, from the latest scan. A measurement of the demo as shipped, not a promise for your page.

Accessibility
100
Best practices
100

No performance score, on purpose. That figure depends on how you deploy: your server's compression and caching, your CDN, the connection and the device doing the test, none of which the code controls. The same page can score very differently on two consecutive runs, so measure it where it will live.

The Vault opens this source and the whole library.

Each product gives you the HTML, CSS and JavaScript source, the full documentation and an AI setup prompt, licensed for unlimited personal and commercial projects. Every paid product is tested for desktop and mobile layouts, reduced-motion handling, animation cleanup and keyboard controls wherever there is something to operate.

One payment, over 350 products, and future additions to the library.

Documentation

Quick Start

1. Add to your HTML <head>:

In your downloadThe working code for this step, in index.html.

2. Add before the closing </body> tag:

In your downloadThe working code for this step, in index.html.

3. Put the attribute on the frame around each image or video:

In your downloadThe working code for this step, in index.html.

The script starts itself. There is nothing to call unless you want different defaults or need to set up frames added later.

Using It With Your Own Design

What the effect needs from your markup: a frame element carrying data-reveal, with one <img>, <picture> or <video> inside it, sized to fill the frame (width: 100%; height: 100%; object-fit: cover is typical). The frame is what gets clipped, sliced or folded, and the media inside it gets the counter-zoom or settle. The script reads only data-reveal and the data-reveal-* attributes below, never class names. A frame can also hold a caption or overlay, and those are revealed with it.

What is only the demo's styling: everything in style.css below the DEMO PAGE (safe to delete) banner. That covers the Mona Sans type, the grey palette, the asymmetric exhibition grid, the captions and the monospace attribute chips. The replay switch and its inline script in index.html are demo-only, as are the window.MediaRevealOptions = { once: false } line and assets/smooth-scroll.js (see Lenis below).

CSS the effect depends on: the block at the top of style.css:

In your downloadThe working code for this step, in style.css.

The pre-hide is gated on .has-js, which the head snippet adds before the stylesheet loads. Without JavaScript, or when GSAP or ScrollTrigger fail to load (the script removes .has-js), every image and poster stays visible. Beyond that:

  • If a frame is position: static, it becomes relative while a layered preset runs.
  • For blinds, tiles, slices, shutter, fold and pixelate, give the frame a transparent background, so no empty grey box shows between the pieces.

Presets

Preset What it does
zoom-clip A small rounded window (data-reveal-window) opens to the full frame from data-reveal-origin while the picture counter-zooms, so it seems to arrive from inside its frame
shutter The picture splits at a centre seam, and its halves slide apart into place like doors opening while the photo counter-zooms. data-reveal-from="top" or "bottom" splits it horizontally instead
fold Accordion panels (data-reveal-slices, default 4) hinged on alternate edges unfold flat in 3D one after another, each shaded until it lies flat
pixelate Starts as a coarse mosaic and sharpens in steps to full resolution, then hands back to the real image or video
slices Vertical strips slide in from alternate ends (odd from the top, even from the bottom) and meet as one picture. data-reveal-from="left" or "right" gives horizontal strips from alternate sides
blinds Strips (data-reveal-slices, default 6) open in place one after another with a slight offset. Top or bottom gives horizontal strips, left or right gives vertical ones
tiles A grid of cells (data-reveal-grid, default 4x3) uncovers the picture in a diagonal wave from the corner it enters from, each cell scaling in
iris A circle opens from data-reveal-origin while the picture settles
curve Uncovered through an arched edge (data-reveal-curve) that sweeps in and flattens straight as it lands
diagonal An angled wipe with a soft, feathered leading edge
block-wipe A solid block (data-reveal-color) sweeps across and covers the frame, then retracts towards the far side to uncover it
clip A straight wipe from any side, with the media settling from a zoom. The plain option, and the fallback for unknown values
none Opts a frame out (useful inside a staggered group)

Video

Every preset works on a frame that contains a <video>:

  • Clip-based presets (zoom-clip, iris, curve, diagonal, clip, block-wipe) mask the frame, so the video simply plays underneath.
  • Layered presets (blinds, tiles, slices, shutter, fold) need many copies of the picture. For video, each copy is a <canvas> redrawn from the one playing <video> on every frame while the reveal runs. There is one decoder, so strips and cells never drift out of sync. The canvases carry the fold panels in CSS 3D like any other element. When the reveal settles, the canvases are removed and the real video is shown again.
  • pixelate draws the live video frame into its mosaic at each step.

Playback is handled for you:

  • A video starts playing (muted, inline) when its reveal starts, or while a scrubbed frame is on screen.
  • It pauses whenever its frame leaves the viewport, or when a replaying frame resets.
  • The script sets muted and playsinline, but keep them in your markup too, along with a poster.
  • Under reduced motion nothing autoplays and the poster shows. Without JavaScript the poster shows.
  • Use short, small loops: the demo's clips are 540×960 and 0.2–0.36 MB each.

Canvas sampling needs same-origin media, or cross-origin media served with CORS (crossorigin="anonymous" plus an Access-Control-Allow-Origin header). pixelate checks for this and falls back to clip when it cannot read the pixels. If a cross-origin video has no CORS, use a clip-based preset on it.

Scroll response

  • Scrub. data-reveal-scrub drives the reveal from scroll position, forwards and backwards. Give it a number (data-reveal-scrub="0.4") to smooth the follow by that many seconds. The layered presets spread their pieces across the scroll range, so strips and cells follow the wheel one after another. The default range runs from clamp(top 90%) to clamp(center 40%); because it is clamped, a frame on the first screen starts closed. Change the range with data-reveal-start and data-reveal-end.
  • In and out. data-reveal-scrub="out" (or data-reveal-scrub plus data-reveal-exit) adds a second range. As the frame leaves the top of the viewport, the reveal plays backwards and the frame closes, slices away or folds up. The frame opens while its top travels from 95% of the viewport down to its centre at 62%, stays open, then closes as its centre passes 38% until its bottom leaves. Adjust these with data-reveal-start, data-reveal-end, data-reveal-exit-start and data-reveal-exit-end.
  • Speed. A frame that enters during a fast scroll or fling arrives with extra travel and a slight skew along the scroll axis, both clamped and both settling out. A calm scroll gives the clean version. Use data-reveal-velocity="0" to turn this off for a frame, a number above 1 to strengthen it, or velocity: 0 to turn it off globally.
  • Direction and replay. With once: false (or data-reveal-once="false"), a frame replays every time it re-enters. Re-entering from above mirrors the reveal: wipes come from the top and the tiles wave starts at the top corner.
  • Nothing left behind. In once mode, frames already above the viewport after a load, an anchor jump or a fling appear immediately. A reveal you scroll past before it finishes completes at once.

Attributes

Attribute Values Default Description
data-reveal a preset name clip The reveal to use
data-reveal-scrub empty or true, seconds of smoothing, or out off Follow the scroll; out also reveals out on the way past
data-reveal-exit present off Adds the way out to a scrubbed frame
data-reveal-from bottom, top, left, right per preset Entry side for clip, curve, blinds, block-wipe and diagonal; split axis for shutter; strip axis for slices
data-reveal-origin center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right center Where zoom-clip and iris open from, and where the tiles wave starts
data-reveal-slices 2 to 24 6 (fold: 4) Strips for blinds and slices, panels for fold
data-reveal-grid COLSxROWS 4x3 Cells for tiles
data-reveal-window 0 to 1 0.3 Start size of the zoom-clip window
data-reveal-color any CSS colour currentColor Block colour for block-wipe
data-reveal-curve 0 to 1 0.5 Arch depth for curve
data-reveal-blur px (empty = 12) off Modifier: also comes into focus from a blur
data-reveal-scale start scale (empty = 0.92) off Modifier: the frame also settles up from this scale
data-reveal-delay seconds 0 Extra wait before this frame starts
data-reveal-duration seconds 1 Base duration; each preset scales it slightly
data-reveal-distance px 40 Travel for clip (shortened on small screens)
data-reveal-start, data-reveal-end ScrollTrigger positions see above When a reveal fires, or a scrub's opening range
data-reveal-exit-start, data-reveal-exit-end ScrollTrigger positions center 38%, bottom top The closing range of scrub="out"
data-reveal-velocity 0/false, or a multiplier 1 Strength of the fast-scroll arrival
data-reveal-ease any GSAP ease name per preset Override the preset's ease
data-reveal-once true, false true false replays on every re-entry
data-reveal-stagger seconds (on a parent) 0.08 Frames inside it that enter together reveal as one staggered wave

Works with Lenis

The kit reads scroll position and speed from ScrollTrigger, so it follows native scrolling, any smooth-scroll library already wired to ScrollTrigger, or the optional assets/smooth-scroll.js used by the demo. That file is the standard Lenis wiring, separate from the kit so you can keep it, swap it or delete it:

  • Lenis is driven from gsap.ticker and every Lenis scroll updates ScrollTrigger, so scrubbed reveals follow the smoothed wheel exactly.
  • ?smooth=off (or ?smooth=on) in the URL overrides <html data-smooth="off">, and reduced motion overrides both.
  • An existing window.lenis belongs to your page and is never replaced or destroyed.

In your downloadThe working code for this step, in index.html.

If your site already sets up Lenis, skip smooth-scroll.js and make sure your setup calls lenis.on('scroll', ScrollTrigger.update).

Accessibility

  • Reduced motion: with prefers-reduced-motion: reduce, every frame is visible immediately. Nothing is sliced or drawn to canvas, nothing moves, and no video autoplays, so posters show. Switching the preference while the page is open takes effect at once.
  • No JavaScript or blocked CDN: every image and poster is visible. The pre-hide only applies under .has-js, which is removed if GSAP or ScrollTrigger are missing, and the optional head failsafe covers the kit's own script failing to load.
  • Screen readers: strips, cells, panels and canvases are aria-hidden copies. The original <img> or <video> keeps its place, its alt or aria-label, and its layout, and is shown again as soon as the reveal settles.
  • Video: clips play muted and inline only while visible. Give each one a poster and an accessible label, and use controls if the footage carries information.

Dependencies

Required:

  • GSAP 3.12+ (the demo is pinned to 3.15.0)
  • ScrollTrigger plugin

Optional:

  • Lenis 1.3+ for smooth scrolling (the demo is pinned to 1.3.17), wired with assets/smooth-scroll.js or your own setup.

The demo's photographs are licensed stock (sources in assets/img-manifest.json). Its three film loops are graded derivatives of Pexels footage, used under the Pexels licence (sources in assets/video-manifest.json). Replace them with your own media for production.

Also in your download: the full source, worked examples, the events and programmatic API, and the class reference.

£7