Scroll through UI

Scrolls a real screen to show more of it without cutting away.

Rendered video, with motion blur.

0.00 / 1.75 s

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

What it does

The screen's content moves up smoothly, stops, then holds so it can be read.

Curve

Ease in-out cubic

Values

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

FactValue
Purpose
Build
Acts on
Screen
Typical length
0.8 to 1.2 s (24 to 36 frames at 30 fps), per screen height, then hold 0.75 s
Caution
Never with a camera push; at 24 fps it judders, so prefer 30 or 60.
PropertyValue
Curve
Ease in-out cubic
Speed
0.8 to 1.2 s per screen height
Hold
0.75 s after it stops
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 scrollThrough(t: number, distance: number, screenHeight = 1080, perScreen = 1, start = 0) {
  return { y: -distance * easeInOut(phase(t, start, perScreen * distance / screenHeight)) };
}

Best practices

Use it forAvoid
Long pages, feeds and dashboards
A camera push at the same time
Showing more of one screen in a single shot
24 fps, where it judders; prefer 30 or 60

Reduced motion: a simple opacity fade over 0.2 s.