import { useEffect, useState } from 'react';

export const useDepth3DAnimation = () => {
  const [perspective, setPerspective] = useState(1000);

  useEffect(() => {
    const handleMouseMove = (e: MouseEvent) => {
      const x = e.clientX / window.innerWidth;
      const y = e.clientY / window.innerHeight;
      const newPerspective = 1000 - (x + y) * 200;
      setPerspective(Math.max(800, newPerspective));
    };

    window.addEventListener('mousemove', handleMouseMove);
    return () => window.removeEventListener('mousemove', handleMouseMove);
  }, []);

  return { perspective };
};
