Communitygithub.com

Mattttfb/animation-engineering

Expert guidance, patterns, and code implementations for creating fluid, high-performance animations, micro-interactions, layout transitions, and motion design across web (CSS, Framer Motion, GSAP, Three.js, Canvas), mobile, and desktop applications. Activate whenever the user requests animations, transitions, motion graphics, interactive UI effects, or dynamic visual feedback.

What is animation-engineering?

animation-engineering is a Claude Code agent skill that expert guidance, patterns, and code implementations for creating fluid, high-performance animations, micro-interactions, layout transitions, and motion design across web (CSS, Framer Motion, GSAP, Three.js, Canvas), mobile, and desktop applications. Activate whenever the user requests animations, transitions, motion graphics, interactive UI effects, or dynamic visual feedback.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Mattttfb/antigravity-animation-toolkit/tree/HEAD/skills/animation-engineering

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Animation Engineering & Motion Craft

This skill equips the agent with industry-standard practices, production-ready patterns, and mathematical physics models to design and code fluid, performant animations across web and application interfaces.


1. Golden Rules of Motion Performance

  1. Animate ONLY Composite Properties:
    • Always prefer transform (translate3d, scale, rotate) and opacity.
    • NEVER animate geometry properties (width, height, top, left, margin, padding) unless using the FLIP technique (First, Last, Invert, Play). Animating geometry triggers expensive layout recalculations (Reflow) and Paint on the CPU.
  2. Promote to GPU Responsibly:
    • Use will-change: transform, opacity; only on actively animated elements, and remove it after animation completes if memory is constrained.
    • Force GPU layer composition with transform: translateZ(0) or backface-visibility: hidden when needed.
  3. Respect User Accessibility:
    • Always support @media (prefers-reduced-motion: reduce):
      @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
          animation-duration: 0.01ms !important;
          animation-iteration-count: 1 !important;
          transition-duration: 0.01ms !important;
          scroll-behavior: auto !important;
        }
      }
      
  4. Natural Timing & Durations:
    • Micro-interactions (button press, toggle, tooltip): 100ms - 200ms
    • Standard transitions (dropdowns, dialogs, drawers, cards): 200ms - 350ms
    • Complex scene transitions / page transitions: 350ms - 500ms
    • Animations longer than 500ms feel sluggish unless they are continuous atmospheric background loops or narrative storytelling.

2. Technology Selection Matrix

Scenario / NeedRecommended ToolWhy?
Simple hover, focus, active states, fade/slideCSS Transitions & @keyframes or Tailwind CSSZero JavaScript overhead, 120 FPS hardware acceleration.
React / Next.js UI, Modals, Shared Layout TransitionsFramer Motion (motion)Declarative API, spring physics, automatic FLIP (layoutId), AnimatePresence.
Complex Timelines, SVG Morphing, Scroll-driven UIGSAP (GreenSock) + ScrollTriggerUnmatched choreography control, precise scrubbing, cross-browser consistency.
3D Experiences, Particle Networks, ShadersThree.js / React Three Fiber / Canvas 2DDirect WebGL GPU rendering for hundreds of thousands of particles.
Vector Motion Graphics & Character IllustrationsLottie / dotLottie / RiveTiny JSON/binary payloads, scalable vector fidelity, interactive state machines.

3. Motion Curves (Easing Tokens)

Never use linear for UI movement unless simulating a constant-speed conveyor belt or infinite spinning loader. Natural movement accelerates and decelerates:

  • Snappy Entrance (Standard UI pop/open): cubic-bezier(0.16, 1, 0.3, 1) (Expo Out - fast initial burst, smooth deceleration)
  • Smooth Exit (Dismiss/close): cubic-bezier(0.7, 0, 0.84, 0) (Expo In - accelerates off screen)
  • Natural Dynamic / Emphasized: cubic-bezier(0.34, 1.56, 0.64, 1) (Subtle overshoot bounce)
  • Spring Physics (Preferred for touch & drag):
    • Stiffness: 300 - 400
    • Damping: 25 - 35
    • Mass: 0.8 - 1.0

4. Deep Guides & References

For comprehensive code patterns and detailed walkthroughs, consult the references:


5. Verification Checklist

When building animated components:

  • Are animations smooth (60-120 FPS) without stutter or frame drops?
  • Are layout shifts (CLS) avoided during animation?
  • Are exit animations properly awaited before element unmount?
  • Does the UI handle rapid clicking/tapping without glitching (interruptible animations)?
  • Is prefers-reduced-motion implemented?

Related Skills