graphicsmotion
gsap
tweens, timelines, easing, stagger, scroll, svg, flip and split text, with a live demo of each.
a tween changes values over time. a timeline lines tweens up. scroll, svg, layout and text are plugins on top.
- duration
- 0.5 s the default, when you leave it out
- ease
- power1.out the default. quick start, soft stop
- plugins
- free all of them, since 3.13
- from()
- at once sets its start values the moment it's made
- a sequence of ui motion
- scroll-driven effects
- svg strokes and shapes
- layout changes, with flip
gsap is a javascript animation library. you name a target and the values it should reach, and gsap moves them there over time, one step per animation frame, in step with the browser.1 this sheet is the core (tween, timeline, ease, stagger) and five plugins. every figure waits for you: a press, a scroll or a drag. nothing moves on its own.
this page runs gsap 3.15.0. since 3.13 the whole library is free, plugins included, for commercial work too.2 the license is the standard “no charge” one: any site or app, paid work included. what it rules out is building gsap into a no-code animation tool that competes with webflow, which owns gsap.3
tween
a tween animates properties of a target from where they are to the values you give. gsap.to is the usual one. gsap.from runs the other way: it starts at the values you give and ends where the target already is. gsap.fromTo spells out both ends. gsap.set is a tween with no duration: the values, now. the target can be an element, a selector string, an array, or a plain object.4,5
leave duration out and it is 0.5 s. leave ease out and it is power1.out. gsap.defaults changes both for every tween made after it.4,6
import { gsap } from 'gsap';
gsap.to('.box', { x: 200, duration: 1, ease: 'power2.out' }); // from where it is to x: 200
gsap.from('.box', { opacity: 0, y: 20 }); // starts there, ends where it already is
gsap.fromTo('.box', { x: 100 }, { x: 200, duration: 0.8 }); // both ends spelled out
gsap.set('.box', { x: 200 }); // no animation: the values, now
const tween = gsap.to('.box', { x: 200, paused: true }); // make it once, drive it later
tween.play();
tween.reverse();
tween.progress(0.5);
for css transforms, use the shorthands: x and y are a translate in px, xPercent and yPercent a translate in percent of the element’s own size, rotation in degrees, scale. gsap applies them in one fixed order, and it skips the parsing a transform string would need. autoAlpha is opacity and visibility together, so a faded-out thing also stops taking clicks.7
gsap.to(box, { x: 200 })from where it is to the value. 0.5 s and power1.out: the defaults, since the call doesn't set them.
one white square on a dashed track and four buttons: to, from, fromTo and set. each button runs that gsap call on the square with the default duration and ease. a dashed cyan outline marks where the square starts and an amber one where it ends, a thin bar under the track fills with the tween's progress, and a line of code shows the call that ran. a replay button runs it again.
a tween is an object you keep: play, pause, reverse, restart, progress(0.5), timeScale(2), kill.8 a timeline has the same controls.
what trips people up:
fromsets its start values the moment you make it, even with a delay. in a timeline,immediateRender: falsemakes it wait for its turn.9- the flash people see comes before that. the page paints the element where it ends before your script runs, then
fromsnaps it to the start. hide it in css withvisibility: hiddenand bring it in withautoAlpha.10 - a
fromtween reads its end values when it first renders. run the samefromagain before it finishes and it ends short, at wherever the last one had got to. usefromTo, or make the tween once andrestart()it.11
timeline
gsap.timeline() lines tweens up. each .to() on it goes at the end of the timeline, unless the third argument, the position parameter, says otherwise. the timeline’s defaults go into every tween it makes, and a tween’s own vars win. the whole thing plays, pauses, reverses, scrubs and changes speed as one.12,13
const tl = gsap.timeline({ defaults: { duration: 0.8, ease: 'power2.inOut' }, paused: true });
tl.to('.a', { x: 200 }) // at 0
.to('.b', { x: 200 }, '<') // with the start of the previous tween
.to('.c', { x: 200 }, '-=0.3') // 0.3 s before the end of the timeline: an overlap
.addLabel('out')
.to('.a', { opacity: 0 }, 'out+=0.5'); // half a second after the label
tl.play();
tl.reverse();
tl.progress(0.5); // scrub to the middle
tl.timeScale(2); // twice as fast
the position parameter, in one list:13
- a number: seconds from the start of the timeline.
"+=1"and"-=1": one second after or before the end of the timeline."+=0"is the default."<"and">": the start or the end of the last tween added."<0.2"is 0.2 s after that start.- a percent:
"-=25%"is 25% of the tween being added, back from the end."<25%"is 25% into the last tween. - a label name, or
"out+=0.5". a label that does not exist yet is made at the end.
tl.to(a, { x, duration: 1 })
.to(b, { x, duration: 0.6 }, "<")
.to(c, { x, duration: 0.8 })left out, it is the end of the timeline. c runs from 1 s to 1.8 s, and the timeline lasts 1.8 s.
three squares, a in cyan, b in amber and c in white, each on its own dashed lane. a runs for one second from the start and b for 0.6 s alongside it. a menu sets the position parameter of c, which lasts 0.8 s: left out, the start of b, the end of b, 0.3 s before or after the end, 0.2 s after b starts, half a second in, or half of c before the end. a track view under the lanes shows the three tweens as bars on a time axis with a playhead, a line says in words where c starts and ends and how long the timeline lasts, a play button runs the timeline, and a slider scrubs it.
the step-by-step movies elsewhere on this site, like the one on merge sort, are gsap timelines. site/src/visuals/kit/use-timeline.ts takes one from each figure, reads its chapters from labels named c0, c1 and on, and seeks with time() when you tap or drag the progress bar.
what trips people up:
- a tween added to a timeline that has already finished does not play until the timeline runs again. to react to a click, make a new tween, or control one you made before.11
tl.to(...)returns the timeline, which is what makes the chain work. to keep a child, make the tween first andtl.add(tween, position)it.14defaultsreach only the tweens the timeline makes, when it makes them. a tween made withgsap.toand then added keeps its own.12
easing
an ease maps time to value: progress through the duration goes in, 0 to 1, and how far along the value is comes out. the families are power1 to power4 (quad, cubic, quart, quint), sine, expo, circ, back, elastic and bounce, each with .in, .out and .inOut, plus steps(n) and none, which is linear. a bare name like power2 means .out.15,16
the power outs are 1 − (1 − p)n+1: at half time, power1.out is 75% of the way, power2.out 87.5%, power4.out 97%. back runs past the end and settles; with the default overshoot of 1.70158 the peak is about 10% over. elastic takes an amplitude and a period, 1 and 0.3 by default. bounce reaches the end, then bounces three times, each bounce a quarter the height of the one before. steps(5) jumps five times.16
gsap.to('.box', { x: 200, ease: 'power2.out' }); // fast start, long settle
gsap.to('.box', { x: 200, ease: 'back.out(1.7)' }); // past the end, then back
gsap.to('.box', { x: 200, ease: 'elastic.out(1, 0.3)' }); // amplitude, period
gsap.to('.box', { x: 200, ease: 'steps(5)' }); // five jumps
gsap.to('.box', { x: 200, ease: 'none' }); // linear
gsap.defaults({ ease: 'power2.out', duration: 0.6 }); // for everything after this line
gsap.timeline({ defaults: { ease: 'power2.inOut' } }); // or for one timeline's children
{
duration: 1.2,
ease: "power1.out",
}halfway through the time, it is 75% of the way there.
a menu of fifteen eases, from none and the power family to back, elastic, bounce and steps. the chosen ease is drawn as a curve, time across and value up, over a dashed straight line for no ease, with a cyan line at 0 and an amber line at 1. on play a white dot crosses the plot at a steady pace while its height follows the ease, and a white square in a lane to the right rises with it. a line under the plot gives the value at half time, and how far past 1 or below 0 the ease goes.
what trips people up:
- with a scrub, the scrollbar sets the progress and the ease still bends it:
power1.outmoves most at the start of the scroll.ease: "none"keeps the value in step with the scroll. slow,roughandexpoScaleare not in the core. they come with the EasePack plugin.15
stagger
when a tween has several targets, stagger spreads out their start times.17
- a number: the gap in seconds between one start and the next.
eachoramount: the gap, or a total to split among them all.from: where the wave starts. an index,"start","center","edges","end"or"random".grid: rows and columns, so distance is measured across the grid.axiskeeps it to"x"or"y".ease: how the starts are spread out."power2"starts with big gaps and bunches up toward the end.- a function of the index: each target’s delay, outright.
with each: 0.1, five items in a row start at 0, 0.1, 0.2, 0.3 and 0.4 s. with amount: 1, the same five start at 0, 0.25, 0.5, 0.75 and 1 s. in a grid, the farthest cell starts at each times the grid’s longer side, wherever the wave starts: 0.5 s in a 5 by 5 grid with each: 0.1.18
gsap.from('.cell', { scale: 0, stagger: 0.1 }); // 0.1 s between starts
gsap.from('.cell', { scale: 0, stagger: { amount: 1, from: 'end' } }); // 1 s split among all, last first
gsap.from('.cell', { scale: 0, stagger: { each: 0.1, from: 'center', grid: [5, 5] } });
gsap.from('.cell', { scale: 0, stagger: (i) => i * i * 0.02 }); // any function of the index
stagger: {
each: 0.1,
from: "center",
grid: [5, 5],
}each cell shows its delay in seconds. cyan starts first, amber last, at 0.50 s.
a grid of 25 cells, each printing its delay in seconds for the chosen starting point: start, center, edges, end, index 6, or random. the first cell to move is outlined cyan and the last amber, at half a second. play shrinks and fades every cell, then grows them back in that order.
what trips people up:
grid: "auto"measures the elements to find the columns, so they have to be laid out first.17from: "random"is a new order for every tween. for one that repeats, pass a function with your own shuffle.18eachandamountanswer different questions: a gap, or a total. withamount, more targets means smaller gaps.17
scrolltrigger
ScrollTrigger ties a tween or a timeline to a scroll position. trigger is the element it watches.19
startandendare two words: a place on the trigger, then a place on the scroller."top 80%"is the trigger’s top meeting the line 80% down the viewport. the defaults are"top bottom"and"bottom top", so the trigger is in play while any of it shows.20scrub: trueties the animation’s progress to the scrollbar. a number, likescrub: 1, is the seconds the playhead takes to catch up.- without a scrub,
toggleActionssays what to do at the four crossings: enter, leave, enter back, leave back. the default is"play none none none". pin: trueholds the trigger still while it’s active, and the rest scrolls past. then the start default is"top top".once: truekills the trigger the first time the end is reached. the animation stays, so it never resets or plays again.scrollermeasures against a scrolling box instead of the viewport.markers: truedraws the start and the end while you work.
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
gsap.to('.card', {
x: '100%',
ease: 'none',
scrollTrigger: {
trigger: '.card',
scroller: '.box', // leave it out for the page itself
start: 'top 80%', // the card's top hits 80% down the box
end: 'bottom 20%', // the card's bottom hits 20% down the box
scrub: true, // or 1: a second to catch up
markers: true, // while you work
},
});
// toggled instead of scrubbed: play on the way in, reverse on the way back up
gsap.from('.card', {
opacity: 0,
y: 40,
scrollTrigger: { trigger: '.card', start: 'top 80%', toggleActions: 'play none none reverse' },
});
scrollTrigger: {
trigger: card, scroller: box,
start: "top 80%", end: "bottom 20%",
scrub: true,
}progress 0.00
a box 240 pixels tall with its own scrollbar. inside it, a white card labelled trigger, and two dashed lines across the box: cyan at 80% down, where the card's top starts the trigger, and amber at 20% down, where the card's bottom ends it. scrolling the box slides the card to the right while it is between the lines, a bar along the top fills with the trigger's progress, and a readout prints the progress and the scroll positions of the start and the end. a menu switches between scrub true, scrub 1, and toggleActions.
what trips people up:
- start and end are worked out when the trigger is made and when the scroller resizes, not as you scroll. if the layout changes in between, like content added above the trigger, call
ScrollTrigger.refresh().19 - with a scrub, a tween’s
durationis a share of the scroll distance, not seconds.19 - a trigger outlives the component that made it. kill it on unmount:
gsap.context()anduseGSAPdo that for you.21
svg draw
DrawSVGPlugin reveals a stroke by animating stroke-dasharray and stroke-dashoffset. the drawSVG value is the part of the stroke that shows, start and end, in percent or px: "0% 100%" is all of it, "20% 80%" the middle three fifths. one value means from 0, so "100%" is the whole thing, and so is true. it works on path, line, polyline, polygon, rect, ellipse and circle, and it only touches the stroke.22,23
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';
gsap.registerPlugin(DrawSVGPlugin);
gsap.from('#path', { drawSVG: 0, duration: 1.5 }); // from nothing to the whole stroke
gsap.fromTo('#path', { drawSVG: '50% 50%' }, { drawSVG: '0% 100%' }); // from the middle outward
gsap.fromTo('#path', { drawSVG: '0 12%' }, { drawSVG: '88% 100%' }); // a dash that travels
gsap.fromTo(path,
{ drawSVG: 0 },
{ drawSVG: "100%" })the grey line is the whole path. play strokes it in white.
one looping stroke drawn in grey across the panel. a menu picks how the white stroke over it is drawn: from the start, from the middle outward, from the end back, or as a short dash that travels its length. play runs the tween, the line of code shows the drawSVG values used, and a note gives the path's length and which part of it the end state shows.
what trips people up:
- some browsers won’t measure an element that isn’t rendered, like one with
display: noneor a mask insidedefs. make the tween once the element shows.23 - browsers draw a stroke badly when one path has several
Mcommands. split it into one path per segment.22 - it needs a stroke. a shape with a fill and no stroke draws nothing.22
svg morph
MorphSVGPlugin tweens one path’s d into another’s. it converts both to cubic béziers and adds points until they have the same number, then interpolates. it morphs path (and the points of a polyline or polygon); a circle, rect, ellipse or line becomes a path first with convertToPath.24,25
shapeIndex picks which point of the start maps to the first point of the end. that matters for closed shapes: the wrong one crosses over itself halfway. type: "rotational" tweens the angles and lengths of the points instead of their x and y, which can look more natural.24
import { MorphSVGPlugin } from 'gsap/MorphSVGPlugin';
gsap.registerPlugin(MorphSVGPlugin);
MorphSVGPlugin.convertToPath('circle, rect, ellipse, line, polygon, polyline'); // paths first
gsap.to('#shape', { morphSVG: '#star', duration: 0.8 }); // a selector, an element, or a d string
gsap.to('#shape', { morphSVG: { shape: '#star', shapeIndex: 3 } }); // which point maps to the first
gsap.to('#shape', { morphSVG: { shape: '#star', type: 'rotational' } });
gsap.to(shape, {
morphSVG: {
shape: "#circle",
type: "linear",
},
})pick a shape: the path morphs into it in 0.9 s. each point moves in a straight line to its new place.
one white shape and five buttons: circle, star, heart, bolt and square. a button morphs the shape into that one over nine tenths of a second, and a line under it says what moved and how. a menu switches the type between linear and rotational.
what trips people up:
- a
circleorrectcan’t morph as is. convert it, and morph the path you get back.24 shapeIndexonly applies to closed paths. a negative value reverses the start path.24- the plugin keeps the original
din adata-originalattribute, so morphing back to the element itself returns to it.25
flip
flip is a technique: first, last, invert, play. record where things are, change the layout any way you like, move them back to where they were with transforms, then animate the transforms away.26
the Flip plugin does the recording and the animating: Flip.getState(targets) before the change, Flip.from(state, vars) after it. it returns a timeline.27
- elements match up by identity, or by
data-flip-idwhen one element stands in for another. absolute: truetakes the elements out of flow during the flip, which flex and grid layouts often need.scale: trueresizes with transforms instead of width and height.nested: truekeeps a parent’s move from adding to its children’s.onEnterandonLeaveget the elements that are in only one of the two states, to fade them in or out.
import { Flip } from 'gsap/Flip';
gsap.registerPlugin(Flip);
const grid = document.querySelector('.grid');
const state = Flip.getState('.tile'); // first: where everything is now
grid.classList.toggle('as-row'); // last: change the layout
// invert and play: back to where they were, then animate to where they are
Flip.from(state, {
duration: 0.5,
ease: 'power2.inOut',
absolute: true,
onEnter: (els) => gsap.fromTo(els, { opacity: 0 }, { opacity: 1 }),
onLeave: (els) => gsap.to(els, { opacity: 0 }),
});
const state = Flip.getState(tiles);
setOrder(next); // react renders
// then, in a layout effect:
Flip.from(state, {
targets: tiles,
absolute: true,
});the tiles, in a row: a b c d e.
five tiles labelled a to e in a row, and three buttons: shuffle, reverse, and a switch between a row and a three-column grid. every change re-renders the tiles in their new places, flip slides each one from where it was, and a line spells out the new order.
what trips people up:
- react renders after your click, and may make new elements. call
Flip.fromonce it has, in auseLayoutEffect, and passtargetsso it finds them in the state bydata-flip-id.27 the figure’s hook,kit/use-flip.ts, does this. - an element you remove has no end state. to fade one out, keep it in the page with
display: noneand fade it inonLeave. it only shows during the fade withabsolute: trueorabsoluteOnLeave: true.27
split text
SplitText splits an element’s text into lines, words and characters, each in its own element (a div by default), so you can stagger them. revert() puts the original html back.28,29
type: what to split. the default is"chars,words,lines"; split only what you need.aria: by default the element gets anaria-labeland each piecearia-hidden, so a screen reader still reads the sentence.mask: wraps each piece in a clipping element, for reveals.autoSplit: true: lines depend on the width and the font, so it splits again when the fonts load or the width changes, and runsonSpliteach time.
import { SplitText } from 'gsap/SplitText';
gsap.registerPlugin(SplitText);
const split = SplitText.create('.headline', { type: 'words, chars' });
gsap.from(split.chars, { y: 16, opacity: 0, stagger: 0.02 });
// later: split.revert() puts the original html back
SplitText.create('.headline', {
type: 'lines',
mask: 'lines', // a clipping wrapper per line
autoSplit: true, // split again when the width or the fonts change
// return the tween, so a re-split reverts it and picks it up where it was
onSplit: (self) => gsap.from(self.lines, { yPercent: 100, stagger: 0.1 }),
});
every word moves on its own cue.
SplitText.create(el, {
type: "chars,words",
}).charsthe sentence 'every word moves on its own cue.' and three buttons: chars, words, lines. a button splits the sentence that way, staggers the pieces in, and prints how many there were: 26 characters, 7 words, and however many lines fit the width.
what trips people up:
- splitting by characters alone lets a word break across lines. split by words too, or set
smartWrap.28 - lines are a layout result. split after the fonts load, or let
autoSplitdo it, and make the animation insideonSplit.28 - with
aria: "auto", links inside the text lose their meaning to a screen reader. the docs suggestaria: "hidden"and a visually hidden copy of the text.28
pitfalls
- clean up. a tween, a trigger or a split outlives the component that made it.
gsap.context()collects everything made inside its function, andrevert()undoes it all. in react,useGSAPfrom@gsap/reactdoes that on unmount, which matters because strict mode runs effects twice.21,30 - reduced motion.
gsap.matchMedia()runs setup code only while a media query matches, and reverts it when the query stops matching. give it one branch forprefers-reduced-motion: reduceand one forno-preference.31,32 the figures here check the same query and jump each tween to its end withprogress(1). - register plugins. call
gsap.registerPlugin(...)once, before you use them. without it a bundler’s tree shaking can drop the plugin.33 - transforms. set every transform with gsap, the starting ones too, not in css. gsap reads a css transform back as a matrix in px, which loses units like
%and can’t tell 0 degrees from 360.11,7 - css transitions. a
transitionon a property gsap animates fights every value gsap writes, and slows the tween down. take it off.11
sources
-
gsap.ticker (opens in a new tab) in the gsap docs: it updates the global timeline on every requestAnimationFrame. ↩
-
the 3.13 release post (opens in a new tab) on gsap.com: thanks to webflow, the whole library, bonus plugins included, is free, commercial use included, and the plugins ship in the public npm package. the pricing page (opens in a new tab) says the entire library is free for all users, thanks to webflow. ↩
-
the standard “no charge” license (opens in a new tab), effective april 30, 2025, read on 2026-10-28. the readme (opens in a new tab) and
package.jsonat 3.15.0 point to it. it allows gsap on any website, web app or digital interface, rules out tools that build animations without code in competition with webflow’s, and leaves the intellectual property with webflow. its faq says commercial use is covered, plugins included. ↩ -
gsap.to() (opens in a new tab) in the gsap docs: what a target can be,
durationdefaulting to 0.5,easeto"power1.out", andimmediateRenderto false forto()and true forfrom()andfromTo(). the defaults in the source are gsap-core.js (opens in a new tab), lines 17 to 21 and 1092. ↩ ↩2 -
gsap.set() (opens in a new tab) in the gsap docs: a zero-duration
to()tween. ↩ -
gsap.defaults() (opens in a new tab) in the gsap docs. ↩
-
the css plugin (opens in a new tab) page in the gsap docs: the transform shorthands, the fixed order they apply in, why a
transformstring costs more,xPercent, andautoAlpha. ↩ ↩2 -
Tween (opens in a new tab) in the gsap docs: the methods. ↩
-
gsap.from() (opens in a new tab) in the gsap docs:
immediateRenderis true forfrom()tweens, so the start state renders at once, whatever the delay, andimmediateRender: falsemakes it wait, which is usually what you want in a timeline. ↩ -
avoiding fouc (opens in a new tab) in the gsap docs: the browser paints before your javascript runs, so hide the elements with
visibility: hiddenin css and show them withautoAlpha. ↩ -
common gsap mistakes (opens in a new tab) in the gsap docs: the
from()logic issues, setting all transforms with gsap, adding tweens to a timeline that has finished, and css transitions on the same properties. ↩ ↩2 ↩3 ↩4 -
Timeline (opens in a new tab) in the gsap docs:
defaults, which a timeline’s tweens inherit when they are created, nesting withadd(),timeScale(),progress(), and the controls. ↩ ↩2 -
the position parameter (opens in a new tab) in the gsap docs, and how it is read in gsap-core.js (opens in a new tab), lines 390 to 412. ↩ ↩2
-
a timeline’s
to(),from(),fromTo()andset()end withreturn thisin gsap-core.js (opens in a new tab), lines 1486 to 1507. ↩ -
easing (opens in a new tab) in the gsap docs: the families, the default of
power1.out, and which eases live in EasePack. ↩ ↩2 -
the ease formulas in gsap-core.js (opens in a new tab), lines 1023 to 1092: how
.outand.inOutderive from.in, the power family, back’s 1.70158, elastic’s 1 and 0.3 (0.45 for inOut), bounce’s four pieces, and steps. the halfway values, the 10% peak and the bounce heights are checked insite/src/visuals/gsap/ease.test.tsagainstgsap.parseEase. ↩ ↩2 -
staggers (opens in a new tab) in the gsap docs: the number, object and function forms, and
each,amount,from,grid,axisandease. ↩ ↩2 ↩3 -
distribute()in gsap-core.js (opens in a new tab), lines 452 to 506, which turns a stagger into each target’s delay, and the shuffle that"random"uses, line 450. the delays on this page are checked against it insite/src/visuals/gsap/stagger.test.ts. ↩ ↩2 -
ScrollTrigger (opens in a new tab) in the gsap docs:
startandendwith their defaults,scrub,toggleActions(default"play none none none"),pin,once,scroller,markers, when positions are worked out andrefresh(), and how duration works with a scrub. ↩ ↩2 ↩3 -
ScrollTrigger.js (opens in a new tab): the start default,
"0 100%"or"0 0"when pinned, at line 853, the end default at line 890,toggleActions: "play"at line 143, and the catch-up tween a numeric scrub makes at lines 654 to 661. ↩ -
gsap with react (opens in a new tab) in the gsap docs:
useGSAPreverts everything made inside it on unmount, and why cleanup matters with strict mode. ↩ ↩2 -
DrawSVGPlugin (opens in a new tab) in the gsap docs: the value syntax, the elements it works on, that it needs a stroke,
live, and splitting a path with several segments. ↩ ↩2 ↩3 -
DrawSVGPlugin.js (opens in a new tab): how a value is read at lines 30 to 43 and 151 to 157, the lengths per element type at lines 44 to 104 with the warning about invisible elements at line 63, and what it writes to the stroke at lines 205 to 210. ↩ ↩2
-
MorphSVGPlugin (opens in a new tab) in the gsap docs: converting to cubic béziers and adding points,
convertToPath,shapeIndex, andtype: "rotational". ↩ ↩2 ↩3 ↩4 -
MorphSVGPlugin.js (opens in a new tab): only
path,polylineandpolygontargets at lines 650 to 657,shapeIndexdefaulting to auto at line 664,data-originalat line 675, and the type falling back todefaultType, which is"linear", at lines 695 and 853. ↩ ↩2 -
paul lewis, flip your animations (opens in a new tab) (2015), where the technique and its name come from. ↩
-
Flip (opens in a new tab) and Flip.from() (opens in a new tab) in the gsap docs:
getState,from,absolute,scale,nested,onEnter,onLeave,absoluteOnLeave,data-flip-id, that it returns a timeline, and, for react, waiting for the render and passingtargets. ↩ ↩2 ↩3 -
SplitText (opens in a new tab) in the gsap docs:
create, the defaulttype,aria,mask,autoSplitwithonSplit,revert,smartWrap, and the note that spaces are not characters. ↩ ↩2 ↩3 ↩4 -
SplitText.ts (opens in a new tab): the
divandaria: "auto"defaults at line 141,aria-hiddenon each piece at line 149, thetypedefault at line 355,aria-labelat line 373, masks at lines 450 to 457, andrevert()at lines 483 to 497. ↩ -
gsap.context() (opens in a new tab) in the gsap docs. ↩
-
gsap.matchMedia() (opens in a new tab) in the gsap docs, with the
prefers-reduced-motionexample. ↩ -
accessible animation (opens in a new tab) in the gsap docs: the two matchMedia branches for reduced motion. ↩
-
gsap.registerPlugin() (opens in a new tab) and the installation (opens in a new tab) page in the gsap docs: register once, so tree shaking keeps the plugin. ↩