From 9c6b7fd6983e4e623f5265f52472157c668f2642 Mon Sep 17 00:00:00 2001 From: zguiyang Date: Sat, 14 Mar 2026 11:17:02 +0800 Subject: [PATCH] feat(home): redesign homepage with refined visuals and improved layout flow - Enhanced hero section with updated typography, animations, and gradient backgrounds. - Replaced single featured project with dynamic multi-project filtering. - Improved section transitions and added cohesive hover effects for interactivity. - Updated CSS variables for softer background colors and unified design language. - Added responsive refinements for better experience across devices. --- src/pages/index.astro | 354 ++++++++++++++++++++++----------------- src/pages/zh/index.astro | 354 ++++++++++++++++++++++----------------- src/styles/global.css | 2 +- 3 files changed, 399 insertions(+), 311 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 56e4fe7..1159e4a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -14,7 +14,7 @@ const pageTitle = t("site.title"); const prefix = lang === "zh" ? "/zh" : ""; const localizedServices = services[lang]; -const featuredProject = projects[lang].find((project) => project.featured) ?? projects[lang][0]; +const featuredProjects = projects[lang].filter((project) => project.featured); const careerMilestones = [ { @@ -44,58 +44,78 @@ const keyFacts = [ -
-
-
- -
-
-
-

{t("home.hero.eyebrow")}

-

{personalInfo.name}

-

{personalInfo.position[lang]}

-

{t("home.hero.summary")}

-
+
+
+ {/* 统一的页面背景装饰 */} +
+ +
+
+ +
+
+
+

+ {personalInfo.name} +

+

{personalInfo.position[lang]}

+
+ +

{t("home.hero.summary")}

-
- + -
+
{keyFacts.map((item) => ( - + + {item} ))}
-
-
-
-
- - - +
+
+
+
+
+
+ + + +
+ {personalInfo.terminal.username} +
+
+
+ ~ +

whoami {personalInfo.name}

+
+
+ ~ +

role {personalInfo.position[lang]}

+
+
+ ~ +

stack TypeScript, React, Node.js, Astro

+
+
+ ~ +

status {t("home.hero.terminalStatus")}

+
+
+ ~ +

contact {personalInfo.github}

+
- {personalInfo.terminal.username} -
-
-

$ whoami

-

{personalInfo.name}

-

$ role

-

{personalInfo.position[lang]}

-

$ stack

-

TypeScript, React, Node.js, Astro

-

$ status

-

{t("home.hero.terminalStatus")}

-

$ contact

-

{personalInfo.github}

@@ -103,134 +123,158 @@ const keyFacts = [
-
- -
-
-

{t("home.services.eyebrow")}

-

{t("home.services.title")}

-

{t("home.services.description")}

+
+
+ +
+
+

{t("home.services.title")}

+

{t("home.services.description")}

+
+ + {t("services.viewAll")} + +
- -
-
- {localizedServices.map((service) => ( -
-
-
- - - +
+ {localizedServices.map((service) => ( +
+
+
+ + + +
+

{service.title}

-

{service.title}

-
-
    - {service.items.slice(0, 3).map((item) => ( -
  • - - {item} -
  • - ))} -
-
- ))} -
- -
- -
- -
-

{t("home.career.eyebrow")}

-

{t("home.career.title")}

-

{t("home.career.description")}

-
- -
- {careerMilestones.map((item) => ( -
- -
-

{item.period}

-

{item.title}

-

{item.outcome}

+
    + {service.items.slice(0, 3).map((item) => ( +
  • + + {item} +
  • + ))} +
-
- ))} -
- - -
-
- -
- -
-

{t("home.featured.eyebrow")}

-

{t("home.featured.title")}

-
- -
-
- {t("project.featured")} -

{featuredProject.title}

-
- -
-
-

{t("home.featured.challenge")}

-

{featuredProject.impact}

-
-
-

{t("home.featured.approach")}

-

{featuredProject.description[0]}

-
-
-

{t("home.featured.outcome")}

-

{featuredProject.description[1]}

-
-
- -
- {featuredProject.tech.slice(0, 4).map((tech) => ( - {tech} ))}
+ +
-
-
- -
-

{t("home.final.title")}

-

{t("home.final.description")}

- - -
-
+ +
+ {featuredProjects.map((project) => ( +
+ {/* 顶部封面图区域 */} +
+
+
+ {project.icon} +
+
+ + {project.type} + +
+
+ + {/* 内容区域 */} +
+
+

{project.title}

+

+ {project.impact} +

+ +
+ {project.tech.map((tech) => ( + + {tech} + + ))} +
+
+ + {/* 操作按钮 */} +
+ + {t("home.featured.ctaPrimary")} + + {project.links?.github && ( + + + + )} +
+
+
+ ))} +
+ + + +
+ +
+
+
+

{t("home.final.title")}

+

{t("home.final.description")}

+ +
+
+
+
+ + +