From 971c789f70ca5e9f8ba577bea7275d4c0fd1fe03 Mon Sep 17 00:00:00 2001 From: estel <690930@qq.com> Date: Wed, 25 Jun 2025 17:43:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E5=8A=A0=E9=A6=96=E9=A1=B5=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E5=9B=BE=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E8=81=94=E7=B3=BB=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/components/Hero.tsx | 148 ++++++++++++++++++++++++++-------------- 2 files changed, 96 insertions(+), 53 deletions(-) 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 */} -
-
+ + + + + + + + + ); };