Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/assets/imgs/admin.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Monorepo:
<img src=".github/assets/imgs/home.webp" alt="nav 首页:全屏背景图上的毛玻璃搜索框,顶部是「开发」「阅读」分类锚点,下面是两排公开导航图标卡片" width="960" />
</p>

| 私有区(登录后) | 后台管理 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src=".github/assets/imgs/private.webp" alt="登录后的 nav 首页:多出带「私有」徽标的「私人」分类(仅登录可见),右上角换成「后台」「退出」" width="480" /> | <img src=".github/assets/imgs/admin.webp" alt="nav 后台管理:左侧导航与「分类 / 链接 / 搜索引擎 / 站点设置 / 导入导出 / 安全 / 系统管理」标签页,当前在链接管理页,每行可拖拽排序、编辑与删除" width="480" /> |
| 私有区(登录后) | 后台管理 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src=".github/assets/imgs/private.webp" alt="登录后的 nav 首页:多出带「私有」徽标的「私人」分类(仅登录可见),右上角换成「后台」「退出」" width="480" /> | <img src=".github/assets/imgs/admin.webp" alt="nav 后台管理:壁纸背景上的玻璃顶栏(站点标题、返回首页、主题、退出)与左侧竖排菜单(分类 / 链接 / 搜索引擎 / 站点设置 / 导入导出 / 安全·两步验证 / 系统管理),右侧是毛玻璃内容卡,当前在链接管理页,每行可拖拽排序、编辑与删除" width="480" /> |

## 本地开发

Expand Down
7 changes: 4 additions & 3 deletions docs/api-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"backgroundUrl": "",
"wallpaperSource": "bing",
"logoUrl": "",
"theme": "system",
"columns": 0,
"searchNewTab": true
}
Expand Down Expand Up @@ -138,8 +137,10 @@ Passkey(WebAuthn,/api/auth/passkey/*,@simplewebauthn/server v14):

### 站点设置

- `GET /api/admin/settings` → `{siteTitle, backgroundUrl, wallpaperSource, logoUrl, theme, columns, searchNewTab}`
- `PUT /api/admin/settings` body 可含 `{siteTitle, backgroundUrl, wallpaperSource(bing|custom), logoUrl, theme(light|dark|system), columns(0–12), searchNewTab(boolean)}` → 更新后对象
- `GET /api/admin/settings` → `{siteTitle, backgroundUrl, wallpaperSource, logoUrl, columns, searchNewTab}`
- `PUT /api/admin/settings` body 可含 `{siteTitle, backgroundUrl, wallpaperSource(bing|custom), logoUrl, columns(0–12), searchNewTab(boolean)}` → 更新后对象

主题(设深色/浅色)**不在**站点设置里:深浅色只由访客本机偏好(顶栏主题按钮,`localStorage` 键 `nav.visitor-theme`)决定,没有偏好时跟随系统外观。`PUT` 传 `theme` 不生效(白名单外的键一律忽略);存量的 `settings.theme` 行不删不迁移,只是停产不用。

`searchNewTab`:搜索是否在新标签页打开。存储键 `search_new_tab`,值 `"1"`/`"0"`(同 `totp_enabled` 的 KV 布尔惯例);库中**无此键**(存量库)时按 `true` 返回。写入只接受布尔值,非布尔返回 400 `searchNewTab must be a boolean`。

Expand Down
17 changes: 0 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions web/design-system/nav/MASTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
| 仪表盘/后台 | **Kumo(@cloudflare/kumo)** 可选用于后台表格/设置面板 | 与 shadcn/ui 并存时以 shadcn/ui 为通用层 |
| 图标 | **Lucide**(`lucide-react`) | 所有图标来自 Lucide;禁止 emoji 图标、禁止混入其它图标库 |
| 动画 | **Motion**(`motion` / framer-motion 后继) | 入场、拖拽、微交互一律用 Motion;禁止手写 keyframes 做等价动画 |
| 布局 | **react-resizable-panels** | 后台需要可调分栏时使用 |
| 布局 | **固定宽左栏**(无分栏依赖) | 后台左栏 230px 固定宽(见 §1.2);将来确需可调分栏时再引入 `react-resizable-panels` |
| 拖拽排序 | **@dnd-kit**(core / sortable / utilities) | 后台分类、链接、搜索引擎排序一律用 dnd-kit |
| 状态 | **Zustand** | 全局状态(登录态、公开/私有数据、编辑态)用 Zustand;局部态用组件内 state |
| 样式 | Tailwind CSS(shadcn/ui 同源)+ CSS 变量 token | token 走下方变量表,禁止组件里写裸 hex |
Expand All @@ -37,9 +37,12 @@
4. **导航区**:分类分节;每节是分类标题 + 图标网格(桌面 7–8 列,平板 5–6 列,手机 4 列)。
5. **私有区**(仅登录后):与公开区同构的分节,视觉上以毛玻璃卡片边缘的 accent 描边/「私有」徽标区分;**未登录时该区块在 DOM 与数据中完全不存在**。

### 1.2 后台(`/admin`)
### 1.2 后台(`/#admin`)

- 左侧导航(分类 / 链接 / 搜索引擎 / 站点设置 / 导入导出),右侧内容区;窄屏折叠为顶部标签。
- 与公开页同一设计语言:**整条玻璃顶栏**(站点标题/Logo + 返回首页 + 主题切换 + 退出登录)、**壁纸背景**(与公开页共用同一背景层实现:壁纸来源解析 + 渐变罩层)、**玻璃内容卡**。
- 深浅色只跟访客**本机偏好**(顶栏主题按钮,缺省跟随系统),**没有站点级主题设置**;前后台共用同一份偏好与同一个 `ThemeProvider`。
- **左侧导航**:固定宽 230px 玻璃面,竖排七项(分类 / 链接 / 搜索引擎 / 站点设置 / 导入导出 / 安全·两步验证 / 系统管理),每项配 Lucide 图标,选中项为玻璃胶囊态。实现是单一 Radix Tabs 根(`orientation="vertical"`,方向键 ↑↓ 切换),不手写 tab 状态机、不做可调分栏。
- **窄屏**:同一个 TabsList 变成内容区顶部 48px 高的横向滚动菜单条(不做抽屉、不做汉堡菜单),七项均可达且页面不横向溢出。
- 列表行 = 可拖拽排序(dnd-kit sortable)+ 显式上下移动按钮(键盘/单指替代,WCAG 2.2 Dragging Movements)。
- 编辑一律用 Dialog 表单(shadcn/ui Form + react-hook-form 模式),不用独立编辑页。

Expand Down
1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-hook-form": "^7.91.0",
"react-resizable-panels": "^4.14.8",
"shadcn": "^4.22.1",
"sonner": "^2.0.8",
"tw-animate-css": "^1.4.0",
Expand Down
Loading
Loading