removed support for touch screens
This commit is contained in:
parent
d0b92e6a49
commit
2bb35da1ba
1 changed files with 4 additions and 2 deletions
|
@ -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`}
|
||||
|
|
Loading…
Reference in a new issue