Skip to content

Commit 53259cc

Browse files
committed
feat: GitHub Pages 颠覆式重构 - Phase 1-4 完成
## 核心改进 ### Phase 1: 深浅色模式彻底修复 - 新增 ThemedLogo.vue 主题感知 Logo 组件 - 修复 ArchitectureDiagram.vue 硬编码 fill="white" 问题 - 增强 ThemedSvg.vue 组件,支持多种主题适配策略 - 新增 svg-theme-test.ts SVG 主题测试工具 ### Phase 2: 视觉设计重塑 - 新增语义化色彩变量(状态色、图表色、代码高亮色) - 新增排版系统(Major Third 比例 1.25) - 新增高级动画(fade-up、pulse-glow-tech、data-flow、shimmer) - 增强玻璃态效果和深度层级 ### Phase 3: 内容深度重构 - 新增技术白皮书板块(性能分析、设计决策记录) - 新增企业案例研究 - 新增 Prompt 工程深度解读 - 扩展学术引用至 40+ 条 - 更新导航结构,新增"技术白皮书"入口 ### Phase 4: 架构优化 - 引入 UnoCSS 原子化 CSS 框架 - 引入 @vueuse/core Vue 组合式工具函数 - 配置 UnoCSS shortcuts(glass、interactive-card、gradient-text 等) ## 文件变更统计 - 新增文件: 12 个 - 修改文件: 9 个 - 新增依赖: unocss, @vueuse/core
1 parent 60093d8 commit 53259cc

20 files changed

Lines changed: 3583 additions & 22 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'vitepress'
22
import { withMermaid } from 'vitepress-plugin-mermaid'
33
import llmstxt from 'vitepress-plugin-llms'
4+
import UnoCSS from 'unocss/vite'
45
import { zhNav, enNav, zhSidebar, enSidebar } from './site/atlas'
56
import { siteFacts } from './site/facts'
67

