import React from "react"; import { AbsoluteFill, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, } from "remotion"; import { palette } from "./contract"; const FONT_FAMILY = "Archivo, sans-serif"; const CLAMP = { extrapolateLeft: "clamp" as const, extrapolateRight: "clamp" as const, }; const withAlpha = (hex: string, alpha: number): string => { const clean = hex.replace("#", ""); const r = parseInt(clean.slice(0, 2), 16); const g = parseInt(clean.slice(2, 4), 16); const b = parseInt(clean.slice(4, 6), 16); return `rgba(${r}, ${g}, ${b}, ${alpha})`; }; const RelayLogo: React.FC<{ size?: number; progress?: number; }> = ({ size = 64, progress = 1 }) => { const slide = interpolate(progress, [0, 1], [-8, 8], CLAMP); return ( {/* Top baton track */} {/* Handoff connector */} {/* Bottom focus baton track */} ); }; const CursorArrow: React.FC<{ x: number; y: number; color: string; scale?: number; opacity?: number; }> = ({ x, y, color, scale = 1, opacity = 1 }) => { return (
); }; const IntroScene: React.FC = () => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); // Clutter blocks parting to "make room for focused work" const partProgress = spring({ frame: Math.max(0, frame - 4), fps, config: { damping: 16, stiffness: 110, mass: 0.9 }, }); const logoProgress = spring({ frame: Math.max(0, frame - 8), fps, config: { damping: 14, stiffness: 130, mass: 0.8 }, }); const headlineProgress = spring({ frame: Math.max(0, frame - 16), fps, config: { damping: 16, stiffness: 120, mass: 0.85 }, }); // Transition out into Scene 2 between frames 80 and 90 const exitProgress = interpolate(frame, [80, 90], [0, 1], CLAMP); const containerScale = interpolate(exitProgress, [0, 1], [1, 0.95], CLAMP); const containerOpacity = interpolate(exitProgress, [0, 1], [1, 0], CLAMP); const roomWidth = interpolate(partProgress, [0, 1], [240, 1380], CLAMP); const roomHeight = interpolate(partProgress, [0, 1], [180, 560], CLAMP); const leftBlocks = [ { top: 220, height: 110, width: 220, offset: 0 }, { top: 360, height: 140, width: 260, offset: 30 }, { top: 530, height: 110, width: 200, offset: 15 }, { top: 670, height: 120, width: 240, offset: 40 }, ]; const rightBlocks = [ { top: 210, height: 120, width: 240, offset: 20 }, { top: 360, height: 110, width: 210, offset: 0 }, { top: 500, height: 140, width: 250, offset: 35 }, { top: 670, height: 110, width: 220, offset: 10 }, ]; const pushDistance = interpolate(partProgress, [0, 1], [0, 560], CLAMP); const clutterOpacity = interpolate(partProgress, [0, 0.7, 1], [0.55, 0.25, 0.12], CLAMP); return ( {/* Parting background blocks illustrating clearing space for focus */} {leftBlocks.map((b, i) => (
))} {rightBlocks.map((b, i) => (
))} {/* Cleared architectural focus zone */}
{/* Left & Right Accent Brackets */}
{/* Relay Brand Identity */}
Relay
{/* Tagline: Make room for focused work */}
Make room for focused work
); }; const ProductInterfaceScene: React.FC = () => { const frame = useCurrentFrame(); // 0..179 (global 90..269) const { fps } = useVideoConfig(); // Three 60-frame chapters: // 0..59: Plan together // 60..119: Protect focus time // 120..179: See progress const activePhase = frame < 60 ? 0 : frame < 120 ? 1 : 2; const enterSpring = spring({ frame, fps, config: { damping: 17, stiffness: 120, mass: 0.9 }, }); const exitProgress = interpolate(frame, [170, 180], [0, 1], CLAMP); const sceneScale = interpolate(enterSpring, [0, 1], [0.94, 1], CLAMP) * interpolate(exitProgress, [0, 1], [1, 0.96], CLAMP); const sceneOpacity = interpolate(frame, [0, 10], [0, 1], CLAMP) * interpolate(exitProgress, [0, 1], [1, 0], CLAMP); // Phase transitions const phase1Spring = spring({ frame: Math.max(0, frame - 6), fps, config: { damping: 14, stiffness: 110, mass: 0.85 }, }); const phase2Spring = spring({ frame: Math.max(0, frame - 60), fps, config: { damping: 15, stiffness: 120, mass: 0.85 }, }); const phase3Spring = spring({ frame: Math.max(0, frame - 120), fps, config: { damping: 16, stiffness: 115, mass: 0.9 }, }); const steps = [ { num: "01", label: "Plan together", color: palette.secondary }, { num: "02", label: "Protect focus time", color: palette.accent }, { num: "03", label: "See progress", color: palette.accent }, ]; const days = ["M", "T", "W", "T", "F"]; // Task block definitions on the 5-column schedule const taskCards = [ { id: 0, col: 0, row: 0, startColOffset: -0.55, startRowOffset: 0.45, color: palette.secondary, delay: 6, }, { id: 1, col: 1, row: 0, startColOffset: 0.65, startRowOffset: 0.8, color: palette.secondary, delay: 12, }, { id: 2, col: 2, row: 2, startColOffset: -0.7, startRowOffset: -0.6, color: palette.accent, delay: 16, }, { id: 3, col: 3, row: 0, startColOffset: 0.5, startRowOffset: 0.6, color: palette.secondary, delay: 20, }, { id: 4, col: 4, row: 2, startColOffset: -0.45, startRowOffset: -0.75, color: palette.accent, delay: 24, }, ]; // Width of the schedule area shrinks smoothly in Phase 3 to reveal the Progress Drawer const scheduleWidth = interpolate(phase3Spring, [0, 1], [1040, 620], CLAMP); const colWidth = (scheduleWidth - 88) / 5; // Progress percentage for Phase 3 const progressPct = Math.round( interpolate(frame, [124, 158], [0, 100], CLAMP) ); const ringRadius = 74; const ringCircumference = 2 * Math.PI * ringRadius; const ringOffset = ringCircumference * (1 - interpolate(frame, [124, 158], [0, 1], CLAMP)); // Cursors for Phase 1 ("Plan together") const cursorOpacity = interpolate(frame, [4, 12, 48, 58], [0, 1, 1, 0], CLAMP); const cursor1X = interpolate( phase1Spring, [0, 1], [220, 110 + colWidth * 1.4], CLAMP ); const cursor1Y = interpolate(phase1Spring, [0, 1], [340, 175], CLAMP); const cursor2X = interpolate( phase1Spring, [0, 1], [760, 110 + colWidth * 2.4], CLAMP ); const cursor2Y = interpolate(phase1Spring, [0, 1], [230, 515], CLAMP); return ( {/* Top Bar */}
Relay
{/* Stepper Pills */}
{steps.map((step, idx) => { const isActive = activePhase === idx; const isDone = activePhase > idx; return (
{step.num} {step.label}
); })}
{/* Main Split Stage */}
{/* Left Column: Active Feature Callout & Chapter Timeline */}
{/* Large Active Feature Headline */}
{steps[activePhase].num}
{steps[activePhase].label}
{/* Three-Chapter Interactive Progress Stack */}
{steps.map((step, idx) => { const segStart = idx * 60; const segEnd = (idx + 1) * 60; const fill = interpolate(frame, [segStart, segEnd], [0, 1], CLAMP); const isCurrent = activePhase === idx; return (
{step.label} 0 ? step.color : palette.muted, }} > {step.num}
{/* Progress bar track */}
); })}
{/* Right Column: Animated Product Interface Canvas */}
{/* Schedule Grid Area */}
{/* Day Columns Header */}
{days.map((d, i) => (
{d}
))}
{/* 3 Horizontal Swimlanes: Morning (Row 0), Focus Corridor (Row 1), Afternoon (Row 2) */}
{["09:00", "11:00", "15:00"].map((timeLabel, rowIdx) => (
{/* Time & Avatar Column */}
{timeLabel}
{/* Day Grid Cells */}
{days.map((_, colIdx) => (
))}
))} {/* Animated Collaborative Task Cards (Phase 1 -> Phase 3) */} {taskCards.map((card, idx) => { const cardSpring = spring({ frame: Math.max(0, frame - card.delay), fps, config: { damping: 14, stiffness: 120, mass: 0.8 }, }); const currentCol = interpolate( cardSpring, [0, 1], [card.col + card.startColOffset, card.col], CLAMP ); const currentRow = interpolate( cardSpring, [0, 1], [card.row + card.startRowOffset, card.row], CLAMP ); const checkSpring = spring({ frame: Math.max(0, frame - (124 + idx * 5)), fps, config: { damping: 14, stiffness: 150 }, }); const cardX = 88 + currentCol * colWidth + 10; const cardY = 20 + currentRow * 215 + 24; const cardW = colWidth - 20; const cardH = 148; return (
0.1 ? palette.accent : card.color, 0.15 ), border: `2px solid ${ checkSpring > 0.1 ? palette.accent : card.color }`, padding: 16, display: "flex", flexDirection: "column", justifyContent: "space-between", boxShadow: `0 12px 30px ${withAlpha(palette.background, 0.5)}`, zIndex: 10, }} >
0.1 ? palette.accent : card.color, }} /> {/* Completion Check Badge */}
0.1 ? palette.accent : withAlpha(palette.foreground, 0.1), display: "flex", alignItems: "center", justifyContent: "center", transform: `scale(${interpolate(checkSpring, [0, 0.5, 1], [0.85, 1.15, 1], CLAMP)})`, }} >
{/* Structural task progress bars */}
0.1 ? palette.accent : card.color, }} />
); })} {/* Phase 2: "Protect focus time" Shield Band across Middle Row */}
{/* Subtle Diagonal Protection Hatch */} {/* Focus Shield Badge */}
{/* Shield SVG Icon */} Protect focus time
{/* Collaborative Cursors during Phase 1 */}
{/* Phase 3: "See progress" Analytics Drawer */}
See progress
{/* Radial Completion Ring */}
{progressPct}%
{/* 5-Day Completion Bars */}
{days.map((d, idx) => { const barSpring = spring({ frame: Math.max(0, frame - (126 + idx * 4)), fps, config: { damping: 13, stiffness: 130 }, }); const heights = [96, 112, 124, 118, 134]; return (
= 2 ? palette.accent : palette.secondary, }} /> {d}
); })}
); }; const FinaleScene: React.FC = () => { const frame = useCurrentFrame(); // 0..89 (global 270..359) const { fps } = useVideoConfig(); // Fast, decisive entrance so the final message is 100% settled by local frame 14 (2.53s of full readability) const entrance = spring({ frame, fps, config: { damping: 18, stiffness: 180, mass: 0.75 }, }); const opacity = interpolate(frame, [0, 10], [0, 1], CLAMP); const translateY = interpolate(entrance, [0, 1], [28, 0], CLAMP); const scale = interpolate(entrance, [0, 1], [0.95, 1], CLAMP); const days = ["M", "T", "W", "T", "F"]; return (
{/* Relay Logo Badge */}
Relay
{/* Final Message: Fully readable from frame 282 to 360 (>2.5 seconds) */}

Start your next week with{" "} Relay

{/* Illuminated Next-Week Horizon Strip */}
{days.map((d, idx) => { const pillSpring = spring({ frame: Math.max(0, frame - (6 + idx * 4)), fps, config: { damping: 15, stiffness: 150 }, }); return (
{d}
); })}
); }; export const BenchmarkVideo: React.FC = () => { const frame = useCurrentFrame(); // Subtle ambient background glow drift across the 12-second timeline const glowX = interpolate(frame, [0, 180, 360], [30, 70, 50], CLAMP); const glowY = interpolate(frame, [0, 180, 360], [35, 55, 45], CLAMP); return ( {/* Ambient radial lighting using palette colors */} {/* Subtle architectural grid lines */} {/* 0-3s: Intro ("Relay" & "Make room for focused work") */} {/* 3-9s: Animated Product Interface ("Plan together", "Protect focus time", "See progress") */} {/* 9-12s: Finale ("Start your next week with Relay") */} ); };