// Particulas: camada de pontos e traços que flutuam o tempo todo (parallax em 3 profundidades). Dá movimento // de fundo sem competir com o herói. Determinística: a mesma `semente` dá o mesmo desenho em qualquer render. import React from 'react'; import {AbsoluteFill, useCurrentFrame, useVideoConfig} from 'remotion'; export type ParticulasProps = {quantidade?: number; cor?: string; semente?: number; velocidade?: number; opacidade?: number}; const rnd = (n: number) => { const x = Math.sin(n * 127.1 + 311.7) * 43758.5453; return x - Math.floor(x); }; export const Particulas: React.FC = ({quantidade = 36, cor = '#FF5B14', semente = 1, velocidade = 1, opacidade = 0.55}) => { const f = useCurrentFrame(); const {width: L, height: A} = useVideoConfig(); return {Array.from({length: quantidade}, (_, i) => { const prof = 0.4 + rnd(i + semente) * 1.2; const x = ((rnd(i * 3 + semente) * L + f * 0.9 * prof * velocidade) % (L + 80)) - 40; const y = ((rnd(i * 7 + semente) * A - f * 1.6 * prof * velocidade) % (A + 80) + (A + 80)) % (A + 80) - 40; const tam = 3 + prof * 5, pisca = 0.55 + 0.45 * Math.sin(f / (9 + i % 7) + i); return
; })} ; };