Stagger grid

Builds a grid of cards or logos one after another, so the eye reads it in order.

Rendered video, with motion blur.

0.00 / 1.20 s

Live preview, driven by the code below. No motion blur.

What it does

Each item in the grid arrives with Fade and rise, a little after the one before.

Curve

Cubic out

Values

S is the frame's short side, 1080 px at 1080p. Unmeasured inputs in the preview are illustrations, not rules.

FactValue
Purpose
Enter, build
Acts on
Group
Typical length
1.2 s (36 frames at 30 fps), for the whole grid
Caution
Never all at once, and never over 2 s.
PropertyValue
Each item
Fade and rise
Gap
0.05 to 0.08 s
Order
Reading order, or centre out
Whole grid
Lands within 1.2 s; shrink the gap as the grid grows
Export samples
12; 1 when still

Starting values from research. Measure against a reference before relying on them.

Code

ts
export const seg = (t: number, a: number, b: number) => Math.max(0, Math.min(1, (t - a) / (b - a)));

export const lerp = (a: number, b: number, k: number) => a + (b - a) * k;

export const out = (k: number) => (k >= 1 ? 1 : 1 - Math.pow(2, -10 * k));

export const io = (k: number) => (k < 0.5 ? 16 * k ** 5 : 1 - Math.pow(-2 * k + 2, 5) / 2);

export const inn = (k: number) => k * k * k;

export const cubicOut = (k: number) => 1 - Math.pow(1 - k, 3);

export const h = (i: number, j: number) => { const x = Math.sin(i * 127.1 + j * 311.7) * 43758.5453; return x - Math.floor(x); };

export const phase = (t: number, start = 0, duration = 0.6) => seg(t, start, start + duration);

export const easeInOut = (p: number) => p < 0.5 ? 4 * p ** 3 : 1 - (-2 * p + 2) ** 3 / 2;

export function fadeAndRise(t: number, start = 0, duration = 0.45, rise = 27) {
  const k = cubicOut(phase(t, start, duration));
  return { y: rise * (1 - k), opacity: phase(t, start, duration * 0.6) };
}

export function staggerGap(count: number, each = 0.45, total = 1.2) {
  if (count <= 1) return 0;
  return Math.max(1 / 30, Math.min(0.08, (total - each) / (count - 1)));
}

export function staggerGrid(t: number, order: number, count: number) {
  return fadeAndRise(t, order * staggerGap(count));
}

Best practices

Use it forAvoid
Logo walls and feature grids
Everything arriving at once
Card sets of four to twelve
A build longer than 2 s

Reduced motion: a simple opacity fade over 0.2 s.