import { useEffect, useState } from 'react' import { BookOpen, Clapperboard, Image as ImageIcon, Send } from 'lucide-react' import './quanxue/quanxue.css' import { Player, type Orient } from './quanxue/ui/Player' import { ExportPanel } from './quanxue/ui/ExportPanel' import { CoverPanel } from './quanxue/ui/CoverPanel' import { PublishPanel } from './quanxue/ui/PublishPanel' import { Transcript } from './quanxue/ui/Transcript' import { DURATION, TL } from './quanxue/timeline' import { fmtTime } from './quanxue/ui/store' import { Ascii, ExportTest, MusicDump, Still } from './quanxue/dev' const isPhonePortrait = () => typeof window !== 'undefined' && window.matchMedia('(max-width: 820px) and (orientation: portrait)').matches function Section({ id, icon, title, sub, children }: { id: string; icon: React.ReactNode; title: string; sub: string; children: React.ReactNode }) { return (
{icon}

{title}

{sub}
{children}
) } function Main() { const [orient, setOrientState] = useState(() => (isPhonePortrait() ? 'portrait' : 'landscape')) const [manual, setManual] = useState(false) const [seekReq, setSeekReq] = useState({ t: 0, n: 0 }) const setOrient = (o: Orient) => { setManual(true); setOrientState(o) } // 手机旋转时自动切换横竖屏(除非用户手动选择过) useEffect(() => { const mq = window.matchMedia('(max-width: 820px) and (orientation: portrait)') const mq2 = window.matchMedia('(max-height: 520px) and (orientation: landscape)') const f = () => { if (manual) return; if (mq.matches) setOrientState('portrait'); else if (mq2.matches) setOrientState('landscape') } mq.addEventListener('change', f); mq2.addEventListener('change', f) return () => { mq.removeEventListener('change', f); mq2.removeEventListener('change', f) } }, [manual]) const seek = (t: number) => { setSeekReq((s) => ({ t, n: s.n + 1 })); window.scrollTo({ top: 0, behavior: 'smooth' }) } const nav = [['watch', '观看'], ['script', '文稿'], ['export', '导出'], ['cover', '封面'], ['publish', '发布']] return (

劝学· 荀子

从“性恶论”到“化性起伪”,读懂学习的本质 · 时长 {fmtTime(DURATION)}

{TL.chapters.map((c) => ( ))}
} title="解说文稿" sub="点击任意一句跳转播放">
} title="导出 MP4" sub="浏览器本地渲染 · 不上传任何数据">
} title="封面生成" sub="4:3 · 3:4 · 16:9 多选 · 每个比例多套设计">
} title="发布文案" sub="小红书 · 抖音 · 视频号 · 哔哩哔哩">
原文据《荀子·劝学》(统编版高中语文必修上册)
解说文案原创 · AI 配音 · 画面 / 古琴配乐 / 音效 均为程序化实时生成
) } export default function App() { if (typeof location !== 'undefined') { if (location.search.includes('still=')) return if (location.search.includes('musicdump')) return if (location.search.includes('exporttest')) return if (location.search.includes('ascii=')) return } return
}