'use client'; import React, { useEffect, useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { useRecordMode } from './RecordModeContext'; export function PlaybackCursor() { const { isPlaying, cursorPosition, isClicking } = useRecordMode(); const [scrollOffset, setScrollOffset] = useState({ x: 0, y: 0 }); // Track scroll so cursor stays locked to the correct element useEffect(() => { if (!isPlaying) return; const handleScroll = () => { setScrollOffset({ x: window.scrollX, y: window.scrollY }); }; handleScroll(); // Init window.addEventListener('scroll', handleScroll, { passive: true }); return () => window.removeEventListener('scroll', handleScroll); }, [isPlaying]); if (!isPlaying) return null; return ( {isClicking && ( )} {/* Outer Pulse Ring */}
{/* Visual Cursor */}
{/* Soft Glow */}
{/* Pointer Arrow */}
); }