CRT Scanlines
CRT scanline overlay on emerald grid with vignette. Retro terminal aesthetic for devtools, hacker-themed landing pages, and nostalgic brand sites. Subtle scan animation without hurting readability.
Dependencies
react
npm install react react-domexport function CrtScanlinesBackground({ children }: { children?: React.ReactNode }) {
return (
<div className="relative min-h-screen overflow-hidden bg-zinc-950">
<div
className="pointer-events-none absolute inset-0 opacity-20"
style={{
backgroundImage: "linear-gradient(rgba(16,185,129,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(16,185,129,0.5) 1px, transparent 1px)",
backgroundSize: "32px 32px",
}}
aria-hidden
/>
<div
className="pointer-events-none absolute inset-0 opacity-[0.07]"
style={{
backgroundImage: "repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.4) 2px, rgba(0,0,0,0.4) 4px)",
animation: "scan 0.1s linear infinite",
}}
aria-hidden
/>
<div className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,transparent_0%,#09090b_75%)]" aria-hidden />
<style>{`@keyframes scan{0%{background-position:0 0}100%{background-position:0 4px}}`}</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 CrtScanlinesBackground({ children }: { children?: React.ReactNode }) {
return (
<div className="relative min-h-screen overflow-hidden bg-zinc-950">
<div
className="pointer-events-none absolute inset-0 opacity-20"
style={{
backgroundImage: "linear-gradient(rgba(16,185,129,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(16,185,129,0.5) 1px, transparent 1px)",
backgroundSize: "32px 32px",
}}
aria-hidden
/>
<div
className="pointer-events-none absolute inset-0 opacity-[0.07]"
style={{
backgroundImage: "repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.4) 2px, rgba(0,0,0,0.4) 4px)",
animation: "scan 0.1s linear infinite",
}}
aria-hidden
/>
<div className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,transparent_0%,#09090b_75%)]" aria-hidden />
<style>{`@keyframes scan{0%{background-position:0 0}100%{background-position:0 4px}}`}</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.