/**
* Mesh Gradient Hero Section Template
*
* A hero section with animated mesh gradient background using @paper-design/shaders-react.
* Features smooth, fluid color transitions perfect for modern SaaS landing pages.
*
* Dependencies:
* - @paper-design/shaders-react
*/
'use client';
import { useEffect, useState } from 'react';
import { MeshGradient } from '@paper-design/shaders-react';
// ============================================
// TYPES
// ============================================
interface MeshGradientHeroProps {
title?: string;
highlightText?: string;
description?: string;
buttonText?: string;
onButtonClick?: () => void;
colors?: string[];
distortion?: number;
swirl?: number;
speed?: number;
offsetX?: number;
className?: string;
titleClassName?: string;
descriptionClassName?: string;
buttonClassName?: string;
maxWidth?: string;
veilOpacity?: string;
fontFamily?: string;
fontWeight?: number;
}
// ============================================
// COMPONENT
// ============================================
export function MeshGradientHero({
title = "Intelligent AI Agents for",
highlightText = "Smart Brands",
description = "Transform your brand and evolve it through AI-driven brand guidelines and always up-to-date core components.",
buttonText = "Join Waitlist",
onButtonClick,
colors = ["#72b9bb", "#b5d9d9", "#ffd1bd", "#ffebe0", "#8cc5b8", "#dbf4a4"],
distortion = 0.8,
swirl = 0.6,
speed = 0.42,
offsetX = 0.08,
className = "",
titleClassName = "",
descriptionClassName = "",
buttonClassName = "",
maxWidth = "max-w-6xl",
veilOpacity = "bg-white/20 dark:bg-black/25",
fontFamily = "Satoshi, sans-serif",
fontWeight = 500,
}: MeshGradientHeroProps) {
const [dimensions, setDimensions] = useState({ width: 1920, height: 1080 });
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
const update = () =>
setDimensions({
width: window.innerWidth,
height: window.innerHeight,
});
update();
window.addEventListener("resize", update);
return () => window.removeEventListener("resize", update);
}, []);
const handleButtonClick = () => {
if (onButtonClick) {
onButtonClick();
}
};
return (
{/* Mesh Gradient Background */}
{/* Content */}
{title} {highlightText}
{description}
);
}
// ============================================
// PRESET COLOR PALETTES
// ============================================
export const meshGradientPresets = {
// Soft pastels (default)
softPastels: ["#72b9bb", "#b5d9d9", "#ffd1bd", "#ffebe0", "#8cc5b8", "#dbf4a4"],
// Ocean vibes
ocean: ["#0077b6", "#00b4d8", "#90e0ef", "#caf0f8", "#023e8a", "#48cae4"],
// Sunset warmth
sunset: ["#ff6b6b", "#feca57", "#ff9ff3", "#ff6348", "#ffa502", "#ee5a24"],
// Aurora borealis
aurora: ["#667eea", "#764ba2", "#6B73FF", "#000DFF", "#a855f7", "#3b82f6"],
// Forest moss
forest: ["#2d6a4f", "#40916c", "#52b788", "#74c69d", "#95d5b2", "#b7e4c7"],
// Midnight purple
midnight: ["#1a1a2e", "#16213e", "#0f3460", "#533483", "#e94560", "#1a1a2e"],
// Candy pop
candy: ["#ff0099", "#ff6b6b", "#feca57", "#48dbfb", "#ff9ff3", "#54a0ff"],
};
// ============================================
// USAGE EXAMPLE
// ============================================
/*
import { MeshGradientHero, meshGradientPresets } from './mesh-gradient-hero';
function LandingPage() {
return (
console.log('clicked')}
colors={meshGradientPresets.aurora}
speed={0.3}
distortion={0.6}
/>
);
}
*/
export default MeshGradientHero;