This commit is contained in:
2026-02-16 19:34:35 +00:00
commit 9ab0940ca4
784 changed files with 41710 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
export function detectDevice() {
const ua = navigator.userAgent.toLowerCase();
const isTouch = navigator.maxTouchPoints > 1;
const width = screen.width;
if (/tablet|ipad/.test(ua)) return 'Tablet';
if (/mobile|iphone|ipod|android/.test(ua)) return 'Mobile';
if (isTouch && width < 768) return 'Mobile';
if (isTouch && width >= 768 && width <= 1280) return 'Tablet';
return 'Desktop';
}