Skip to content

Commit d3a0a22

Browse files
committed
feat(website): unify module registry and link homepage cards to feature pages
1 parent 10e9e55 commit d3a0a22

3 files changed

Lines changed: 34 additions & 56 deletions

File tree

‎website/app/page.tsx‎

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { motion } from "framer-motion";
88
import { GlowOrb } from "@/components/GlowOrb";
99
import { SectionReveal } from "@/components/SectionReveal";
1010
import { SuperEllipseCard } from "@/components/SuperEllipseCard";
11+
import { MODULES } from "@/lib/features/modules";
1112

1213
/* ---------- 数据 ---------- */
1314

@@ -32,45 +33,6 @@ const PHILOSOPHY = [
3233
},
3334
];
3435

35-
const FEATURES = [
36-
{
37-
name: "深潜",
38-
origin: "番茄钟",
39-
desc: "切断海面噪音,潜入零干扰的心流深海。",
40-
color: "var(--kb-focus-blue)",
41-
},
42-
{
43-
name: "结礁",
44-
origin: "智能笔记",
45-
desc: "将漂浮的碎片,沉淀为坚实的认知暗礁。",
46-
color: "var(--kb-brand-400)",
47-
},
48-
{
49-
name: "回声定位",
50-
origin: "课堂助手",
51-
desc: "捕捉深海回声,打捞暗流中的知识暗物质。",
52-
color: "var(--kb-cyber-cyan)",
53-
},
54-
{
55-
name: "反衰减呼吸",
56-
origin: "闪卡复习",
57-
desc: "规律吐纳,让记忆在深海高压下依然鲜活。",
58-
color: "var(--kb-moss-green)",
59-
},
60-
{
61-
name: "浮出水面",
62-
origin: "费曼学习法",
63-
desc: "向世界呼出你的理解。雾散了,轮廓就清晰了。",
64-
color: "var(--kb-amber)",
65-
},
66-
{
67-
name: "萤火海沟",
68-
origin: "灵感空间",
69-
desc: "安放微光,它们终将照亮整片深域。",
70-
color: "var(--kb-accent-400)",
71-
},
72-
];
73-
7436
/* ---------- 页面 ---------- */
7537

