UNPKG

@xeokit/xeokit-sdk

Version:

3D BIM IFC Viewer SDK for AEC engineering applications. Open Source JavaScript Toolkit based on pure WebGL for top performance, real-world coordinates and full double precision

18 lines (16 loc) 569 B
const os = { isIphoneSafari() { const userAgent = window.navigator.userAgent; const isIphone = /iPhone/i.test(userAgent); const isSafari = /Safari/i.test(userAgent) && !/Chrome/i.test(userAgent); return isIphone && isSafari; }, isTouchDevice() { return ( 'ontouchstart' in window || //works for most devices navigator.maxTouchPoints > 0 || //works for modern touch devices navigator.mxMaxTouchPoints > 0 //works for older microsoft touch devices ) } }; export { os };