Master GSAP: Build Award-Worthy Animated Websites

Learn GSAP animation fundamentals through seven core concepts (to, from, fromTo, timeline, stagger, scroll trigger, text animation), then build a fully animated Mojito cocktails landing page with scroll-triggered effects, parallax, masked reveals, and smooth transitions.

Why Front-End Development Still Matters

AI Cannot Replace Award-Worthy Interactions

While AI can generate basic UIs, it cannot craft cinematic animations and interactive experiences that stop users in their tracks. Real front-end developers using tools like GSAP create the standout, award-winning experiences that differentiate products.

GSAP: The Industry Standard for Web Animations

GSAP is a powerful, free animation library trusted by top-tier agencies and creatives worldwide. It enables smooth, performant animations that were previously paid-only skills, now democratized for all developers.

GSAP Fundamentals: Seven Core Concepts

gsap.to() – Animate to a New State

The to() method animates elements from their current state to a new state. You target an element by ID, specify properties (rotation, X position, etc.), set duration, and choose easing. Example: animating a box 250px right with 360° rotation over 1 second.

gsap.from() – Animate from a New State

The from() method animates elements from a specified state to their current state—the reverse of to(). If you set X to 250, the element starts at X:250 and animates back to X:0, creating an entrance effect.

gsap.fromTo() – Define Both Start and End States

The fromTo() method lets you specify both the starting state and the ending state explicitly. Pass two objects: the first defines the 'from' properties, the second defines the 'to' properties. Useful when you want precise control over the entire animation arc.

GSAP Timeline – Sequence Multiple Animations

A timeline is a container that manages multiple animations, allowing you to sequence them one after another or overlap them. You can pause, resume, and reverse the entire timeline. Essential for complex multi-step animations.

Stagger – Animate Multiple Elements with Delay

Stagger applies a time delay between animations of multiple elements. Instead of all boxes animating simultaneously, each one animates after the previous one, creating a wave or cascade effect. Can be a simple number (0.5 seconds) or a complex object with grid, axis, and from properties.

ScrollTrigger – Trigger Animations on Scroll

ScrollTrigger is a GSAP plugin that ties animations to scroll position. Define when an animation starts (e.g., 'top center') and ends (e.g., 'bottom top'). Use scrub to link animation progress directly to scroll speed, creating smooth parallax and reveal effects.

SplitText – Animate Text Character by Character

The SplitText plugin breaks text into individual characters, words, or lines, allowing you to animate each piece separately. Common use: stagger characters to create a wave-in effect where each letter appears one after another.

Easing Functions: Control Animation Feel

Common Easing Curves Shape Animation Personality

Easing functions control how an animation accelerates and decelerates. Examples: power1.inOut (smooth start and end), bounce.out (bouncy landing), elastic (springy), expo.out (fast then slow). Choose easing to match the emotional tone of your design.

Building the Mojito Cocktails Landing Page

Project Setup: React + Vite + Tailwind + GSAP

Create a new React app with Vite for fast builds. Install GSAP and register ScrollTrigger and SplitText plugins globally in App.jsx. Add Tailwind CSS for utility-first styling. This stack enables rapid, performant animation development.

Navbar with Scroll-Triggered Glass Effect

The navbar starts transparent and gains a dark, blurred background as the user scrolls past the hero section. Uses gsap.fromTo() with ScrollTrigger to animate background color and backdrop-filter blur from transparent to semi-opaque black.

Hero Section: Animated Title + Parallax Leaves

The hero title animates character-by-character using SplitText with a stagger of 0.06 seconds, creating a wave effect. Subtitle lines fade in with a 1-second delay. Two leaf images move up and down via scroll-triggered parallax (Y: 200 and Y: -200) as the user scrolls through the hero.

Video Scroll Animation: Frame-by-Frame Playback

A video of a cocktail glass is pinned to the screen while the user scrolls. The video's currentTime is tied to scroll progress via ScrollTrigger's scrub property, creating the illusion of the glass falling into the drink frame-by-frame. Video must be optimized with ffmpeg to have keyframes on every frame for smooth scrubbing.

