Focus Front Swap
A headline pulls focus from line to line, blurring one out as the next comes forward, then ends on a logo. A free, MIT-licensed Remotion text animation.
$ pnpm dlx shadcn@latest add @remocn/focus-front-swapUsage
// src/Root.tsx
import { Composition } from "remotion";
import { FocusFrontSwap } from "@/components/remocn/focus-front-swap";
const FocusFrontSwapScene = () => (
<FocusFrontSwap lines={["Remocn knows the beat", "You describe it once", "Ship it {tonight}."]} logo={false} />
);
export const RemotionRoot = () => (
<Composition
id="FocusFrontSwap"
component={FocusFrontSwapScene}
durationInFrames={300}
fps={60}
width={1280}
height={720}
/>
);Each line in lines sharpens into focus while the previous one blurs back, and a mark appears under the final line. Wrap a word in {} such as {tonight} to accent it, and set logo={false} to drop the mark.
The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop. It ships in light and dark through the theme prop.
Props15
| Prop | Type | Default |
|---|---|---|
| lines | string[]— Headlines in order; wrap a word in curly braces to accent it. | |
| accent | string— Accent color override; falls back to the theme accent. | |
| ink | string— Text color override; falls back to the theme ink. | |
| logo | booleantrue Show the logo mark after the last line. | |
| theme | "dark" | "light""dark" Ships light and dark; picks the palette. | |
| ground | GshPresetId— Gradient ground preset id for the backdrop. | |
| groundParams | Partial<GradientParams>— Partial gradient parameters that tweak the chosen ground preset. | |
| swap | numberBEAT.swap Frames between focus pulls. | |
| blur | number18 Maximum blur radius in pixels for out-of-focus lines. | |
| fontWeight | number300 Weight of the lines. | |
| background | string— Solid fill in place of the gradient ground; pass "transparent" to drop it. | |
| fontFamily | string"Geist" Typeface for the copy. Load the font in your project first. | |
| scale | number1 Size of the foreground around the frame's center; the background stays put. | |
| delay | number0 Frames to hold the first frame before anything moves. | |
| speed | number1 Playback speed multiplier for the whole timeline. | |
- linesstring[]
Headlines in order; wrap a word in curly braces to accent it.
- accentstring
Accent color override; falls back to the theme accent.
- inkstring
Text color override; falls back to the theme ink.
- logoboolean
Show the logo mark after the last line.
Default
true - theme"dark" | "light"
Ships light and dark; picks the palette.
Default
"dark" - groundGshPresetId
Gradient ground preset id for the backdrop.
- groundParamsPartial<GradientParams>
Partial gradient parameters that tweak the chosen ground preset.
- swapnumber
Frames between focus pulls.
Default
BEAT.swap - blurnumber
Maximum blur radius in pixels for out-of-focus lines.
Default
18 - fontWeightnumber
Weight of the lines.
Default
300 - backgroundstring
Solid fill in place of the gradient ground; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Geist" - scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - speednumber
Playback speed multiplier for the whole timeline.
Default
1