feat(geek): 极客层 P0 四件套——键盘/构建透明/页面转场/项目墙

- Keyboard:? 帮助浮层 + t 明暗 + g-chords 导航(300ms 缓冲,输入域旁路);
  路由表经 data-routes 注入(module 脚本 currentScript 为 null 的坑)
- BuildInfo:vite.define 四重回退注入 commit/时间,hash 链到 gitea
- ClientRouter 页面转场(reduced-motion 降级在 global.css 总闸)
- ProjectWall:构建时双源拉取(gitea+github)置顶排序+缓存兜底,零运行时 JS
- Header 补主题可视切换钮:键盘 t 的触屏等价物(同 key 同逻辑)

验证: pnpm astro build exit 0;dist 标记 built from×2/kbd-help×4/
      view-transition×2; astro check 未跑(无类型错误构建期可证伪面有限)

Spec: 2026-10-24_add-blog-skeleton
Co-authored-by: GLM-5.3
This commit is contained in:
wait4xandGLM-5.3 committed 2026-10-24 23:13:23 +08:00
1 parent b50eddf2bb
commit 725bfde21f
8 files changed
+324 -2

No files matched your search

+19
View File
@@ -35,11 +35,30 @@ const isCurrent = (href: string) =>
</svg>
</button>
</li>
<!-- 触屏等价物:主题可视切换(与键盘 t / ThemeScript 同一存储 key) -->
<li>
<button class="tap nav-link" type="button" data-theme-toggle aria-label="切换明暗">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
<circle cx="12" cy="12" r="4"></circle>
<path d="M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"></path>
</svg>
</button>
</li>
</ul>
</nav>
</div>
</header>
<script>
// 与 geek/Keyboard.ts 的 t 键同一逻辑与 key,双入口不改行为
document.querySelector('[data-theme-toggle]')?.addEventListener('click', () => {
const root = document.documentElement;
const next = root.dataset.theme === 'dark' ? 'light' : 'dark';
root.dataset.theme = next;
localStorage.setItem('theme', next);
});
</script>
<style>
.site-header {
border-bottom: 1px solid var(--line);