diff --git a/web/src/app/chat/page.tsx b/web/src/app/chat/page.tsx index 452fd45..46cc297 100644 --- a/web/src/app/chat/page.tsx +++ b/web/src/app/chat/page.tsx @@ -1,20 +1,35 @@ 'use client'; import { HeroParallax } from '@/components/ui/hero-parallax'; +import { useTheme } from '@/hooks/useTheme'; import { products } from './products'; export default function ChatPage() { + const { isDark } = useTheme(); + return (
-
+
-

+

准备好开始了吗?

-

+

点击下方按钮,立即体验 Xyzen AI Agent

diff --git a/web/src/app/chat/products.ts b/web/src/app/chat/products.ts index ae9c9d5..01443b9 100644 --- a/web/src/app/chat/products.ts +++ b/web/src/app/chat/products.ts @@ -9,7 +9,7 @@ export const products = [ title: "chat2", link: "https://www.bohrium.com/apps/xyzen/job?type=app", thumbnail: - "https://storage.sciol.ac.cn/library/docs/chat2.png", + "https://storage.sciol.ac.cn/library/docs/chat2_light.png", }, { title: "chat3", @@ -22,7 +22,7 @@ export const products = [ title: "chat4", link: "https://www.bohrium.com/apps/xyzen/job?type=app", thumbnail: - "https://storage.sciol.ac.cn/library/docs/chat4.png", + "https://storage.sciol.ac.cn/library/docs/chat4_light.png", }, { title: "chat5", @@ -34,7 +34,7 @@ export const products = [ title: "chat6", link: "https://www.bohrium.com/apps/xyzen/job?type=app", thumbnail: - "https://storage.sciol.ac.cn/library/docs/chat6.png", + "https://storage.sciol.ac.cn/library/docs/chat6_light.png", }, { @@ -47,7 +47,7 @@ export const products = [ title: "chat8", link: "https://www.bohrium.com/apps/xyzen/job?type=app", thumbnail: - "https://storage.sciol.ac.cn/library/docs/chat8.png", + "https://storage.sciol.ac.cn/library/docs/chat8_light.png", }, { title: "chat9", @@ -59,7 +59,7 @@ export const products = [ title: "chat10", link: "https://www.bohrium.com/apps/xyzen/job?type=app", thumbnail: - "https://storage.sciol.ac.cn/library/docs/chat10.png", + "https://storage.sciol.ac.cn/library/docs/chat10_light.png", }, { title: "chat11", @@ -72,7 +72,7 @@ export const products = [ title: "chat12", link: "https://www.bohrium.com/apps/xyzen/job?type=app", thumbnail: - "https://storage.sciol.ac.cn/library/docs/chat12.png", + "https://storage.sciol.ac.cn/library/docs/chat12_light.png", }, { title: "chat13", @@ -84,7 +84,7 @@ export const products = [ title: "chat14", link: "https://www.bohrium.com/apps/xyzen/job?type=app", thumbnail: - "https://storage.sciol.ac.cn/library/docs/chat14.png", + "https://storage.sciol.ac.cn/library/docs/chat14_light.png", }, // { // title: "E Free Invoice", diff --git a/web/src/app/navbar/Navbar.tsx b/web/src/app/navbar/Navbar.tsx index 3c50cb2..202e458 100644 --- a/web/src/app/navbar/Navbar.tsx +++ b/web/src/app/navbar/Navbar.tsx @@ -7,15 +7,15 @@ import About from './About'; import Community from './Community'; import Projects from './Projects'; import { RightSideStatus } from './RightSideStatus'; -import Tutorial from './Tutorials'; +// import Tutorial from './Tutorials'; -const TutorialComponent = Tutorial as React.ComponentType<{ - index: number; - activeMenuItem: number | null; - setActiveMenuItem: React.Dispatch>; - open: boolean; - setOpen: React.Dispatch>; -}>; +// const Tutorial = Tutorial as React.ComponentType<{ +// index: number; +// activeMenuItem: number | null; +// setActiveMenuItem: React.Dispatch>; +// open: boolean; +// setOpen: React.Dispatch>; +// }>; const NavbarMenu = () => { const { t } = useTranslation(); @@ -37,13 +37,19 @@ const NavbarMenu = () => { open={open} setOpen={setOpen} /> - + {t('navbar.tutorial')} + + {/* + /> */} - 教程 - + className="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-neutral-900 focus:outline-none dark:text-neutral-100 hover:text-indigo-600 dark:hover:text-indigo-500" + > + {t('navbar.tutorial','Tutorial')} + ); } diff --git a/web/src/components/ui/hero-parallax.tsx b/web/src/components/ui/hero-parallax.tsx index 75ae479..a3c5a91 100644 --- a/web/src/components/ui/hero-parallax.tsx +++ b/web/src/components/ui/hero-parallax.tsx @@ -7,6 +7,7 @@ import { useTransform, } from 'motion/react'; import React from 'react'; +import { useTheme } from '@/hooks/useTheme'; export const HeroParallax = ({ products, @@ -17,6 +18,8 @@ export const HeroParallax = ({ thumbnail: string; }[]; }) => { + const { isDark } = useTheme(); + const firstRow = products.slice(0, 5); const secondRow = products.slice(5, 10); const thirdRow = products.slice(10, 15); @@ -56,9 +59,9 @@ export const HeroParallax = ({
-
+
{ +export const Header = ({isDark}:{isDark: boolean}) => { return ( //white text
-

+

Xyzen (/ˈsaɪ.zan/)!
AI-driven Agent IDE

-

+

Xyzen 是一个 Agent, 他是一个会创造 Agent 的 Agent。 Xyzen 可以为你开启一个通往Agent 与MCP无限可能的大门。

diff --git a/web/src/hooks/useTheme.ts b/web/src/hooks/useTheme.ts new file mode 100644 index 0000000..3e2f4b0 --- /dev/null +++ b/web/src/hooks/useTheme.ts @@ -0,0 +1,28 @@ +'use client'; + +import { useUI } from '@/hooks/useUI'; +import { useEffect, useState } from 'react'; + +export function useTheme() { + const { theme } = useUI(); + const [isDark, setIsDark] = useState(false); + + useEffect(() => { + // 根据主题设置 isDark + const updateIsDark = () => { + setIsDark(theme === 'dark' || (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)); + }; + + updateIsDark(); + + // 监听系统主题变化(当主题设置为 system 时) + const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); + mediaQuery.addEventListener('change', updateIsDark); + + return () => { + mediaQuery.removeEventListener('change', updateIsDark); + }; + }, [theme]); + + return { isDark }; +}