gsap-frameworks

Implement lifecycle-aware GSAP animations in Vue and Svelte with scoped selectors.

11|1|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/kartojal/openvps --skill gsap-frameworks-kartojal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-frameworks
Source: https://github.com/kartojal/openvps/tree/main/.agents/skills/gsap-frameworks
Command: npx skills add https://github.com/kartojal/openvps --skill gsap-frameworks-kartojal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides lifecycle-aware GSAP animation patterns for Vue/Nuxt and Svelte/SvelteKit projects, ensuring animations are created after the DOM is ready and properly cleaned up to avoid leaks.

Core Features & Use Cases

  • Scoped animations with gsap.context to confine effects to a component's root.
  • Lifecycle-safe setup and cleanup using Vue's onMounted/onUnmounted and Svelte's onMount/onDestroy.
  • Guidance for integrating ScrollTrigger and plugin registration in a Vue/Svelte app to deliver smooth, reliable UI motion in production use.

Quick Start

Install GSAP in your project, import gsap and ScrollTrigger, and wrap animations inside onMounted/onUnmounted (Vue) or onMount/onDestroy (Svelte), using gsap.context to scope selectors.

Frequently Asked Questions about gsap-frameworks

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

FAQPage Schema
How do I prevent GSAP animation memory leaks in Vue and Svelte?

Prevent GSAP memory leaks in Vue and Svelte by creating animations inside onMounted/onMount and reverting them in onUnmounted/onDestroy, using gsap.context to scope and clean up selectors within the component lifecycle.

Why does my GSAP ScrollTrigger animation run before the Vue or Svelte DOM is ready?

GSAP ScrollTrigger animations run prematurely when initialized outside lifecycle hooks. Execute GSAP setup inside Vue's onMounted or Svelte's onMount to ensure the component DOM is fully rendered before targeting elements and registering plugins.

What is gsap.context used for when adding animations to a Vue or Svelte component?

gsap.context is used to scope GSAP animations to a specific component's root element, confining selector text lookups to that subtree and enabling centralized cleanup of all associated animations when the component unmounts.

Can I use GSAP with Nuxt and SvelteKit without selector conflicts between components?

Yes, you can use GSAP with Nuxt and SvelteKit without selector conflicts by wrapping your animation logic in gsap.context, which restricts selector queries to the current component's DOM tree and prevents unintended cross-component element targeting.

Do I need to manually register GSAP plugins like ScrollTrigger in a Svelte or Vue project?

Yes, you need to manually register GSAP plugins like ScrollTrigger using gsap.registerPlugin before using them in your Vue or Svelte project to ensure the animation functionality is available and operates correctly.

What is the best way to clean up GSAP ScrollTrigger animations when a Svelte component unmounts?

The best way to clean up GSAP ScrollTrigger animations on unmount is to call the revert method on the gsap.context instance within Svelte's onDestroy hook, which removes all scoped animations and restores the DOM.