svelte-threejs-gsap-magnetic-navigation-tailwind Svelte Themes

Svelte Threejs Gsap Magnetic Navigation Tailwind

🧲 Magnetic 3D Navigation — Modern navigation component with liquid WebGL background, magnetic cursor interactions, smooth scrolling, and GSAP animations. Built with Svelte, Three.js, and Tailwind CSS. Ready for Netlify deployment.

ā—† Magnetic 3D Navigation

A modern, configurable navigation component featuring liquid 3D mesh backgrounds, magnetic cursor interactions, and buttery smooth animations. Built with Svelte, Three.js, GSAP, and Tailwind CSS.


✨ Features

  • 🧲 Magnetic Cursor — Navigation links attract towards cursor with elastic physics
  • 🌊 Liquid 3D Background — WebGL mesh with procedural noise displacement
  • šŸŽÆ Smooth Scrolling — Lenis-powered buttery smooth scroll experience
  • šŸ“± Fully Responsive — Mobile-first design with adaptive interactions
  • ⚔ Performance First — Optimized shaders and efficient animations
  • šŸŽØ Easy Configuration — Simple data object for navigation customization
  • šŸ”Œ Integration Ready — Easy to embed in static sites or frameworks

šŸ›  Tech Stack

Technology Purpose
Svelte 4 Reactive UI framework with minimal bundle size
Three.js WebGL 3D graphics and custom shaders
GSAP 3 Professional-grade animations
Tween.js Smooth value interpolation
Lenis Smooth scroll library
Tailwind CSS Utility-first styling
Vite Lightning-fast build tool

šŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/smart-developer1791/svelte-threejs-gsap-magnetic-navigation-tailwind

# Navigate to project directory
cd svelte-threejs-gsap-magnetic-navigation-tailwind

# Install dependencies
npm install

# Start development server
npm run dev

Build for Production

npm run build

Preview Production Build

npm run preview

āš™ļø Configuration

Modify the navConfig object in App.svelte:

const navConfig = {
  brand: {
    name: 'YourBrand',
    icon: 'ā—†'
  },
  links: [
    { id: 'home', label: 'Home', href: '#home' },
    { id: 'about', label: 'About', href: '#about' },
    { id: 'services', label: 'Services', href: '#services' },
    { id: 'contact', label: 'Contact', href: '#contact' }
  ],
  cta: {
    label: 'Get Started',
    href: '#contact'
  }
}

Content Sections

Configure sections via the sections array:

const sections = [
  {
    id: 'about',
    title: 'Section Title',
    subtitle: 'Section Subtitle',
    content: 'Your content here...',
    features: ['Feature 1', 'Feature 2', 'Feature 3'],
    accent: 'plasma' // 'plasma' | 'aurora' | 'solar'
  }
]

šŸ“ Project Structure

svelte-threejs-gsap-magnetic-navigation-tailwind/
ā”œā”€ā”€ public/
│   └── favicon.svg
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ lib/
│   │   └── components/
│   │       ā”œā”€ā”€ Navigation.svelte       # Main navigation component
│   │       ā”œā”€ā”€ LiquidBackground.svelte # Three.js background
│   │       ā”œā”€ā”€ MagneticCursor.svelte   # Custom cursor
│   │       ā”œā”€ā”€ HeroSection.svelte      # Landing hero
│   │       ā”œā”€ā”€ ContentSection.svelte   # Reusable section
│   │       └── Footer.svelte           # Footer component
│   ā”œā”€ā”€ App.svelte                      # Root component
│   ā”œā”€ā”€ app.css                         # Global styles
│   └── main.js                         # Entry point
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ index.html
ā”œā”€ā”€ LICENSE
ā”œā”€ā”€ netlify.toml
ā”œā”€ā”€ package.json
ā”œā”€ā”€ postcss.config.js
ā”œā”€ā”€ README.md
ā”œā”€ā”€ tailwind.config.js
└── vite.config.js

🌐 Deployment

  1. Push your code to GitHub
  2. Connect repository to Netlify
  3. Build settings are auto-configured via netlify.toml
  4. Deploy!

Manual Deployment

# Build the project
npm run build

# The 'dist' folder contains your static files
# Upload to any static hosting provider

šŸŽØ Customization

Colors

Modify tailwind.config.js:

colors: {
  'void': '#0a0a0f',    // Background
  'nebula': '#1a1a2e',  // Secondary background
  'plasma': '#6366f1',  // Primary accent
  'aurora': '#22d3ee',  // Secondary accent
  'solar': '#f59e0b'    // Tertiary accent
}

Shader Effects

Customize the liquid mesh in LiquidBackground.svelte by modifying:

  • Noise frequency and amplitude
  • Color gradients
  • Mouse influence radius
  • Animation speed

šŸ“Š Performance

  • Lighthouse Score: 95+ Performance
  • Bundle Size: ~150KB gzipped
  • First Contentful Paint: < 1s
  • Time to Interactive: < 2s

šŸ¤ Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

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

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


šŸ™ Acknowledgments

  • Svelte — The magical disappearing framework
  • Three.js — 3D graphics made accessible
  • GSAP — Professional-grade animation
  • Lenis — Smooth scroll perfection
  • Tailwind CSS — Utility-first CSS

Pulled into orbit by cursor & code • Forged with Svelte, Three.js & endless ā˜•

Top categories

Loading Svelte Themes