initial commit
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user