Skip to content

Commit b55f78b

Browse files
committed
feat(cursor): opacity 0 for cursor if the cursor leave the body element
1 parent 0217fa4 commit b55f78b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/Cursor.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const Cursor = ({ cursorVariant }) => {
4444

4545
return (
4646
<motion.div
47-
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"
47+
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"
4848
style={{
4949
x: mousePosition.x - 16,
5050
y: mousePosition.y - 16,

src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
body {
6868
@apply bg-background text-foreground font-poppins;
6969
}
70+
#root:hover > .cursor {
71+
opacity: 1
72+
}
7073

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

0 commit comments

Comments
 (0)