7638
export default function HomePage() {
@@ -217,11 +179,11 @@ export default function HomePage() {
217179
</SectionReveal>
218180

219181
<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-5">
220-
{FEATURES.map((feat, i) => (
182+
{MODULES.map((feat, i) => (
221183
<SectionReveal key={feat.name} delay={i * 0.08}>
222-
<motion.div
223-
whileHover={{ y: -5, transition: { duration: 0.35, ease: [0.22, 1, 0.36, 1] } }}
224-
className="group relative rounded-3xl p-7 h-full cursor-default"
184+
<Link
185+
href={feat.href}
186+
className="group relative block rounded-3xl p-7 h-full cursor-pointer transition-all duration-500 hover:-translate-y-[5px] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-kb-brand"
225187
style={{
226188
background: "var(--kb-bg-elevated)",
227189
border: "1px solid var(--kb-glass-border)",
@@ -245,7 +207,7 @@ export default function HomePage() {
245207
className="absolute bottom-0 left-8 right-8 h-px opacity-0 group-hover:opacity-100 transition-opacity duration-500"
246208
style={{ background: `linear-gradient(90deg, transparent, ${feat.color}66, transparent)` }}
247209
/>
248-
</motion.div>
210+
</Link>
249211
</SectionReveal>
250212
))}
251213
</div>

‎website/components/features/FeaturesPage.tsx‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
// @ai-context
2-
// 功能总览页主体:六大认知模块卡片墙,深潜已上线可点入详情,其余标注建设中。
3-
// Features overview: six module cards, dive is live, others under construction.
2+
// 功能总览页主体:六大认知模块卡片墙,深潜已上线可点入详情,其余标注建设中。数据来自共享模块注册表。
3+
// Features overview: six module cards, dive is live, others under construction. Data from shared module registry.
44
"use client";
55

66
import Link from "next/link";
77
import { GlowOrb } from "@/components/GlowOrb";
88
import { SectionReveal } from "@/components/SectionReveal";
9-
10-
const MODULES = [
11-
{ name: "深潜", origin: "番茄钟", desc: "切断海面噪音,潜入零干扰的心流深海。", href: "/features/dive", ready: true, color: "var(--kb-focus-blue)" },
12-
{ name: "结礁", origin: "智能笔记", desc: "将漂浮的碎片,沉淀为坚实的认知暗礁。", href: "/download", ready: false, color: "var(--kb-brand-400)" },
13-
{ name: "回声定位", origin: "课堂助手", desc: "捕捉深海回声,打捞暗流中的知识暗物质。", href: "/download", ready: false, color: "var(--kb-cyber-cyan)" },
14-
{ name: "反衰减呼吸", origin: "闪卡复习", desc: "规律吐纳,让记忆在深海高压下依然鲜活。", href: "/download", ready: false, color: "var(--kb-moss-green)" },
15-
{ name: "浮出水面", origin: "费曼学习法", desc: "向世界呼出你的理解。雾散了,轮廓就清晰了。", href: "/download", ready: false, color: "var(--kb-amber)" },
16-
{ name: "萤火海沟", origin: "灵感空间", desc: "安放微光,它们终将照亮整片深域。", href: "/download", ready: false, color: "var(--kb-accent-400)" },
17-
];
9+
import { MODULES } from "@/lib/features/modules";
1810

1911
export function FeaturesPage() {
2012
return (
@@ -36,7 +28,7 @@ export function FeaturesPage() {
3628
<SectionReveal key={m.name} delay={i * 0.08}>
3729
<Link
3830
href={m.href}
39-
className="group relative block rounded-3xl p-7 h-full transition-all duration-500 hover:-translate-y-1"
31+
className="group relative block rounded-3xl p-7 h-full transition-all duration-500 hover:-translate-y-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-kb-brand"
4032
style={{
4133
background: "var(--kb-bg-elevated)",
4234
border: "1px solid var(--kb-glass-border)",

‎website/lib/features/modules.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// @ai-context
2+
// 六大认知模块共享数据:首页星图与功能总览页的单一数据源。
3+
// Shared module registry for homepage and features overview.
4+
// Why: 两页此前各自维护六模块数组导致字段漂移(首页指向 /features、总览页指向 /download),提取后一处维护。
5+
6+
export interface FeatureModule {
7+
name: string;
8+
origin: string;
9+
desc: string;
10+
color: string;
11+
/** 详情页路径;未上线模块指向 /download 引导下载 */
12+
href: string;
13+
/** 详情页是否已上线 */
14+
ready: boolean;
15+
}
16+
17+
export const MODULES: FeatureModule[] = [
18+
{ name: "深潜", origin: "番茄钟", desc: "切断海面噪音,潜入零干扰的心流深海。", color: "var(--kb-focus-blue)", href: "/features/dive", ready: true },
19+
{ name: "结礁", origin: "智能笔记", desc: "将漂浮的碎片,沉淀为坚实的认知暗礁。", color: "var(--kb-brand-400)", href: "/download", ready: false },
20+
{ name: "回声定位", origin: "课堂助手", desc: "捕捉深海回声,打捞暗流中的知识暗物质。", color: "var(--kb-cyber-cyan)", href: "/download", ready: false },
21+
{ name: "反衰减呼吸", origin: "闪卡复习", desc: "规律吐纳,让记忆在深海高压下依然鲜活。", color: "var(--kb-moss-green)", href: "/download", ready: false },
22+
{ name: "浮出水面", origin: "费曼学习法", desc: "向世界呼出你的理解。雾散了,轮廓就清晰了。", color: "var(--kb-amber)", href: "/download", ready: false },
23+
{ name: "萤火海沟", origin: "灵感空间", desc: "安放微光,它们终将照亮整片深域。", color: "var(--kb-accent-400)", href: "/download", ready: false },
24+
];

0 commit comments

Comments
 (0)