removed support for touch screens

This commit is contained in:
killerboss 2024-10-31 19:30:51 +01:00
parent d0b92e6a49
commit 2bb35da1ba

View file

@ -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 (
<>
<CursorContext.Provider value={{isCustomCursorHidden: isCursorHidden, isCustomCursorEnabled: isCursorEnabled, toggleCursor, toggleCursorEnabled}}>
{isCursorEnabled ?
{isCursorEnabled & !isTouchDevice ?
<div
ref={cursorRef}
className={`pointer-events-none fixed top-0 left-0 ${isCursorHidden || !isCursorEnabled || !isCursorInViewport ? 'invisible' : ''} w-10 h-10 bg-white rounded-full z-50 mix-blend-difference`}