mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-27 20:06:52 +00:00
30 lines
753 B
TypeScript
30 lines
753 B
TypeScript
|
"use client"
|
||
|
|
||
|
import { useEffect, useState } from "react"
|
||
|
|
||
|
export default function MouseMoveEffect() {
|
||
|
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 })
|
||
|
|
||
|
useEffect(() => {
|
||
|
const handleMouseMove = (event: MouseEvent) => {
|
||
|
setMousePosition({ x: event.clientX, y: event.clientY })
|
||
|
}
|
||
|
|
||
|
window.addEventListener("mousemove", handleMouseMove)
|
||
|
|
||
|
return () => {
|
||
|
window.removeEventListener("mousemove", handleMouseMove)
|
||
|
}
|
||
|
}, [])
|
||
|
|
||
|
return (
|
||
|
<div
|
||
|
className="pointer-events-none fixed inset-0 z-30 transition-opacity duration-300"
|
||
|
style={{
|
||
|
background: `radial-gradient(600px at ${mousePosition.x}px ${mousePosition.y}px, rgba(29, 78, 216, 0.15), transparent 80%)`,
|
||
|
}}
|
||
|
/>
|
||
|
)
|
||
|
}
|
||
|
|