How-to
How to copy a GSAP animation from any website
Copy a GSAP animation from a website: detect GSAP, read tweens, durations and eases from the console, then rebuild it with gsap.timeline() or export the code.
You find a site with a hero that staggers in perfectly, or a card stack that fans out with just the right overshoot. You open DevTools, go to the Animations panel, replay it, and nothing shows up. That usually means the animation is driven by GSAP.
This guide explains why GSAP hides from the usual tools, how to confirm a page is using it, how to read the tweens straight from the console, and where that manual approach stops working. Then it shows a faster route and how to rebuild the result with gsap.timeline().
Why DevTools shows nothing
The Chrome Animations panel lists three kinds of animation: CSS animations, CSS transitions and animations created with the Web Animations API. Each of these is an object the browser knows about, with a duration, delay and easing it can display. Inspecting CSS animations in DevTools works because of that.
GSAP does not create any of those objects. It runs its own ticker on requestAnimationFrame, computes each value in JavaScript, and writes it to the element's inline style attribute on every frame. To the browser, it looks like a script setting styles very quickly. There is no timeline to inspect, so the panel stays empty.
Step 1: confirm the page uses GSAP
There are a few quick checks. Try them in order.
- Ask the console. Open DevTools, go to the Console and type
gsap.version. If GSAP is loaded as a global, you get a version string such as"3.13.0". If you get a reference error, it may still be there, just bundled. - Check an animated element. Select the element in the Elements panel, then type
$0._gsapin the console. GSAP stores a small cache object on every element it has animated. If this returns an object, GSAP touched that element. - Watch the inline style. Replay the animation and watch the element in the Elements panel. If its
styleattribute flashes and fills with values liketransform: translate(0px, 12.4px)that change each frame, a JavaScript library is animating it. GSAP is the most common one. - Search the sources. In the Sources panel, press Cmd+Option+F (or Ctrl+Shift+F) and search for
GreenSockorgsap.com. The licence comment at the top of the library often survives minification.
Step 2: read the tweens from the console
When gsap is available as a global, you can ask it what is running. Every tween and timeline lives under gsap.globalTimeline. Paste this into the console while the animation is playing, or just before you trigger it:
const tweens = gsap.globalTimeline.getChildren(true, true, false);
console.table(tweens.map(t => ({
target: t.targets().map(el => el.id || String(el.className) || el).join(', '),
start: t.startTime(),
duration: t.duration(),
delay: t.delay(),
ease: t.vars.ease || 'power1.out (default)',
from: Boolean(t.vars.runBackwards),
stagger: JSON.stringify(t.vars.stagger ?? null)
})));
getChildren(true, true, false) returns nested children, includes tweens and leaves out timelines. Each tween gives you:
targets(): the elements it animates.startTime(): where it sits in its parent timeline, in seconds.duration()anddelay(), in seconds.vars: the object the author passed in, including the end values (y,opacity,scale),easeandstagger.
If vars.runBackwards is true, the tween was made with gsap.from(), so the values in vars are the start state, not the end state. If vars.ease is missing, the tween uses GSAP's default, power1.out, unless the site changed it with gsap.defaults() or a timeline's defaults. Log a whole tween with console.log(tweens[0].vars) to see everything.
Catch it before it finishes
The global timeline removes tweens once they complete. If you run the snippet after an entrance animation has played, the list is empty. Two ways round that:
// Slow everything down to a tenth of the speed
gsap.globalTimeline.timeScale(0.1);
// Or freeze everything, inspect, then carry on
gsap.globalTimeline.pause();
gsap.globalTimeline.resume();
Set the time scale, then trigger the animation again: reload, hover or scroll back to it. For a page-load animation, open the console first, run gsap.globalTimeline.timeScale(0.1) as soon as the page starts loading, and read the tweens while they crawl. You can also pause a single timeline and step through it with tl.progress(0.5) or tl.seek(0.8).
ScrollTrigger animations
Scroll-linked tweens stay in the global timeline, paused and driven by the scroll position. If ScrollTrigger is also a global, you can list its settings:
console.table(ScrollTrigger.getAll().map(st => ({
trigger: st.trigger,
start: st.vars.start,
end: st.vars.end,
scrub: st.vars.scrub,
pin: Boolean(st.vars.pin)
})));
Each trigger's animation property is the tween or timeline it controls, and you read it the same way as above.
Where the manual approach stops working
The console route is precise when it works. It often does not.
- Bundled builds. Most production sites import GSAP through a bundler, so
window.gsapdoes not exist. The library is inside a closure you cannot reach from the console without setting breakpoints in minified code. - Values computed at runtime.
varscan hold functions, such asx: i => i * 40, or values based on window size. You see the function, not the numbers it produced. - Custom eases. A
CustomEaseshows up as a function or an ID, not a curve you can paste. See how to find the easing curve of an animation for ways to measure it. - Mixed sources. One element may get its transform from GSAP and its colour from a CSS transition. You then need two tools to see the full picture.
- Scroll timing. A scrubbed animation has no fixed duration. Its timing depends on scroll distance, which you have to work out from the start and end positions.
The faster way: record it while it plays
Instead of reading the library's internals, you can record what the browser actually renders. Capture Motion is a free Chrome extension that does this. It records an animation while it plays and reads the keyframes, durations, delays and easing of every animated property, whether the motion comes from GSAP, CSS, the Web Animations API or Lottie. It does not need window.gsap, so bundled builds are not a problem.
- Install the extension and open the page with the animation.
- Pick the element and start a capture.
- Play the animation. Reload for an entrance, scroll for a reveal, or hover. For hover, the extension sets a real
:hoverstate through the Chrome DevTools Protocol, attached only during the capture. - Preview the result. Check the keyframes and timing against the original. Capture and preview need no account.
- Export. Choose the GSAP, CSS or React code tab, download a self-contained HTML and CSS file, or take the JSON. A free account is needed to copy or download. The JSON also pastes into the Capture Motion Figma plugin as a Figma Motion timeline, and Copy for LLM copies it with an instruction for ChatGPT or Claude.
Captures stay in your browser unless you save them. If you want to move the motion into plain CSS instead of keeping GSAP, the CSS tab gives you that directly. The animation to code page covers the export options in more detail.
Rebuild it with gsap.timeline()
Whichever way you got the numbers, rebuild the animation as a single timeline. Say you found a heading, a row of three cards and a button with these values:
| Part | Property | Duration | Start | Easing |
|---|---|---|---|---|
| Heading | y 24 → 0, opacity 0 → 1 | 0.6s | 0s | power3.out |
| Cards | y 40 → 0, opacity 0 → 1 | 0.7s | 0.3s, stagger 0.1s | power3.out |
| Button | scale 0.8 → 1, opacity 0 → 1 | 0.5s | 0.8s | back.out(1.7) |
import { gsap } from 'gsap';
const mm = gsap.matchMedia();
mm.add('(prefers-reduced-motion: no-preference)', () => {
const tl = gsap.timeline({ defaults: { ease: 'power3.out' } });
tl.from('.hero h1', { y: 24, opacity: 0, duration: 0.6 }, 0)
.from('.hero .card', { y: 40, opacity: 0, duration: 0.7, stagger: 0.1 }, 0.3)
.from('.hero .cta', {
scale: 0.8,
opacity: 0,
duration: 0.5,
ease: 'back.out(1.7)'
}, 0.8);
return () => tl.kill();
});
Using absolute positions (0, 0.3, 0.8) keeps the rebuild identical to what you measured. Once it matches, you can switch to relative positions like "-=0.4" so later tweaks stay easy. Wrapping it in gsap.matchMedia() means people who ask for reduced motion see the final state without the movement.
Compare your version with the original side by side at a slow speed. gsap.globalTimeline.timeScale(0.25) works on your page too.
A note on reuse
Timing, easing and the general shape of a motion are what you are learning from. The site's illustrations, fonts and code are its own. Rebuild the motion with your own markup and assets. If you are unsure whether GSAP or CSS suits your version better, read GSAP vs CSS animation. For animations that are not built with GSAP, the general guide to copying an animation from any website covers the rest.
Questions
Why does the Chrome Animations panel not show GSAP animations?
The Animations panel only records CSS animations, CSS transitions and Web Animations API animations. GSAP writes inline styles from JavaScript on every frame, so there is no animation object for DevTools to list.
How can I tell if a website uses GSAP?
Type gsap.version in the console. If GSAP is loaded as a global, it returns a version number. If it is bundled, look for a _gsap property on animated elements or for inline transform values changing every frame in the Elements panel.
Can I copy a ScrollTrigger animation?
You can read its settings with ScrollTrigger.getAll() when ScrollTrigger is exposed as a global, and scrub through it by scrolling. The tween values are in the linked animation's vars, the same as any other tween.
Can Capture Motion export GSAP code?
Yes. Capture Motion records the animation while it plays and gives you GSAP, CSS and React code tabs, plus JSON and a self-contained HTML and CSS file. Capture and preview need no account; copying or downloading needs a free account.
