Alright, here’s a performance-optimized version of your viewer, ready to paste into WordPress.
I kept all features (theme toggle, play/pause, fullscreen, helper overlay) but:
-
Stops rendering when the viewer is off-screen
-
✅ Removed backdrop-filter and canvas CSS filter
-
Throttles
ResizeObserver -
✅ Pauses rendering when the tab is hidden
-
✅ Caps
pixelRatiofor smoother scrolling