A modern, interactive cocktail bar website built with React and GSAP (GreenSock Animation Platform). This project serves as a comprehensive learning journey to master advanced GSAP animation techniques, including scroll-triggered animations, text splitting, video scrubbing, and complex timeline orchestrations.
This project is designed to master GSAP through hands-on implementation of professional-grade animations. Each component demonstrates different GSAP techniques and best practices, making it an ideal learning resource for developers looking to elevate their animation skills.
- Hero Section with video scrubbing and parallax leaf animations
- Text Animations using SplitText for character and word-level animations
- Scroll-Triggered Animations throughout the entire page
- Interactive Menu Slider with smooth transitions
- Mask Animations for creative reveal effects
- Responsive Design with mobile-optimized animations
- Smooth Scroll Interactions with pinning and scrubbing
- React 19 - Modern React with latest features
- Vite 7 - Lightning-fast build tool and dev server
- GSAP 3.14.2 - Professional animation library
- @gsap/react - React hooks for GSAP
- Tailwind CSS 4 - Utility-first CSS framework
- react-responsive - Media query hooks for responsive animations
- Scroll-based animations with custom start/end points
- Pin animations for fixed sections during scroll
- Scrub animations tied to scroll position
- Responsive scroll triggers for mobile/desktop
- Character-level text animations
- Word-level text splitting
- Line-by-line paragraph reveals
- Staggered text animations
- Complex animation sequences
- Parallel animations using position parameters
- Nested timelines for organized code
- Scroll-triggered timelines
- Video playback controlled by scroll position
- Smooth video timeline scrubbing
- Pin video during scroll animation
- CSS mask property animations
- Scale and position mask effects
- Reveal animations with masking
- Custom easing functions (
expo.out,power1.inOut) - Stagger animations for sequential reveals
- Smooth transitions between states
-
Clone the repository
git clone <repository-url> cd mojito
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Build for production
npm run build
-
Preview production build
npm run preview
After starting the development server, navigate to http://localhost:5173 (or the port shown in your terminal) to view the website.
- Hero: Scroll to see video scrubbing and parallax effects
- Cocktails: Scroll-triggered leaf animations
- About: Staggered grid image reveals
- Art: Mask animation reveal effects
- Menu: Interactive cocktail slider with transitions
- Contact: Scroll-triggered footer animations
mojito/
βββ public/
β βββ images/ # All image assets
β βββ videos/ # Video files for hero section
β βββ fonts/ # Custom fonts
βββ src/
β βββ components/
β β βββ Navber.jsx # Navigation component
β β βββ Hero.jsx # Hero with video scrubbing
β β βββ Cocktails.jsx # Cocktail list section
β β βββ About.jsx # About section with grid
β β βββ Art.jsx # Art section with masks
β β βββ Menu.jsx # Interactive menu slider
β β βββ Contact.jsx # Contact/footer section
β βββ constant/
β β βββ index.js # Data constants
β βββ App.jsx # Main app component
β βββ main.jsx # Entry point
β βββ index.css # Global styles
βββ package.json
βββ vite.config.js
βββ README.md
- Plugin Registration: Properly registering ScrollTrigger and SplitText plugins
- useGSAP Hook: Using React-specific GSAP hook for cleanup and performance
- Responsive Animations: Adapting animations based on screen size
- Performance: Using
scrubfor smooth scroll animations - Code Organization: Separating animation logic using timelines
- Accessibility: Maintaining semantic HTML while animating
- ScrollTrigger: Creating scroll-based animations
- Timelines: Orchestrating complex animation sequences
- SplitText: Advanced text animation techniques
- Easing Functions: Creating natural motion
- Stagger: Sequential element animations
- Pin: Fixed elements during scroll
- Scrub: Scroll-linked animations
ScrollTrigger- Scroll-based animationsSplitText- Text splitting for animations
- Mobile:
max-width: 767px - Desktop:
768pxand above
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- Add more GSAP plugins (MorphSVG, DrawSVG)
- Implement custom cursor animations
- Add page transitions
- Create animation presets library
- Add performance monitoring
- Implement lazy loading for animations
This project is for educational purposes to master GSAP animation techniques.
Built as a learning project to master GSAP (GreenSock Animation Platform).
Note: This project focuses on demonstrating GSAP capabilities. The cocktail bar theme serves as a creative canvas for implementing various animation techniques.