Skip to content

Commit

Permalink
i
Browse files Browse the repository at this point in the history
  • Loading branch information
i1li committed Jul 23, 2024
1 parent ec359cf commit af99569
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/detect-mobile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Detect if user is viewing from mobile device
function detectMobile() {
const isMobile = (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) ||
(window.matchMedia && window.matchMedia("(max-width: 768px)").matches) ||
const isMobile = (window.matchMedia("(orientation: portrait)").matches) ||
(window.innerHeight > window.innerWidth) ||
/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|windows phone|kindle|playbook|silk|mobile|tablet|samsung|lg|htc|nokia|motorola|symbian|fennec|maemo|tizen|blazer|series60|ucbrowser|bada|micromessenger|webview/.test(navigator.userAgent.toLowerCase());
return !isMobile;
}

0 comments on commit af99569

Please sign in to comment.