Files
aichat/index.html
T
2026-10-16 21:39:08 +08:00

29 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RnB AI Chat</title>
<script>
// 主题预置:bundle 执行前把 <html class="dark"> 落好,避免深色用户看到一帧白闪。
// 与 stores/theme.ts 共用 key 'ai-chat-theme';key 不存在时跟随系统(与 store 规则一致)。
// 这里只「应用」,不「写入」——写入只发生在用户手动切换(stores/theme.ts 的 setTheme)。
try {
var storedTheme = localStorage.getItem('ai-chat-theme')
var isDark =
storedTheme === 'dark' ||
(storedTheme !== 'light' &&
typeof window.matchMedia === 'function' &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
if (isDark) document.documentElement.classList.add('dark')
} catch (error) {
/* 读取失败就按浅色渲染,与 stores/theme.ts 的降级一致 */
}
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>