Files
auv/index.html
T
Sakurasan 6478e0d403 feat: AI分析单页展示 + 主题切换 + 移动端适配
- AI分析页改为直接展示最新报告,历史存数据库
- 新增浅色/深色/系统自动主题切换
- 市场看板、AI分析页适配主题变量
- 移动端表格可滑动、按钮自动换行
- Mermaid图表支持
- Markdown表格渲染支持(remark-gfm)
2026-09-01 12:33:27 +08:00

65 lines
2.0 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>A股历史走势追踪</title>
<style>
/* 内联样式确保主题色立即生效,避免闪烁 */
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
html.light, html.light body {
background-color: #ffffff !important;
color: #000000;
}
html.dark, html.dark body {
background-color: #1a1a1a !important;
color: #ffffff;
}
</style>
<script>
// 在 React 加载前立即设置主题,避免闪烁
(function() {
function applyThemeToDOM(theme) {
document.documentElement.classList.remove('light', 'dark');
document.documentElement.classList.add(theme);
document.documentElement.setAttribute('data-theme', theme);
}
var isInIframe = window.self !== window.top;
if (isInIframe) {
// 监听父窗口主动推送的主题消息
window.addEventListener('message', function(event) {
if (event.data && typeof event.data.theme === 'string') {
var theme = event.data.theme;
if (theme === 'light' || theme === 'dark') {
applyThemeToDOM(theme);
}
}
});
} else {
// 从 localStorage 读取用户选择
var saved = localStorage.getItem('theme');
var theme;
if (saved === 'light' || saved === 'dark') {
theme = saved;
} else {
// system: 跟随系统偏好
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
applyThemeToDOM(theme);
}
})();
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>