import React from "react"; import { useCurrentFrame, useVideoConfig, Sequence, AbsoluteFill, interpolate, Easing, } from "remotion"; import type { RemotionScene } from "../Root"; import { THEMES } from "../base/theme/colors"; import { Background } from "../base/components/background"; import { SubtitleBar } from "../base/components/subtitle-bar"; import { LowerThird } from "../base/components/lower-third"; import { Watermark } from "../base/components/watermark"; import { HeadlineCard } from "./components/headline-card"; import { NewsTicker } from "./components/news-ticker"; interface NewsSceneProps { scene: RemotionScene; sceneIndex: number; totalScenes: number; totalFrames: number; title: string; } const NewsScene: React.FC = ({ scene, sceneIndex, totalScenes, totalFrames, title, }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const colors = THEMES.news; // Scene-level fade const fadeOpacity = interpolate( frame, [0, 8, scene.endFrame - scene.startFrame - 8, scene.endFrame - scene.startFrame], [0, 1, 1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" } ); return ( {/* Breaking news badge */} {sceneIndex === 0 && (
BREAKING
{title}
)} {/* Main content area */}
{sceneIndex === 0 ? ( // Intro scene: big headline
60 ? 40 : 64, fontWeight: 800, color: "white", fontFamily: "sans-serif", lineHeight: 1.2, marginBottom: 24, maxHeight: 260, overflow: "hidden", display: "-webkit-box", WebkitLineClamp: 4, WebkitBoxOrient: "vertical", }} > {scene.narration}
{scene.keyframes.map((kf, i) => ( ))}
) : ( // Other scenes: cards layout
60 ? 30 : 42, fontWeight: 700, color: "white", fontFamily: "sans-serif", marginBottom: 32, lineHeight: 1.3, maxHeight: 200, overflow: "hidden", display: "-webkit-box", WebkitLineClamp: 4, WebkitBoxOrient: "vertical", }} > {scene.narration}
{scene.keyframes .filter((kf) => kf.type === "text" || kf.type === "highlight") .map((kf, i) => ( ))}
)}
{/* Subtitle bar */} {scene.wordTimestamps.length > 0 && ( )} {/* News ticker */} kf.content)} />
); }; export default NewsScene;