Cocktails Section: Parallax Leaves + List Animation

Leaf images animate in from off-screen using a parallax timeline. Cocktail and mocktail lists fade in with staggered line animations. The section uses scroll triggers to start animations when the top of the section reaches 30% of the viewport.

About Section: Staggered Text + Grid Image Reveal

Title words fade in one by one. Grid images (arranged in a 3-6-3 and 8-4 layout) fade in with a stagger of 0.04 seconds. Animations overlap by 0.5 seconds to create a fluid, fast reveal sequence.

Art Section: Masked Image Reveal on Scroll

The art section is pinned while scrolling. Initial content fades out, then a mask image expands (scale 1 → 1.3, mask-size 0% → 400%) to reveal a barman creating cocktails. Final message fades in at the end. Creates an immersive 'entering the world' effect.

Menu Section: Carousel with Slide Animations

A carousel of cocktails with left/right arrow navigation. When switching slides, the new cocktail image slides in from the left (X: -100% → 0%) while the title and description fade in from below (Y: 100% → 0%). Animations re-trigger whenever the current index changes via useEffect dependency array.

Contact Footer: Staggered Text + Leaf Parallax

Footer title words fade in with stagger. Contact details (address, phone, email, hours) fade in with stagger. Leaf images move up/down via scroll trigger. All animations start when the top of the footer reaches the center of the viewport.

Advanced Techniques & Best Practices

Responsive Animations: Mobile vs. Desktop

Use useMediaQuery hook to detect screen size and adjust animation start/end values accordingly. Mobile devices have less viewport space, so trigger animations earlier and end them later to account for smaller screens.

Emotion-Driven Design: Animations Must Have Purpose

Every animation should serve a narrative or emotional goal, not just look cool. Example: leaves moving up/down make users feel they're entering a jungle; a drink sliding across the table makes them feel it's being served to them. This emotional connection increases engagement and conversion.

Performance: Keep Animations Fast and Smooth

Use short stagger delays (0.05–0.1 seconds) to keep animations snappy. Avoid long animations that make the site feel slow. Optimize videos for scroll scrubbing by ensuring every frame is a keyframe (use ffmpeg). Test on real devices to ensure 60 FPS.

GitHub Commits: Track Progress After Each Feature

Commit after implementing each section (navbar, hero, cocktails, etc.). This creates a clear history that recruiters can review to see your development process. Use descriptive commit messages like 'implement hero scroll animation'.

Deployment: Vercel One-Click Deploy

Connect your GitHub repo to Vercel. Every push automatically deploys. Share the live URL in your portfolio to showcase animations in action. Recruiters can interact with the site and see your skills firsthand.

Key Takeaways

GSAP Demystified: It's Not Magic, It's Smart Use of Video and Timing

Complex animations like the falling cocktail glass are often just videos played frame-by-frame or images revealed with masks. Once you understand the underlying technique, you can replicate it. This knowledge is what separates award-winning developers from the rest.

From Fundamentals to Production: You Now Have the Skills

You've learned the seven core GSAP concepts and applied them to a real, production-ready landing page. You understand scroll triggers, timelines, stagger, text animation, and responsive design. This foundation lets you build award-worthy animations in any future project.

Notable quotes

AI can spit out cookie cutter UIs, but it can't craft experiences worthy of awards. — Adrian
People pay thousands for these skills, but today you'll get them for free. — Adrian
Every animation has to make sense outside of just looking cool. — Adrian

Action items

  • Install GSAP and register ScrollTrigger and SplitText plugins in your React app
  • Set up Tailwind CSS and create utility classes for consistent styling
  • Build the navbar with scroll-triggered glass background effect
  • Implement hero section with SplitText character animation and parallax leaves
  • Create video scroll animation by tying video.currentTime to scroll progress
  • Build cocktails section with parallax and staggered list animations
  • Implement about section with grid image reveal and staggered text
  • Create art section with masked image expand effect on scroll
  • Build menu carousel with slide-in animations triggered on index change
  • Add footer with staggered text and leaf parallax animations
  • Optimize video with ffmpeg for smooth frame-by-frame scrubbing
  • Test animations on mobile and desktop; adjust start/end values for responsive behavior
  • Commit each feature to GitHub with descriptive messages
  • Deploy to Vercel and share live URL in your portfolio
