computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
779 B
33 lines
779 B
export function isAndroid(): boolean { |
|
return ( |
|
typeof navigator !== 'undefined' && /android/i.test(navigator.userAgent) |
|
); |
|
} |
|
|
|
export function isSmallIOS(): boolean { |
|
return ( |
|
typeof navigator !== 'undefined' && /iPhone|iPod/.test(navigator.userAgent) |
|
); |
|
} |
|
|
|
export function isLargeIOS(): boolean { |
|
return ( |
|
typeof navigator !== 'undefined' && |
|
(/iPad/.test(navigator.userAgent) || |
|
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) |
|
); |
|
} |
|
|
|
export function isIOS(): boolean { |
|
return isSmallIOS() || isLargeIOS(); |
|
} |
|
|
|
export function isMobile(): boolean { |
|
return isAndroid() || isIOS(); |
|
} |
|
|
|
export function isMobileScreen(): boolean { |
|
return ( |
|
typeof window !== 'undefined' && (window.innerWidth < 640 || isMobile()) |
|
); |
|
}
|
|
|