- 新增 4 套主题模板:starter/default/dark/minimal - Starter: 毛玻璃 + GradientText + SpotlightCard (原有风格) - Default: Aurora 极光背景 + SplitText + TiltedCard - Dark: Particles 粒子 + DecryptedText 赛博朋克风格 - Minimal: 极简优雅 + FadeContent 淡入动画 - 新增 i18n 中英双语支持 (i18next + browser-languagedetector) - 新增 ThemeProvider 运行时主题切换 (根据 theme_template 字段) - 新增 11 个 react-bits 动画组件 - 所有页面文案国际化 (Login/Register/Dashboard/Tokens/Pricing/Packages) - 新增 README.md + README.zh.md 含主题切换指南 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
import{u as h,a as u,b as g,c as b,r as p,j as e,L as s,O as f}from"./index-Drgd7k5E.js";import{u as j}from"./useTranslation-B7WzaWp0.js";function w(){const{t:a}=j(),{user:o,logout:m}=h(),{site:t}=u(),d=g(),c=b(),[l,i]=p.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0}].filter(n=>!n.auth||o);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-black text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-green-500/10 border-b border-green-500/20 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-green-300 font-mono",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-black/80 border-b border-green-500/10",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-7 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-md bg-green-500/20 border border-green-500/30 flex items-center justify-center text-green-400 font-bold font-mono text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-green-400 font-mono group-hover:text-green-300 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(n=>e.jsx(s,{to:n.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${c.pathname===n.to?"text-green-400 bg-green-500/10":"text-neutral-500 hover:text-green-400"}`,children:n.label},n.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 font-mono hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-neutral-500 hover:text-green-400 font-mono transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(s,{to:"/login",className:"text-sm text-neutral-500 hover:text-green-400 font-mono transition-colors hidden sm:block",children:a("nav.login")}),e.jsx(s,{to:"/register",className:"px-4 py-1.5 rounded-md bg-green-500/10 border border-green-500/30 text-green-400 text-sm font-mono hover:bg-green-500/20 transition-all",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded hover:bg-white/5",onClick:()=>i(!l),children:e.jsx("svg",{className:"w-5 h-5 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),l&&e.jsx("div",{className:"md:hidden border-t border-green-500/10 bg-black/95 backdrop-blur-xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(n=>e.jsx(s,{to:n.to,onClick:()=>i(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${c.pathname===n.to?"text-green-400 bg-green-500/10":"text-neutral-500 hover:text-green-400"}`,children:n.label},n.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(f,{})}),e.jsx("footer",{className:"border-t border-green-500/10 mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-xs text-neutral-600 font-mono",children:["© ",new Date().getFullYear()," ",r]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-green-400 font-mono transition-colors",children:a("nav.contact")})]})})]})}export{w as default};
|