const isIphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) const isIpad = (navigator.userAgent.match(/iPad/i)) const isAndroid = (navigator.userAgent.match(/Android/i)) const isMobile = isIphone || isIpad || isAndroid const isDesktop = ! isMobile document.body.classList.add(isMobile ? 'mobile' : 'desktop') const browser = { isIphone, isIpad, isAndroid, isMobile, isDesktop } function clamp(n,a,b){ return n { e.preventDefault(); f(e.touches[0]) }} export { browser, clamp, mod, choice, randint, randrange, firstTouch, }