- 新增 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
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
import{r as c,j as e,u as f,a as N,l as v,k as w,L as r}from"./index-Drgd7k5E.js";import{C as p}from"./CountUp-Omm8FlHl.js";import{u as y}from"./useTranslation-B7WzaWp0.js";const o=({children:t,blur:i=!1,duration:n=800,delay:d=0,threshold:x=.1,initialOpacity:m=0,className:h="",...a})=>{const s=c.useRef(null),[l,j]=c.useState(!1);return c.useEffect(()=>{const b=s.current;if(!b)return;const u=new IntersectionObserver(([g])=>{g.isIntersecting&&(j(!0),u.disconnect())},{threshold:x});return u.observe(b),()=>u.disconnect()},[x]),e.jsx("div",{ref:s,className:h,style:{opacity:l?1:m,filter:i?l?"blur(0px)":"blur(10px)":void 0,transform:l?"translateY(0)":"translateY(20px)",transition:`opacity ${n}ms ease-out ${d}ms, filter ${n}ms ease-out ${d}ms, transform ${n}ms ease-out ${d}ms`,willChange:"opacity, filter, transform"},...a,children:t})};function $(){const{t}=y(),{user:i}=f(),{site:n}=N(),[d,x]=c.useState([]),[m,h]=c.useState([]);c.useEffect(()=>{v().then(s=>{s.data.success&&x(s.data.data||[])}).catch(()=>{}),w().then(s=>{s.data.success&&h(s.data.data||[])}).catch(()=>{})},[]);const a=d.filter(s=>s.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(o,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(r,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.getStarted")," →"]}),e.jsx(r,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("home.viewPricing")})]})})]})}),e.jsx(o,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(p,{from:0,to:a.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(p,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(p,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc")},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc")},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc")}].map((s,l)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-neutral-600 mt-0.5",children:["0",l+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:s.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:s.desc})]})]},l))})]})}),a.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("home.availableModelsDesc",{count:a.length})})]}),a.length>8&&e.jsxs(r,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[t("home.viewAllModels",{count:a.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:a.slice(0,8).map((s,l)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:s.display_name||s.model_name})},s.id||l))})]})}),m.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:m.filter(s=>s.enabled).slice(0,3).map(s=>e.jsxs("div",{className:"rounded-xl p-6 flex flex-col border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:[e.jsx("h3",{className:"text-base font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),e.jsx(r,{to:i?"/packages":"/register",className:"mt-4 py-2.5 rounded-lg bg-neutral-800 text-white font-medium text-sm text-center hover:bg-neutral-700 transition-colors",children:t(i?"home.subscribe":"home.getStarted")})]},s.id))})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(o,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(r,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(r,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[t("home.createFreeAccount")," →"]}),e.jsx(r,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("home.signIn")})]})})]})})})]})}export{$ as default};
|