From 2bb35da1ba67dc3786fc40f4fd81439e464dde36 Mon Sep 17 00:00:00 2001 From: killerboss Date: Thu, 31 Oct 2024 19:30:51 +0100 Subject: [PATCH] removed support for touch screens --- cursor.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cursor.jsx b/cursor.jsx index 0577dd2..29a7b3d 100644 --- a/cursor.jsx +++ b/cursor.jsx @@ -43,9 +43,11 @@ export function CursorProvider ({ hidden, enabled, children }) { }; }, []); + const isTouchDevice = "ontouchstart" in window; + useEffect(() => { const htmlElement = document.documentElement; - if (isCursorEnabled) { + if (isCursorEnabled & !isTouchDevice) { htmlElement.classList.add('custom-cursor-enabled-env'); } else { htmlElement.classList.remove('custom-cursor-enabled-env'); @@ -55,7 +57,7 @@ export function CursorProvider ({ hidden, enabled, children }) { return ( <> - {isCursorEnabled ? + {isCursorEnabled & !isTouchDevice ?