diff --git a/marketing/product-film/src/components/PillarTitle.tsx b/marketing/product-film/src/components/PillarTitle.tsx new file mode 100644 index 0000000..cbeda42 --- /dev/null +++ b/marketing/product-film/src/components/PillarTitle.tsx @@ -0,0 +1,44 @@ +import { useCurrentFrame, interpolate, spring, useVideoConfig, AbsoluteFill } from "remotion"; +import { theme } from "../theme"; + +export const PillarTitle: React.FC<{ + index: string; // "①" etc, or "01" + title: string; + subtitle: string; + startFrame: number; + durationInFrames: number; +}> = ({ index, title, subtitle, startFrame, durationInFrames }) => { + const frame = useCurrentFrame(); + const { fps } = useVideoConfig(); + const local = frame - startFrame; + if (local < 0 || local > durationInFrames) return null; + + const enter = spring({ frame: local, fps, config: { damping: 200 }, durationInFrames: 20 }); + const opacity = interpolate(local, [0, 10, durationInFrames - 12, durationInFrames], [0, 1, 1, 0], { + extrapolateLeft: "clamp", + extrapolateRight: "clamp", + }); + const y = interpolate(enter, [0, 1], [40, 0]); + + return ( + +
+
{index}
+
+ {title} +
+
{subtitle}
+
+
+ ); +};