From 1fd2213192d22880706440e7f724bdc6db966ee0 Mon Sep 17 00:00:00 2001 From: Juan Marin Noguera Date: Tue, 22 Aug 2023 17:56:56 +0200 Subject: Añadida presentación MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- present/js/utils/device.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 present/js/utils/device.js (limited to 'present/js/utils/device.js') diff --git a/present/js/utils/device.js b/present/js/utils/device.js new file mode 100644 index 0000000..f2bce20 --- /dev/null +++ b/present/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 -- cgit v1.2.3