@@ -114,7 +115,10 @@ export default withMermaid(defineConfig({
114115
],
115116

116117
vite: {
117-
plugins: [llmstxt()]
118+
plugins: [
119+
UnoCSS(),
120+
llmstxt()
121+
]
118122
},
119123

120124
lastUpdated: true,

docs/.vitepress/site/atlas.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,32 @@ function createRuleSidebarGroups(lang: 'zh' | 'en') {
111111

112112
export const zhNav = [
113113
{ text: '项目导读', link: '/zh/introduction/mission', activeMatch: '/zh/introduction/' },
114+
{ text: '技术白皮书', link: '/zh/whitepaper/performance', activeMatch: '/zh/whitepaper/' },
114115
{ text: '学院路径', link: '/zh/academy/learning-path', activeMatch: '/zh/academy/' },
115116
{ text: '架构设计', link: '/zh/architecture/system-overview', activeMatch: '/zh/architecture/' },
116-
{ text: '实施指南', link: '/zh/guides/team-onboarding', activeMatch: '/zh/guides/' },
117117
{ text: '规则索引', link: '/zh/rules/', activeMatch: '/zh/rules/' },
118118
{ text: '研究引用', link: '/zh/research/references', activeMatch: '/zh/research/' },
119119
];
120120

121121
export const enNav = [
122122
{ text: 'Introduction', link: '/en/introduction/mission', activeMatch: '/en/introduction/' },
123+
{ text: 'Whitepaper', link: '/en/whitepaper/performance', activeMatch: '/en/whitepaper/' },
123124
{ text: 'Academy', link: '/en/academy/learning-path', activeMatch: '/en/academy/' },
124125
{ text: 'Architecture', link: '/en/architecture/system-overview', activeMatch: '/en/architecture/' },
125-
{ text: 'Guides', link: '/en/guides/team-onboarding', activeMatch: '/en/guides/' },
126126
{ text: 'Rules Index', link: '/en/rules/', activeMatch: '/en/rules/' },
127127
{ text: 'Research', link: '/en/research/references', activeMatch: '/en/research/' },
128128
];
129129

130130
export const zhSidebar = {
131+
'/zh/whitepaper/': [
132+
{
133+
text: '技术白皮书',
134+
items: [
135+
{ text: '性能分析', link: '/zh/whitepaper/performance' },
136+
{ text: '设计决策', link: '/zh/whitepaper/design-decisions' },
137+
],
138+
},
139+
],
131140
'/zh/introduction/': [
132141
{
133142
text: '项目导读',
@@ -143,6 +152,7 @@ export const zhSidebar = {
143152
items: [
144153
{ text: '学院路径', link: '/zh/academy/learning-path' },
145154
{ text: '维护者课程', link: '/zh/academy/maintainer-curriculum' },
155+
{ text: '企业案例研究', link: '/zh/academy/case-studies/enterprise-adoption' },
146156
],
147157
},
148158
],
@@ -174,6 +184,7 @@ export const zhSidebar = {
174184
text: '研究引用',
175185
items: [
176186
{ text: '参考文献', link: '/zh/research/references' },
187+
{ text: 'Prompt 工程解读', link: '/zh/research/papers/prompt-engineering' },
177188
{ text: '相关开源项目探究', link: '/zh/resources/ecosystem' },
178189
{ text: '演进思考', link: '/zh/resources/extended-reading' },
179190
{ text: '更新日志', link: '/zh/changelog' },
@@ -208,6 +219,15 @@ export const zhSidebar = {
208219
};
209220

210221
export const enSidebar = {
222+
'/en/whitepaper/': [
223+
{
224+
text: 'Whitepaper',
225+
items: [
226+
{ text: 'Performance Analysis', link: '/en/whitepaper/performance' },
227+
{ text: 'Design Decisions', link: '/en/whitepaper/design-decisions' },
228+
],
229+
},
230+
],
211231
'/en/introduction/': [
212232
{
213233
text: 'Introduction',
@@ -223,6 +243,7 @@ export const enSidebar = {
223243
items: [
224244
{ text: 'Academy Path', link: '/en/academy/learning-path' },
225245
{ text: 'Maintainer Curriculum', link: '/en/academy/maintainer-curriculum' },
246+
{ text: 'Enterprise Case Study', link: '/en/academy/case-studies/enterprise-adoption' },
226247
],
227248
},
228249
],
@@ -254,6 +275,7 @@ export const enSidebar = {
254275
text: 'Research',
255276
items: [
256277
{ text: 'References', link: '/en/research/references' },
278+
{ text: 'Prompt Engineering Deep Dive', link: '/en/research/papers/prompt-engineering' },
257279
{ text: 'Open Source Survey', link: '/en/resources/ecosystem' },
258280
{ text: 'Evolution Notes', link: '/en/resources/extended-reading' },
259281
{ text: 'Changelog', link: '/en/changelog' },

docs/.vitepress/theme/components/ArchitectureDiagram.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const svgClasses = computed(() => [
8181
:x="100"
8282
:y="76 + i * 95"
8383
text-anchor="middle"
84-
fill="white"
84+
:fill="isDark ? 'white' : 'var(--figure-fill-surface)'"
8585
font-family="var(--font-display)"
8686
font-size="20"
8787
font-weight="700"
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<script setup lang="ts">
2+
/**
3+
* ThemedLogo - Theme-aware Logo component
4+
* Automatically adjusts colors based on light/dark mode for perfect visibility
5+
*/
6+
import { useData } from 'vitepress'
7+
import { computed } from 'vue'
8+
9+
const props = defineProps<{
10+
width?: number
11+
height?: number
12+
}>()
13+
14+
const { isDark } = useData()
15+
16+
const width = computed(() => props.width || 100)
17+
const height = computed(() => props.height || 100)
18+
19+
// Dynamic colors based on theme
20+
const colors = computed(() => ({
21+
gradientStart: isDark.value ? '#7c8aff' : '#5c6ef8',
22+
gradientEnd: isDark.value ? '#5ce1e6' : '#3dc9d0',
23+
text: isDark.value ? '#1a1a2e' : '#fafafa',
24+
mark: isDark.value ? '#ffb347' : '#f5a623'
25+
}))
26+
</script>
27+
28+
<template>
29+
<svg
30+
xmlns="http://www.w3.org/2000/svg"
31+
viewBox="0 0 100 100"
32+
:width="width"
33+
:height="height"
34+
role="img"
35+
aria-label="Awesome Cursor Rules Logo"
36+
>
37+
<defs>
38+
<linearGradient id="logo-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
39+
<stop offset="0%" :stop-color="colors.gradientStart" />
40+
<stop offset="100%" :stop-color="colors.gradientEnd" />
41+
</linearGradient>
42+
<!-- Glow filter for dark mode -->
43+
<filter v-if="isDark" id="logo-glow" x="-20%" y="-20%" width="140%" height="140%">
44+
<feGaussianBlur stdDeviation="2" result="blur" />
45+
<feMerge>
46+
<feMergeNode in="blur" />
47+
<feMergeNode in="SourceGraphic" />
48+
</feMerge>
49+
</filter>
50+
</defs>
51+
52+
<!-- Background rounded rectangle -->
53+
<rect
54+
width="100"
55+
height="100"
56+
rx="20"
57+
fill="url(#logo-gradient)"
58+
:filter="isDark ? 'url(#logo-glow)' : undefined"
59+
/>
60+
61+
<!-- Main text "CR" -->
62+
<text
63+
x="50"
64+
y="50"
65+
font-family="ui-sans-serif, system-ui, sans-serif"
66+
font-size="45"
67+
font-weight="700"
68+
:fill="colors.text"
69+
text-anchor="middle"
70+
dominant-baseline="middle"
71+
>
72+
CR
73+
</text>
74+
75+
<!-- Accent mark dot -->
76+
<circle cx="85" cy="15" r="8" :fill="colors.mark" />
77+
</svg>
78+
</template>
79+
80+
<style scoped>
81+
svg {
82+
transition: filter 0.3s ease;
83+
}
84+
85+
svg:hover {
86+
filter: brightness(1.1);
87+
}
88+
</style>

docs/.vitepress/theme/components/ThemedSvg.vue

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
/**
3-
* ThemedSvg - Theme-aware SVG wrapper component
4-
* Automatically adjusts SVG appearance for light/dark mode
3+
* ThemedSvg - Enhanced theme-aware SVG wrapper component
4+
* Automatically adjusts SVG appearance for light/dark mode with multiple strategies
55
*/
66
import { useData } from 'vitepress'
77
import { computed } from 'vue'
@@ -10,6 +10,14 @@ const props = defineProps<{
1010
class?: string
1111
viewBox?: string
1212
ariaLabel?: string
13+
/** Invert colors in dark mode */
14+
invertOnDark?: boolean
15+
/** Brightness adjustment (1.0 = no change) */
16+
adjustBrightness?: number
17+
/** Contrast adjustment (1.0 = no change) */
18+
adjustContrast?: number
19+
/** Saturation adjustment (1.0 = no change) */
20+
adjustSaturation?: number
1321
}>()
1422
1523
const { isDark } = useData()
@@ -19,12 +27,43 @@ const svgClasses = computed(() => [
1927
props.class,
2028
{ 'themed-svg--dark': isDark.value }
2129
])
30+
31+
const filterStyle = computed(() => {
32+
if (!isDark.value) return 'none'
33+
34+
const filters: string[] = []
35+
36+
// Invert colors for dark mode
37+
if (props.invertOnDark) {
38+
filters.push('invert(1)')
39+
}
40+
41+
// Brightness adjustment
42+
const brightness = props.adjustBrightness ?? 1.05
43+
if (brightness !== 1) {
44+
filters.push(`brightness(${brightness})`)
45+
}
46+
47+
// Contrast adjustment
48+
const contrast = props.adjustContrast ?? 1.02
49+
if (contrast !== 1) {
50+
filters.push(`contrast(${contrast})`)
51+
}
52+
53+
// Saturation adjustment
54+
if (props.adjustSaturation && props.adjustSaturation !== 1) {
55+
filters.push(`saturate(${props.adjustSaturation})`)
56+
}
57+
58+
return filters.length > 0 ? filters.join(' ') : 'none'
59+
})
2260
</script>
2361

2462
<template>
2563
<svg
2664
:class="svgClasses"
2765
:viewBox="viewBox"
66+
:style="{ filter: filterStyle }"
2867
role="img"
2968
:aria-label="ariaLabel"
3069
>
@@ -35,10 +74,20 @@ const svgClasses = computed(() => [
3574
<style scoped>
3675
.themed-svg {
3776
color: var(--figure-text-label);
38-
transition: filter var(--duration-normal) var(--ease-out-expo);
77+
transition:
78+
filter var(--duration-normal, 0.25s) var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)),
79+
opacity var(--duration-normal, 0.25s) var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
3980
}
4081
4182
.themed-svg--dark {
42-
filter: brightness(1.05) contrast(1.02);
83+
/* Enhanced dark mode visibility */
84+
opacity: 1;
85+
}
86+
87+
/* Ensure SVG inherits color for currentColor usage */
88+
.themed-svg :deep(*) {
89+
transition:
90+
fill var(--duration-fast, 0.15s) var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)),
91+
stroke var(--duration-fast, 0.15s) var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
4392
}
4493
</style>

docs/.vitepress/theme/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import DefaultTheme from 'vitepress/theme'
2+
import 'virtual:uno.css'
23
import './style.css'
34
import ExecutiveHero from './components/ExecutiveHero.vue'
45
import MetricBand from './components/MetricBand.vue'
@@ -17,6 +18,7 @@ import ReferenceCard from './components/ReferenceCard.vue'
1718
import ArchitectureDiagram from './components/ArchitectureDiagram.vue'
1819
import RuleDecisionTree from './components/RuleDecisionTree.vue'
1920
import RuleCard from './components/RuleCard.vue'
21+
import ThemedLogo from './components/ThemedLogo.vue'
2022

2123
export default {
2224
...DefaultTheme,
@@ -38,6 +40,7 @@ export default {
3840
app.component('ArchitectureDiagram', ArchitectureDiagram)
3941
app.component('RuleDecisionTree', RuleDecisionTree)
4042
app.component('RuleCard', RuleCard)
43+
app.component('ThemedLogo', ThemedLogo)
4144

4245
// Legacy Components (kept for backward compatibility)
4346
app.component('ExecutiveHero', ExecutiveHero)

0 commit comments

Comments
 (0)