gsap-frameworks

Enable lifecycle-aware, scoped GSAP animations in Vue, Nuxt, and Svelte apps.

Updated Mar 18, 2025
One-click install
npx skills add https://github.com/utsavm81098/88-residences --skill gsap-frameworks-utsavm81098
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/utsavm81098/88-residences/tree/main/.agents/skills/gsap-frameworks
Command: npx skills add https://github.com/utsavm81098/88-residences --skill gsap-frameworks-utsavm81098

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Framework-based UI development often requires declarative, lifecycle-aware GSAP animations that clean up after themselves and scope selectors to each component. This Skill provides clear patterns for Vue, Nuxt, and Svelte workflows.

Core Features & Use Cases

  • Scoped GSAP context per component to prevent leaks and conflicts.
  • Lifecycle integration using onMounted/onMount and onUnmounted/destroy to auto-create and cleanup animations.
  • Plugin usage patterns and safe ScrollTrigger integration across frameworks, with recommended practices.

Quick Start

Create a GSAP animation inside onMounted (or onMount) and revert it on unmount to ensure cleanup.

Frequently Asked Questions about gsap-frameworks

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

FAQPage Schema
How do I clean up GSAP animations on component unmount in Vue?

To clean up GSAP animations on component unmount in Vue, initialize them inside onMounted and call their revert method within onUnmounted. This lifecycle integration automatically destroys animations and prevents memory leaks when the component is destroyed.

What is GSAP context scoping and when do I need it for Svelte animations?

GSAP context scoping restricts selector queries and animations to a specific component instance, preventing global leaks. You need it in Svelte when multiple components use GSAP simultaneously, ensuring animations only target local elements within their own component boundaries.

Does ScrollTrigger work with Nuxt and Vue lifecycle hooks?

Yes, ScrollTrigger integrates with Nuxt and Vue lifecycle hooks. You register the ScrollTrigger plugin and initialize it inside onMounted, then ensure proper cleanup by reverting the GSAP context during onUnmounted to safely remove scroll-driven animations.

Why does my GSAP animation target elements outside its Vue component?

Your GSAP animation targets external elements because it lacks scoped context. Using gsap.context scopes selector queries to a specific component reference, preventing animations from accidentally querying and affecting elements outside the intended Vue or Svelte component.

What's the best way to structure GSAP animations in Svelte components?

The best way to structure GSAP animations in Svelte is to initialize them within the onMount lifecycle hook and use gsap.context for selector scoping. Return a cleanup function from onMount or use onDestroy to revert the context and prevent animation leaks.