GSAP (GreenSock Animation Platform) was created by Jack Doyle around 2008 to provide smooth, high-performance animations for Flash.
When Flash declined, GSAP was rewritten in JavaScript (2012), quickly becoming the industry standard for web animation.
- Scrub animating
- Timeline composition
- CSS/JS property animation
- Bespoke property transitions
- Scattering, bouncing, 3D transforms
- No limits but what you can imagine (and time)
This layout uses a sticky scrub, which is a specific way of defining containers and elements to provide an easy timeline scrub context.
It consists of:
- Container (
height:auto) - Scrub (
height:>100vh) - Content (
position:sticky)
+-------------------- .container -------------------+
| +---------- .scrub ----------+ |
| | +--------------------+ | |
| | | .content | | |
| | +--------------------+ | |
| +----------------------------+ |
| +---------- .scrub ----------+ |
| | +--------------------+ | |
| | | .content | | |
| | +--------------------+ | |
| +----------------------------+ |
+---------------------------------------------------+
- As the
.containerelement scrolls, the.contentelement will get picked up by.scrubas part of thestickypositioning. - We use
.scrubas ourtriggerreference, because it is taller than100vhwe can use the overlap to scrub the elemments inside.content; - If we want a faster animation you can decrease the height of
.scrub - If we make
.scrubat100vhthe animation will be static
https://newmediapilot.github.io/gsap-examples/
npm i
npm run start
npm run deploy