summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/index.js b/client/index.js
index caec5aa..55792c6 100644
--- a/client/index.js
+++ b/client/index.js
@@ -2,5 +2,13 @@ import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';
+const is_iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))
+const is_ipad = (navigator.userAgent.match(/iPad/i))
+const is_android = (navigator.userAgent.match(/Android/i))
+const is_mobile = is_iphone || is_ipad || is_android
+const is_desktop = ! is_mobile
+
+document.body.classList.add(is_desktop ? 'desktop' : 'mobile')
+
ReactDOM.render(<App />, document.getElementById('container'));