Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ui/index.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AITokenPool</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%234ecdc4'/%3E%3Cstop offset='1' stop-color='%232a9d8f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='64' height='64' rx='14' fill='url(%23g)'/%3E%3Ctext x='32' y='43' font-family='-apple-system,Segoe UI,Arial,sans-serif' font-size='30' font-weight='800' text-anchor='middle' fill='%23062021'%3EAT%3C/text%3E%3C/svg%3E">
<link rel="stylesheet" href="css/style.css?v=20260824-11">
<link rel="stylesheet" href="css/style.css?v=20260824-12">
</head>
<body>

Expand DownExpand Up@@ -683,9 +683,9 @@ <h3 id="chat-title">使用模型</h3>
</div>
</div>

<script src="js/api.js?v=20260824-11"></script>
<script src="js/data.js?v=20260824-11"></script>
<script src="js/i18n.js?v=20260824-11"></script>
<script src="js/app.js?v=20260824-11"></script>
<script src="js/api.js?v=20260824-12"></script>
<script src="js/data.js?v=20260824-12"></script>
<script src="js/i18n.js?v=20260824-12"></script>
<script src="js/app.js?v=20260824-12"></script>
</body>
</html>
18 changes: 16 additions & 2 deletions ui/js/app.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -1280,8 +1280,15 @@
const nm = Math.max(absMax, 1e-9) / np;
const maxV = Math.max((nm <= 1 ? 1 : nm <= 2 ? 2 : nm <= 5 ? 5 : 10) * np, 4);
const minV = neg ? -maxV : 0;
// 紧凑几何(rant 10:51:57.821928:高 170 → 85 减半,无网格预留边距)
const W = 640, H = 85, PL = 32, PR = 8, PT = 6, PB = 14;
// 紧凑几何 + 动态 viewBox(rant 2026-08-24T14:29:57 真正根因):SVG width:100% 在宽容器
// 会被等比放大 ~2.4x(1534px 容器 / 640 viewBox → canvasScale 2.397),使 CSS 像素
// (stroke-width 1.4 / font-size 8px)实际渲染 ≈3.4px / ≈19px——v0.7.15→v0.7.16 调细后
// "看起来没变化"即被此放大吞掉。修复:viewBox 宽 = 容器宽 → 1 viewBox 单位 ≈ 1 物理像素,
// 线宽/字号按 CSS 值真实呈现;窄屏(容器 ≤ 设计宽 640)保持 s=1 原样等比缩小,避免变形。
const DW = 640, DH = 85;
const cw = el.clientWidth - 32; // .tx-trend 水平 padding 16px*2 → svg 实际可用宽
const s = Math.max(1, (cw > 0 ? cw : DW) / DW);
const W = DW * s, H = DH * s, PL = 32 * s, PR = 8 * s, PT = 6 * s, PB = 14 * s;
const iw = W - PL - PR, ih = H - PT - PB;
const X = (i) => PL + (buckets.length === 1 ? iw / 2 : iw * i / (buckets.length - 1));
const Y = (v) => PT + ih * (maxV - v) / (maxV - minV || 1);
Expand DownExpand Up@@ -3259,6 +3266,13 @@
if (tip) tip.style.display = "none";
if (guide) guide.style.display = "none";
});
// 窗口 resize → 重渲染趋势图(动态 viewBox 需跟随容器宽度,debounce 防抖;视图隐藏时跳过)
let _txTrendResizeT = null;
window.addEventListener("resize", () => {
if (txTrendEl.offsetParent === null) return;
clearTimeout(_txTrendResizeT);
_txTrendResizeT = setTimeout(renderTxTrend, 120);
});
}

// 表格键盘导航(rant 20:46:57 F):点击行 → 激活高亮,之后 ↑/↓/Enter/Esc 可用
Expand Down
Loading