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