Fix desktop blur from false tablet layout.

Stop classifying short desktop viewports as tablets so densify fonts do not apply.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-16 13:35:41 +08:00
parent 57dad1ffdf
commit 480f6d78e8
3 changed files with 35 additions and 4 deletions
+9 -3
View File
@@ -77,13 +77,19 @@
return window.matchMedia("(max-width: 720px)").matches;
}
/** 平板 CSS 视口(如 2560×1600 @2x ≈ 1280×800),或高度偏矮的大屏 */
/**
* 平板 CSS 视口(如 2560×1600@2x≈1280×800, 竖屏≈800×1280)。
* 禁止「仅按高度」判断:1080p 电脑开任务栏/浏览器栏时 innerHeight 常 ≤920,
* 会误加 hub-tablet,字号被压到 ~10px,看起来发糊。
*/
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;
// 横屏平板:中等宽度 + 偏矮
if (w >= 721 && w <= 1366 && h > 0 && h <= 900) return true;
// 竖屏平板:偏窄 + 偏高
if (w >= 721 && w <= 920 && h >= 900) return true;
return false;
}
+1 -1
View File
@@ -1327,6 +1327,6 @@
<script src="/assets/options_expiry_countdown.js?v=1"></script>
<script src="/assets/options_position_cards.js?v=1"></script>
<script src="/assets/backup.js?v=1"></script>
<script src="/assets/app.js?v=20260716-hub-fit-tablet"></script>
<script src="/assets/app.js?v=20260716-hub-desktop-clear"></script>
</body>
</html>