mirror of
https://github.com/shy3130/tick-stock-panel.git
synced 2026-11-02 02:16:13 +00:00
49 lines
1.9 KiB
HTML
49 lines
1.9 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>Tick Stock Panel · Quant Terminal</title>
|
|
<!-- 字体已自托管 (@fontsource, 见 main.tsx), 不再引用第三方 CDN 样式表 -->
|
|
</head>
|
|
<body class="bg-base text-foreground">
|
|
<div id="root"></div>
|
|
<script>
|
|
// 预渲染缩放脚本: #root transform scale (方案详见 src/lib/pageZoom.ts —
|
|
// 不用 CSS zoom, zoom≠1 会让 ECharts 鼠标命中偏移)。
|
|
// 放在 #root 之后、main.tsx (module 延迟执行) 之前: 首帧绘制前生效, 无尺寸跳变。
|
|
(function () {
|
|
var z = 1
|
|
try {
|
|
var raw = localStorage.getItem('tf-page-zoom')
|
|
var v = raw == null ? 1 : JSON.parse(raw)
|
|
if (typeof v === 'number' && v >= 0.8 && v <= 1.5) z = v
|
|
} catch (e) { /* 解析失败保底不缩放 */ }
|
|
if (z !== 1) {
|
|
var root = document.getElementById('root')
|
|
root.style.transformOrigin = '0 0'
|
|
root.style.transform = 'scale(' + z + ')'
|
|
root.style.width = (100 / z) + '%'
|
|
root.style.height = (100 / z) + '%'
|
|
}
|
|
})()
|
|
</script>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|