diff --git a/.gitignore b/.gitignore index a547bf3..05ad170 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ dist-ssr *.njsproj *.sln *.sw? +dist.zip diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx index f98d8de..9b82e26 100644 --- a/src/components/Hero.tsx +++ b/src/components/Hero.tsx @@ -1,9 +1,22 @@ import { useEffect, useState } from 'react'; import { useTheme } from './theme-provider'; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogFooter, + DialogClose, +} from "@/components/ui/dialog"; +import { toast } from "@/components/ui/use-toast"; + +const WECHAT_ID = "JIWEI-Tech"; export const Hero = () => { const { theme } = useTheme(); const [isDark, setIsDark] = useState(false); + const [isContactModalOpen, setIsContactModalOpen] = useState(false); useEffect(() => { if (theme === 'system') { @@ -17,68 +30,97 @@ export const Hero = () => { } }, [theme]); + const handleBackgroundClick = () => { + setIsContactModalOpen(true); + }; + + const handleCopy = () => { + navigator.clipboard.writeText(WECHAT_ID).then( + () => { + setIsContactModalOpen(false); + toast({ + title: "复制成功", + description: "微信号已复制到剪贴板", + }); + }, + (err) => { + console.error("Async: Could not copy text: ", err); + toast({ + title: "复制失败", + description: "请手动复制微信号。", + variant: "destructive", + }); + } + ); + }; + const bgUrl = isDark ? 'url(https://lijue-me.oss-cn-chengdu.aliyuncs.com/20250619153149236.png)' : 'url(https://lijue-me.oss-cn-chengdu.aliyuncs.com/20250619153149236.png)'; return ( -
- {/*
-
-

- - Shadcn - {" "} - landing page -

{" "} - for{" "} -

- - React - {" "} - developers -

-
+ <> +
-

- Build your React landing page effortlessly with the required sections - to your project. -

-
- + {/* Shadow effect */} +
+
- - Github Repository - - -
- */} + {/* Contact Modal */} + + + + + 联系我们 + + - {/* Hero cards sections */} - {/*
- -
*/} +
+
+ 联系二维码 +
+

+ 扫描二维码添加微信 +

+

+ 专业顾问为您提供一对一咨询服务 +

+
- {/* Shadow effect */} -
-
+ + + + + + + + + ); };