Skip to content

Commit da342c2

Browse files
committed
feat(website): add feature config types, chronos states and dive content config
1 parent 8b078c6 commit da342c2

3 files changed

Lines changed: 118 additions & 0 deletions

File tree

‎website/lib/features/chronos.ts‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// @ai-context
2+
// Chronos 六态形态定义与视觉参数:类型、展示元数据、Canvas 演示渲染参数。
3+
// Chronos six-state definitions and visual params for the web demo.
4+
// Why: 状态机与展示数据集中定义,ChronosDemo 组件与 dive 内容配置共享同一来源,避免漂移。
5+
6+
export type ChronosState =
7+
| "asleep"
8+
| "breathing"
9+
| "focus"
10+
| "short_break"
11+
| "long_break"
12+
| "milestone";
13+
14+
export interface ChronosStateMeta {
15+
key: ChronosState;
16+
name: string;
17+
icon: string;
18+
desc: string;
19+
}
20+
21+
export const CHRONOS_STATES: ChronosStateMeta[] = [
22+
{ key: "asleep", name: "沉睡", icon: "🌑", desc: "暗红余烬脉动,等待被唤醒。" },
23+
{ key: "breathing", name: "呼吸", icon: "🌕", desc: "60bpm 心跳红光,准备好开始。" },
24+
{ key: "focus", name: "专注", icon: "🔥", desc: "白炽星体,粒子随倒计时消散。" },
25+
{ key: "short_break", name: "短休", icon: "🌱", desc: "嫩绿种子自旋,萌芽新生。" },
26+
{ key: "long_break", name: "长休", icon: "🌳", desc: "种子破土,长成参天大树。" },
27+
{ key: "milestone", name: "划时代点", icon: "💡", desc: "把时间抽象,变成有生命的伙伴。" },
28+
];
29+
30+
/** 六态渲染参数:RGB 主色 / 心跳强度(0-1) / 粒子规模 / 漂移速度 / 光晕强度 / 是否粒子消散 */
31+
export interface ChronosStateStyle {
32+
color: [number, number, number];
33+
pulse: number;
34+
scale: number;
35+
drift: number;
36+
glow: number;
37+
dissipate: boolean;
38+
}
39+
40+
export const STATE_STYLE: Record<ChronosState, ChronosStateStyle> = {
41+
asleep: { color: [156, 59, 59], pulse: 0.35, scale: 0.55, drift: 0.25, glow: 0.22, dissipate: false },
42+
breathing: { color: [239, 68, 68], pulse: 1.0, scale: 1.0, drift: 0.4, glow: 0.4, dissipate: false },
43+
focus: { color: [249, 115, 22], pulse: 0.2, scale: 1.2, drift: 0.7, glow: 0.55, dissipate: true },
44+
short_break: { color: [74, 222, 128], pulse: 0.55, scale: 0.9, drift: 0.55, glow: 0.45, dissipate: false },
45+
long_break: { color: [34, 197, 94], pulse: 0.3, scale: 1.1, drift: 0.35, glow: 0.5, dissipate: false },
46+
milestone: { color: [251, 191, 36], pulse: 0.9, scale: 1.15, drift: 0.6, glow: 0.6, dissipate: false },
47+
};

‎website/lib/features/dive.ts‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// @ai-context
2+
// 深潜功能页内容配置:数据驱动渲染,新增功能页时复制本文件结构。
3+
// Dive feature page content config.
4+
import type { FeatureConfig } from "./types";
5+
import { CHRONOS_STATES } from "./chronos";
6+
7+
export const DIVE_CONFIG: FeatureConfig = {
8+
slug: "dive",
9+
name: "深潜",
10+
origin: "番茄钟",
11+
tagline: "把番茄钟,养成一只时间生物",
12+
hero: {
13+
title: "把番茄钟,养成一只时间生物",
14+
subtitle: "它不是倒计时,是你亲手点亮、看着它燃烧与生长的 Chronos。",
15+
},
16+
mechanics: {
17+
title: "它的一生,由你点亮",
18+
hint: "点击形态,中央的 Chronos 会变成它",
19+
items: CHRONOS_STATES.map((s) => ({ name: s.name, icon: s.icon, desc: s.desc })),
20+
},
21+
scenes: {
22+
title: "不是 25 分钟,是你的节奏",
23+
items: [
24+
{ name: "刷题", rhythm: "50 / 10", story: "沉浸演算,别让铃声打断思路。" },
25+
{ name: "背单词", rhythm: "15 / 3", story: "短频快,趁记忆窗口最亮时反复。" },
26+
{ name: "晚自习", rhythm: "90 / 20", story: "长线作战,跟着超昼夜节律走。" },
27+
],
28+
},
29+
outcome: {
30+
title: "你的深潜,会积成一片海",
31+
desc: "每一次专注都是一段下潜深度——它们被记录、被看见、长成只属于你的认知星图。",
32+
},
33+
science: {
34+
title: "为什么「一个番茄」不够",
35+
points: [
36+
"注意力遵循 90–120 分钟的超昼夜节律,固定 25 分钟会截断你的高效期。",
37+
"休息不是浪费——清醒期记忆重放,让刚学的内容在后台沉淀。",
38+
"失败不被惩罚:连续受挫时屏幕注入柔粉,而非刺眼的红色。",
39+
],
40+
},
41+
cta: { text: "免费下载 · 现在就能养一只" },
42+
};

‎website/lib/features/types.ts‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// @ai-context
2+
// 功能页内容配置类型:所有功能页共享同一结构,新增功能仅需实现该接口。
3+
// Feature config types: shared schema for all feature landing pages.
4+
// 纯类型文件,无运行时逻辑,不需要 "use client" 指令。
5+
6+
export interface FeatureMechanicsItem {
7+
name: string;
8+
icon: string;
9+
desc: string;
10+
}
11+
12+
export interface FeatureSceneItem {
13+
name: string;
14+
rhythm: string;
15+
story: string;
16+
}
17+
18+
export interface FeatureConfig {
19+
slug: string;
20+
name: string;
21+
origin: string;
22+
tagline: string;
23+
hero: { title: string; subtitle: string };
24+
mechanics: { title: string; hint?: string; items: FeatureMechanicsItem[] };
25+
scenes: { title: string; items: FeatureSceneItem[] };
26+
outcome: { title: string; desc: string };
27+
science: { title: string; points: string[] };
28+
cta: { text: string };
29+
}

0 commit comments

Comments
 (0)