"use client";
import { ThemeColor, DesignConfig, DAISY_THEMES, HEROUI_MARKETING_THEMES, ACETERNITY_THEMES } from "./types";
function fontStack(font?: string) {
if (font === "plus-jakarta") return '"Plus Jakarta Sans", system-ui, sans-serif';
if (font === "dm-sans") return '"DM Sans", system-ui, sans-serif';
if (font === "geist") return '"Geist", system-ui, sans-serif';
if (font === "inter") return '"Inter", system-ui, sans-serif';
if (font === "nunito") return '"Nunito", system-ui, sans-serif';
return "system-ui, sans-serif";
}
// CSS keyframes injected once per component render (scoped names prevent conflicts)
const ACE_KEYFRAMES = `
@keyframes ace-blob1 {
0%,100% { transform: translate(0%,0%) scale(1); }
33% { transform: translate(28%,-22%) scale(1.12); }
66% { transform: translate(-18%,18%) scale(0.9); }
}
@keyframes ace-blob2 {
0%,100% { transform: translate(0%,0%) scale(1); }
33% { transform: translate(-24%,14%) scale(0.95); }
66% { transform: translate(20%,-24%) scale(1.08); }
}
@keyframes ace-blob3 {
0%,100% { transform: translate(0%,0%) rotate(0deg); }
50% { transform: translate(12%,-14%) rotate(180deg); }
}
@keyframes ace-blob4 {
0%,100% { transform: translate(0%,0%) scale(1); }
50% { transform: translate(-16%,20%) scale(1.1); }
}
@keyframes ace-meteor {
0% { transform: translateX(0) translateY(0) rotate(-35deg); opacity: 1; }
70% { opacity: 0.6; }
100% { transform: translateX(160px) translateY(160px) rotate(-35deg); opacity: 0; }
}
@keyframes ace-sparkle {
0%,100% { opacity:0; transform:scale(0.4); }
40%,60% { opacity:1; transform:scale(1); }
}
@keyframes ace-cursor {
0%,100% { opacity:1; } 50% { opacity:0; }
}
@keyframes ace-marquee {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
}
@keyframes ace-beam-pulse {
0%,100% { opacity:0.08; } 50% { opacity:0.22; }
}
@keyframes ace-lamp {
0%,100% { opacity:0.6; transform:scaleX(1); }
50% { opacity:1; transform:scaleX(1.15); }
}
`;
// ---------------------------------------------------------------------------
// Aceternity UI
// ---------------------------------------------------------------------------
export function MarketingAceternity({ themeColor, config }: { themeColor?: ThemeColor; config?: DesignConfig }) {
const accent = themeColor ?? ACETERNITY_THEMES[0];
const p = accent.primary;
const p2 = accent.ring.replace("0.4)", "1)").replace("rgba(", "rgb("); // second accent
const isDark = config?.mode !== "light";
const bgStyle = config?.background ?? "beams";
const navStyle = config?.nav ?? "minimal";
const hdrStyle = config?.header ?? "gradient-text";
const comps = config?.components ?? ["features", "moving-cards"];
const ff = fontStack(config?.font);
// sparkles forces black; aurora forces light; shader always dark-text-over-vibrant
const forcedDark = bgStyle === "sparkles" || bgStyle === "shader";
const forcedLight = bgStyle === "aurora";
const effectiveDark = forcedDark ? true : forcedLight ? false : isDark;
const bg = forcedDark ? "#000" : forcedLight ? "#f8f9ff" : isDark ? "#050010" : "#fafafa";
const text = effectiveDark ? "#fff" : "#0f172a";
const muted = effectiveDark ? "rgba(255,255,255,0.38)" : "#64748b";
const card = effectiveDark ? "rgba(255,255,255,0.035)" : "rgba(0,0,0,0.03)";
const border= effectiveDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.08)";
// ── Background layers ──────────────────────────────────────────────────────
const BgLayer = () => {
// Animated gradient blobs — mirrors Aceternity's Background Gradient Animation
if (bgStyle === "gradient") return (
);
// Lines Gradient Shader — bold diagonal rainbow band: purple→pink→orange→yellow
if (bgStyle === "shader") return (
{/* Diagonal gradient band */}
{/* Subtle line overlay */}
{/* Soft vignette */}
);
// Background Beams — SVG-style radial beams on dark bg
if (bgStyle === "beams") return (
);
// Meteors — diagonal shooting-star streaks with glow tails
if (bgStyle === "meteors") return (
{Array.from({ length: 12 }).map((_, i) => (
))}
);
// Sparkles — true black bg with small twinkling star particles
if (bgStyle === "sparkles") return (
{Array.from({ length: 40 }).map((_, i) => {
const size = i % 6 === 0 ? 3 : i % 3 === 0 ? 2 : 1.5;
return (
);
})}
);
// Aurora — soft lavender/blue glow on a LIGHT background (matches Aceternity's Aurora)
if (bgStyle === "aurora") return (
);
if (bgStyle === "wavy") return (
);
if (bgStyle === "dot-grid") return (
);
return ;
};
const floatingNav = navStyle === "floating";
return (
{/* Nav */}
{floatingNav ? (
) : (
)}
{/* Hero */}
{hdrStyle === "gradient-text" && (
✦ Open source · 12k GitHub stars
Build the future
of the web
Beautifully crafted components built with Tailwind CSS and Framer Motion.
)}
{hdrStyle === "lamp" && (
{/* Lamp cone */}
Build the future
of the web
Powered by Framer Motion and Tailwind CSS.
)}
{hdrStyle === "typewriter" && (
The future is here
Build the future
of the web
Components that bring ideas to life.
)}
{/* Sections */}
{comps.includes("badge") && (
✦ v2.0 just shipped — see what's new →
)}
{comps.includes("features") && (
{[{ label: "Animated", icon: "✦", c: p }, { label: "Accessible", icon: "◎", c: "#3b82f6" }, { label: "Open source", icon: "⬡", c: "#22c55e" }].map(f => (
{f.icon}
{f.label}
Built for production
))}
)}
{comps.includes("moving-cards") && (
Trusted by developers worldwide
{[...Array(2)].map((_, pass) => (
{[
{ text: "\"Game changer for our team.\"", name: "Sarah K.", role: "CTO" },
{ text: "\"Ships 3× faster than before.\"", name: "James R.", role: "Eng Lead" },
{ text: "\"Zero-config deploys.\"", name: "Mia L.", role: "Founder" },
{ text: "\"Best DX I've ever had.\"", name: "Tom W.", role: "Developer" },
].map(t => (
{t.text}
— {t.name} · {t.role}
))}
))}
)}
{comps.includes("bento") && (
)}
{comps.includes("pricing") && (
{[{ plan: "Starter", price: "Free", hi: false }, { plan: "Pro", price: "$29/mo", hi: true }, { plan: "Enterprise", price: "Custom", hi: false }].map(pl => (
{pl.plan}
{pl.price}
{pl.hi &&
Most popular
}
))}
)}
{comps.includes("cta") && (
Start building today
Join thousands of developers worldwide.
)}
);
}
// ---------------------------------------------------------------------------
// DaisyUI
// ---------------------------------------------------------------------------
export function MarketingDaisy({ themeColor, config }: { themeColor?: ThemeColor; config?: DesignConfig }) {
const theme = themeColor ?? DAISY_THEMES[0];
const isDark = config ? config.mode === "dark" : (theme.bg ?? "#fff").match(/^#[012]/i) !== null;
const bg = isDark ? (theme.bg ?? "#1d232a") : (theme.bg?.match(/^#[012]/) ? "#fff" : (theme.bg ?? "#fff"));
const text = isDark ? (theme.textColor ?? "#a6adba") : (theme.textColor ?? "#1f2937");
const muted = isDark ? (theme.mutedText ?? "rgba(255,255,255,0.4)") : (theme.mutedText ?? "#6b7280");
const card = isDark ? (theme.cardBg ?? "rgba(255,255,255,0.04)") : (theme.cardBg ?? "#f9fafb");
const border = isDark ? (theme.borderColor ?? "rgba(255,255,255,0.09)") : (theme.borderColor ?? "#e5e7eb");
const bgStyle = config?.background ?? "solid";
const navStyle = config?.nav ?? "standard";
const hdrStyle = config?.header ?? "centered";
const comps = config?.components ?? ["features", "pricing"];
const ff = fontStack(config?.font);
const heroBgLayer =
bgStyle === "gradient" ? `radial-gradient(ellipse 80% 55% at 50% -5%, ${theme.primary}45, transparent)` :
bgStyle === "noise" ? "none" : "none";
return (
{bgStyle === "pattern" &&
}
{/* Nav */}
{navStyle === "pill" ? (
) : (
)}
{/* Hero — centered */}
{hdrStyle === "centered" && (
{heroBgLayer &&
}
✦ {theme.label} theme · just shipped
Build faster,
ship smarter
The all-in-one platform that helps teams build, launch, and scale.
)}
{hdrStyle === "split" && (
{heroBgLayer &&
}
✦ {theme.label}
Build faster,
ship smarter
The platform teams trust to ship faster.
{["#ff5f56","#ffbd2e","#27c93f"].map(c =>
)}
{[["Revenue","$12k"],["Users","2.8k"],["Growth","+24%"]].map(([k,v]) => (
))}
)}
{hdrStyle === "stats" && (
{heroBgLayer &&
}
Build faster,
ship smarter
Trusted by thousands of teams worldwide.
{[["50k+","Teams"],["99.9%","Uptime"],["10ms","Latency"]].map(([v, l]) => (
))}
)}
{/* Sections */}
{comps.includes("logos") && (
Trusted by
{["Vercel","Stripe","Linear","Notion","Supabase"].map(b => {b})}
)}
{comps.includes("features") && (
{[{ icon: "⚡", title: "Lightning fast", desc: "Deploy in seconds" }, { icon: "🔒", title: "Secure by default", desc: "Enterprise-grade" }, { icon: "📈", title: "Scales with you", desc: "0 to millions" }].map(f => (
{f.icon}
{f.title}
{f.desc}
))}
)}
{comps.includes("steps") && (
How it works
{["Connect your repo","Configure stack","Deploy in seconds"].map((s, i) => (
))}
)}
{comps.includes("testimonials") && (
{[{ q: "\"Deployed in 5 minutes.\"", name: "Sarah K.", role: "CTO" }, { q: "\"Cut infra costs 40%.\"", name: "James R.", role: "Eng Lead" }].map(t => (
{t.q}
{t.name} · {t.role}
))}
)}
{comps.includes("pricing") && (
Simple pricing
{[{ plan: "Starter", price: "Free", hi: false }, { plan: "Pro", price: "$29/mo", hi: true }, { plan: "Enterprise", price: "Custom", hi: false }].map(p => (
))}
)}
{comps.includes("faq") && (
FAQ
{["What's included in free?","Can I upgrade anytime?","Team billing?"].map((q, i) => (
{q}
{i === 0 ? "−" : "+"}
))}
)}
{comps.includes("cta") && (
Ready to ship faster?
Join 50,000+ teams already on Acme.
)}
);
}
// ---------------------------------------------------------------------------
// HeroUI
// ---------------------------------------------------------------------------
export function MarketingHeroUI({ themeColor, config }: { themeColor?: ThemeColor; config?: DesignConfig }) {
const theme = themeColor ?? HEROUI_MARKETING_THEMES[0];
const isDark = config ? config.mode === "dark" : (theme.bg ?? "#fff") === "#09090b";
const bg = isDark ? (theme.bg ?? "#09090b") : (theme.bg ?? "#fff");
const text = isDark ? (theme.textColor ?? "#f4f4f5") : (theme.textColor ?? "#18181b");
const muted = isDark ? (theme.mutedText ?? "#71717a") : (theme.mutedText ?? "#71717a");
const card = isDark ? (theme.cardBg ?? "#18181b") : (theme.cardBg ?? "#fafafa");
const border = isDark ? (theme.borderColor ?? "#27272a") : (theme.borderColor ?? "#f4f4f5");
const bgStyle = config?.background ?? "clean";
const navStyle = config?.nav ?? "blur";
const hdrStyle = config?.header ?? "animated-badge";
const comps = config?.components ?? ["features", "metrics"];
const ff = fontStack(config?.font);
const navBlur = navStyle === "blur";
const navBg = navBlur ? (isDark ? "rgba(9,9,11,0.65)" : "rgba(255,255,255,0.65)") : navStyle === "minimal" ? "transparent" : bg;
const heroBgOverlay =
bgStyle === "gradient-mesh" ? `radial-gradient(ellipse 65% 55% at 25% 40%, ${theme.primary}22, transparent 55%), radial-gradient(ellipse 55% 50% at 78% 62%, #06b6d420, transparent 55%)` :
bgStyle === "glass" ? `linear-gradient(130deg, ${theme.primary}12, ${isDark ? "#18181b" : "#fff"} 55%)` :
bgStyle === "aurora" ? `radial-gradient(ellipse 80% 60% at 50% -10%, ${theme.primary}38, transparent 70%)` :
undefined;
return (
{heroBgOverlay &&
}
{/* Nav */}
{hdrStyle === "animated-badge" && (
🚀 Now in public beta · Join 12k users
Build faster,
ship smarter
The all-in-one platform for teams that move fast.
)}
{hdrStyle === "split" && (
🚀 Beta
Build faster,
ship smarter
The platform for fast-moving teams.
{["#ff5f56","#ffbd2e","#27c93f"].map(c =>
)}
{["Revenue $12k","Users 2.8k","Growth +24%","Churn 2.1%"].map(m => (
{m.split(" ")[0]}
{m.split(" ")[1]}
))}
)}
{hdrStyle === "gradient" && (
Build faster.
Ship smarter.
Everything your team needs in one platform.
)}
{/* Sections */}
{comps.includes("features") && (
{[{ icon: "⚡", title: "10× faster deploys" }, { icon: "🔒", title: "Zero-trust security" }, { icon: "📦", title: "Any stack" }, { icon: "🌍", title: "Global CDN" }].map(f => (
))}
)}
{comps.includes("metrics") && (
Live metrics
{["Revenue $128k","Users 24.8k","Growth +34%","Churn 1.4%"].map(m => (
{m.split(" ")[0]}
{m.split(" ")[1]}
))}
)}
{comps.includes("avatars") && (
{[theme.primary,"#2563eb","#0d9488","#e11d48"].map((c, i) => (
0 ? -9 : 0 }} />
))}
Trusted by 50,000+ teams
)}
{comps.includes("pricing") && (
{[{ plan: "Starter", price: "Free", hi: false }, { plan: "Pro", price: "$29/mo", hi: true }, { plan: "Enterprise", price: "Custom", hi: false }].map(p => (
))}
)}
{comps.includes("testimonials") && (
{[{ q: "\"Shipped 3× faster since switching.\"", name: "Sarah K." }, { q: "\"Cut infra costs by 40%.\"", name: "James R." }].map(t => (
))}
)}
{comps.includes("cta") && (
Ready to ship faster?
Join 50,000+ teams already on Acme.
)}
);
}
// ---------------------------------------------------------------------------
// Tailwind only
// ---------------------------------------------------------------------------
export function MarketingTailwind({ themeColor, config }: {
themeColor?: ThemeColor; config?: DesignConfig;
}) {
const isDark = config?.mode === "dark";
const bgStyle = config?.background ?? "clean";
const navStyle = config?.nav ?? "minimal";
const hdrStyle = config?.header ?? "editorial";
const comps = config?.components ?? ["features", "stats", "pricing"];
const ff = fontStack(config?.font);
// Use themeColor accent if provided (shadcn palette)
const accent = themeColor?.primary ?? "#09090b";
const accentFg = themeColor?.primaryFg ?? "#fff";
const bg = isDark ? "#09090b" : "#fff";
const text = isDark ? "#f4f4f5" : "#09090b";
const muted = isDark ? "#71717a" : "#71717a";
const card = isDark ? "#18181b" : "#f9fafb";
const border= isDark ? "#27272a" : "#e5e7eb";
const navBg = navStyle === "minimal" ? "transparent" : bg;
return (
{bgStyle === "dot-grid" && (
)}
{bgStyle === "lines" && (
)}
{/* Nav */}
{hdrStyle === "editorial" && (
Now in public beta
The platform
built for scale
Everything your team needs to build, deploy, and monitor production applications.
)}
{hdrStyle === "split" && (
Public beta
The platform
built for scale
Deploy anywhere. Monitor everything.
{["#ff5f56","#ffbd2e","#27c93f"].map(c =>
)}
$ git push origin main
✓ Build complete · 2.1s
→ Deployed to prod
)}
{hdrStyle === "centered" && (
The platform
built for scale
Everything your team needs.
)}
{comps.includes("badge") && (
→ v2.0 released — see what's new
)}
{comps.includes("logos") && (
Trusted by
{["Vercel","Stripe","Linear","Notion","Supabase"].map(b => {b})}
)}
{comps.includes("features") && (
{[{ title: "99.9% uptime SLA", desc: "Enterprise reliability" }, { title: "10ms avg latency", desc: "Edge-first network" }, { title: "SOC2 compliant", desc: "Security baked in" }, { title: "GDPR ready", desc: "Privacy by default" }].map(f => (
))}
)}
{comps.includes("stats") && (
{[["50k+","Teams"],["99.9%","Uptime"],["10ms","Latency"],["$0","To start"]].map(([v, l], i) => (
))}
)}
{comps.includes("testimonials") && (
{[{ q: "\"Shipped 3× faster.\"", name: "Sarah K.", role: "CTO" }, { q: "\"Cut costs by 40%.\"", name: "James R.", role: "Eng Lead" }].map(t => (
{t.q}
{t.name} · {t.role}
))}
)}
{comps.includes("pricing") && (
{[{ plan: "Starter", price: "Free", hi: false }, { plan: "Pro", price: "$29/mo", hi: true }, { plan: "Enterprise", price: "Custom", hi: false }].map(p => (
))}
)}
{comps.includes("faq") && (
{["What's included in free?","Can I upgrade anytime?","Do you offer team plans?"].map((q, i) => (
{q}
{i === 0 ? "−" : "+"}
))}
)}
{comps.includes("cta") && (
Ready to ship faster?
Join 50,000+ teams already on Acme.
)}
);
}
export { DAISY_THEMES, HEROUI_MARKETING_THEMES, ACETERNITY_THEMES };