Mobile scroll perf: cut paint cost and re-render rate

Mobile scrolling was janky from a stack of expensive paint passes
running every frame. This pass:

- CSS: hide .grain (SVG feTurbulence is the single biggest cost),
  drop mix-blend-mode on .haze/.smoke-puff, drop backdrop-filter on
  .cmd-box, hide the blurred arm-glow, and remove blur filters from
  chip-glow / conveyor-pulse / scan-tear under <=760px.
- JSX: capture an IS_MOBILE flag once at boot. On mobile, halve
  smoke puffs / chimneys / sparks / chip-pulse dots / embers, and
  switch GSAP scrub from 0.6 (rAF interpolation) to true (direct
  scroll-tied) — which is cheaper and more responsive.
- HUD: gate setProgress() on a changed integer depth (0..100) so we
  re-render at most ~100 times per full scroll instead of every frame.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-03 03:09:44 +08:00
parent 277d161a95
commit dbe965d0e9
3 changed files with 43 additions and 9 deletions

View File

@@ -9,7 +9,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600&family=VT323&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="styles.css?v=20260503-mobile" />
<link rel="stylesheet" href="styles.css?v=20260503-mobile2" />
<!-- Preload background images -->
<link rel="preload" as="image" href="assets/exterior-factory.png" />
@@ -28,6 +28,6 @@
<script src="https://unpkg.com/gsap@3.12.5/dist/gsap.min.js"></script>
<script src="https://unpkg.com/gsap@3.12.5/dist/ScrollTrigger.min.js"></script>
<script type="text/babel" src="app.jsx?v=20260503-mobile"></script>
<script type="text/babel" src="app.jsx?v=20260503-mobile2"></script>
</body>
</html>