Compositor-friendly properties, zero-re-render pointer tracking, and RAF lifecycle cleanup.
MotionFoundry enforces strict performance budgets across all 48 components:
- Compositor-Only Keyframes: Continuous animations animate
transform,opacity,clip-path, orbackground-positionrather than layout-thrashing properties. - Zero React State Re-Renders on Pointer Move:
VelocityButtonandLiquidGlassCardupdate CSS variables (el.style.setProperty) directly without callingsetStateon every mousemove frame. - Deterministic Listener & RAF Cleanup:
ConstellationCardandOrbitingParticlescap particle counts and cancelrequestAnimationFrameandresizelisteners on unmount.
// Zero-re-render pointer tracking in LiquidGlassCardconst handlePointerMove = (e: React.PointerEvent<HTMLDivElement>) => { const el = cardRef.current; if (!el) return; const rect = el.getBoundingClientRect(); el.style.setProperty("--mf-lg-x", `${e.clientX - rect.left}px`); el.style.setProperty("--mf-lg-y", `${e.clientY - rect.top}px`);};