upload project source code

This commit is contained in:
2026-04-30 18:49:43 +08:00
commit 9b394ba682
2277 changed files with 660945 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
/**
* 判断当前环境是否使用「电脑端网页」布局(/test-name-live 等页面)。
* - 典型手机 UA始终视为手机端
* - 其余:视口宽度 >= 992px 为电脑端,否则为手机端(含平板竖屏、窄窗口)
*/
export function getIsDesktopLayout(): boolean {
if (typeof window === 'undefined') {
return true;
}
const ua = navigator.userAgent || '';
const isPhoneUA =
/iPhone|iPod|Android.*Mobile|webOS|BlackBerry|IEMobile|Opera Mini/i.test(ua);
if (isPhoneUA) {
return false;
}
return window.innerWidth >= 992;
}