🧠 Description
This project demonstrates a smooth scroll-based panel animation using GSAP ScrollTrigger.
Each fullscreen section pins to the viewport, then scales down and fades out as the user scrolls — creating a clean, cinematic transition between sections.
Why This Animation Feels Premium
- Fullscreen panel-based layout
- Scroll-driven scale & opacity animation
- Smooth pinning without layout jumps
- Minimal and modern UI
- GPU-friendly transform animations
- Perfect for landing pages, portfolios, and storytelling websites
Core Concept
Each .panel:
- Occupies 100vh
- Pins itself when reaching the viewport bottom
- Scales down (
1 → 0.6) - Fades out (
opacity: 1 → 0) - Unpins smoothly so the next section can take over
All motion is controlled purely by scroll — no timelines required.
💻 Step 1: HTML Structure
Complete HTML Code
HTML Breakdown
.slides-wrapper holds all scroll sections
Each .panel is a fullscreen slide
Headings + images create visual hierarchy
GSAP & ScrollTrigger loaded via CDN for simplicity
🎨 Step 2: CSS – Layout & Visual Styling
CSS Code
CSS Breakdown
CSS Variables → Easy theme control
100vh panels → Fullscreen experience
Flexbox centering → Perfect alignment
Clamp() typography → Responsive headings
Perspective → Prepares for future 3D effects
⚙️ Step 3: JavaScript – GSAP ScrollTrigger Logic
JavaScript Code
JavaScript Breakdown
Key Concepts Used:
ScrollTrigger.registerPlugin() → Enables scroll-based animations
gsap.utils.toArray() → Converts NodeList into an array
fromTo() → Explicit start & end animation states
scrub: true → Smooth frame-by-frame scroll sync
pin: true → Locks panel in viewport
pinSpacing: false → Prevents extra space after pin
Scroll Flow Explanation
Panel reaches bottom of viewport
Panel pins instantly
Scale + opacity animate on scroll
Panel releases smoothly
Next panel takes over
