This file contains hidden or 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
| // You must place this file in a Next.js App Router project. | |
| // This is now a client component to allow for hooks and event listeners. | |
| 'use client'; | |
| import React, { useRef, useEffect } from 'react'; | |
| // --- Custom Hook for Mouse Position --- | |
| // This hook tracks the mouse's position relative to the center of an element | |
| // and updates a CSS custom property '--angle' to be used in styles. | |
| const useMousePosition = (elementRef: React.RefObject<HTMLElement>) => { |