All products

Animate Vue components with AI and GSAP

Keep animation setup and cleanup tied to a component so several instances can share a page safely.

You can animate Vue components with AI and GSAP when each instance needs to control its own elements. A page might contain several product galleries using the same class names. Opening the second gallery should animate its photographs alone. The gsap-frameworks skill shows a coding agent how to scope selectors to the mounted component and clean up its context on removal.

A route change is a useful test. Returning to a page can expose an old scroll trigger that survived the previous visit. The guide also discusses browser-only work in Nuxt and lifecycle patterns for Svelte.

What it does

  • Animate a gallery after its DOM elements exist.
  • Give two component instances independent motion scopes.
  • Revert the previous context when a component unmounts.
  • Restrict browser-dependent animation setup to the client.
  • Identify when a changed collection needs a fresh setup.

Install and use

  1. Use an authorised Vue, Nuxt or Svelte project with the official GSAP package installed. Give the agent the component and a relevant route.
  2. Ask it to animate only a selected gallery and remove that instance’s scroll triggers on exit.
  3. Visit another route and return, then check that the interaction runs exactly once.

FAQ

Source

Made by GreenSock (Webflow). Original skill: gsap-frameworks, published on GitHub under the MIT licence.

View on GitHub