Skip to content

Commit

Permalink
disable custom cursor in the admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
vvhybe committed Oct 9, 2023
1 parent 50adff7 commit f5e52b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/components/Cursor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ const Cursor = memo(({debug=false}) => {
const cursorRef = useRef(null);

useEffect(() => {
// disable the custom cursor in the /admin page
// change the css variable: --cursor-flag to "auto"
if (window.location.pathname.includes("/admin")) {
document.documentElement.style.setProperty("--cursor-flag", "auto");
return;
}


const moveCursor = e => {
const windowHeight = window.innerHeight;
const windowWidth = window.innerWidth;
Expand Down
6 changes: 5 additions & 1 deletion src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
@tailwind components;
@tailwind utilities;

:root{
--cursor-flag: none;
}

*, *::before, *::after {
box-sizing: border-box;
cursor: none !important;
cursor: var(--cursor-flag) !important;
}


Expand Down

0 comments on commit f5e52b8

Please sign in to comment.