JavaScript Mastery
2 hr 28 min video
3 min read
Master GSAP: Build Award-Worthy Animated Websites
You just saved 2 hr 25 min.
The big takeaway
Learn GSAP animation fundamentals through seven core concepts (to, from, fromTo, timeline, stagger, scroll trigger, text animation), then build a fully animated Mojito cocktails landing page with scroll-triggered effects, parallax, masked reveals, and smooth transitions.
Why Front-End Development Still Matters
AI Cannot Replace Award-Worthy Interactions
While AI can generate basic UIs, it cannot craft cinematic animations and interactive experiences that stop users in their tracks. Real front-end developers using tools like GSAP create the standout, award-winning experiences that differentiate products.
GSAP: The Industry Standard for Web Animations
GSAP is a powerful, free animation library trusted by top-tier agencies and creatives worldwide. It enables smooth, performant animations that were previously paid-only skills, now democratized for all developers.
GSAP Fundamentals: Seven Core Concepts
gsap.to() – Animate to a New State
The to() method animates elements from their current state to a new state. You target an element by ID, specify properties (rotation, X position, etc.), set duration, and choose easing. Example: animating a box 250px right with 360° rotation over 1 second.
1
Target element by ID (e.g., 'blue-box')
2
Define target properties (X: 250, rotation: 360)
3
Set duration (e.g., 2 seconds)
4
Choose easing (e.g., elastic, bounce.out)
5
Animation plays from current state to target state
How gsap.to() works: current state → target state
gsap.from() – Animate from a New State
The from() method animates elements from a specified state to their current state—the reverse of to(). If you set X to 250, the element starts at X:250 and animates back to X:0, creating an entrance effect.
Starting position
X: 250px (off-screen)
Ending position
X: 0px (current state)
gsap.from() reverses the animation direction
gsap.fromTo() – Define Both Start and End States
The fromTo() method lets you specify both the starting state and the ending state explicitly. Pass two objects: the first defines the 'from' properties, the second defines the 'to' properties. Useful when you want precise control over the entire animation arc.
1
Define 'from' object: X: 0, rotation: 0, borderRadius: 0%
2
Define 'to' object: X: 250, rotation: 360, borderRadius: 100%
3
Element animates from square to circle while moving right
fromTo() gives you explicit control over start and end
GSAP Timeline – Sequence Multiple Animations
A timeline is a container that manages multiple animations, allowing you to sequence them one after another or overlap them. You can pause, resume, and reverse the entire timeline. Essential for complex multi-step animations.
1
Create timeline: const tl = gsap.timeline()
2
Add first animation: tl.to(element1, {properties})
3
Add second animation: tl.to(element2, {properties})
4
Control entire sequence: tl.play(), tl.pause(), tl.reverse()
Timeline sequences animations with full control
Stagger – Animate Multiple Elements with Delay
Stagger applies a time delay between animations of multiple elements. Instead of all boxes animating simultaneously, each one animates after the previous one, creating a wave or cascade effect. Can be a simple number (0.5 seconds) or a complex object with grid, axis, and from properties.
1
Target multiple elements with same class
2
Apply stagger property: 0.5 (half-second delay between each)
3
Advanced: use stagger object with grid (2,1), axis (Y), from (center)
4
Result: elements animate in sequence, creating visual rhythm
Stagger creates cascading animations across multiple elements
ScrollTrigger – Trigger Animations on Scroll
ScrollTrigger is a GSAP plugin that ties animations to scroll position. Define when an animation starts (e.g., 'top center') and ends (e.g., 'bottom top'). Use scrub to link animation progress directly to scroll speed, creating smooth parallax and reveal effects.
1
Register ScrollTrigger plugin: gsap.registerPlugin(ScrollTrigger)
2
Create timeline with scroll trigger
3
Define start: 'top center' (element top hits screen center)
4
Define end: 'bottom top' (element bottom hits screen top)
5
Enable scrub: true for smooth scroll-linked animation
ScrollTrigger links animations to scroll position
SplitText – Animate Text Character by Character
The SplitText plugin breaks text into individual characters, words, or lines, allowing you to animate each piece separately. Common use: stagger characters to create a wave-in effect where each letter appears one after another.
1
Import SplitText from gsap/all
2
Create split: new SplitText(target, {type: 'chars, words'})
3
Access split.chars or split.words array
4
Animate each piece: gsap.from(split.chars, {stagger: 0.05})
SplitText enables per-character and per-word animations
Easing Functions: Control Animation Feel
Common Easing Curves Shape Animation Personality
Easing functions control how an animation accelerates and decelerates. Examples: power1.inOut (smooth start and end), bounce.out (bouncy landing), elastic (springy), expo.out (fast then slow). Choose easing to match the emotional tone of your design.
1
power1.inOut
Smooth, balanced acceleration
2
bounce.out
Bouncy landing effect
3
elastic
Spring-like, oscillating
4
expo.out
Fast start, slow finish
5
back.inOut
Slight overshoot on both ends
Different easing functions create different animation feels
Building the Mojito Cocktails Landing Page
Project Setup: React + Vite + Tailwind + GSAP
Create a new React app with Vite for fast builds. Install GSAP and register ScrollTrigger and SplitText plugins globally in App.jsx. Add Tailwind CSS for utility-first styling. This stack enables rapid, performant animation development.
1
npm create vite@latest (choose React + JavaScript)
2
npm install gsap @gsap/react react-responsive
3
npm install tailwindcss @tailwindcss/vite
4
Register plugins: gsap.registerPlugin(ScrollTrigger, SplitText)
5
Configure Tailwind in vite.config.js and index.css
Tech stack for animated landing pages
Navbar with Scroll-Triggered Glass Effect
The navbar starts transparent and gains a dark, blurred background as the user scrolls past the hero section. Uses gsap.fromTo() with ScrollTrigger to animate background color and backdrop-filter blur from transparent to semi-opaque black.
Hero Section: Animated Title + Parallax Leaves
The hero title animates character-by-character using SplitText with a stagger of 0.06 seconds, creating a wave effect. Subtitle lines fade in with a 1-second delay. Two leaf images move up and down via scroll-triggered parallax (Y: 200 and Y: -200) as the user scrolls through the hero.
0s
Title characters animate in (stagger 0.06s each)
1s
Subtitle lines fade in (delay 1s)
Scroll
Left leaf moves up, right leaf moves down (parallax)
Hero section animation sequence
Video Scroll Animation: Frame-by-Frame Playback
A video of a cocktail glass is pinned to the screen while the user scrolls. The video's currentTime is tied to scroll progress via ScrollTrigger's scrub property, creating the illusion of the glass falling into the drink frame-by-frame. Video must be optimized with ffmpeg to have keyframes on every frame for smooth scrubbing.
1
Render video element with ref
2
Create timeline with ScrollTrigger (pin: true, scrub: true)
3
On video load, tie video.currentTime to animation progress
4
Optimize video with ffmpeg for every-frame keyframes
5
Result: smooth frame-by-frame playback on scroll
Video scrubbing creates smooth scroll-linked playback
Cocktails Section: Parallax Leaves + List Animation
Leaf images animate in from off-screen using a parallax timeline. Cocktail and mocktail lists fade in with staggered line animations. The section uses scroll triggers to start animations when the top of the section reaches 30% of the viewport.
About Section: Staggered Text + Grid Image Reveal
Title words fade in one by one. Grid images (arranged in a 3-6-3 and 8-4 layout) fade in with a stagger of 0.04 seconds. Animations overlap by 0.5 seconds to create a fluid, fast reveal sequence.
Art Section: Masked Image Reveal on Scroll
The art section is pinned while scrolling. Initial content fades out, then a mask image expands (scale 1 → 1.3, mask-size 0% → 400%) to reveal a barman creating cocktails. Final message fades in at the end. Creates an immersive 'entering the world' effect.
Start
Section pinned, content visible
Mid-scroll
Content fades out, mask expands
End
Mask fully revealed, closing message fades in
Masked reveal creates immersive scroll experience
Menu Section: Carousel with Slide Animations
A carousel of cocktails with left/right arrow navigation. When switching slides, the new cocktail image slides in from the left (X: -100% → 0%) while the title and description fade in from below (Y: 100% → 0%). Animations re-trigger whenever the current index changes via useEffect dependency array.
1
Track currentIndex in state
2
Use modulo operator to loop carousel infinitely
3
On index change, trigger animations
4
Image slides from left: X -100% → 0%
5
Text fades in from below: Y 100% → 0%
Carousel animations trigger on slide change
Contact Footer: Staggered Text + Leaf Parallax
Footer title words fade in with stagger. Contact details (address, phone, email, hours) fade in with stagger. Leaf images move up/down via scroll trigger. All animations start when the top of the footer reaches the center of the viewport.
Advanced Techniques & Best Practices
Responsive Animations: Mobile vs. Desktop
Use useMediaQuery hook to detect screen size and adjust animation start/end values accordingly. Mobile devices have less viewport space, so trigger animations earlier and end them later to account for smaller screens.
Emotion-Driven Design: Animations Must Have Purpose
Every animation should serve a narrative or emotional goal, not just look cool. Example: leaves moving up/down make users feel they're entering a jungle; a drink sliding across the table makes them feel it's being served to them. This emotional connection increases engagement and conversion.
Performance: Keep Animations Fast and Smooth
Use short stagger delays (0.05–0.1 seconds) to keep animations snappy. Avoid long animations that make the site feel slow. Optimize videos for scroll scrubbing by ensuring every frame is a keyframe (use ffmpeg). Test on real devices to ensure 60 FPS.
GitHub Commits: Track Progress After Each Feature
Commit after implementing each section (navbar, hero, cocktails, etc.). This creates a clear history that recruiters can review to see your development process. Use descriptive commit messages like 'implement hero scroll animation'.
Deployment: Vercel One-Click Deploy
Connect your GitHub repo to Vercel. Every push automatically deploys. Share the live URL in your portfolio to showcase animations in action. Recruiters can interact with the site and see your skills firsthand.
Key Takeaways
GSAP Demystified: It's Not Magic, It's Smart Use of Video and Timing
Complex animations like the falling cocktail glass are often just videos played frame-by-frame or images revealed with masks. Once you understand the underlying technique, you can replicate it. This knowledge is what separates award-winning developers from the rest.
From Fundamentals to Production: You Now Have the Skills
You've learned the seven core GSAP concepts and applied them to a real, production-ready landing page. You understand scroll triggers, timelines, stagger, text animation, and responsive design. This foundation lets you build award-worthy animations in any future project.
Worth quoting
"AI can spit out cookie cutter UIs, but it can't craft experiences worthy of awards."
— Adrian, at [0:00]
"People pay thousands for these skills, but today you'll get them for free."
— Adrian, at [1:03]
"Every animation has to make sense outside of just looking cool."
— Adrian, at [132:57]
Try this
Install GSAP and register ScrollTrigger and SplitText plugins in your React app
Set up Tailwind CSS and create utility classes for consistent styling
Build the navbar with scroll-triggered glass background effect
Implement hero section with SplitText character animation and parallax leaves
Create video scroll animation by tying video.currentTime to scroll progress
Build cocktails section with parallax and staggered list animations
Implement about section with grid image reveal and staggered text
Create art section with masked image expand effect on scroll
Build menu carousel with slide-in animations triggered on index change
Add footer with staggered text and leaf parallax animations
Optimize video with ffmpeg for smooth frame-by-frame scrubbing
Test animations on mobile and desktop; adjust start/end values for responsive behavior
Commit each feature to GitHub with descriptive messages
Deploy to Vercel and share live URL in your portfolio
Made with Glimpse by Wozart
glimpse.wozart.com/v/xun4tsdb
Share this infographic

More like this