Fall back
Pushes the background away so one item can step forward and become the subject.
Rendered video, with motion blur.
0.00 / 1.20 s
Live preview, driven by the code below. No motion blur.
What it does
A card recedes while one item comes forward.
Curve
Expo out
Values
S is the frame's short side, 1080 px at 1080p. Unmeasured inputs in the preview are illustrations, not rules.
| Fact | Value |
|---|---|
Purpose | Emphasis |
Acts on | Window, card |
Typical length | 1.2 s (36 frames at 30 fps) |
Caution | Keep blur off the foreground text. |
| Property | Value |
|---|---|
Card Z | 0 to -39% S (-420 px) |
Card rotateX | 0 to +6 deg |
Card blur | 0 to 0.74% S (8 px) |
Item Z | -18.5% S (-199.8 px) to +35% S (378 px) |
Item rotateX | 10 to 0 deg |
Duration | Caller supplied; not measured |
Export samples | 12; 1 when still |
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 fallBack(t: number, duration: number) {
const k = out(phase(t, 0, duration));
return { cardZ: -420 * k, cardRotateX: 6 * k, cardBlur: 8 * k, itemZ: lerp(-199.8, 378, k), itemRotateX: 10 * (1 - k) };
}Best practices
| Use it for | Avoid |
|---|---|
Extracting an item | A whole-scene flip |
Separating foreground from screen | Blur over foreground text |
Reduced motion: a simple opacity fade over 0.2 s.