Spaces:
Running
Running
Update: ≤3s WeChat-compatible live photos, sets 3 & 4 (fill-in-the-blank), in-browser maker tool
0daf81d verified Download source/frontend/src/App.tsx from Ethscriptions/eths: direct link, hf CLI and curl.
- Browser
- Download file 2.45 kB
-
https://huggingface.co/spaces/Ethscriptions/eths/resolve/main/source/frontend/src/App.tsx
- Command line
-
hf download hf://spaces/Ethscriptions/eths/source/frontend/src/App.tsx
-
curl -L -o App.tsx https://huggingface.co/spaces/Ethscriptions/eths/resolve/main/source/frontend/src/App.tsx
2.45 kB
| import { lazy, Suspense, useState } from 'react' | |
| import { Loader2 } from 'lucide-react' | |
| import PackGallery from './components/PackGallery' | |
| const LiveMaker = lazy(() => import('./components/LiveMaker')) | |
| type Tab = 'maker' | 'gallery' | |
| export default function App() { | |
| const [tab, setTab] = useState<Tab>(() => (typeof window !== 'undefined' && window.location.hash === '#gallery' ? 'gallery' : 'maker')) | |
| const go = (t: Tab) => { | |
| setTab(t) | |
| if (typeof window !== 'undefined') window.history.replaceState(null, '', t === 'gallery' ? '#gallery' : '#maker') | |
| } | |
| return ( | |
| <div className="min-h-screen bg-[#0d0d10] text-neutral-100"> | |
| <main className="mx-auto max-w-6xl px-5 pb-24 pt-8 sm:px-8"> | |
| <nav className="mb-8 flex items-center justify-between gap-4"> | |
| <div className="text-sm font-semibold tracking-wide text-neutral-300"> | |
| 这个用英语怎么说<span className="text-[#ff3b5c]">?</span> | |
| </div> | |
| <div className="flex rounded-full border border-white/10 p-1 text-sm"> | |
| {([['maker', '实况图制作工具'], ['gallery', '示例素材包']] as const).map(([k, l]) => ( | |
| <button | |
| key={k} | |
| type="button" | |
| onClick={() => go(k)} | |
| className={`rounded-full px-4 py-1.5 transition ${tab === k ? 'bg-white font-semibold text-neutral-900' : 'text-neutral-300 hover:text-white'}`} | |
| > | |
| {l} | |
| </button> | |
| ))} | |
| </div> | |
| </nav> | |
| {tab === 'maker' ? ( | |
| <> | |
| <header className="mb-8 max-w-3xl"> | |
| <h1 className="text-3xl font-black leading-tight tracking-tight sm:text-4xl">自己做「这个用英语怎么说?」实况图</h1> | |
| <p className="mt-3 text-[15px] leading-7 text-neutral-400"> | |
| 放一张底图,填上单词和中文,选好读音、音效和样式,直接导出苹果实况照片(JPG + MOV,带声音)。不需要 AI:读音可以用维基共享资源的真人录音、你自己的录音或上传的音频。 | |
| </p> | |
| </header> | |
| <Suspense fallback={<div className="flex items-center gap-2 text-neutral-400"><Loader2 className="h-4 w-4 animate-spin" />加载中</div>}> | |
| <LiveMaker /> | |
| </Suspense> | |
| </> | |
| ) : ( | |
| <PackGallery /> | |
| )} | |
| </main> | |
| </div> | |
| ) | |
| } | |