Proof Of Work
A big title over a grid of work that flies in, or tumbles into view, as you scroll.
Customize
<ProofOfWork works={works} />Changes show live and stay in the address, so a link keeps them.
Code
"use client";
import { useRef, type CSSProperties } from "react";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useGSAP } from "@gsap/react";
// A title with a grid of work under it. Each piece arrives as you scroll to it, and there are two
// ways it can arrive:
// "rise" the picture flies up from below, tipped over 50 degrees, and settles upright
// "fall" the picture sits under a solid tile, and the tile tumbles away down the page
// The grid is plain CSS, so it works with any number of columns. Only the arrival is animated, so
// with no JavaScript, or with reduced motion, every picture is simply there.
if (typeof window !== "undefined") gsap.registerPlugin(useGSAP, ScrollTrigger);
export type ProofOfWorkItem = {
/** Address of the picture. */
image: string;
/** Alt text for the picture. Falls back to the title. */
imageAlt?: string;
/** The name of the piece, shown in capitals under the picture. */
title: string;
/** A short line under the title, such as the kind of work. */
subtitle?: string;
};
export type ProofOfWorkProps = {
/** The pieces, in reading order. */
works: ProofOfWorkItem[];
/** The big heading above the grid. */
title?: string;
/** A small line under the heading. Leave it out to hide it. */
tagline?: string;
/** Which tag the heading uses. Pick h1 when this is the main title of the page. */
titleAs?: "h1" | "h2" | "h3";
/** How a piece arrives: "rise" flies the picture up from below, "fall" drops a cover tile away from it. */
effect?: "rise" | "fall";
/** How many columns the grid has from tablet width up. It is always one column on a phone. */
columns?: number;
/** The shape of every picture as a CSS aspect-ratio, e.g. "4 / 5", "1 / 1" or "16 / 10". */
aspectRatio?: string;
/** For "rise": how far each picture is tipped over before it settles, in degrees. The direction alternates. */
rotation?: number;
/** For "rise": how far below its place each picture starts, in pixels (a little less on phones). */
distance?: number;
/** How long one arrival takes, in seconds. */
duration?: number;
/** Extra wait for each column after the first, in seconds, so a row arrives left to right. */
columnDelay?: number;
/** The GSAP ease of the arrival. */
ease?: string;
/** For "fall": the colour of the cover tile. "currentColor" follows the text colour, so it works in light and dark. */
coverColor?: string;
/** Show a small running number next to each title. */
showNumbers?: boolean;
/** Play the arrival again, backwards, when you scroll back up past a piece. Off means it plays once. */
replay?: boolean;
/** When a piece arrives, as a ScrollTrigger start such as "top 85%". Leave it out for a good default per effect. */
start?: string;
/** The scrolling element. Leave it out to use the page; give it a selector or an element for an inner scroller. */
scroller?: string | HTMLElement;
/** Extra classes for the outer box. Set a background and a text colour here. */
className?: string;
/** Extra classes for the heading, e.g. a font family. */
titleClassName?: string;
/** Extra classes for each picture box, e.g. a radius. */
imageClassName?: string;
};
// The grid switches from one column to many at the same width as Tailwind's md: breakpoint
const WIDE_SCREEN = "(min-width: 768px)";
export function ProofOfWork({
works,
title = "Proof of Work",
tagline,
titleAs: Heading = "h2",
effect = "rise",
columns = 2,
aspectRatio = "4 / 5",
rotation = 50,
distance = 500,
duration = 1,
columnDelay = 0.25,
ease = "power2.inOut",
coverColor = "currentColor",
showNumbers = true,
replay = false,
start,
scroller,
className = "",
titleClassName = "",
imageClassName = "",
}: ProofOfWorkProps) {
const rootRef = useRef<HTMLDivElement>(null);
useGSAP(
() => {
const root = rootRef.current;
if (!root) return;
const mm = gsap.matchMedia();
// Reduced motion adds nothing here: every picture stays where the page put it
mm.add({ motion: "(prefers-reduced-motion: no-preference)", wide: WIDE_SCREEN }, (context) => {
const { motion, wide } = context.conditions ?? {};
if (!motion) return;
const items = gsap.utils.toArray<HTMLElement>("[data-pow-item]", root);
const columnCount = wide ? Math.max(1, Math.round(columns)) : 1;
const trigger = start ?? (effect === "fall" ? "top 80%" : "top 88%");
const scrollerBox = typeof scroller === "string" ? document.querySelector<HTMLElement>(scroller) : scroller;
const viewHeight = () => scrollerBox?.clientHeight ?? window.innerHeight;
// Phones are short, so the pictures start a little closer
const rise = wide ? distance : distance * 0.7;
items.forEach((item, index) => {
const media = item.querySelector<HTMLElement>("[data-pow-media]");
const cover = item.querySelector<HTMLElement>("[data-pow-cover]");
const caption = item.querySelector<HTMLElement>("[data-pow-caption]");
if (!media) return;
// Each piece has its own timeline, started by its own ScrollTrigger. It plays once by default.
const arrival = gsap.timeline({
scrollTrigger: {
trigger: item,
scroller,
start: trigger,
once: !replay,
toggleActions: "play none none reverse",
},
});
// Pieces further along the row arrive a beat later
const wait = (index % columnCount) * columnDelay;
if (effect === "rise") {
arrival.fromTo(
media,
{ rotation: index % 2 === 0 ? -rotation : rotation, y: rise, opacity: 0, transformOrigin: "50% 50%" },
{ rotation: 0, y: 0, opacity: 1, duration, ease },
wait,
);
} else if (cover) {
// The tile is hidden by default so the page works without JavaScript. Show it now.
gsap.set(cover, { autoAlpha: 1 });
arrival.to(
cover,
{
x: () => gsap.utils.random(-100, 100),
// Far enough to leave the screen, but never past the bottom of this component
y: () => {
const room = root.getBoundingClientRect().bottom - item.getBoundingClientRect().top;
return Math.min(viewHeight() * 2 + gsap.utils.random(0, 400), room + 80);
},
rotation: () => gsap.utils.random(-180, 180),
// Near the bottom of the component the tile fades out, so it never gets cut off in view
opacity: () => (root.getBoundingClientRect().bottom - item.getBoundingClientRect().top < viewHeight() * 2 ? 0 : 1),
duration: duration * 1.35,
ease: "power3.in",
},
wait,
);
arrival.set(cover, { autoAlpha: 0 });
}
if (caption) {
arrival.fromTo(caption, { opacity: 0, y: 14 }, { opacity: 1, y: 0, duration: 0.7, ease: "power2.out" }, wait + duration * 0.45);
}
});
// Fonts and pictures change the page height after the first measure, so measure again.
// A short delay turns a burst of changes into one measure.
let measure: gsap.core.Tween | undefined;
const observer = new ResizeObserver(() => {
measure?.kill();
measure = gsap.delayedCall(0.2, () => ScrollTrigger.refresh());
});
observer.observe(root);
return () => {
measure?.kill();
observer.disconnect();
};
});
return () => mm.revert();
},
{ scope: rootRef, dependencies: [works.length, effect, columns, rotation, distance, duration, columnDelay, ease, replay, start, scroller], revertOnUpdate: true },
);
return (
<div
ref={rootRef}
className={`relative w-full overflow-clip px-[clamp(1rem,4vw,4rem)] pt-[clamp(3rem,8vw,6rem)] pb-[clamp(4rem,12vh,10rem)] ${className}`}
style={{ "--pow-columns": Math.max(1, Math.round(columns)) } as CSSProperties}
>
<div className="mx-auto max-w-[1400px]">
<header className="mb-[clamp(2.5rem,7vw,6rem)] text-center">
<Heading className={`m-0 text-[clamp(2.75rem,13vw,11rem)] leading-[0.92] font-normal tracking-[-0.03em] ${titleClassName}`}>{title}</Heading>
{tagline ? <p className="mt-5 text-[11px] tracking-[0.18em] uppercase opacity-60">{tagline}</p> : null}
</header>
<ul className="m-0 grid list-none grid-cols-1 gap-x-[clamp(1rem,3vw,3rem)] gap-y-[clamp(2.5rem,6vw,5rem)] p-0 md:grid-cols-[repeat(var(--pow-columns),minmax(0,1fr))]">
{works.map((work, index) => (
<li key={`${index}-${work.image}`} data-pow-item className="group relative isolate min-w-0" style={{ zIndex: works.length - index }}>
<figure className="m-0">
<div className="relative">
<div
data-pow-media
className={`relative overflow-hidden ${imageClassName}`}
style={{ aspectRatio, backgroundColor: "color-mix(in srgb, currentColor 10%, transparent)", willChange: "transform, opacity" }}
>
<img
src={work.image}
alt={work.imageAlt ?? work.title}
loading="lazy"
decoding="async"
draggable={false}
className="block h-full w-full object-cover transition-transform duration-[900ms] ease-out group-hover:scale-[1.04] motion-reduce:transition-none"
/>
</div>
{/* The cover sits outside the clipped picture box, so it can tumble out of it */}
{effect === "fall" ? <div data-pow-cover aria-hidden="true" className={`invisible absolute inset-0 z-[2] ${imageClassName}`} style={{ backgroundColor: coverColor, willChange: "transform" }} /> : null}
</div>
<figcaption data-pow-caption className="mt-3 flex items-baseline justify-between gap-4">
<span className="min-w-0">
<span className="block text-[13px] font-semibold tracking-[0.04em] uppercase">{work.title}</span>
{work.subtitle ? <span className="mt-1 block text-[13px] opacity-65">{work.subtitle}</span> : null}
</span>
{showNumbers ? (
<span aria-hidden="true" className="text-[11px] tabular-nums opacity-45">
{String(index + 1).padStart(2, "0")}
</span>
) : null}
</figcaption>
</figure>
</li>
))}
</ul>
</div>
</div>
);
}
The component. Installs to components/dimaac/proof-of-work.tsx.
Install
With the shadcn CLI
npx shadcn@latest add https://ui.dimaac.com/r/proof-of-work.jsonIt adds components/dimaac/proof-of-work.tsx and installs what it imports. With the @dimaac namespace in components.json (Docs) it's just npx shadcn@latest add @dimaac/proof-of-work.
By hand
npm install gsap @gsap/react- Install the packages it uses: gsap, @gsap/react.
- Copy the component file below into components/dimaac/proof-of-work.tsx.
- It's styled with Tailwind v4 classes. If that folder sits outside the places Tailwind scans, add it with @source in your CSS.
- Import it with import { ProofOfWork } from "@/components/dimaac/proof-of-work". Give its parent a size: it fills it.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
works (required) | ProofOfWorkItem[] | - | The pieces, in reading order. |
title | string | "Proof of Work" | The big heading above the grid. |
tagline | string | - | A small line under the heading. Leave it out to hide it. |
titleAs | "h1" | "h2" | "h3" | - | Which tag the heading uses. Pick h1 when this is the main title of the page. |
effect | "rise" | "fall" | "rise" | How a piece arrives: "rise" flies the picture up from below, "fall" drops a cover tile away from it. |
columns | number | 2 | How many columns the grid has from tablet width up. It is always one column on a phone. |
aspectRatio | string | "4 / 5" | The shape of every picture as a CSS aspect-ratio, e.g. "4 / 5", "1 / 1" or "16 / 10". |
rotation | number | 50 | For "rise": how far each picture is tipped over before it settles, in degrees. The direction alternates. |
distance | number | 500 | For "rise": how far below its place each picture starts, in pixels (a little less on phones). |
duration | number | 1 | How long one arrival takes, in seconds. |
columnDelay | number | 0.25 | Extra wait for each column after the first, in seconds, so a row arrives left to right. |
ease | string | "power2.inOut" | The GSAP ease of the arrival. |
coverColor | string | "currentColor" | For "fall": the colour of the cover tile. "currentColor" follows the text colour, so it works in light and dark. |
showNumbers | boolean | true | Show a small running number next to each title. |
replay | boolean | false | Play the arrival again, backwards, when you scroll back up past a piece. Off means it plays once. |
start | string | - | When a piece arrives, as a ScrollTrigger start such as "top 85%". Leave it out for a good default per effect. |
scroller | string | HTMLElement | - | The scrolling element. Leave it out to use the page; give it a selector or an element for an inner scroller. |
className | string | "" | Extra classes for the outer box. Set a background and a text colour here. |
titleClassName | string | "" | Extra classes for the heading, e.g. a font family. |
imageClassName | string | "" | Extra classes for each picture box, e.g. a radius. |
Use with AI
Agent prompt
Paste it into Claude Code, Cursor or any coding agent, or open it straight in a chat. It carries your Customize settings.
Add the Proof Of Work component (<ProofOfWork />) from DiMaac UI to this project.
Docs: https://ui.dimaac.com/components/proof-of-work
Source and dependencies (shadcn registry JSON): https://ui.dimaac.com/r/proof-of-work.json
Install it with:
npx shadcn@latest add https://ui.dimaac.com/r/proof-of-work.json
Then use it like this:
import { ProofOfWork } from "@/components/dimaac/proof-of-work";
<ProofOfWork works={works} />
If the shadcn CLI isn't set up here, fetch the registry JSON above, write files[0].content to components/dimaac/proof-of-work.tsx and install gsap, @gsap/react.
It uses Tailwind v4 classes, so make sure Tailwind scans that folder. Give its parent a size: it fills it. Keep light and dark mode working and keep its prefers-reduced-motion fallback.
Full index for agents: https://ui.dimaac.com/llms.txtFiles agents read
- llms.txt
- Every component and how to install it
- proof-of-work.md
- This page as Markdown: install, props and the full source
- proof-of-work.json
- The shadcn registry item
About
A showcase grid under a big heading. Each piece arrives as you scroll to it, in one of two ways: the picture flies up from below, tipped over and fading in, and settles upright (rise), or it sits under a solid tile that tumbles off down the page and away (fall). Pieces further along a row arrive a beat later, so a row lands left to right, and each caption fades in just behind its picture. The grid is plain CSS with any number of columns and any picture shape, one column on phones. It uses one ScrollTrigger timeline per piece, plays once or replays when you scroll back up, works on the page or inside any scrolling element through the scroller prop, measures again when fonts or pictures change the page, and leaves every picture in place for visitors who prefer reduced motion. Ported from the first DiMaac UI and merged with two YouTube builds, rebuilt without any site context.
- Installs to
components/dimaac/proof-of-work.tsx- Uses
- gsap, @gsap/react
- Tags
- scrolltrigger, grid, portfolio, reveal, images
Abstract Eye Close-Up by Kuba on Lummi (Lummi License). Avant-Garde Fashion Pose by Semihan Dosunmu on Lummi (Lummi License). Modern Architectural Design by rena on Lummi (Lummi License). Elegant Perfume Bottle by Dona Mara on Lummi (Lummi License). Surreal 3D Planet Scene by Ricardo Matos on Lummi (Lummi License). Desert Wanderer by Beth Design Studio on Lummi (Lummi License). Vivid Portrait on Pink by Amino on Lummi (Lummi License). Contemplative Silhouette against Modern Minimalist Architecture by Viri Gutiérrez on Lummi (Lummi License). Portrait Through Orange Frame by Bernardo Lickfold on Lummi (Lummi License). Elegant Perfume Bottles by Amino on Lummi (Lummi License). Intricate Natural Texture by Nika on Lummi (Lummi License). Vibrant Cylindrical Arrangement by SHIHO on Lummi (Lummi License).