From f76a00c0a6b118817b28849b479cb21ddbd25137 Mon Sep 17 00:00:00 2001 From: zguiyang Date: Mon, 16 Mar 2026 22:30:26 +0800 Subject: [PATCH] feat(projects): simplify categories and add cover-ready card layout --- src/lib/data/projects.ts | 2 + src/pages/projects.astro | 166 ++++++++++++++++-------------------- src/pages/zh/projects.astro | 166 ++++++++++++++++-------------------- src/types/data.ts | 2 + 4 files changed, 148 insertions(+), 188 deletions(-) diff --git a/src/lib/data/projects.ts b/src/lib/data/projects.ts index cf25b36..1dcb4f1 100644 --- a/src/lib/data/projects.ts +++ b/src/lib/data/projects.ts @@ -181,6 +181,8 @@ const sharedCases: Project[] = [ 'An open AI workspace for builders.', 'Used as an R&D track, not the primary professional narrative.', ], + coverImage: '', + coverImageAlt: 'Elynd project cover', tech: ['TypeScript', 'React', 'AI Workflow', 'Open Source'], link: '#', }, diff --git a/src/pages/projects.astro b/src/pages/projects.astro index b23f35a..8500ce3 100644 --- a/src/pages/projects.astro +++ b/src/pages/projects.astro @@ -9,82 +9,96 @@ import { defaultLang } from '@/i18n/ui'; const lang = (Astro.currentLocale as Lang) || defaultLang; const isZh = lang === 'zh'; -const pageProjects = projects[lang]; - -const filters = [ - { key: 'all', label: isZh ? '全部' : 'All' }, - { key: 'product', label: isZh ? '产品系统' : 'Product Systems' }, - { key: 'client', label: isZh ? '企业项目' : 'Client Systems' }, - { key: 'experiment', label: isZh ? '实验项目' : 'Experiments' }, -]; +const pageProjects = projects[lang].map((project) => ({ + ...project, + category: project.id === 'elynd' ? 'indie' : 'enterprise', +})); +const enterpriseProjects = pageProjects.filter((project) => project.category === 'enterprise'); +const indieProjects = pageProjects.filter((project) => project.category === 'indie'); --- -
+
-

{isZh ? '工程案例' : 'Engineering Case Studies'}

+

{isZh ? '项目经历' : 'Project Experience'}

{isZh - ? '围绕复杂系统建设的真实项目经验,重点展示技术挑战、职责边界和结果。' - : 'Real projects focused on complex system delivery, highlighting technical challenges, responsibilities, and outcomes.'} + ? '按两类展示:企业项目与独立开发项目。采用卡片布局,聚焦项目背景、职责和结果。' + : 'Organized into two categories: enterprise projects and independent projects, shown in a cover-style card grid.'}

-
- {filters.map((filter, index) => ( - +
+

{isZh ? '企业项目' : 'Enterprise Projects'}

+ {enterpriseProjects.length} {isZh ? '个项目' : 'projects'} +
+
+ {enterpriseProjects.map((project) => ( +
+
+

{isZh ? '企业项目' : 'Enterprise'}

+

{project.title}

+

{project.systemType}

+
+
+

{project.context}

+
+ {project.tech.slice(0, 5).map((tech) => ( + {tech} + ))} +
+

{isZh ? '结果:' : 'Outcome:'} {project.outcomes?.[0] ?? project.impact}

+

{isZh ? '受保密协议限制,暂不提供在线预览。' : 'Online preview is not available due to confidentiality restrictions.'}

+
+
))}
+
-
- {pageProjects.map((project) => ( -
-
-
-

{project.systemType}

-

{project.title}

-

{project.context}

- -
- {project.tech.map((tech) => ( - {tech} - ))} -
-
- -
-
-

{isZh ? '技术挑战' : 'Technical Challenges'}

-
    - {project.challenges?.map((item) =>
  • • {item}
  • )} -
-
- -
-

{isZh ? '职责范围' : 'Responsibilities'}

-
    - {project.responsibilities?.map((item) =>
  • • {item}
  • )} -
-
- -
-

{isZh ? '结果' : 'Outcomes'}

-
    - {project.outcomes?.map((item) =>
  • • {item}
  • )} -
+
+
+

{isZh ? '独立项目' : 'Independent Projects'}

+ {indieProjects.length} {isZh ? '个项目' : 'projects'} +
+
+ {indieProjects.map((project) => ( +
+
+ {project.coverImage ? ( + {project.coverImageAlt + ) : ( +
+

{isZh ? '封面待补充' : 'Cover Coming Soon'}

+

{project.title}

+

{project.systemType}

+ )} +
+
+

{isZh ? '独立项目' : 'Independent'}

+

{project.title}

+

{project.context}

+
+ {project.tech.slice(0, 5).map((tech) => ( + {tech} + ))}
+

{isZh ? '结果:' : 'Outcome:'} {project.outcomes?.[0] ?? project.impact}

+ {project.link !== '#' && ( + + {isZh ? '查看项目' : 'Open Project'} + + )}
))} @@ -95,39 +109,3 @@ const filters = [