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.
- π§² 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
| 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 |
- Node.js 18+
- npm or yarn
# 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 devnpm run buildnpm run previewModify 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'
}
}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'
}
]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
- Push your code to GitHub
- Connect repository to Netlify
- Build settings are auto-configured via
netlify.toml - Deploy!
# Build the project
npm run build
# The 'dist' folder contains your static files
# Upload to any static hosting providerModify tailwind.config.js:
colors: {
'void': '#0a0a0f', // Background
'nebula': '#1a1a2e', // Secondary background
'plasma': '#6366f1', // Primary accent
'aurora': '#22d3ee', // Secondary accent
'solar': '#f59e0b' // Tertiary accent
}Customize the liquid mesh in LiquidBackground.svelte by modifying:
- Noise frequency and amplitude
- Color gradients
- Mouse influence radius
- Animation speed
- Lighthouse Score: 95+ Performance
- Bundle Size: ~150KB gzipped
- First Contentful Paint: < 1s
- Time to Interactive: < 2s
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- 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 β