Azqato's Prompts

Animation Performance

Claude Code Prompt

Fixes pages that make the computer fan spin or grow slower the longer they stay open. Claude measures first: at the top, middle, and bottom of the page and at a phone width, it counts which CSS animations are running while offscreen, including those on ::before and ::after, and checks canvas, WebGL, and physics loops separately, since pausing CSS does not stop a JavaScript loop. For leaks, it records element, canvas, and image counts, then samples again after the page sits idle and after navigating away and back.

It then changes the smallest piece of code that owns each problem: an observer that pauses offscreen sections, a render loop that stops when its canvas leaves the screen and resumes when it returns, and cleanup that releases listeners, timers, observers, WebGL resources, animation-library tweens, and media when a component goes away. The aim is not less motion: visible animations must still play.

It proves the result with the same measurements run again, aiming for zero animations running offscreen, and says plainly what it could not measure.