import React from "react"; import { AbsoluteFill, interpolate, spring, useCurrentFrame, useVideoConfig } from "remotion"; import { z } from "zod"; import { colorSchema } from "../lib/branding"; import { FONT } from "../lib/fonts"; import { useLayout } from "../lib/aspect"; import { BrandBackground, useReveal } from "../lib/kit"; import { hexToRgba } from "../lib/anim"; export const youTubeIntroSchema = z.object({ channelName: z.string(), subtitle: z.string(), cta: z.string(), ...colorSchema, }); type Props = z.infer; export const YouTubeIntro: React.FC = ({ channelName, subtitle, cta, accentColor, secondaryColor, backgroundColor, textColor, }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const L = useLayout(); const playPop = spring({ frame, fps, config: { damping: 11, stiffness: 130, mass: 0.7 } }); const playScale = interpolate(playPop, [0, 1], [0, 1]); const ripple = (frame % 45) / 45; const name = useReveal(28, { from: 40 }); const sub = useReveal(44, { from: 26 }); const bell = useReveal(60, { from: 22, damping: 11 }); const bellWiggle = Math.sin(frame / 5) * (frame > 60 && frame < 90 ? 10 : 0); return ( {/* Play button with ripple */}
{channelName}
{subtitle}
{/* Subscribe pill */}
🔔 {cta}
); };