Skip to content

Commit 2e0ab36

Browse files
committed
Refactor code structure for improved readability and maintainability
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 6116182 commit 2e0ab36

File tree

3 files changed

+1163
-839
lines changed

3 files changed

+1163
-839
lines changed

content/docs/themes/shiro/extra.mdx

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: 额外功能
33
description: Shiro 主题的额外功能配置
44
icon: SquarePlus
55
---
6+
67
# 额外功能
78

89
## 扩展的 Markdown 语法
@@ -18,18 +19,17 @@ icon: SquarePlus
1819

1920
Shiro 主题中,有一个可以在顶部显示博主当前正在做的事情的功能,这个功能是通过云函数和 ProcessReporter 软件实现的。
2021

21-
import { ToGithub } from '@/app/components/ToGithub';
22+
import { ToGithub } from '@/app/components/ToGithub'
2223

2324
<ToGithub repo="mx-space/ProcessReporterMac" />
2425
<ToGithub repo="TNXG/ProcessReporterWinpy" />
2526
<ToGithub repo="ttimochan/processforlinux" />
2627

27-
2828
<Callout type="info">
2929
非常感谢 Innei, timochan, TNXG 的贡献,目前 ProcessReporter 已支持全平台!
3030
</Callout>
3131

32-
import { Step, Steps } from 'fumadocs-ui/components/steps';
32+
import { Step, Steps } from 'fumadocs-ui/components/steps'
3333

