diff options
Diffstat (limited to 'animism-align/frontend/app/utils')
| -rw-r--r-- | animism-align/frontend/app/utils/index.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/animism-align/frontend/app/utils/index.js b/animism-align/frontend/app/utils/index.js index 0ed8898..4519861 100644 --- a/animism-align/frontend/app/utils/index.js +++ b/animism-align/frontend/app/utils/index.js @@ -16,7 +16,7 @@ export const isiPhone = !!((navigator.userAgent.match(/iPhone/i)) || (navigator. export const isiPad = !!(navigator.userAgent.match(/iPad/i)) export const isAndroid = !!(navigator.userAgent.match(/Android/i)) export const isMobile = isiPhone || isiPad || isAndroid -export const isHandheld = isiPhone || isAndroid +export const isHandheld = isiPhone || (isAndroid && window.innerWidth <= 640) export const isTablet = isMobile && window.innerWidth > 640 export const isDesktop = !isMobile @@ -94,6 +94,7 @@ export const px = (n, w) => Math.round(n * w) + 'px' export const clamp = (n, a=0, b=1) => n < a ? a : n < b ? n : b export const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)) +export const xor = (a,b) => ((!a && !!b) || (!!a && !b)) export const mod = (n, m) => n - (m * Math.floor(n / m)) export const angle = (x1, y1, x2, y2) => Math.atan2(y2 - y1, x2 - x1) export const lerp = (n,a,b) => (b-a)*n+a |
