The goal was to build a landing page that showcases featured content while staying clean, modern, and user-friendly. We also needed to integrate smooth scroll-triggered animations and ensure the layout stayed responsive with real-time visual updates.
This project pushed me to deeply understand how to coordinate GSAP animations with React rendering while maintaining clean and scalable layout code using Tailwind CSS.
🧪 Case Study: Challenges I Faced Building a Scroll-Triggered Featured Section with React, GSAP, and Tailwind
While building a modern “Featured Works” section using React.js, GSAP, and Tailwind CSS, I encountered a few key challenges that tested my problem-solving and animation integration skills.
1. 🧩 Structuring the Layout with Tailwind CSS Grid
Challenge:
Creating a two-column layout (with a clear vertical dividing line) using only utility classes was tricky. I needed precise alignment between the left (text and decorative shape) and the right (image grid), while also making it responsive.
Solution:
I used Tailwind’s grid grid-cols-2 and applied border-r and border-t utilities to draw the vertical and top dividers. It was important to wrap each side with py and px padding to control spacing. This kept the layout clean and responsive without custom CSS.
2. 🎬 Staggered Scroll Animations with GSAP + ScrollTrigger
Challenge:
I wanted the image grid to stagger in as the section enters the viewport, but coordinating GSAP animations with React’s rendering and refs took some trial and error.
Solution:
I used the useGSAP() hook from @gsap/react and registered ScrollTrigger. Then, I targeted all grid items using a shared class (.featured-item) and animated them using:
The key fix was ensuring the animation runs after React renders by wrapping it inside useGSAP, and referencing the container correctly.
3. 🎨 Keeping Tailwind Utility Classes Manageable
Challenge:
With many elements (text, images, buttons), I initially overused Tailwind classes, which made the JSX unreadable.
Solution:
I grouped related styles into reusable components and meaningful classNames. I also kept the styling consistent using Tailwind’s design tokens (e.g., text-sm, rounded-lg, bg-[#2C2C2C]) and avoided inlining unnecessary repetition.
4. 🧵 Styling Vertical and Horizontal Grid Lines
Challenge:
The grid of images needed thin dividers between each image (without affecting the outer padding or responsiveness).
Solution:
I applied border-r and border-b to each grid cell and used a parent grid grid-cols-2 border-t border-l setup. I also used border-[#2C2C2C] to match the design.
This produced clean, responsive vertical and horizontal lines with no extra wrapper divs or custom CSS.
✅ Final Thoughts
This section taught me how to:
- Combine GSAP animations cleanly with React’s lifecycle 
- Leverage Tailwind CSS grid utilities and borders for layout precision 
- Maintain readable component structure while using utility-first CSS 
- Animate multiple elements in staggered sequence triggered on scroll 
It was a rewarding challenge that improved both my animation logic and layout skills in modern frontend workflows.




