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

Function handleAnimation

src/ts-default/Components/PixelCard/PixelCard.tsx:250–255  ·  view source on GitHub ↗
(name: keyof Pixel)

Source from the content-addressed store, hash-verified

248 };
249
250 const handleAnimation = (name: keyof Pixel) => {
251 if (animationRef.current !== null) {
252 cancelAnimationFrame(animationRef.current);
253 }
254 animationRef.current = requestAnimationFrame(() => doAnimate(name));
255 };
256
257 const onMouseEnter = () => handleAnimation('appear');
258 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