import React from 'react'; import { AbsoluteFill, interpolate, useCurrentFrame, useVideoConfig, } from 'remotion'; import { colors, fonts } from '../lib/theme'; type TitleCardProps = { text: string; subtitle: string; showUrl?: boolean; }; export const TitleCard: React.FC = ({ text, subtitle, showUrl = false, }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); // Logo fade + scale in const logoOpacity = interpolate(frame, [0, 0.5 * fps], [0, 1], { extrapolateRight: 'clamp', }); const logoScale = interpolate(frame, [0, 0.5 * fps], [0.8, 1], { extrapolateRight: 'clamp', }); // Subtitle fades in slightly after logo const subtitleOpacity = interpolate( frame, [0.3 * fps, 0.8 * fps], [0, 1], { extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }, ); // URL fades in last const urlOpacity = showUrl ? interpolate(frame, [0.6 * fps, 1.1 * fps], [0, 1], { extrapolateLeft: 'clamp', extrapolateRight: 'clamp', }) : 0; return ( {/* Lightning bolt icon */}
{text}
{subtitle}
{showUrl && (
github.com/Ark0N/Codeman
)}
); };