mx / quanxue-src /src /quanxue /ui /Transcript.tsx
Ethscriptions's picture
Step 2-6: 文案旁白、渲染引擎与全部镜头、配乐音效与播放器、MP4 本地导出、封面与发布文案
7b4250a verified
Raw History Blame Contribute Delete
1.48 kB
import { TL } from '../timeline'
import { fmtTime } from './store'
export function Transcript({ onSeek }: { onSeek: (t: number) => void }) {
return (
<div className="grid md:grid-cols-2 gap-x-10 gap-y-8">
{TL.chapters.map((c, ci) => (
<div key={c.id} className="flex flex-col gap-3">
<button onClick={() => onSeek(c.start + 0.01)} className="flex items-baseline gap-3 text-left group">
<span className="qx-brush text-2xl text-[#b8392b]">{c.no}</span>
<span className="qx-song text-lg text-[#efe6d2] group-hover:text-[#cfa961] tracking-wider">{c.title.replace(/\s/g, '')}</span>
<span className="text-xs text-[#9d927f] tabular-nums">{fmtTime(c.start)}</span>
</button>
<div className="flex flex-col gap-2 border-l border-white/10 pl-4">
{TL.lines.filter((l) => l.chapter === ci).map((l) => (
<button key={l.id} onClick={() => onSeek(l.start - 0.3)} className="text-left group">
{l.kind === 'quote'
? <span className="qx-kai text-[15px] leading-relaxed text-[#e9d7a8] group-hover:text-white">{l.text}</span>
: <span className="text-sm leading-relaxed text-[#b9ae98] group-hover:text-[#efe6d2]">{l.text}</span>}
<span className="ml-2 text-[10px] text-[#6f6656] tabular-nums">{fmtTime(l.start)}</span>
</button>
))}
</div>
</div>
))}
</div>
)
}