fixing-motion-performance

Audit UI animations and optimize transforms to reduce layout thrashing.

160|16|Updated Dec 4, 2024
One-click install
npx skills add https://github.com/MaggieAppleton/maggieappleton.com-V3 --skill fixing-motion-performance-maggieappleton
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/MaggieAppleton/maggieappleton.com-V3/tree/main/.claude/skills/animation/fixing-motion-performance
Command: npx skills add https://github.com/MaggieAppleton/maggieappleton.com-V3 --skill fixing-motion-performance-maggieappleton

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

UI animations often suffer from layout thrashing and jank, leading to glitchy interactions and poor user experience. This Skill provides a structured approach to auditing and fixing motion performance, focusing on transforms, compositor properties, scroll-linked motion, and restrained blur effects to deliver smoother interfaces.

Core Features & Use Cases

  • Diagnose and fix layout thrash by batching reads/writes and preferring transform/opacity-based animations.
  • Apply safe scroll-linked motion techniques using view timelines and IntersectionObserver while minimizing re-paints on large surfaces.
  • Use during design reviews or code refactors to improve perceived performance of interactive UI elements and transitions.

Quick Start

Audit a UI animation and apply the constraints to reduce layout thrashing and switch to transform and opacity.

Frequently Asked Questions about fixing-motion-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix layout thrashing and reduce jank in UI animations?

Fix layout thrashing by batching DOM measurement reads and write operations to prevent forced reflows, and reduce jank by animating only transform and opacity properties to keep motion on the compositor.

What is the best way to apply will-change for performant UI motion?

Apply will-change sparingly only to elements actively undergoing transform or opacity animations, ensuring safe performant motion without exhausting browser memory or causing excessive compositing layers.

How do I implement smooth scroll-linked motion without causing re-paints?

Implement smooth scroll-linked motion using view timelines and IntersectionObserver, ensuring scroll-driven animations target compositor properties to minimize re-paints on large surfaces.

Can I optimize CSS and WAAPI animations without migrating to a different library?

Yes, you can optimize CSS and Web Animations API (WAAPI) motion by applying constraints around compositor properties and measurement batching, ensuring safe performant motion without migrating libraries.

When should I audit UI animation performance during the development lifecycle?

Audit UI animation performance during design reviews, code refactors, and runtime UI audits to proactively diagnose layout thrashing and eliminate jank before production deployment.