import React from "react"; import { AbsoluteFill, Easing, interpolate, Sequence, spring, useCurrentFrame, useVideoConfig, } from "remotion"; import { palette } from "./contract"; const D = { background: "#101114", foreground: "#F5F5F2", accent: "#B8F36B", secondary: "#78B9ED", muted: "#B1B4BC", }; const C: typeof D = { ...D, ...((palette as Partial) ?? {}) }; const K = { extrapolateLeft: "clamp", extrapolateRight: "clamp" } as const; const A = (hex: string, al: number) => { const h = (hex || "#ffffff").replace("#", ""); const s = h.length === 3 ? h.split("").map((c) => c + c).join("") : h; const n = parseInt(s, 16); return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${al})`; }; const F = "Archivo"; const Backdrop: React.FC = () => ( ); const Mark: React.FC<{ p: number; s?: number }> = ({ p, s = 1 }) => (
{[0, 1, 2].map((i) => { const r = interpolate(p, [i * 0.2, i * 0.2 + 0.5], [0, 1], K); const d = (13 + i * 6) * s; return (
); })}
); /* ---------------- Scene 1 ---------------- */ const Intro: React.FC = () => { const f = useCurrentFrame(); const { fps } = useVideoConfig(); const exit = interpolate(f, [74, 90], [0, 1], K); const mp = interpolate(f, [0, 26], [0, 1], { ...K, easing: Easing.out(Easing.cubic) }); const lw = interpolate(f, [24, 48], [0, 150], { ...K, easing: Easing.out(Easing.cubic) }); const to = interpolate(f, [34, 54], [0, 1], K); const ty = interpolate(f, [34, 54], [20, 0], { ...K, easing: Easing.out(Easing.cubic) }); return (
{"Relay".split("").map((ch, i) => { const p = spring({ frame: f - 8 - i * 3, fps, config: { damping: 200, mass: 0.6, stiffness: 95 }, }); return ( {ch} ); })}
Make room for focused work
); }; /* ---------------- Product --------------- */ const COLS: number[][] = [ [96, 140, 96], [72, 120, 128], [110, 84, 96, 84], [104, 96, 140], [140, 96, 100], ]; const TONE = (c: number, b: number): string => c === 2 && b === 1 ? A(C.accent, 0.3) : (c === 1 && b === 1) || (c === 3 && b === 0) ? A(C.secondary, 0.26) : A(C.foreground, 0.075); const Grid: React.FC<{ f: number; fps: number; dim?: boolean }> = ({ f, fps, dim }) => { let gi = 0; return (
{COLS.map((blocks, ci) => (
{blocks.map((h, bi) => { const p = spring({ frame: f - 2 - gi++ * 1.6, fps, config: { damping: 200, mass: 0.5, stiffness: 110 }, }); return (
); })}
))}
); }; const Plan: React.FC<{ f: number; fps: number }> = ({ f, fps }) => { const p = spring({ frame: f - 18, fps, config: { damping: 15, mass: 0.55, stiffness: 120 } }); return ( <>
); }; const Focus: React.FC<{ f: number; fps: number }> = ({ f, fps }) => { const p = spring({ frame: f - 66, fps, config: { damping: 16, mass: 0.7, stiffness: 105 } }); const q = spring({ frame: f - 78, fps, config: { damping: 200, mass: 0.5, stiffness: 100 } }); return ( <>
); }; const BARS = [0.34, 0.48, 0.4, 0.62, 0.78, 0.7, 1]; const Progress: React.FC<{ f: number; fps: number }> = ({ f, fps }) => { const r = 100; const circ = 2 * Math.PI * r; const pr = interpolate(f, [118, 150], [0, 0.78], { ...K, easing: Easing.out(Easing.cubic) }); const ck = interpolate(f, [138, 154], [0, 1], { ...K, easing: Easing.out(Easing.cubic) }); return (
{BARS.map((v, i) => { const p = spring({ frame: f - 116 - i * 3.5, fps, config: { damping: 16, mass: 0.6, stiffness: 110 } }); return (
= 5 ? A(C.accent, i === 6 ? 0.95 : 0.45) : A(C.foreground, 0.085), transform: `scaleY(${p})`, transformOrigin: "bottom center", }} /> ); })}
); }; const FEATURES = ["Plan together", "Protect focus time", "See progress"]; const NAV = [58, 78, 66, 88, 54]; const Product: React.FC = () => { const f = useCurrentFrame(); const { fps } = useVideoConfig(); const enter = spring({ frame: f, fps, config: { damping: 200, mass: 0.8, stiffness: 80 } }); const exit = interpolate(f, [164, 180], [0, 1], K); const op = enter * (1 - exit); const ty = (1 - enter) * 30 - exit * 22; const act = interpolate(f, [10, 50, 66, 104, 116, 152], [0, 0, 1, 1, 2, 2], K); const l1 = interpolate(f, [6, 20, 62, 74], [0, 1, 1, 0], K); const l2 = interpolate(f, [62, 74, 110, 122], [0, 1, 1, 0], K); const l3 = interpolate(f, [112, 124], [0, 1], K); return (
Relay
{FEATURES.map((label, i) => { const k = Math.max(0, 1 - Math.abs(act - i)); return (
0.01 ? `0 0 ${20 * k}px ${A(C.accent, 0.5 * k)}` : "none", }} />
{label}
); })}
{[0, 1, 2].map((i) => (
))}
{[A(C.accent, 0.92), A(C.secondary, 0.92), A(C.muted, 0.8)].map((bg, i) => { const s = spring({ frame: f - 6 - i * 4, fps, config: { damping: 15, mass: 0.5, stiffness: 130 } }); return (
); })}
{NAV.map((w, i) => { const k = Math.max(0, 1 - Math.abs(act - i)); return (
); })}
); }; /* ---------------- Scene 3 ---------------- */ const Outro: React.FC = () => { const f = useCurrentFrame(); const mp = interpolate(f, [0, 20], [0, 1], { ...K, easing: Easing.out(Easing.cubic) }); const o1 = interpolate(f, [4, 22], [0, 1], { ...K, easing: Easing.out(Easing.cubic) }); const y1 = interpolate(f, [4, 22], [36, 0], { ...K, easing: Easing.out(Easing.cubic) }); const o2 = interpolate(f, [10, 28], [0, 1], { ...K, easing: Easing.out(Easing.cubic) }); const y2 = interpolate(f, [10, 28], [36, 0], { ...K, easing: Easing.out(Easing.cubic) }); const uw = interpolate(f, [22, 44], [0, 200], { ...K, easing: Easing.out(Easing.cubic) }); const glow = interpolate(f, [0, 30], [0, 1], K); return (
Start your next week
with Relay
); }; /* ---------------- Root ------------------ */ export const BenchmarkVideo: React.FC = () => { return ( ); };