Skip to content

Commit

Permalink
improve cursor and fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
No0ne003 committed Apr 14, 2024
1 parent bd009cc commit 75adfa6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/components/Cursor.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { motion } from "framer-motion";
import { FaArrowAltCircleRight } from "react-icons/fa";
import { FaArrowRight } from "react-icons/fa";

const Cursor = ({ cursorVariant }) => {
const [mousePosition, setMousePosition] = useState({
Expand All @@ -25,26 +25,26 @@ const Cursor = ({ cursorVariant }) => {

const variants = {
default: {
x: mousePosition.x - 16,
y: mousePosition.y - 16,
scale: 1,
},
text: {
x: mousePosition.x - 75,
y: mousePosition.y - 75,
height: 150,
width: 150,
scale: 3,
},
};

return (
<motion.div
className="cursor max-lg:hidden size-8 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-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-90"
style={{
x: mousePosition.x - 16,
y: mousePosition.y - 16,
}}
variants={variants}
animate={cursorVariant}
>
{cursorVariant === "text" ? (
<p className="mix-blend-darken dark:mix-blend-difference -rotate-45">
<FaArrowAltCircleRight size={50} />
<FaArrowRight size={20} />
</p>
) : null}
</motion.div>
Expand Down

0 comments on commit 75adfa6

Please sign in to comment.