gsap-vanilla

Implements GSAP page and component animation lifecycles on plain HTML, CSS, and JavaScript sites.

1|Updated Aug 17, 2026
One-click install
npx skills add https://github.com/NalinDalal/skillset --skill gsap-vanilla-nalindalal
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gsap-vanilla
Source: https://github.com/NalinDalal/skillset/tree/main/skills/ui/gsap-vanilla
Command: npx skills add https://github.com/NalinDalal/skillset --skill gsap-vanilla-nalindalal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Animation on plain HTML sites often breaks at page boundaries: content flashes before intros, outros get skipped on back/forward navigation, the bfcache restores broken states, and failed scripts leave pages blank. This Skill provides a complete lifecycle contract (mount, initial state, intro, settled, outro, end state, unmount) so GSAP animation on vanilla sites stays readable, interruptible, and recoverable. ## Core Features & Use Cases - Full page lifecycle management: Covers page intros/outros, component show/hide, scroll effects, and conditional presence with explicit phase tracking and cleanup via gsap.context. - Navigation model guidance: Supports full document loads, cross-document View Transitions (pageswap/pagereveal), and same-document fetch/swap routers like Swup, Barba, or Taxi. - Initialization and recovery contract: Pre-paint hiding rules, bounded initialization deadlines, and per-owner recovery so a blocked bundle or failed setup never leaves hidden content. - Use Case: You are adding a fade-and-slide page transition to a static site. The Skill guides you to set initial state before first paint, intercept link clicks for the outro, handle bfcache restores without replaying intros, and verify reduced-motion and no-JavaScript fallbacks. ## Quick Start Use the gsap-vanilla skill to add a page intro and outro transition to my plain HTML and JavaScript site.

Frequently Asked Questions about gsap-vanilla

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

FAQPage Schema
How do I add GSAP page transitions to a plain HTML site?▼

Set initial state with an inline head script before first paint, run the intro after DOMContentLoaded, and intercept link clicks to play an outro before following the link with location.assign. Keep one navigation lock and race the outro against a timeout so users never get stuck.

Should I use View Transitions or GSAP for page animation?▼

Use cross-document View Transitions for snapshot morphs and page crossfades, and GSAP for live-DOM outros that gate navigation, interruptible sequences, split text, or scroll-linked motion. Assign one engine per element so a named morph and a GSAP tween never fight over the same node.

Why does my GSAP intro flash settled content before animating?▼

The flash happens when initial values are applied after the browser has already painted. Set a marker on the html element from an inline head script, hide intro targets only under that marker with visibility, and write start values with gsap.set before releasing the hiding rule.

Does GSAP animation work with the browser back button and bfcache?▼

Yes, but back and forward never run an outro. On pagehide, finish any outro instantly and leave the page readable; on pageshow with persisted, skip the intro and refresh ScrollTrigger. Never add unload or beforeunload listeners, since they disable the bfcache.

When should I not use this vanilla GSAP approach?▼

Do not use it when a component framework like React or Vue renders the pages; that case belongs to the framework's own animation skill. It also does not cover isolated GSAP API questions, which the official gsap-core skill handles.

How do I prevent a failed script from leaving my page blank?▼

Arm an independent initialization deadline in the early head script before hiding any content, and register per-owner recovery before setup work. On timeout or exception, kill owned timelines, revert split DOM, and restore the readable settled state without touching unrelated GSAP work.