import React from "react"; import { useCurrentFrame, useVideoConfig, 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 { AnimatedText } from "../base/components/animated-text"; import { Watermark } from "../base/components/watermark"; import { QuoteBlock } from "./components/quote-block"; interface OpinionSceneProps { scene: RemotionScene; sceneIndex: number; totalScenes: number; totalFrames: number; title: string; channelName?: string; } const OpinionScene: React.FC = ({ scene, sceneIndex, totalScenes, totalFrames, title, channelName, }) => { const frame = useCurrentFrame(); const colors = THEMES.opinion; const visualText = scene.displayText ?? scene.narration; const fadeOpacity = interpolate( frame, [0, 10, scene.endFrame - scene.startFrame - 10, scene.endFrame - scene.startFrame], [0, 1, 1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" } ); return ( {/* Opinion badge */}
观点 · {title}
{/* Main content */}
{sceneIndex === 0 ? ( // Opening: quote style ) : ( <> {scene.keyframes .filter((kf) => kf.type === "text" || kf.type === "highlight") .map((kf, i) => ( ))} )}
{scene.wordTimestamps.length > 0 && ( )} ); }; export default OpinionScene;