summaryrefslogtreecommitdiff
path: root/2024-06-18-guix-social/reveal.js/js/utils/device.js
diff options
context:
space:
mode:
Diffstat (limited to '2024-06-18-guix-social/reveal.js/js/utils/device.js')
-rw-r--r--2024-06-18-guix-social/reveal.js/js/utils/device.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/2024-06-18-guix-social/reveal.js/js/utils/device.js b/2024-06-18-guix-social/reveal.js/js/utils/device.js
new file mode 100644
index 0000000..f2bce20
--- /dev/null
+++ b/2024-06-18-guix-social/reveal.js/js/utils/device.js
@@ -0,0 +1,8 @@
+const UA = navigator.userAgent;
+
+export const isMobile = /(iphone|ipod|ipad|android)/gi.test( UA ) ||
+ ( navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 ); // iPadOS
+
+export const isChrome = /chrome/i.test( UA ) && !/edge/i.test( UA );
+
+export const isAndroid = /android/gi.test( UA ); \ No newline at end of file