perf: pause GradientBlinds animation when off-screen
Removes the unconditional start of the animation loop on mount. The loop is now exclusively managed by the existing IntersectionObserver, ensuring it only runs when the component is visible. Updates tests to reflect this behavior by simulating intersection events to trigger the animation.
This commit is contained in:
@@ -349,8 +349,6 @@ void main() {
|
||||
});
|
||||
observer.observe(container);
|
||||
|
||||
rafRef.current = requestAnimationFrame(loop);
|
||||
|
||||
return () => {
|
||||
if (rafRef.current) cancelAnimationFrame(rafRef.current);
|
||||
canvas.removeEventListener('pointermove', onPointerMove);
|
||||
|
||||
Reference in New Issue
Block a user