{
+ boundingRef.current = null;
+ }}
+ onMouseEnter={(ev) => {
+ boundingRef.current = ev.currentTarget.getBoundingClientRect();
+ }}
+ onMouseMove={(ev) => {
+ if (!boundingRef.current) return;
+ const x = ev.clientX - boundingRef.current.left;
+ const y = ev.clientY - boundingRef.current.top;
+ const xPercentage = x / boundingRef.current.width;
+ const yPercentage = y / boundingRef.current.height;
+ const xRotation = (xPercentage - 0.5) * 20;
+ const yRotation = (0.5 - yPercentage) * 20;
+
+ ev.currentTarget.style.setProperty("--x-rotation", `${yRotation}deg`);
+ ev.currentTarget.style.setProperty("--y-rotation", `${xRotation}deg`);
+ ev.currentTarget.style.setProperty("--x", `${xPercentage * 100}%`);
+ ev.currentTarget.style.setProperty("--y", `${yPercentage * 100}%`);
+ }}
+ className="group relative w-full flex flex-col gap-6 py-6 items-center overflow-hidden rounded-md bg-gradient-to-b from-[#EAFFED] to-[#C6F7C9] p-4 text-[#01A977] transition-transform ease-out hover:[transform:rotateX(var(--x-rotation))_rotateY(var(--y-rotation))_scale(1.05)]"
+ >
+
+
+
+