import React from "react"; import { useCurrentFrame, interpolate, Easing } from "remotion"; interface QuoteBlockProps { quote: string; author?: string; color?: string; } export const QuoteBlock: React.FC = ({ quote, author, color = "#f97316", }) => { const frame = useCurrentFrame(); const opacity = interpolate(frame, [0, 15], [0, 1], { extrapolateRight: "clamp", }); const scale = interpolate(frame, [0, 12], [0.95, 1], { extrapolateRight: "clamp", easing: Easing.out(Easing.cubic), }); // Typewriter effect for quote text const charsVisible = Math.floor( interpolate(frame, [5, 5 + quote.length * 1.5], [0, quote.length], { extrapolateRight: "clamp", }) ); const displayText = quote.slice(0, charsVisible); return (
{/* Quote mark */}
"
{displayText}
{author && (
— {author}
)}
); };