fix: rewrite BackgroundBoxes from 225 DOM divs to single canvas element

Root cause: 225 individually animated DOM elements forced Chrome's
compositor to create separate paint regions per element. Any hover
state change on page content triggered re-compositing of all 225
regions, causing visible flickering on all pages.

Canvas fix: single <canvas> element renders the entire grid effect
via requestAnimationFrame. Canvas content is pixel-based and cannot
be affected by DOM hover state changes on other elements.

Additional fixes:
- Fix z-index collision: portal z-index -1 → -2 (was same as body::before noise)
- Replace all transition-all with specific properties on .btn, .btn-icon,
  .input, .nav-item, .bottom-nav-item, checkbox
- Remove backdrop-blur-sm from desktop .bento-card and .card
  (forced Chrome to re-sample animated background pixels on every hover)
This commit is contained in:
Fringg
2026-02-27 08:46:22 +03:00
parent fe32322c32
commit d89c534c0b
3 changed files with 160 additions and 62 deletions

View File

@@ -92,7 +92,7 @@ export function BackgroundRenderer() {
<div
className="pointer-events-none fixed inset-0"
style={{
zIndex: -1,
zIndex: -2,
opacity: effectiveConfig.opacity,
filter: effectiveConfig.blur > 0 ? `blur(${effectiveConfig.blur}px)` : undefined,
contain: 'strict',