Capítulo 184 de 411
Browsers pause requestAnimationFrame in background tabs to save battery/CPU, which pauses GSAP's ticker too; this helper keeps GSAP advancing at a reduced rate (~2fps, via a throttled setInterval) while the tab is hidden, using the Page Visibility API to switch modes.
tickGSAPWhileHidden(true) enables it; tickGSAPWhileHidden(false) removes the listener and clears the interval.visibilitychange event: when hidden, disables GSAP's lag smoothing (gsap.ticker.lagSmoothing(0)) and manually calls gsap.ticker.tick() via setInterval; when visible again, restores normal lag smoothing.tickGSAPWhileHidden(true);