Text Warp
A two-second showreel opener: SHOWREEL types in and warps through white and black cuts, then 2025 lands.
Install using CLI
npx shadcn@latest add https://mavenshots.com/r/text-warp.jsonDownload assets (fonts and images)
node mavenshots-assets.mjs text-warpUsage
import "./mavenshots/text-warp/design/fonts";
import { Recreation } from "./mavenshots/text-warp/videos/text-warp/Recreation";
<Composition
id="Recreation"
component={Recreation}
durationInFrames={51}
fps={25}
width={1920}
height={1080}
/>Install manually
Copy the source code into src/mavenshots/text-warp/
import React from 'react';
import {AbsoluteFill, useCurrentFrame, useVideoConfig} from 'remotion';
import {font} from '../../design/tokens';
import data from './data.json';
import glyphs from './glyphs.json';
import {Glyph, glyphPath, lerpPose, makeWarp, Pose} from './warp';
// The first two seconds of the showreel, measured from the original frame by frame (projects/text-warp).
// The original runs at 25 fps, so every time here is an original frame number.
export const SOURCE_FPS = 25;
export const SOURCE_FRAMES = 51;
const SCALE = 1920 / 1280; // Everything was measured on the 1280 wide original.
type Shot = {from: number; to: number; word: 'SHOWREEL' | '2025'; bg: string; ink: string};
const SHOTS: Shot[] = [
{from: 0, to: 24, word: 'SHOWREEL', bg: '#ffffff', ink: '#121212'},
{from: 25, to: 38, word: 'SHOWREEL', bg: '#000000', ink: '#f0f0f0'},
{from: 39, to: 50, word: '2025', bg: '#ffffff', ink: '#000000'},
];
const poses = data.poses as unknown as Record<string, Pose>;
const Word: React.FC<{shot: Shot; at: number}> = ({shot, at}) => {
const a = Math.floor(at);
const b = Math.min(a + 1, shot.to);
const pose = lerpPose(poses[a], poses[b], at - a);
// In the first frames the word types in: some letters are missing and the rest close up around them.
const reveal = (data.reveal as unknown as Record<string, {hide: number[]; shift: [number, number][]}>)[a];
const letters = (glyphs as unknown as Record<string, Glyph[]>)[shot.word];
const warp = makeWarp((data.knots as Record<string, number[]>)[shot.word], pose);
return (
<svg width={1920} height={1080} viewBox="0 0 1280 720" style={{position: 'absolute', inset: 0}}>
{letters.map((glyph, i) => {
if (reveal?.hide.includes(i)) return null;
const dx = reveal?.shift.find(([index]) => index === i)?.[1] ?? 0;
return <path key={i} d={glyphPath(glyph, warp, dx)} fill={shot.ink} fillRule="evenodd" />;
})}
</svg>
);
};
type LabelFrame = {x: number; y: number; on: string};
const labels = data.labels as unknown as {text: string; frames: LabelFrame[]}[];
// The small labels slide along the edges of the frame, and letters blink out as they move. They're white with a
// difference blend, so they turn black on white and stay readable where a giant letter passes behind them.
const Labels: React.FC<{at: number}> = ({at}) => {
const a = Math.floor(at);
const b = Math.min(a + 1, SOURCE_FRAMES - 1);
return (
<>
{labels.map((label) => {
const x = label.frames[a].x + (label.frames[b].x - label.frames[a].x) * (at - a);
return (
<div
key={`${label.text}${label.frames[0].y}`}
style={{position: 'absolute', left: x * SCALE, top: label.frames[a].y * SCALE, display: 'flex', fontFamily: font.mono, fontWeight: 800, fontSize: 15.5 * SCALE, lineHeight: 1, color: '#ffffff', mixBlendMode: 'difference'}}
>
{[...label.text].map((ch, i) => (
<span key={i} style={{width: data.pitch * SCALE, textAlign: 'center', opacity: label.frames[a].on[i] === '1' ? 1 : 0}}>
{ch === ' ' ? ' ' : ch}
</span>
))}
</div>
);
})}
</>
);
};
export const Recreation: React.FC<{sourceFrame?: number}> = ({sourceFrame}) => {
const frame = useCurrentFrame();
const {fps} = useVideoConfig();
const at = Math.min(sourceFrame ?? (frame / fps) * SOURCE_FPS, SOURCE_FRAMES - 1);
const shot = SHOTS.find((s) => at < s.to + 1) ?? SHOTS[SHOTS.length - 1];
return (
<AbsoluteFill style={{background: shot.bg, overflow: 'hidden'}}>
<Word shot={shot} at={Math.min(at, shot.to)} />
<Labels at={at} />
</AbsoluteFill>
);
};Plus 5 files it imports. Copy them with the same folder layout:
Download assets (fonts and images)
curl -O https://mavenshots.com/mavenshots-assets.mjsnode mavenshots-assets.mjs text-warp