import { AbsoluteFill, random, useCurrentFrame, useVideoConfig } from "remotion"; import { theme } from "../theme"; /** Deterministic starfield (seeded with remotion's random) so every render frame is reproducible. */ export function Starfield({ count = 140, accent = theme.blue }: { count?: number; accent?: string }) { const frame = useCurrentFrame(); const { width, height, fps } = useVideoConfig(); const t = frame / fps; return ( {Array.from({ length: count }).map((_, i) => { const x = random(`x${i}`) * width; const y = (random(`y${i}`) * height + t * (4 + random(`s${i}`) * 10)) % height; const r = 0.6 + random(`r${i}`) * 1.6; const twinkle = 0.45 + 0.55 * Math.abs(Math.sin(t * (0.6 + random(`p${i}`)) + i)); return ; })} ); }