3434
<Steps>
3535
### 配置云函数
@@ -166,7 +166,7 @@ LOG_ENABLE=true
166166
如果有什么疑问,可以去阅读该项目的 [README](https://github.com/ttimochan/processforlinux#readme)
167167

168168
<script>
169-
{`
169+
{`
170170
document.addEventListener('DOMContentLoaded', () => {
171171
const style = document.createElement('style');
172172
style.textContent = \`
@@ -220,11 +220,80 @@ LOG_ENABLE=true
220220

221221
在主页登录之后,你可以点击此头像的右下方设置状态。
222222

223+
## AI 参与声明
224+
225+
<Callout type="warn">此特性为闭源版本特有</Callout>
226+
227+
Shiro 主题支持在文章的 Meta 数据中声明 AI 的参与程度,实现创作过程的透明化。编辑时可在 `meta.aiGen` 字段选择声明类型,前端会自动展示对应的 AI 参与徽章。
228+
229+
支持的声明类型:
230+
231+
| 类型 | 说明 |
232+
| -------- | ---------------------------------------------- |
233+
| 手作 | 本文内容完全由作者独立创作,未使用任何 AI 辅助 |
234+
| 辅助写作 | AI 辅助构思/结构/表达,作者审阅并修改后发布 |
235+
| 润色 | AI 用于语言润色/语法调整,不改变核心观点 |
236+
| 完全 | 内容主要由 AI 生成,作者进行了选择与编辑后发布 |
237+
| 故事整理 | 作者口述内容,AI 进行整理与润色后发布 |
238+
| 标题生成 | 标题由 AI 生成或优化 |
239+
| 校对 | AI 协助校对文本,检查拼写、语法和逻辑问题 |
240+
| 灵感提供 | AI 提供创意灵感或写作思路 |
241+
| 改写 | AI 将内容改写成不同风格或语气 |
242+
243+
## 动态背景系统
244+
245+
<Callout type="warn">此特性为闭源版本特有</Callout>
246+
247+
Shiro 主题内置基于 WebGL 的高性能粒子物理背景系统,支持多种效果自动切换:
248+
249+
### 粒子物理背景
250+
251+
基于牛顿力学的粒子物理系统,响应页面滚动产生惯性运动效果。
252+
253+
**技术特点:**
254+
255+
- 滚动驱动力:与滚动速度成正比
256+
- 阻力模拟:每帧保留 85% 速度,模拟能量耗散
257+
- 恢复力系统:停止滚动后逐渐回归原始轨道
258+
- 智能分布:80% 粒子避开内容区域,避免干扰阅读
259+
260+
### 雪花背景
261+
262+
程序化生成的六重对称雪花,支持完整的物理效果。
263+
264+
**可配置参数:**
265+
266+
- 风力系统:风速、风向控制
267+
- 重力模拟:可调节下落速度
268+
- 湍流效果:随机扰动的自然飘落
269+
- 深度模糊:基于距离的景深效果
270+
- 雪花密度:可调整粒子数量
271+
272+
### 萤火虫背景
273+
274+
互动式萤火虫动画,营造梦幻氛围。
275+
276+
**交互特性:**
277+
278+
- 鼠标点击惊吓:萤火虫会逃离点击区域
279+
- 多种颜色:黄绿色、绿色、淡蓝色
280+
- 脉动闪烁:自然的亮度变化效果
281+
- 智能避让:自动避开内容阅读区域
282+
283+
### 季节自动切换
284+
285+
系统会根据当前日期和主题自动选择合适的背景效果:
286+
287+
| 条件 | 背景效果 |
288+
| ----------------------------- | ------------------------- |
289+
| 冬季(12 月 -2 月)+ 深色模式 | 雪花背景 |
290+
| 其他情况 | 粒子物理背景 / 萤火虫背景 |
291+
292+
文章详情页默认不显示背景动画,以保持阅读体验。
293+
223294
## 签名动画
224295

225-
<Callout type="warn">
226-
此特性为闭源版本特有
227-
</Callout>
296+
<Callout type="warn">此特性为闭源版本特有</Callout>
228297

229298
![](/assets/images/themes/shiro/sign.gif)
230299

@@ -259,4 +328,4 @@ LOG_ENABLE=true
259328
}
260329
}
261330
}
262-
```
331+
```

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,50 @@
1313
"generate-sitemap": "tsx scripts/generate-sitemap.ts"
1414
},
1515
"dependencies": {
16-
"@orama/orama": "^3.1.14",
17-
"@orama/tokenizers": "^3.1.14",
16+
"@orama/orama": "^3.1.18",
17+
"@orama/tokenizers": "^3.1.18",
1818
"@oramacloud/client": "^2.1.4",
19-
"@tailwindcss/postcss": "^4.1.13",
19+
"@tailwindcss/postcss": "^4.1.18",
2020
"autocorrect-node": "^2.14.0",
2121
"class-variance-authority": "^0.7.1",
2222
"clsx": "^2.1.1",
2323
"commitizen": "^4.3.1",
2424
"copy-to-clipboard": "^3.3.3",
2525
"cz-conventional-changelog": "^3.3.0",
26-
"dotenv": "^16.6.1",
26+
"dotenv": "^17.2.3",
2727
"fast-glob": "^3.3.3",
28-
"framer-motion": "^12.23.22",
28+
"framer-motion": "^12.23.26",
2929
"fumadocs-core": "15.1.2",
3030
"fumadocs-mdx": "11.5.7",
31-
"fumadocs-typescript": "^3.1.0",
31+
"fumadocs-typescript": "^5.0.0",
3232
"fumadocs-ui": "15.1.2",
33-
"lucide-react": "^0.483.0",
33+
"lucide-react": "^0.562.0",
3434
"next": "15.2.3",
35-
"only-allow": "^1.2.1",
36-
"react": "^19.1.1",
37-
"react-dom": "^19.1.1",
35+
"only-allow": "^1.2.2",
36+
"react": "^19.1.4",
37+
"react-dom": "^19.1.4",
3838
"react-icons": "^5.5.0",
39-
"shiki": "^3.13.0",
40-
"std-env": "^3.9.0",
41-
"tailwind-merge": "^3.3.1"
39+
"shiki": "^3.20.0",
40+
"std-env": "^3.10.0",
41+
"tailwind-merge": "^3.4.0"
4242
},
4343
"devDependencies": {
44-
"@fumadocs/cli": "^0.0.8",
44+
"@fumadocs/cli": "^1.2.0",
4545
"@types/mdx": "^2.0.13",
4646
"@types/node": "22.13.11",
47-
"@types/react": "^19.1.14",
48-
"@types/react-dom": "^19.1.9",
49-
"autoprefixer": "^10.4.21",
47+
"@types/react": "^19.2.7",
48+
"@types/react-dom": "^19.2.3",
49+
"autoprefixer": "^10.4.23",
5050
"postcss": "^8.5.6",
51-
"prettier": "^3.6.2",
52-
"tailwindcss": "^4.1.13",
53-
"tsx": "^4.20.6",
54-
"typescript": "^5.9.2"
51+
"prettier": "^3.7.4",
52+
"tailwindcss": "^4.1.18",
53+
"tsx": "^4.21.0",
54+
"typescript": "^5.9.3"
5555
},
5656
"config": {
5757
"commitizen": {
5858
"path": "cz-conventional-changelog"
5959
}
6060
},
61-
"packageManager": "pnpm@9.12.3+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
61+
"packageManager": "pnpm@10.26.2"
6262
}

0 commit comments

Comments
 (0)