VibeFX
Live preview · fully interactive

The prompt

Build a drawing hex grid.

## Look
Hexagons with radius 28px, stroke #7c6cff, stroke-width 1, no fill, on #08080d. Stagger alternate rows.

## Behavior
stroke-dasharray 80. Animate stroke-dashoffset from 80 to 0, then loop opacity down to 0.35.

## Design tokens
- Stroke #7c6cff; page #08080d.

## Motion
- Draw 2s ease, once. Breathe 3.5s ease-in-out, infinite, delayed 2s.

## Constraints
- Single self-contained HTML file. No libraries.
- Honor prefers-reduced-motion: reduce by skipping the loop and leaving a readable static frame
- Readable at 390px width with no horizontal page scroll

The code

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { min-height: 100%; }
  body {
    background: #08080d; color: #f2f2f7; font-family: Inter, system-ui, sans-serif;
    min-height: 100vh; overflow: hidden;
  }
  .hint { position: absolute; left: 16px; top: 16px; z-index: 5; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8a99; }
  svg { position: fixed; inset: 0; width: 100%; height: 100%; } polygon { fill: none; stroke: #7c6cff; stroke-width: 1; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 2s ease forwards, breathe 3.5s ease-in-out 2s infinite; } @keyframes draw { to { stroke-dashoffset: 0; } } @keyframes breathe { 50% { opacity: 0.35; } }
  @media (max-width: 420px) {
    .hint { font-size: 10px; letter-spacing: 0.08em; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  }
</style>
</head>
<body>
<svg id="s"></svg>

<script>

  var svg = document.getElementById("s");
  var ns = "http://www.w3.org/2000/svg";
  function hex(cx, cy, r) {
    var pts = [];
    for (var i = 0; i < 6; i++) {
      var a = Math.PI / 6 + i * Math.PI / 3;
      pts.push((cx + Math.cos(a) * r).toFixed(1) + "," + (cy + Math.sin(a) * r).toFixed(1));
    }
    var p = document.createElementNS(ns, "polygon");
    p.setAttribute("points", pts.join(" "));
    svg.appendChild(p);
  }
  var r = 28, row = 0;
  for (var y = 0; y < window.innerHeight + r; y += r * 1.5) {
    var offset = row % 2 ? r * 1.2 : 0;
    for (var x = -r; x < window.innerWidth + r; x += r * 2.1) hex(x + offset, y, r);
    row++;
  }
</script>
</body>
</html>

About this effect

An SVG pattern of hexagons covers the page. Stroke dashoffset animates from 80 to 0 over 2s, then opacity breathes between 0.35 and 0.8.

Similar effects