From 0b854ecccfe7832ba9a837605822a103fd9d8bc0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 21 Jun 2017 00:50:15 +0200 Subject: clearing out old code --- client/util.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 client/util.js (limited to 'client/util.js') diff --git a/client/util.js b/client/util.js new file mode 100644 index 0000000..fe8ec35 --- /dev/null +++ b/client/util.js @@ -0,0 +1,10 @@ +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(isDesktop ? 'desktop' : 'mobile') + +export default { isIphone, isIpad, isAndroid, isMobile, isDesktop } + -- cgit v1.2.3-70-g09d2