mirror of
https://github.com/ILoveBingLu/CipherTalk.git
synced 2026-03-22 07:08:26 +08:00
37 lines
1.1 KiB
HTML
37 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>密语</title>
|
|
<script>
|
|
// 阻塞脚本:在页面渲染前设置主题,防止闪烁
|
|
(function() {
|
|
// 优先从 URL 参数读取(子窗口场景)
|
|
var params = new URLSearchParams(window.location.search);
|
|
var theme = params.get('theme');
|
|
var mode = params.get('mode');
|
|
|
|
// 如果 URL 没有,尝试从 localStorage 读取(主窗口场景)
|
|
if (!theme) {
|
|
try { theme = localStorage.getItem('theme'); } catch(e) {}
|
|
}
|
|
if (!mode) {
|
|
try { mode = localStorage.getItem('themeMode'); } catch(e) {}
|
|
}
|
|
|
|
// 设置默认值
|
|
theme = theme || 'cloud-dancer';
|
|
mode = mode || 'light';
|
|
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
document.documentElement.setAttribute('data-mode', mode);
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|