This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-01-08 02:04:01 -08:00
|
|
|
const LAYOUT_BREAKPOINT = 1024;
|
|
|
|
|
|
|
|
export function isMobile(width) {
|
|
|
|
return width <= LAYOUT_BREAKPOINT;
|
|
|
|
};
|
2017-03-07 00:54:57 -08:00
|
|
|
|
|
|
|
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
2017-07-27 13:31:59 -07:00
|
|
|
let userTouching = false;
|
|
|
|
|
|
|
|
window.addEventListener('touchstart', () => {
|
|
|
|
userTouching = true;
|
|
|
|
}, { once: true });
|
|
|
|
|
|
|
|
export function isUserTouching() {
|
|
|
|
return userTouching;
|
|
|
|
}
|
2017-03-07 00:54:57 -08:00
|
|
|
|
|
|
|
export function isIOS() {
|
|
|
|
return iOS;
|
|
|
|
};
|