Skip to content

Commit 3c6659c

Browse files
committed
style(design): fix contrast, layout thrashing, and resolve ghost-card pattern
1 parent aa352ce commit 3c6659c

4 files changed

Lines changed: 48 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ data/generated/
1515
docs/superpowers/
1616
.codex/
1717
AGENTS.md
18+
.agents/

PRODUCT.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Product
2+
3+
## Register
4+
5+
product
6+
7+
## Users
8+
这个项目的主要用户是中文开发者,通常在编码、排查问题、查命令、看配置项时打开这张速查页。他们使用时的核心场景不是“沉浸式阅读”,而是“快速扫读、快速定位、快速确认”。界面需要优先服务信息检索效率,让用户能在高密度内容里迅速找到模块、分组、字段和说明。
9+
10+
## Product Purpose
11+
生成和发布 Claude Code 中文速查表。自动抓取上游内容,利用词表完成中文映射并静态生成页面,在极低同步和维护成本下,为中文开发者提供最即时的信息检索和速查参考。
12+
13+
## Brand Personality
14+
高效、锐利、现代。页面给人的感受应当是专业、可信、干净利落,而不是热闹、营销化或装饰驱动。
15+
16+
## Anti-references
17+
- **Side-stripe borders**: 侧边粗边框作为卡片或警示的修饰。
18+
- **Gradient text**: 渐变字,影响低照度和低对比度下的扫读。
19+
- **Tiny uppercase tracked eyebrow**: 章节顶部的小字全大写跟踪线(如 "ABOUT" "PROCESS"),此为 AI 脚手架模板痕迹。
20+
- **Numbered eyebrows**: 无意义的 01 / 02 / 03 序号标识。
21+
- **Identical card grids**: 相同的卡片无限重复,应通过差异化排版提高信息层级。
22+
23+
## Design Principles
24+
1. **扫读效率优先于装饰表现**:任何视觉决策都应先服务于“更快定位信息、更少认知负担、更清晰层级”。
25+
2. **高对比与可访问性是硬约束**:所有主题都应满足 WCAG AA,兼顾色盲友好、减少动画和清晰焦点态。
26+
3. **现代感来自秩序、比例和节奏**:可以锐利,可以有技术感,但不要依赖重阴影、夸张渐变、炫技动效或视觉噪声。
27+
4. **展示层可以重做,但同步链路不能被破坏**:上游抓取、解析、映射、生成的逻辑必须保持稳定;设计调整只发生在前端展示层与样式表达层。
28+
5. **信息密度要高,但不能压垮阅读**:允许紧凑布局,但必须通过分组、留白、字重、字号、颜色层级和模块边界维持清晰可读。
29+
30+
## Accessibility & Inclusion
31+
- 确保文字对比度符合 WCAG AA 规范。
32+
- 支持深色和浅色双主题,具有出色的高对比度和清晰的聚焦态。
33+
- 减少不必要的动画,并支持 `prefers-reduced-motion`

script.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,14 @@ function initStickyOffsets() {
135135

136136
updateStickyOffsets();
137137

138+
var resizeTimeout = null;
138139
if (window && typeof window.addEventListener === "function") {
139-
window.addEventListener("resize", updateStickyOffsets);
140+
window.addEventListener("resize", function () {
141+
if (resizeTimeout) {
142+
cancelAnimationFrame(resizeTimeout);
143+
}
144+
resizeTimeout = requestAnimationFrame(updateStickyOffsets);
145+
});
140146
}
141147
}
142148

styles.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
--border-strong: #b8c5d8;
3434
--text: #17202e;
3535
--text-soft: #334155;
36-
--text-muted: #64748b;
37-
--shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
36+
--text-muted: #526075;
37+
--shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
3838
--chip-bg: #f2f6fb;
3939
--chip-border: #c9d4e3;
4040
--control-bg: #eef2f7;
@@ -75,8 +75,8 @@
7575
--border-strong: #36516f;
7676
--text: #e8eef7;
7777
--text-soft: #c6d2e3;
78-
--text-muted: #91a4bc;
79-
--shadow: 0 24px 56px rgba(2, 6, 23, 0.45);
78+
--text-muted: #a0b7d7;
79+
--shadow: 0 2px 8px rgba(2, 6, 23, 0.25);
8080
--chip-bg: #1b2a3d;
8181
--chip-border: #32485f;
8282
--control-bg: #152233;
@@ -116,8 +116,8 @@
116116
--border-strong: #36516f;
117117
--text: #e8eef7;
118118
--text-soft: #c6d2e3;
119-
--text-muted: #91a4bc;
120-
--shadow: 0 24px 56px rgba(2, 6, 23, 0.45);
119+
--text-muted: #a0b7d7;
120+
--shadow: 0 2px 8px rgba(2, 6, 23, 0.25);
121121
--chip-bg: #1b2a3d;
122122
--chip-border: #32485f;
123123
--control-bg: #152233;
@@ -881,7 +881,7 @@ a,
881881
padding: 0.16rem 0.42rem;
882882
border-radius: 999px;
883883
background: var(--danger);
884-
color: #fff;
884+
color: #ffffff;
885885
font-size: 0.66rem;
886886
line-height: 1;
887887
font-weight: 700;

0 commit comments

Comments
 (0)