import { useEffect, useMemo, useState } from 'react' import { Clapperboard, Copy as CopyIcon, Download, Film as FilmIcon, Image as ImageIcon, ListVideo, Repeat, Trash2, X } from 'lucide-react' import Player from '@/film/Player' import Gallery from '@/film/Gallery' import ExportPanel from '@/film/ExportPanel' import CopyPanel from '@/film/CopyPanel' import CoverPanel from '@/film/CoverPanel' import { useThumbs } from '@/film/useThumbs' import { QUOTES } from '@/film/data/quotes' import { getCopy } from '@/film/core/copy' import { pad2 } from '@/film/core/util' type Tab = 'export' | 'copy' | 'cover' export default function App() { const [current, setCurrent] = useState(1) const [portrait, setPortrait] = useState(() => typeof window !== 'undefined' && window.matchMedia?.('(max-width: 768px) and (orientation: portrait)').matches) const [selected, setSelected] = useState([]) const [mergeMode, setMergeMode] = useState(false) const [tab, setTab] = useState('export') const [autoNext, setAutoNext] = useState(false) const [autoKey, setAutoKey] = useState(0) const thumbs = useThumbs(true) useEffect(() => { document.title = '奥德彪语录' }, []) const ids = useMemo(() => (mergeMode && selected.length ? selected : [current]), [mergeMode, selected, current]) const q = QUOTES.find((x) => x.id === current)! const c = getCopy(current) const open = (id: number, auto = false) => { setMergeMode(false) setCurrent(id) setAutoKey(auto ? Date.now() : 0) if (!auto) window.scrollTo({ top: 0, behavior: 'smooth' }) } const step = (d: number) => open(((current - 1 + d + QUOTES.length) % QUOTES.length) + 1, autoNext) const toggle = (id: number) => setSelected((s) => (s.includes(id) ? s.filter((x) => x !== id) : [...s, id])) return (
{/* 顶栏 */}

奥德彪语录 · 语录短片

ODEBIAO · FORTY-THREE QUOTES

43 条语录原片 · 字幕 · 配音本地导出 MP4
{/* 播放器 + 片目信息 */}
step(-1)} onNext={() => step(1)} onEnded={() => { if (autoNext && !mergeMode) step(1) }} autoPlayKey={autoKey} />
{mergeMode && selected.length ? (
合集预览 · {selected.length} 则

{selected.map((i) => `№${pad2(i)} ${getCopy(i)?.chapter ?? ''}`).join(' → ')}

) : (
№{pad2(current)} {c?.chapter}

「{q.text}」

{c?.en &&

{c.en}

}
)}
{!mergeMode && ( )}
{/* 侧栏 */}
{/* 作品墙 */}

四十三则 THE COLLECTION

点击观看 · 右上角圆圈勾选多条,可预览并合并导出为一条视频

{selected.length > 0 && }
open(id)} onToggle={toggle} />
{/* 合集条 */} {selected.length > 0 && (
已选 {selected.length} 条
{selected.map((i) => ( №{pad2(i)} ))}
{mergeMode && }
)}
) }