Skill library

Agent skill Web motion

GSAP Scrolltrigger

Design or implement effects that respond to scrolling on a web page.

  • Scroll animation
  • GSAP

Install the skill

Installation method

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

npx skills@latest add nexu-io/open-design --skill gsap-scrolltrigger --agent claude-code --yes

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

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add nexu-io/open-design --skill gsap-scrolltrigger

    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. The Open Design and GreenSock editions use the same installed Skill directory. Check the source and the edition your project needs if the name is already present. Open a frontend project in a coding assistant that can load the Skill. The examples use the separate gsap package, ScrollTrigger registration, and GSAP 3.11+ for gsap.matchMedia().

View operation manual

What this skill helps with

  • Design or implement effects that respond to scrolling on a web page.

Good for

  • Scroll-driven storytelling
Current edition
The GreenSock workflow curated by Open Design.
Upstream publisher
GreenSock, with the ScrollTrigger plugin documentation.
Inputs
The page and elements, actual scrolling container, motion range, and small-screen layout.
Controls
Use scrub for scroll-linked progress and toggleActions for discrete playback.
Deliverable
A local preview with measured trigger boundaries and component-level cleanup.
Skill name
gsap-scrolltrigger

Define the two scroll boundaries

An open-ended request

Add scroll animation to the product page.

The assistant has to guess where the animation starts, which content follows scrolling, and whether pinning fits the available space.

A measured scroll range

  1. Specify the start and end from the section and viewport edges.
  2. Pin the visual frame and animate an element inside it.
  3. Keep the content in reading order at phone width and with reduced motion.

GSAP ScrollTrigger operation manual

Build a desktop product tour that follows the scroll position, or add a one-time entrance to an existing case-study card.

Keep a product preview in view while three real steps scroll beside it on wide screens.

  1. Find the section, frame, and scroller

    Measure the actual section and distinguish the element that stays in place from the content that moves.

    Prompt · Step 1
    Use the Open Design edition of the gsap-scrolltrigger Skill to plan a three-step tour on my existing product page. Locate the section, three step descriptions, product preview, and actual scrolling element. On a wide viewport, use the section as trigger and identify a separate frame to pin. Check whether the section has enough scroll distance for start: 'top top' and end: 'bottom bottom'. If those boundaries do not fit the layout, propose alternatives and explain where each lands. Show the three steps in ordinary reading order on phones and when reduced motion is enabled. Return the targets, scroll range, and fallback before editing.
  2. Drive one timeline with scroll

    Register ScrollTrigger in client-side code, tie a top-level timeline to the scroller, and scope it to the section.

    Prompt · Step 2
    Use gsap-scrolltrigger to implement the approved tour. Register ScrollTrigger once in the project’s GSAP setup. Use one top-level timeline with scrollTrigger, the agreed trigger and positions, pin set to the frame, and scrub: true so the playhead follows the scroll position directly. Animate the preview inside the frame. Keep the step text readable as it scrolls, and keep the product link outside the animated visual state.
    
    Activate this timeline only when the chosen breakpoint and prefers-reduced-motion: no-preference both match, using gsap.matchMedia(). Revert the matchMedia instance during component teardown. If an asset or expanded section changes the measured layout after setup, run ScrollTrigger.refresh() after that change settles. Return the edited files and the local preview route.
  3. Verify both scroll directions and cleanup

    Check the pin start and release, resize into the normal layout, and check the next section.

    • Each preview state can be reached in both scroll directions.
    • Phone and reduced-motion layouts retain all steps and links.
    • The pin releases and route changes clean up its spacer.
    Prompt · Step 3
    Use gsap-scrolltrigger to verify the tour in the running browser. Scroll down and back up through all three steps. Check that the preview reaches each agreed state, the pinned frame releases at the boundary, and the next section stays reachable without an extra gap. Use markers only for local diagnosis. Switch across the breakpoint and enable reduced motion. Verify the instructions and links stay available and the frame is unpinned. Navigate away and return to check that the section has only one trigger and no stale spacer. List exactly which checks you ran.

Look up a scroll behavior

Name the affected section and the start, end, or direction where you observe a problem.

The animation should move backward with scrollingProgress
Command or reference
scrub
Examples
Set scrub: true for direct tracking. A number adds that many seconds for the playhead to catch up.
The pinned graphic jumpsPinning
Command or reference
pin and pinSpacing
Examples
Check the spacer, pin a stable wrapper, and animate a child. Inspect the real scrolling container and its layout.
The entry position changes when content loadsMeasurement
Command or reference
ScrollTrigger.refresh()
Examples
Refresh after a verified layout change once its new dimensions are available.

ScrollTrigger troubleshooting

Why did a tween inside my timeline lose sync?

Give the top-level timeline one ScrollTrigger. Its playhead already controls the children, so arrange each child at the appropriate time within that timeline.

Can I turn off pinning on a phone?

Create the trigger in a wide-screen gsap.matchMedia() branch and keep the default layout in normal flow. GSAP reverts the animations created in that branch when it stops matching.

When should I refresh the trigger measurements?

ScrollTrigger recalculates on resize by default. Call ScrollTrigger.refresh() after an additional layout change such as a late-loading asset or expanded accordion. Check markers in development to see the recalculated points.