Skip to content

Commit

Permalink
feat(cursor): opacity 0 for cursor if the cursor leave the body element
Browse files Browse the repository at this point in the history
  • Loading branch information
nuexq committed May 30, 2024
1 parent 0217fa4 commit b55f78b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Cursor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Cursor = ({ cursorVariant }) => {

return (
<motion.div
className="cursor max-lg:hidden size-8 bg-secondary dark:bg-primary fixed rounded-full z-50 pointer-events-none mix-blend-darken dark:mix-blend-difference top-0 left-0 flex justify-center items-center color-black"
className="cursor max-lg:hidden size-8 bg-secondary dark:bg-primary fixed rounded-full z-50 pointer-events-none mix-blend-darken dark:mix-blend-difference top-0 left-0 flex justify-center items-center color-black opacity-0 transition-opacity duration-500 ease"
style={{
x: mousePosition.x - 16,
y: mousePosition.y - 16,
Expand Down
3 changes: 3 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
body {
@apply bg-background text-foreground font-poppins;
}
#root:hover > .cursor {
opacity: 1
}

#root {
@apply h-screen w-screen flex flex-col overflow-x-hidden box-border;
Expand Down

0 comments on commit b55f78b

Please sign in to comment.