Spaces:
Running
Running
Download dengtaishan-src/src/app/Studio.tsx from Ethscriptions/mx: direct link, hf CLI and curl.
- Browser
- Download file 4.23 kB
-
https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/dengtaishan-src/src/app/Studio.tsx
- Command line
-
hf download hf://spaces/Ethscriptions/mx/dengtaishan-src/src/app/Studio.tsx
-
curl -L -o Studio.tsx https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/dengtaishan-src/src/app/Studio.tsx
4.23 kB
| // 主页面 | |
| import { useEffect, useState } from 'react' | |
| import PlayerView from './PlayerView' | |
| import ExportPanel from './ExportPanel' | |
| import PublishPanel from './PublishPanel' | |
| import CoverPanel from './CoverPanel' | |
| import { Section, Toaster } from './ui' | |
| import { loadFonts } from '../video/fonts' | |
| import { DURATION, SHOT_NAMES } from '../video/timeline' | |
| const NAV = [ | |
| ['watch', '观看'], | |
| ['export', '导出 MP4'], | |
| ['publish', '发布文案'], | |
| ['cover', '封面'], | |
| ] as const | |
| export default function Studio() { | |
| const [ready, setReady] = useState(false) | |
| const [orient, setOrient] = useState<'l' | 'p'>('l') | |
| useEffect(() => { | |
| if (window.innerWidth < 768 && window.innerHeight > window.innerWidth) setOrient('p') | |
| loadFonts().then(() => setReady(true)) | |
| }, []) | |
| return ( | |
| <div className="min-h-screen bg-[#0b0b0d] text-[#ddd6c9] font-serif-r"> | |
| <div className="pointer-events-none fixed inset-0 bg-[radial-gradient(ellipse_at_top,rgba(201,168,106,0.10),transparent_55%),radial-gradient(ellipse_at_bottom_right,rgba(179,38,30,0.08),transparent_50%)]" /> | |
| <header className="sticky top-0 z-40 border-b border-white/5 bg-[#0b0b0d]/80 backdrop-blur"> | |
| <div className="mx-auto flex max-w-[1280px] items-center justify-between gap-4 px-4 sm:px-8 h-14"> | |
| <a href="#watch" className="flex items-center gap-3"> | |
| <span className="flex h-8 w-8 items-center justify-center rounded-[6px] bg-[#b3261e] font-kai text-[18px] text-[#f6efe2]">岱</span> | |
| <span className="font-serif-b text-[16px] text-[#f3eee4] tracking-wider">登泰山记 · 五个镜头</span> | |
| </a> | |
| <nav className="hidden sm:flex items-center gap-1"> | |
| {NAV.map(([id, l]) => ( | |
| <a key={id} href={`#${id}`} className="rounded-full px-4 py-1.5 text-[14px] text-[#a39d92] hover:text-[#f3eee4] hover:bg-white/5">{l}</a> | |
| ))} | |
| </nav> | |
| </div> | |
| </header> | |
| <main className="relative"> | |
| <div className="mx-auto max-w-[1280px] px-4 sm:px-8 pt-10 sm:pt-14"> | |
| <div className="text-[12px] tracking-[0.5em] text-[#c9a86a]">高中语文 · 必修上 · 姚鼐</div> | |
| <h1 className="mt-3 font-kai text-[44px] sm:text-[68px] leading-[1.1] text-[#f6f1e6]"> | |
| 《登泰山记》<span className="text-[#c9a86a]">是一部电影</span> | |
| </h1> | |
| <p className="mt-4 max-w-[780px] text-[15px] sm:text-[17px] leading-8 text-[#a39d92]"> | |
| 四百四十八字,被很多同学当成“流水账”。换一种读法——{SHOT_NAMES.join('、')},五个镜头对应全文五段:读懂它的结构,也就背下了它。全片约 {Math.round(DURATION / 60)} 分钟,画面、配乐与音效均在网页中实时生成。 | |
| </p> | |
| </div> | |
| <Section id="watch" kicker="Watch" title="观看"> | |
| <PlayerView orient={orient} setOrient={setOrient} ready={ready} /> | |
| <p className="mt-4 text-[12px] text-[#6f6a61]">快捷键:空格 播放/暂停,← → 快退/快进 5 秒。手机竖屏观看请切换“竖屏 9:16”。</p> | |
| </Section> | |
| <Section id="export" kicker="Export" title="导出 MP4" desc="在浏览器本地渲染并保存为 MP4 文件,可选横屏/竖屏、2K/1080P/720P、24/30/60 帧,以及是否包含背景音乐。"> | |
| <ExportPanel orient={orient} /> | |
| </Section> | |
| <Section id="publish" kicker="Publish" title="发布文案" desc="小红书、抖音、微信视频号、哔哩哔哩四个平台的标题、描述与话题,已按各平台字数和话题数量要求编写,点击即可复制。"> | |
| <PublishPanel /> | |
| </Section> | |
| <Section id="cover" kicker="Covers" title="封面" desc="4:3、3:4、16:9 三种比例,每种 4 款设计。点击卡片可多选,打包下载 PNG 原图。"> | |
| <CoverPanel ready={ready} /> | |
| </Section> | |
| <footer className="mx-auto max-w-[1280px] px-4 sm:px-8 py-12 text-[12px] leading-6 text-[#5f5a52]"> | |
| 原文:姚鼐《登泰山记》(乾隆三十九年)。旁白为语音合成;画面、配乐与音效为程序化生成。 | |
| </footer> | |
| </main> | |
| <Toaster /> | |
| </div> | |
| ) | |
| } | |