MCPcopy Create free account
hub / github.com/code100x/daily-code / handlePointerMove

Function handlePointerMove

apps/web/components/use-follow-pointer.ts:15–22  ·  view source on GitHub ↗
({ clientX, clientY }: MouseEvent)

Source from the content-addressed store, hash-verified

13 if (!ref.current) return;
14
15 const handlePointerMove = ({ clientX, clientY }: MouseEvent) => {
16 const element = ref.current!;
17
18 frame.read(() => {
19 xPoint.set(clientX - element.offsetLeft - element.offsetWidth / 4);
20 yPoint.set(clientY - element.offsetTop - element.offsetHeight / 4);
21 });
22 };
23
24 window.addEventListener("pointermove", handlePointerMove);
25

Callers

nothing calls this directly

Calls 1

setMethod · 0.65

Tested by

no test coverage detected