Deploy Patchwise: new name and mark, account pages with the 3D hero and beUI form (React 19, Tailwind 4 alongside Mantine)
8f175f6 verified Download web/src/lib/hooks/use-hover-capable.ts from EnergyVenom/patch-testing-coworker: direct link, hf CLI and curl.
- Browser
- Download file 770 Bytes
-
https://huggingface.co/spaces/EnergyVenom/patch-testing-coworker/resolve/main/web/src/lib/hooks/use-hover-capable.ts
- Command line
-
hf download hf://spaces/EnergyVenom/patch-testing-coworker/web/src/lib/hooks/use-hover-capable.ts
-
curl -L -o use-hover-capable.ts https://huggingface.co/spaces/EnergyVenom/patch-testing-coworker/resolve/main/web/src/lib/hooks/use-hover-capable.ts
770 Bytes
| "use client"; | |
| import { useEffect, useState } from "react"; | |
| /** | |
| * Returns true only on devices that have a true hover (mouse / trackpad). | |
| * Touch devices fire phantom `:hover` on tap that sticks until tap-elsewhere | |
| * — gate hover-only effects (scale lifts, magnetic pulls) behind this. | |
| */ | |
| export function useHoverCapable() { | |
| const [canHover, setCanHover] = useState(false); | |
| useEffect(() => { | |
| if (typeof window === "undefined" || !window.matchMedia) return; | |
| const mq = window.matchMedia("(hover: hover) and (pointer: fine)"); | |
| const update = () => setCanHover(mq.matches); | |
| update(); | |
| mq.addEventListener?.("change", update); | |
| return () => mq.removeEventListener?.("change", update); | |
| }, []); | |
| return canHover; | |
| } | |