Skip to content

AshimChoudhary/MacBook-Parallax-Studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ MacBook Pro Showcase - GSAP Animation Project

A stunning, interactive MacBook Pro showcase website featuring cutting-edge animations powered by GSAP (GreenSock Animation Platform), React Three Fiber, and Tailwind CSS. This project demonstrates advanced web animation techniques with smooth parallax effects, 3D model interactions, and immersive scrolling experiences.

MacBook GSAP GSAP Three.js Vite Tailwind CSS

๐Ÿ“ธ Screenshots

Hero Section

Hero Section MacBook Pro landing page with animated title and video background

3D Product Viewer

Product Viewer Interactive 3D MacBook models (14" & 16") with color customization

Showcase Section

Showcase M4 Chip features with video mask animation

Performance Section

Performance Multi-layer parallax effects with performance images

Features Section

Features AI-powered features with animated 3D models

Highlights Section

Highlights Product highlights in a masonry grid layout


โœจ Key Features

๐ŸŽฌ Advanced GSAP Animations

  • ScrollTrigger Integration: Animations triggered by scroll position
  • Timeline Animations: Complex sequenced animations
  • Parallax Effects: Multi-layer depth animations with different scroll speeds
  • Smooth Scrubbing: Direct scroll-to-animation linking

๐ŸŽจ Interactive 3D Models

  • React Three Fiber: WebGL-powered 3D rendering
  • Interactive Controls: Rotate, zoom, and explore MacBook models
  • Model Switching: Smooth transitions between 14" and 16" models
  • Material Animations: Dynamic opacity and fade effects

๐Ÿ–ผ๏ธ Visual Effects

  • Multi-Layer Parallax: 6+ different scroll speeds for depth
  • Rotation Parallax: Dynamic rotation based on scroll
  • Scale Animations: Zoom effects for emphasis
  • Blur & Focus: Depth-of-field effects
  • Opacity Transitions: Smooth fade in/out animations
  • Center Spotlight: Dramatic entrance/exit for featured content

๐Ÿ“ฑ Responsive Design

  • Mobile-first approach with Tailwind CSS
  • Breakpoint-specific animations
  • Touch-friendly interactions
  • Optimized for all screen sizes

๐ŸŽฏ Performance Optimizations

  • GPU-accelerated transforms
  • Efficient scroll listeners
  • Lazy loading of assets
  • Optimized 3D model rendering

๐Ÿ› ๏ธ Tech Stack

Core

  • React 19.1.1 - UI framework
  • Vite 7.1.7 - Build tool and dev server
  • JavaScript (ES6+) - Programming language

Animation & 3D

  • GSAP 3.13.0 - Professional-grade animation library
  • @gsap/react 2.1.2 - React hooks for GSAP
  • React Three Fiber 9.4.0 - React renderer for Three.js
  • @react-three/drei 10.7.6 - Useful helpers for R3F
  • Three.js 0.181.0 - 3D graphics library

Styling & UI

  • Tailwind CSS 4.1.16 - Utility-first CSS framework
  • @tailwindcss/vite 4.1.16 - Tailwind Vite plugin
  • clsx 2.1.1 - Conditional className utility

State Management

  • Zustand 5.0.8 - Lightweight state management

Utilities

  • react-responsive 10.0.1 - Media query hooks

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn

Steps

  1. Clone the repository
git clone https://github.com/AshimChoudhary/Macbook_GSAP.git
cd Macbook_GSAP
  1. Install dependencies
npm install
  1. Start development server
npm run dev
  1. Open in browser
Navigate to http://localhost:5173

๐ŸŽฏ Available Scripts

Command Description
npm run dev Start development server with hot reload
npm run build Build for production
npm run preview Preview production build locally
npm run lint Run ESLint for code quality

๐Ÿ“‚ Project Structure

