import React, { useEffect, useRef } from "react"; export const HUD = () => { const wheel = useRef(); useEffect(() => { const handleMouseMove = (e) => { if (wheel.current) { const { clientX, clientY } = e; const screenWidth = window.innerWidth; const rotation = ((clientX - screenWidth / 2) / screenWidth) * 180; wheel.current.style.left = `${clientX - 100}px`; wheel.current.style.top = `${clientY - 100}px`; wheel.current.style.transform = `rotate(${rotation}deg)`; } }; window.addEventListener("mousemove", handleMouseMove); return () => { window.removeEventListener("mousemove", handleMouseMove); }; }, []); return (
dadasd
logo
steering wheel
); };