From f7770bb8af4c01055c7fc934acfd3ebee8d6e85c Mon Sep 17 00:00:00 2001 From: xiaozhou233 Date: Sun, 26 Jul 2026 10:26:21 +0800 Subject: [PATCH] docs: add inline comments across components and hooks --- src/components/Banner.tsx | 5 +++++ src/components/NavCard.tsx | 1 + src/components/layout/Footer.tsx | 1 + src/data/navigation.ts | 1 + src/hooks/useParallax.ts | 1 + src/hooks/useTypewriter.ts | 1 + src/lib/utils.ts | 1 + src/main.tsx | 19 ++++++++++--------- src/types/index.ts | 1 + 9 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx index 95d667c..515efb6 100644 --- a/src/components/Banner.tsx +++ b/src/components/Banner.tsx @@ -8,6 +8,7 @@ import bannerImg from "@/assets/banner.png"; const FULL_TEXT = "Xiaozhou's Website"; +// Full-screen hero banner with parallax background, typewriter title, and nav cards export default function Banner() { const text = useTypewriter(FULL_TEXT, 100); const parallaxRef = useParallax(0.25); @@ -21,11 +22,13 @@ export default function Banner() { backgroundSize: "cover", }} > + {/* Dark overlay for text readability */}
+ {/* Animated typewriter heading */}

{text} | @@ -35,8 +38,10 @@ export default function Banner() { {"< / Code. Deploy. Repeat. >"}

+ {/* Decorative divider */}
+ {/* Navigation card grid */}
{NAV_ITEMS.map((item) => ( diff --git a/src/components/NavCard.tsx b/src/components/NavCard.tsx index 02416d1..5367f7a 100644 --- a/src/components/NavCard.tsx +++ b/src/components/NavCard.tsx @@ -4,6 +4,7 @@ interface NavCardProps { item: NavItem; } +// A clickable navigation card with icon, title, and description export default function NavCard({ item }: NavCardProps) { const { name, desc, path, Icon, color, borderHover } = item; diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index 0e8dd62..ae12f7e 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -1,5 +1,6 @@ import { ChevronDown } from "lucide-react"; +// Bottom section with scroll indicator and tech stack credit export default function Footer() { return (