gsap-vanilla
Skill5 starsChanged 2 months agoMITView on GitHub
Build or review GSAP animation on plain HTML, CSS, and JavaScript sites with no component framework: page load intros without a flash of settled content, exit animation before a link is followed, cross-document View Transitions with pageswap and pagereveal, back and forward with the bfcache, prerendered pages, animated show and hide, scroll-driven effects, and fetch plus pushState navigation by hand or with Swup, Barba, or Taxi. Use whenever a static site, a multi-page site, or a Vite or bundler project without React, Vue, Svelte, or Astro needs any of these, even if GSAP is not named, and whenever flashes, interrupted animations, or cleanup matter. Not for component frameworks, which have their own skills, or isolated GSAP API questions.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- johnpolacek/animaxxing-skillsedited, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- johnpolacek/animaxxing-skills★ 2247% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository57 other files it gives its agents.
- adversarial-reviewSkill
- aesthetic-animaxxingSkill
- ai-search-optimizationSkill
- announceSkill
- audio-trackSkill
- blindspotSkill
- brave-wesSkill
- chrome-wesSkill
- clihubSkill
- dashclaw-governanceSkill
- deskclawSkill
- de-vibeSkill
- dispatch-blocksSkill
- epic-infographicsSkill
- fable-gptSkill
- frontend-verifySkill
- gsap-astroSkill
- gsap-coreSkill
- gsap-frameworksSkill
- gsap-nextjsSkill
- gsap-nuxtSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-react-routerSkill
- gsap-reactSkill
- gsap-scrolltriggerSkill
- gsap-sveltekitSkill
- gsap-tanstack-routerSkill
- gsap-timelineSkill
- gsap-utilsSkill
- harness-healthSkill
- iphoneSkill
- landing-page-cro-expertSkill
- launchSkill
- launch-videoSkill
- logo-revealSkill
- marketingSkill
- marketing-studioSkill
- meditateSkill
- moleresearchSkill
- og-assetsSkill
- petstoreSkill
- phone-gotchasSkill
- phoneSkill
- preflightSkill
- product-demoSkill
- ship-itSkill
- shipSkill
- show-meSkill
- skillfindSkill
- social-clipSkill
- spec-probeSkill
- teamSkill
- tregSkill
- wes-voiceSkill
- wrapSkill
- xplainerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 12 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Every animated page or component runs through the same lifecycle:
- Distinctive: line 19
Read repository instructions and the current code.
- Very specific: line 23
Check the target browsers.
- Distinctive: line 24
Look at the shared layout, navigation markup, global CSS, accessibility conventions, tests, and any animation already in use.
- Distinctive: line 26
Add GSAP or a plugin only when the requested motion needs it.
- Distinctive: line 32
Full document loads: Every link replaces the document.
- Distinctive: line 38
Use cross-document View Transitions for:
- Distinctive: line 46
Use GSAP when the effect needs:
- Distinctive: line 65
Before calling work done: Verification.
- Distinctive: line 87
Keep outgoing content in the DOM and visible through outro and end state.
- Distinctive: line 90
Keep native link behavior, focus, scroll restoration, and no-JavaScript readability.
- Very specific: line 91
Never add unload or beforeunload listeners for animation.
- Very specific: line 93
Prefer transforms and autoAlpha.
- Distinctive: line 94
Use timelines for sequences.
- Distinctive: line 95
Verify in a real browser when practical, including reload, back, forward, and a click from a background tab.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GSAP Vanilla
Every animated page or component runs through the same lifecycle:
mount → initial state → intro → settled → outro → end state → unmount
On a plain site the browser owns mount and unmount. A page mounts when its document parses and unmounts when the next document replaces it, and nothing survives that swap: not a timeline, not a variable, not a listener. The five phases between belong to your animation code. This skill covers getting them right without a framework: first paint, navigation timing, history, interruptions, and cleanup. The user's request and the existing design decide how things look.
Start with the project
- Read repository instructions and the current code.
- Find out how pages are produced: hand-written HTML, a static generator with no client framework, a bundler such as Vite with no UI framework, or a transition library such as Swup, Barba, or Taxi. If a component framework renders the pages, say this skill does not cover it and use that framework's skill.
- Find out how GSAP loads: npm import, import map, or script tag. Keep it.
- Find out how scripts run: inline,
defer, ortype="module". This decides when the DOM exists and whether the page can paint before the script runs. - Check the target browsers. Cross-document View Transitions,
pageswapandpagereveal, the Navigation API, andblocking="render"are not everywhere. Feature-detect each one instead of trusting memory, and make sure the site works with all of them missing. - Look at the shared layout, navigation markup, global CSS, accessibility conventions, tests, and any animation already in use.
Add GSAP or a plugin only when the requested motion needs it. Do not replace an animation or transition library the project already chose unless asked.
Pick a navigation model
A plain site navigates in one of three ways. Decide which before writing lifecycle code, and do not mix them on one site.
- Full document loads. Every link replaces the document. The outro plays before the link is followed; the intro plays when the new page loads. This is the default and needs no router.
- Full document loads with cross-document View Transitions. The browser snapshots the old page and animates to the new one. GSAP fills in what a snapshot pair cannot do.
- Same-document navigation. Script fetches the next page and swaps content in place, so chrome, state, and timelines survive. Use a maintained library unless the project already owns a router or has a reason to. See Same-document navigation.
Pick GSAP or View Transitions per effect
Use cross-document View Transitions for:
- A shared element that morphs between two pages.
- A whole-page slide or crossfade keyed by transition types.
- Holding persistent chrome still while the content around it changes.
They need no lifecycle code and fall back to an instant swap in unsupported browsers.
Use GSAP when the effect needs:
- An outro that plays on the live page before the browser leaves it.
- Interruption, reversal, or scrubbing. A view transition is a fixed pair of snapshots.
- Sequenced timing across many targets, split text, or scroll-linked progress.
- A completion callback that gates navigation, focus, or removal.
Mixing is fine: the browser morphs one image while GSAP animates the rest. Never give one element to both in the same transition. See Combining with GSAP.
Follow the requested motion
The user's request decides effects, direction, timing, easing, and intensity. Map it onto the five phases without changing the look. For anything unspecified, keep the project's existing convention or pick a quiet default.
Read only what you need
- First paint, script timing, fonts, navigation type, prerendering, the bfcache, hidden tabs, and leaving a page with an outro: Page load and unload.
@view-transition,pageswap,pagereveal, types, render blocking, and handing off between the browser and GSAP: Cross-document navigation.- Fetch and swap routers, link interception, history, scroll, focus, script re-execution, and when to use a library: Same-document navigation.
- The five phases, GSAP setup, contexts, show and hide, layout stability, scroll, text, plugins: Lifecycle implementation.
- Before calling work done: Verification.
The official GSAP skills (gsap-core, gsap-timeline, gsap-scrolltrigger, gsap-plugins, gsap-utils, gsap-performance) cover the GSAP API. This skill covers how GSAP fits a page the browser owns.
Pieces to add, only as needed
- One module that imports GSAP and the plugins the project uses and registers them once. Other modules import from it.
- An inline script at the top of
headthat marks the root as JavaScript-active before first paint, paired with a CSS rule that hides intro targets only under that mark and only during the initial phase. - A page controller that owns the five phases for the current document, chosen by a
data-pageattribute onbodyormain. - A transition-aware link handler that runs the outro, then follows the link.
- Intro and outro timeline builders.
- A presence controller for conditional content that must stay in the DOM through its outro.
- For same-document navigation only: a router or a library adapter, one route container, and a cover.
Persistent header, nav, and footer are rebuilt on every full load. Give them a once-per-session intro or none. See Shell chrome.
Rules
- GSAP runs after the DOM it targets exists. Scope selectors with
gsap.contextto the page or component root. Clean up every tween, trigger, split, and listener when its owner goes away. - Lay out the final page with normal CSS first. One stable wrapper owns the geometry through every phase.
- Set initial values before first paint, then reveal. Users never see the settled state before the intro, and never a blank page without JavaScript.
- Animate to one settled state and clear temporary styles there.
- Keep outgoing content in the DOM and visible through outro and end state. Follow the link, remove the node, or swap only from the end callback.
- Back and forward never run an outro. A fresh document reached by history gets an intro-only path, and a bfcache restore gets no intro at all.
- A prerendered page sets initial state at once and waits for activation before it animates.
- Keep native link behavior, focus, scroll restoration, and no-JavaScript readability.
- Never add
unloadorbeforeunloadlisteners for animation. They disable the bfcache. Usepagehide. - Reduced motion reaches the same settled state and still fires every completion callback.
- Prefer transforms and
autoAlpha. Setwill-changeonly while animating, then clear it. - Use timelines for sequences. Decide up front what happens on rapid clicks and interrupted animations.
- Verify in a real browser when practical, including reload, back, forward, and a click from a background tab.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

