Retro 3D Grid
Retro 3D perspective grid background with scrolling emerald lines and horizon glow. Synthwave-style React component for hero sections, gaming sites, and devtool landing pages. Pure CSS animation, no canvas required.
Dependencies
react
npm install react react-domexport function Retro3DGridBackground({ children }: { children?: React.ReactNode }) {
return (
<div className="relative min-h-screen overflow-hidden bg-zinc-950">
<div
className="pointer-events-none absolute inset-0 origin-bottom"
aria-hidden
style={{
backgroundImage:
"linear-gradient(rgba(16,185,129,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(16,185,129,0.35) 1px, transparent 1px)",
backgroundSize: "48px 48px",
transform: "perspective(500px) rotateX(60deg) scale(2)",
transformOrigin: "center 80%",
animation: "grid-scroll 3s linear infinite",
}}
/>
<div className="pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-emerald-500/20 to-transparent" aria-hidden />
<style>{`@keyframes grid-scroll{0%{transform:perspective(500px) rotateX(60deg) scale(2) translateY(0)}100%{transform:perspective(500px) rotateX(60deg) scale(2) translateY(48px)}}`}</style>
{children && <div className="relative z-10">{children}</div>}
</div>
);
}
Please implement this code in the current project and add it to (Your Desired Section, e.g. homepage hero, pricing page, dashboard). Change the primary accent color to (YOUR HEX CODE COLOR, e.g. #6366F1).
Requirements:
- Use React + Tailwind CSS (match the project's existing setup)
- Install dependencies if needed: npm install react react-dom
- Keep the layout responsive on mobile and desktop
- Replace placeholder copy with content that fits the project
The UI code:
export function Retro3DGridBackground({ children }: { children?: React.ReactNode }) {
return (
<div className="relative min-h-screen overflow-hidden bg-zinc-950">
<div
className="pointer-events-none absolute inset-0 origin-bottom"
aria-hidden
style={{
backgroundImage:
"linear-gradient(rgba(16,185,129,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(16,185,129,0.35) 1px, transparent 1px)",
backgroundSize: "48px 48px",
transform: "perspective(500px) rotateX(60deg) scale(2)",
transformOrigin: "center 80%",
animation: "grid-scroll 3s linear infinite",
}}
/>
<div className="pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-emerald-500/20 to-transparent" aria-hidden />
<style>{`@keyframes grid-scroll{0%{transform:perspective(500px) rotateX(60deg) scale(2) translateY(0)}100%{transform:perspective(500px) rotateX(60deg) scale(2) translateY(48px)}}`}</style>
{children && <div className="relative z-10">{children}</div>}
</div>
);
}
Replace (Your Desired Section) and (YOUR HEX CODE COLOR) before pasting into Cursor, Copilot, or ChatGPT.