Macbook_GSAP/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ fonts/              # Custom fonts
โ”‚   โ”œโ”€โ”€ models/             # 3D model files (.glb)
โ”‚   โ”œโ”€โ”€ videos/             # Video assets
โ”‚   โ””โ”€โ”€ *.png/svg           # Images and icons
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ models/         # 3D model components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Macbook-14.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Macbook-16.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Macbook.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ three/          # Three.js utilities
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ModelSwitcher.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ StudioLights.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Features.jsx    # AI Features section
โ”‚   โ”‚   โ”œโ”€โ”€ Footer.jsx      # Footer component
โ”‚   โ”‚   โ”œโ”€โ”€ Hero.jsx        # Landing hero section
โ”‚   โ”‚   โ”œโ”€โ”€ Highlights.jsx  # Product highlights
โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx      # Navigation bar
โ”‚   โ”‚   โ”œโ”€โ”€ Performance.jsx # Performance section with parallax
โ”‚   โ”‚   โ”œโ”€โ”€ ProductViewer.jsx # 3D product viewer
โ”‚   โ”‚   โ””โ”€โ”€ Showcase.jsx    # M4 chip showcase
โ”‚   โ”œโ”€โ”€ constants/
โ”‚   โ”‚   โ””โ”€โ”€ index.js        # App constants and data
โ”‚   โ”œโ”€โ”€ store/
โ”‚   โ”‚   โ””โ”€โ”€ index.js        # Zustand store
โ”‚   โ”œโ”€โ”€ App.jsx             # Main app component
โ”‚   โ”œโ”€โ”€ index.css           # Global styles
โ”‚   โ””โ”€โ”€ main.jsx            # App entry point
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ vite.config.js
โ””โ”€โ”€ README.md

๐ŸŽจ Animation Sections

1. Hero Section

  • Video playback animation
  • Text fade-in effects
  • Call-to-action button animations

2. Product Viewer

  • 3D model rendering
  • Interactive presentation controls
  • Model switching with slide animations
  • Color picker with active states
  • Size selector (14" / 16")

3. Showcase Section

  • Video mask animation
  • Text reveal on scroll
  • Opacity transitions
  • Multi-column layout animations

4. Performance Section

11 Different Animation Types:

  1. Multi-layer vertical parallax (6 layers)
  2. Horizontal parallax drift
  3. Rotation parallax (ยฑ5ยฐ)
  4. Scale depth effect
  5. Opacity fade transitions
  6. Blur-to-focus effect
  7. Center image spotlight (p5)
    • Dramatic zoom in/out
    • Rotation entrance/exit
    • Blur and brightness effects
    • Continuous glow effect
    • Pulsating scale animation

5. Features Section

  • 3D model showcase
  • Feature cards animation
  • Icon animations
  • Scroll-triggered reveals

6. Highlights Section

  • Masonry grid layout
  • Staggered card animations
  • Gradient effects
  • Hover interactions

๐Ÿ”ง Configuration

Vite Configuration

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
  plugins: [react(), tailwindcss()],
});

Tailwind Configuration

Custom theme with:

  • Custom fonts (Regular, Medium, SemiBold, Bold)
  • Custom colors (primary, dark, light variants)
  • Custom utilities (flex-center, col-center, abs-center)
  • Custom components

๐ŸŽฎ Interactive Features

3D Model Controls

  • Rotation: Click and drag to rotate
  • Zoom: Mouse wheel to zoom in/out
  • Snap: Auto-snap to default position
  • Presentation Mode: Smooth, physics-based controls

Color Customization

  • Space Gray (#adb5bd)
  • Midnight (#2e2c2e)
  • Smooth color transitions

Size Selection

  • 14" MacBook Pro
  • 16" MacBook Pro
  • Animated model switching

๐Ÿš€ Performance Features

Optimization Techniques

  • GPU Acceleration: Using transform3d and will-change
  • Scroll Optimization: Throttled scroll listeners
  • Lazy Loading: Models loaded on demand
  • Code Splitting: Dynamic imports for routes
  • Asset Optimization: Compressed images and models

Animation Performance

  • GSAP's gsap.set(): Instant property updates
  • ScrollTrigger caching: Optimized scroll calculations
  • useGSAP hook: Proper cleanup and scoping
  • Dependency tracking: Animations refresh on state changes

๐ŸŽ“ Learning Resources

This project demonstrates:

  • Advanced GSAP techniques
  • React Three Fiber integration
  • Scroll-based animations
  • Parallax effects
  • 3D model rendering
  • State management with Zustand
  • Responsive design patterns
  • Modern React practices

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is open source and available under the MIT License.


๐Ÿ‘จโ€๐Ÿ’ป Author

Ashim Choudhary


๐Ÿ™ Acknowledgments

  • Apple - Design inspiration
  • GSAP - Amazing animation library
  • Three.js Community - 3D graphics resources
  • React Three Fiber - Making 3D in React easy
  • Tailwind CSS - Utility-first CSS framework

๐Ÿ“ง Contact

For questions or feedback, please open an issue on GitHub.


โญ Star this repo if you found it helpful!

Made with โค๏ธ and GSAP

About

Interactive MacBook Pro showcase with advanced GSAP animations, React Three Fiber 3D models, and stunning parallax effects. Built with React, Vite, and Tailwind CSS.

Topics

Resources

Contributing

Stars

Watchers

Forks

Contributors