A beautiful and intuitive mesh gradient generator built with Nuxt 4. Create stunning gradients for your next project with precision and style.
🌐 Live Demo: https://mesh-magic-hbt934.cranl.net/
- 🎨 Interactive Gradient Editor - Create beautiful mesh gradients with a user-friendly interface
- 🎯 Precise Controls - Adjust position, blur, size, and colors with pixel-perfect precision
- 🌈 Quick Themes - Apply pre-defined color themes (Cosmic, Mystic, Sunset, Ocean, Forest, Aurora)
- 🔄 Real-time Preview - See your changes instantly as you customize
- Framework: Nuxt 4
- UI Components: shadcn-vue
- Styling: Tailwind CSS v4
- Icons: Hugeicons
- UI Primitives: reka-ui
- Animations: GSAP
Goal: Generate a shareable URL containing the gradient configuration.
Steps:
- Serialize
configto a JSON string. - Compress using
LZStringorpakofor URL-friendliness. - Encode to Base64 and append to the URL as a query param (e.g.,
?g=...). - On page load, detect the param, decode, and apply the config.
- Add a "Copy Share Link" button.
Goal: Ensure smooth rendering even with 10+ layers, with a max count of 15 layers at max count.
Steps:
- Debounce/throttle slider updates using VueUse's
useDebounceFn. - Use
v-memoorshallowReffor layer arrays where deep reactivity isn't needed. - Consider rendering layers to an offscreen canvas for heavy blur effects.
- Profile with Vue DevTools and Chrome Performance tab to find bottlenecks.
- Node.js 20+ (or Bun, pnpm, yarn)
- npm, pnpm, yarn, or bun
Install dependencies:
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun installStart the development server:
# npm
npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run devVisit http://localhost:3000 to see your application.
Build the application for production:
# npm
npm run build
# pnpm
pnpm build
# yarn
yarn build
# bun
bun run buildPreview the production build locally:
# npm
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run previewmesh-magic/
├── app/
│ ├── components/ # Vue components
│ │ ├── ui/ # UI components (shadcn-vue)
│ │ └── Mesh/ # Mesh gradient components
│ ├── composables/ # Composables (useMeshGradient, etc.)
│ ├── layouts/ # Layout components
│ ├── pages/ # Pages/routes
│ └── assets/ # Static assets and styles
├── public/ # Public static files
└── nuxt.config.ts # Nuxt configuration
This project is private and proprietary.
Built with 💚 using Nuxt 4
