MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / handleAnimation

Function handleAnimation

src/ts-tailwind/Components/PixelCard/PixelCard.tsx:249–254  ·  view source on GitHub ↗
(name: keyof Pixel)

Source from the content-addressed store, hash-verified

247 };
248
249 const handleAnimation = (name: keyof Pixel) => {
250 if (animationRef.current !== null) {
251 cancelAnimationFrame(animationRef.current);
252 }
253 animationRef.current = requestAnimationFrame(() => doAnimate(name));
254 };
255
256 const onMouseEnter = () => handleAnimation('appear');
257 const onMouseLeave = () => handleAnimation('disappear');

Callers 4

onMouseEnterFunction · 0.70
onMouseLeaveFunction · 0.70
onFocusFunction · 0.70
onBlurFunction · 0.70

Calls 1

doAnimateFunction · 0.70

Tested by

no test coverage detected