Files
MailUI4Agents/client/electron/index.html

42 lines
1.5 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, viewport-fit=cover, interactive-widget=resizes-content" />
<title>AgentMail</title>
<script>
/*
* 首帧防闪屏。
*
* JS bundle 有几百 KB从 HTML 解析完到 React 挂载之间有一段空窗 ——
* 那段时间里页面是 body 的默认底色。深色偏好的用户会被闪一下白屏,
* 而且是每次刷新都闪。
*
* 这段脚本必须**内联且同步**:外链或 defer 都会晚于首次绘制。
* 逻辑与 themeStore 的 readStored/resolveTheme 一致,
* 改那边的键名或取值时这里要同步。
*/
(function () {
try {
var p = localStorage.getItem('agentmail.theme') || 'system';
var dark =
p === 'dark' ||
(p === 'system' &&
window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches);
if (dark) {
document.documentElement.classList.add('dark');
document.documentElement.style.colorScheme = 'dark';
}
} catch (e) {
/* localStorage 不可用(隐私模式)时退回浅色,不阻塞渲染 */
}
})();
</script>
</head>
<body class="bg-gray-50 text-gray-900 antialiased">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>