This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { m } from "framer-motion"; | |
import React, { useEffect, useState } from "react"; | |
const CustomCursor: React.FC<{ cursorElement: JSX.Element }> = ({ | |
cursorElement, | |
}) => { | |
const [mousePosition, setMousePosition] = useState({ x: -100, y: -100 }); | |
const onMouseMove = (e: MouseEvent) => { | |
if (!e.target) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef } from "react"; | |
export default function useIntersectionObserver( | |
el: HTMLElement | null, | |
callback: (entry: IntersectionObserverEntry) => void, | |
options: IntersectionObserverInit & { | |
enabled: boolean; | |
} = { | |
root: null, | |
threshold: 0.4, |