// Terminal: janela preta com borda amarela, barra de título `[x]` e linhas digitadas (`> ...`) com cursor em bloco // que pisca a cada 8 quadros. Digita `velocidade` caracteres por quadro. import React from 'react'; import {useCurrentFrame} from 'remotion'; import {COR, FONTE, SEGURA, eb, seg} from '../base'; export type TerminalProps = {linhas: string[]; titulo?: string; inicio?: number; y?: number; velocidade?: number}; export const Terminal: React.FC = ({linhas, titulo = 'terminal', inicio = 0, y = 760, velocidade = 1.1}) => { const f = useCurrentFrame(); const p = eb(seg(f, inicio, inicio + 8), 1.4); let restante = Math.max(0, (f - inicio - 8) * velocidade); const altura = 110 + linhas.length * 84 + 40; return
{titulo.toUpperCase()}[X]
{linhas.map((l, i) => { const n = Math.max(0, Math.min(l.length, Math.floor(restante))); restante -= l.length + 4; const ativa = n < l.length || i === linhas.length - 1; const cursor = ativa && Math.floor(f / 8) % 2 === 0 && n > 0; return
> {l.slice(0, n)}{cursor &&  }
; })}
; };