From 59da13bec35f0f7c6c8b328e04ac2a53dfe4183f Mon Sep 17 00:00:00 2001 From: B1ue1nWh1te Date: Thu, 7 Nov 2024 04:34:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20feat:=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=98=BE=E7=A4=BA=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=83=A8=E5=88=86=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/Profile.tsx | 2 +- app/components/Projects.tsx | 4 +-- app/components/ProjectsBeam.tsx | 2 +- app/layout.tsx | 2 +- app/page.tsx | 52 ++++++++++++++++++++++++--------- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/app/components/Profile.tsx b/app/components/Profile.tsx index b848a11..b69bd69 100644 --- a/app/components/Profile.tsx +++ b/app/components/Profile.tsx @@ -66,7 +66,7 @@ export default function Profile() { return ( +
{Object.values(projectsInfo).map((project, index) => ( diff --git a/app/components/ProjectsBeam.tsx b/app/components/ProjectsBeam.tsx index adfeb24..a499e4b 100644 --- a/app/components/ProjectsBeam.tsx +++ b/app/components/ProjectsBeam.tsx @@ -60,7 +60,7 @@ export default function ProjectsBeam() { return ( + {children} diff --git a/app/page.tsx b/app/page.tsx index 46fdaf6..8a4efde 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,25 +1,51 @@ +"use client"; + import { NextUIProvider } from "@nextui-org/react"; +import { useEffect, useState } from "react"; import Profile from "./components/Profile"; import Projects from "./components/Projects"; import ProjectsBeam from "./components/ProjectsBeam"; import BlurFade from "./components/ui/blur-fade"; +import { cn } from "./lib/utils"; export default function Home() { + const [isLargeScreen, setIsLargeScreen] = useState(false); + + useEffect(() => { + const checkScreenSize = () => { + const isLarge = window.innerWidth >= 1400; + if (isLarge !== isLargeScreen) { + setIsLargeScreen(isLarge); + } + }; + + checkScreenSize(); + window.addEventListener("resize", checkScreenSize); + return () => window.removeEventListener("resize", checkScreenSize); + }, [isLargeScreen]); + return ( -
-
- -
- - -
-
- -
- -
-
+
+
+
+ +
+ + +
+
+ +
+ +
+
+