Skip to content

perf: pause WebGL render loop when tab hidden or window blurred#128

Draft
jubalm wants to merge 1 commit into
mainfrom
fix-raf-visibility
Draft

perf: pause WebGL render loop when tab hidden or window blurred#128
jubalm wants to merge 1 commit into
mainfrom
fix-raf-visibility

Conversation

@jubalm

@jubalm jubalm commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Stops the PerspectiveGridTunnel requestAnimationFrame loop when:

  • Tab is hidden (switch tabs, minimize)
  • Window loses focus (cmd+tab to another app)
  • prefers-reduced-motion: reduce (already handled)

Resumes on visibility/focus. Saves GPU cycles and battery on mobile/backgrounded tabs while preserving the ambient grid effect on all pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant