Skill library

Agent skill Web motion

GSAP Timeline

Choreograph multi-element animations with GSAP timeline labels, relative positions and playback controls.

  • GSAP
  • Animation timing
  • Hero animation

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add greensock/gsap-skills --skill gsap-timeline --agent claude-code --yes

Check this file in your project.claude/skills/gsap-timeline/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add greensock/gsap-skills --skill gsap-timeline

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Open the project in a coding assistant that can load the installed Skill. To run these examples, the frontend also needs GSAP 3.11 or later for the motion preference and cleanup APIs.

View operation manual

What this skill helps with

  • Sequence or overlap entrance and exit animations.
  • Use labels and relative offsets to control timing.
  • Nest timelines and control playback or reversal.

Good for

  • Animated hero entrances
  • Sequenced illustrations and UI transitions
Official entry
GreenSock’s gsap-timeline/SKILL.md.
What to provide
The page or component, its animation targets, when to play, and which effects should overlap.
Timing tools
Timeline labels, relative positions, shared defaults, and nested sequences.
Deliverable
A sequence you can adjust in one place, with clear playback, a reduced-motion state, and cleanup when the component is removed.
Skill name
gsap-timeline

Specify which movements overlap

Timing left open

Use gsap-timeline to make my landing page feel more dynamic.

The assistant could give each element its own delay. Changing one duration would then require checking every later delay to preserve the intended overlap.

A sequence you can check

  1. Start the headline at 0 seconds and the product image at 0.2 seconds.
  2. Give the headline and image a shared label. Start the button’s movement when both have finished.
  3. Check that the button opens its existing destination and remains usable with reduced motion.

GSAP Timeline operation manual

Plan a one-time hero entrance around overlapping motion, then use a paused parent timeline to build a product demo visitors can play in either direction.

Let the headline and product image enter together for part of the sequence, then let the primary button settle into place.

  1. Map the sequence in seconds

    Identify the actual headline, image, and button in the current hero. Write down which elements move together and when the sequence should finish.

    • The headline and image move together from 0.20 to 0.45 seconds.
    • The button starts moving after the image finishes.
    Prompt · Step 1
    Use GreenSock’s gsap-timeline Skill to plan an entrance for the existing landing-page hero. Locate the component and identify the headline, product image, and primary button. Confirm where the button leads and report any animation already targeting these elements.
    
    Use this starting schedule in seconds. The headline moves from 0 to 0.45, the image from 0.20 to 0.75, and the button makes a small move into place from 0.75 to 1.00. Keep the button fully visible. Return the schedule with each target, start time, and duration, and describe the static state for reduced motion. Keep this pass to planning.
  2. Build one scoped timeline

    Use real element references, set the intro label at zero, and add the action label after both opening tweens. The example shows the timing inside the motion-enabled branch.

    Prompt · Step 2
    Use gsap-timeline to implement the agreed schedule in the existing hero component. Initialize one GSAP timeline after its headline, image, and button elements are available. Add the intro label at 0 and use intro+=0.2 to offset the image. Add the action label after both opening tweens so the button starts at the current end of the timeline. Put the shared ease in defaults, and specify each tween’s duration.
    
    Keep the markup visible by default and the button at full opacity. Use gsap.matchMedia() to honor the motion preference. Keep a playback-started flag for this mount outside the media callback. If the preference changes during playback, restore the default visible state. Turning motion back on during the same mount must not replay an entrance that has already started. Revert the matchMedia instance on teardown. Keep the original button behavior. Give me the changed files and the local route where I can see the result.
    const tl = gsap.timeline({ defaults: { ease: 'power2.out' } });
    tl.addLabel('intro', 0)
      .from(headline, { y: 12, duration: 0.45 }, 'intro')
      .from(image, { y: 16, duration: 0.55 }, 'intro+=0.2')
      .addLabel('action')
      .from(cta, { y: 6, duration: 0.25 }, 'action');
  3. Check timing and the static state

    Check the overlap on the running page, then exercise the button and verify the component can be removed and mounted again cleanly.

    • The headline, image, and button are visible immediately with reduced motion.
    • Each mount starts at most one entrance, and the existing button remains usable.
    Prompt · Step 3
    Use gsap-timeline to verify the hero entrance on the local page. Load it with motion enabled at phone and desktop widths and confirm the headline and image overlap before the button moves. Inspect the actual timeline positions if the overlap is hard to see. Tab to the button during the entrance and verify its original destination.
    
    Repeat with reduced motion enabled and check that all hero content appears immediately. On a new load with motion enabled, switch to reduced motion while the entrance is playing, then switch back without reloading. Confirm that the content stays visible and the same mount does not replay. Navigate away during an entrance and return. Check for duplicate timelines, stale inline styles, and console errors. Report what you observed in the browser and identify any checks unavailable in this environment.

Look up a timing or playback problem

Give the assistant the component and the exact moment that looks wrong. Use these Timeline terms to make the request specific.

Two elements should move togetherOverlap
Command or reference
Position parameter and labels
Examples
Use a shared label to align both starts. Use a label offset to start the second tween a fixed number of seconds later.
A later tween starts before the opening action endsPlacement
Command or reference
Omitted position, <, and >
Examples
Omit the position to append at the current end of the whole timeline. Use < or > to anchor to the start or end of the most recently inserted animation.
A reviewer needs to inspect a particular beatPlayback
Command or reference
pause(), seek(), and reverse()
Examples
Pause and seek to a defined label to inspect that frame. Use reverse() to move backward from the current playhead position.
Animation styles persist after navigating awayCleanup
Command or reference
revert() and gsap.matchMedia()
Examples
Revert the timeline or its owning matchMedia instance during cleanup. Confirm the component’s CSS controls the appearance again.

GSAP Timeline troubleshooting

Does installing the Skill also install GSAP?

The Skill supplies instructions for your coding assistant. Open the project and ask it to load gsap-timeline. The frontend needs the GSAP library separately. If it is missing, use the GSAP installation guide for your project’s setup.

Why did my tween jump to the end after I named a label?

A position string with an unrecognized label creates a label at the current end of the timeline. Define important labels with addLabel() before using them and check the spelling at each call site.

Which cleanup call removes the styles added by the animation?

Use timeline.revert() to stop the timeline and restore the targets’ pre-animation state. If you created the timeline inside a gsap.matchMedia() callback, call revert() on that matchMedia instance during teardown to clean up the animations it owns.