import React from "react"; import { AbsoluteFill, interpolate, useCurrentFrame, useVideoConfig, spring, Sequence, } from "remotion"; type Props = { title: string; hook: string; bullets: string[]; cta: string; ctaUrl: string; brandColor: string; }; const TitleScene: React.FC<{ title: string; brandColor: string }> = ({ title, brandColor, }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const scale = spring({ frame, fps, config: { damping: 12, stiffness: 80 } }); const opacity = interpolate(frame, [0, 20], [0, 1], { extrapolateRight: "clamp" }); return (
{title}
powered by VinOS
); }; const HookScene: React.FC<{ hook: string; brandColor: string }> = ({ hook, brandColor, }) => { const frame = useCurrentFrame(); const opacity = interpolate(frame, [0, 15], [0, 1], { extrapolateRight: "clamp" }); const y = interpolate(frame, [0, 20], [40, 0], { extrapolateRight: "clamp" }); return (
{hook}
); }; const BulletScene: React.FC<{ bullet: string; index: number; total: number; brandColor: string; }> = ({ bullet, index, total, brandColor }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const slideIn = spring({ frame, fps, config: { damping: 14, stiffness: 100 } }); const opacity = interpolate(frame, [0, 15], [0, 1], { extrapolateRight: "clamp" }); return (
{index + 1} / {total}
{index + 1}
{bullet}
); }; const CtaScene: React.FC<{ cta: string; brandColor: string }> = ({ cta, brandColor, }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const scale = spring({ frame, fps, config: { damping: 10, stiffness: 120 } }); const opacity = interpolate(frame, [0, 15], [0, 1], { extrapolateRight: "clamp" }); const pulse = Math.sin(frame / 8) * 0.03 + 1; return (
{cta} →
); }; export const TextExplainer: React.FC = ({ title, hook, bullets, cta, brandColor, }) => { const sceneDuration = 90; // 3 seconds at 30fps let currentFrame = 0; return ( {(() => { currentFrame += sceneDuration; return null; })()} {bullets.map((bullet, i) => { currentFrame += sceneDuration; return ( ); })} {(() => { currentFrame += sceneDuration; return null; })()} ); };