0a33a843f8
fix(theme): resolve hydration mismatch in ThemeToggle by deferring icon render until mounted
2026-06-05 17:07:23 +08:00
ccffab851a
fix: admin pages use client-only fetching; fix theme cookie parsing; restore custom skeletons
2026-06-03 14:55:50 +08:00
6b3e086628
feat: read theme from cookie during SSR
2026-06-03 14:38:00 +08:00
61c1ec7282
修复暗色模式:class 变体、状态同步、FOUC 预防、系统偏好
...
- 配置 Tailwind v4 @custom-variant dark 使用 class 模式
- 用 use_context_provider 共享主题状态,修复 AppRouter/ThemeToggle 不同步
- 默认跟随系统偏好(matchMedia),无 localStorage 时自动检测
- 统一暗色标记为 .dark class,移除 data-theme 冗余
- ThemePreload 内联脚本在 DOM 解析前设置 class,消除首屏闪烁
- SVG 内联 + currentColor,图标颜色随主题切换
- Cargo.toml 补充 web-sys MediaQueryList/DomTokenList feature
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:31:06 +08:00
3079f1a505
ThemeToggle:用 SVG 图标替换 emoji,移除灰色背景
...
- 亮色模式使用太阳 SVG 图标
- 暗色模式使用月亮 SVG 图标
- 移除按钮的灰色背景,改为 hover 透明度变化
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:11:44 +08:00
8b3aab21de
恢复首页路由,添加归档/标签/搜索/关于路由占位
...
- router.rs: / 恢复为 HomePage,新增 /archives /tags /search /about
- mod.rs: 导出 home 模块
- theme.rs: ThemeToggle 从浮动按钮改为内联样式
- home.rs: 创建空占位文件
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:31:52 +08:00
5afd8b597c
Fix clippy warnings
...
- Remove unnecessary clone on Copy type (navigator)
- Allow dead_code for THEME_KEY constant
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:51:12 +08:00
14b92c3a89
US-005: 后台页面与路由整合
...
- src/router.rs: Dioxus 路由定义 (/login, /register, /admin, /)
- src/main.rs: 整合所有模块 + server block 启动 dotenvy + session 清理任务
- src/tasks/session_cleanup.rs: 每小时清理过期 session
- 修复编译错误: chrono serde, tokio-postgres chrono, argon2 OsRng
- 移除 server_context 依赖,简化 get_current_user 查询
- Tailwind CSS CDN + darkMode class 配置
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:29:50 +08:00
4a77f2c457
US-004: 前端页面 - 注册与登录
...
- src/pages/register.rs: 注册表单 + 前端验证 + 错误提示
- src/pages/login.rs: 登录表单 + cookie 设置 + 跳转
- src/pages/admin.rs: 认证检查 + 欢迎信息 + 登出
- src/theme.rs: 暗色/亮色主题切换 + localStorage 持久化
- Tailwind CSS CDN + dark: modifier 实现主题
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:24:05 +08:00