mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 21:24:16 +08:00
- lib/theme.ts: localStorage 持久化 + useTheme hook (本页/跨标签页
同步) + ChartTheme 图表调色板 (ECharts/lightweight-charts 画布
不吃 CSS 变量, 统一从这里取色)
- index.html: 去掉写死的 class=dark, 换预渲染内联脚本 (默认暗色,
切过亮色则保持), 避免首屏闪烁
- Layout: 侧边栏底部亮/暗切换按钮 (设置入口上方)
- 图表主题化 (切换即时生效, 无需刷新):
· EChartsIntraday / EChartsCandlestick / CandlestickChart
(lightweight-charts applyOptions) / AnalysisKChart
· 回测 4 图 (StrategyNav/FactorIC/FactorGroupNav/ReturnDistribution)
· Sentiment 页双图
序列颜色 (红涨绿跌/MA线) 双主题通用保持不变; 轴/网格/十字线/
tooltip/信息栏背景按主题切换
CSS 变量亮色板 index.css 里本就有 (:root), 首次真正启用
33 lines
1.3 KiB
HTML
33 lines
1.3 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<script>
|
|
// 预渲染主题脚本: 首屏前设置 html.dark, 避免亮暗闪烁 (FOUC)。
|
|
// 默认暗色; 用户切过亮色后 (localStorage tf-theme=light) 保持亮色。
|
|
(function () {
|
|
try {
|
|
if (localStorage.getItem('tf-theme') !== 'light') {
|
|
document.documentElement.classList.add('dark')
|
|
}
|
|
} catch (e) {
|
|
document.documentElement.classList.add('dark')
|
|
}
|
|
})()
|
|
</script>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
<meta name="theme-color" content="#8B5CF6" />
|
|
<title>TickFlow Stock Panel · Quant Terminal</title>
|
|
<link rel="preconnect" href="https://rsms.me/" />
|
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
|
</head>
|
|
<body class="bg-base text-foreground">
|
|
<div id="root"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|