# Synthwave grid

> A neon perspective grid rolls towards you under a striped retro sun, straight off an 80s album cover.

- Category: [Backgrounds](https://library.aimran.es/components/patterns)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/pt-synth
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

The synthwave look works wherever a bit of nostalgia helps: the page for a retro gaming night, the site of an electronic music producer, a Twitch overlay or the ticket page for a themed party. The grid scrolling towards the horizon gives instant depth. It’s a synthwave background in pure CSS, no images needed.

Chunky, bold type looks right on top of it, while thin elegant fonts get lost. Keep the headline in the sky above the sun, where the background is calmer, and leave the moving floor free.

## Code

### HTML

```html
<div class="pt-synth"><b></b><i></i><u></u></div>
```

### CSS

```css
.pt-synth {
  --c1: #8b5cf6;
  --c2: #0071e3;
  --c3: #f472b6;
  --k: 1;
  /* velocidad */
  --d: 1;
  /* densidad / escala */
  --o: 1;
  /* opacidad */
  --bg: #05060a;
  --fg: #ffffff;
  --blend: screen;
  min-height: 100vh;
}

.pt-synth {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-synth>* {
  opacity: var(--o);
}

.pt-synth {
  background: linear-gradient(180deg,var(--bg) 0%,color-mix(in srgb,var(--c1) 40%,var(--bg)) 50%,var(--bg) 50%)!important;
}

.pt-synth b {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 34%;
  max-width: 420px;
  aspect-ratio: 1;
  translate: -50% 28%;
  border-radius: 50%;
  background: linear-gradient(180deg,var(--c3),var(--c1));
  -webkit-mask: linear-gradient(#000 52%,transparent 52% 57%,#000 57% 66%,transparent 66% 70%,#000 70% 77%,transparent 77% 82%,#000 82% 87%,transparent 87% 92%,#000 92%);
  mask: linear-gradient(#000 52%,transparent 52% 57%,#000 57% 66%,transparent 66% 70%,#000 70% 77%,transparent 77% 82%,#000 82% 87%,transparent 87% 92%,#000 92%);
}

.pt-synth i {
  position: absolute;
  left: -50%;
  width: 200%;
  top: 50%;
  height: 120%;
  transform-origin: 50% 0;
  transform: perspective(600px) rotateX(70deg);
  background-image: linear-gradient(var(--c2) 2px,transparent 2px),linear-gradient(90deg,var(--c2) 2px,transparent 2px);
  background-size: calc(60px * var(--d)) calc(60px * var(--d));
  -webkit-mask: linear-gradient(180deg,transparent,#000 35%);
  mask: linear-gradient(180deg,transparent,#000 35%);
  animation: pt-synth-m calc(1.2s / var(--k)) linear infinite;
}

.pt-synth u {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--c3);
  box-shadow: 0 0 30px 6px var(--c3);
}

@keyframes pt-synth-m {
  to {
    background-position: 0 calc(60px * var(--d));
  }
}
```

### React

```tsx
// @ts-nocheck
import { useEffect, useRef } from "react";

const css = `
.pt-synth {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-synth>* {
  opacity: var(--o);
}

.pt-synth {
  background: linear-gradient(180deg,var(--bg) 0%,color-mix(in srgb,var(--c1) 40%,var(--bg)) 50%,var(--bg) 50%)!important;
}

.pt-synth b {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 34%;
  max-width: 420px;
  aspect-ratio: 1;
  translate: -50% 28%;
  border-radius: 50%;
  background: linear-gradient(180deg,var(--c3),var(--c1));
  -webkit-mask: linear-gradient(#000 52%,transparent 52% 57%,#000 57% 66%,transparent 66% 70%,#000 70% 77%,transparent 77% 82%,#000 82% 87%,transparent 87% 92%,#000 92%);
  mask: linear-gradient(#000 52%,transparent 52% 57%,#000 57% 66%,transparent 66% 70%,#000 70% 77%,transparent 77% 82%,#000 82% 87%,transparent 87% 92%,#000 92%);
}

.pt-synth i {
  position: absolute;
  left: -50%;
  width: 200%;
  top: 50%;
  height: 120%;
  transform-origin: 50% 0;
  transform: perspective(600px) rotateX(70deg);
  background-image: linear-gradient(var(--c2) 2px,transparent 2px),linear-gradient(90deg,var(--c2) 2px,transparent 2px);
  background-size: calc(60px * var(--d)) calc(60px * var(--d));
  -webkit-mask: linear-gradient(180deg,transparent,#000 35%);
  mask: linear-gradient(180deg,transparent,#000 35%);
  animation: pt-synth-m calc(1.2s / var(--k)) linear infinite;
}

.pt-synth u {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--c3);
  box-shadow: 0 0 30px 6px var(--c3);
}

@keyframes pt-synth-m {
  to {
    background-position: 0 calc(60px * var(--d));
  }
}

`;

export default function PatternSynth() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-synth"
        style={{
          "--c1": "#8b5cf6",
          "--c2": "#0071e3",
          "--c3": "#f472b6",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <b></b><i></i><u></u>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Synthwave grid” block (Backgrounds) from AIMRAN Library to my project.

## What it is
A neon perspective grid rolls towards you under a striped retro sun, straight off an 80s album cover.

## Chosen settings
- Color 1: #8b5cf6
- Color 2: #0071e3
- Color 3: #f472b6
- Speed: 1x (from 0.2 to 3x)
- Density / scale: 1x (from 0.5 to 2x)
- Opacity: 1 (from 0.2 to 1)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck
import { useEffect, useRef } from "react";

const css = `
.pt-synth {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-synth>* {
  opacity: var(--o);
}

.pt-synth {
  background: linear-gradient(180deg,var(--bg) 0%,color-mix(in srgb,var(--c1) 40%,var(--bg)) 50%,var(--bg) 50%)!important;
}

.pt-synth b {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 34%;
  max-width: 420px;
  aspect-ratio: 1;
  translate: -50% 28%;
  border-radius: 50%;
  background: linear-gradient(180deg,var(--c3),var(--c1));
  -webkit-mask: linear-gradient(#000 52%,transparent 52% 57%,#000 57% 66%,transparent 66% 70%,#000 70% 77%,transparent 77% 82%,#000 82% 87%,transparent 87% 92%,#000 92%);
  mask: linear-gradient(#000 52%,transparent 52% 57%,#000 57% 66%,transparent 66% 70%,#000 70% 77%,transparent 77% 82%,#000 82% 87%,transparent 87% 92%,#000 92%);
}

.pt-synth i {
  position: absolute;
  left: -50%;
  width: 200%;
  top: 50%;
  height: 120%;
  transform-origin: 50% 0;
  transform: perspective(600px) rotateX(70deg);
  background-image: linear-gradient(var(--c2) 2px,transparent 2px),linear-gradient(90deg,var(--c2) 2px,transparent 2px);
  background-size: calc(60px * var(--d)) calc(60px * var(--d));
  -webkit-mask: linear-gradient(180deg,transparent,#000 35%);
  mask: linear-gradient(180deg,transparent,#000 35%);
  animation: pt-synth-m calc(1.2s / var(--k)) linear infinite;
}

.pt-synth u {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--c3);
  box-shadow: 0 0 30px 6px var(--c3);
}

@keyframes pt-synth-m {
  to {
    background-position: 0 calc(60px * var(--d));
  }
}

`;

export default function PatternSynth() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-synth"
        style={{
          "--c1": "#8b5cf6",
          "--c2": "#0071e3",
          "--c3": "#f472b6",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <b></b><i></i><u></u>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
