Add tablet viewport fit for hub one-screen layout.

Hi-DPI tablets like 2560x1600 map to ~1280x800 CSS; broaden fit breakpoints and densify for hub-tablet.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-16 13:09:29 +08:00
parent 836b37cc7e
commit 2777419a10
4 changed files with 153 additions and 9 deletions
+16 -5
View File
@@ -72,8 +72,24 @@
const HUB_PHONE_PRIMARY = { monitor: 1, market: 1, calculator: 1, ai: 1 };
/** 窄屏布局:仅按视口宽度,监控区/行情等共用 */
function isMobileLayout() {
return window.matchMedia("(max-width: 720px)").matches;
}
/** 平板 CSS 视口(如 2560×1600 @2x ≈ 1280×800),或高度偏矮的大屏 */
function isTabletLayout() {
if (isMobileLayout()) return false;
const w = window.innerWidth || 0;
const h = window.innerHeight || 0;
if (w >= 721 && w <= 1599) return true;
if (w >= 721 && h > 0 && h <= 920) return true;
return false;
}
function syncHubPhoneShellClass() {
document.body.classList.toggle("hub-phone", isMobileLayout());
document.body.classList.toggle("hub-tablet", isTabletLayout());
}
function closeHubMobileMore() {
@@ -1602,11 +1618,6 @@
return (settingsCache?.exchanges || []).filter((x) => x.enabled);
}
/** 窄屏布局:仅按视口宽度,监控区/行情等共用 */
function isMobileLayout() {
return window.matchMedia("(max-width: 720px)").matches;
}
/** AI 教练手机布局:窄屏或手机 PWA(桌面安装的 App 仍走桌面布局) */
function isMobileAiLayout() {
if (isMobileLayout()) return true;