Skip to content

Glyph Field

Live specimen, runs its own script

This specimen runs the component’s own script. Pointer and keyboard reach it; demo links and submissions stay inside it.

Source markup
<!-- @dsCard group="Sections" height=360 -->
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<title>Glyph Field</title>
<style>
  /* layout of the demo state only */
  .demo { max-width: 960px; margin-inline: auto; }
  .demo > .t-label { margin: 0 var(--space-sm) var(--space-2xs); }
  /* the field sits behind the hero copy; the container is positioned and clipped */
  .glyphfield-demo { position: relative; overflow: hidden; height: 300px; background: var(--color-ground-0); }
  .glyphfield-demo__copy { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-45%); text-align: center; padding: 0 var(--space-md); }
  .glyphfield-demo__copy .t-display { margin: 0; }
  .glyphfield-demo__copy .t-lead { margin: var(--space-2xs) 0 0; color: var(--color-semantic-text-secondary); }
</style>
</head>
<body>
<div class="demo">

  <p class="t-label">Running &middot; click for a ripple, move for a wake; calm zone behind the copy</p>

  <div class="glyphfield-demo">
    <canvas data-nz-glyphfield data-palette="amber" data-seed="20261016" data-calm='{"x":0.5,"y":0.5,"rx":260,"ry":70,"floor":0.3}' aria-hidden="true"></canvas>
    <div class="glyphfield-demo__copy">
      <h2 class="t-display">disrupt the signal.</h2>
      <p class="t-lead">Secure infrastructure for those who value privacy.</p>
    </div>
  </div>

</div>
<script>/* GlyphField: the component script, inlined by its make-preview.sh */</script>
</body>
</html>

Glyph Field is the animated ground behind a hero: a grid of monospaced characters that a slow wind lights as it passes, a click that sends a ripple across them in the brand colour, and a moving pointer that leaves a warm wake. It is one dependency-free script, nz-glyphfield.js, for any site; NOTES.md records the model.

Use it once, behind the opening section, on a neutral black ground, replacing the terminal grid of Hero. It is decoration: it never carries a fact and is hidden from assistive technology.

A positioned, clipped container with a <canvas data-nz-glyphfield aria-hidden="true"> as its first child and the script after it. It sizes itself, uses WebGL2 and falls back to canvas 2D. Options are data attributes or an object passed to NzGlyphField.mount(canvas, options), which returns a controller (ripple, wake, setPalette, setCalm, pause, resume, destroy).

  • data-palette: amber (default), signal, orange, green, blue, violet, white. The ink stays neutral grey; the palette sets only the glow of a touch.
  • data-calm: a JSON zone such as {"x":0.5,"y":0.45,"rx":250,"ry":80,"floor":0.3} where the field runs at floor so copy stays legible.
  • data-budget: seconds the wind runs before settling out (120); any touch brings it back. The file header lists the rest.
  • Resting: every cell holds a glyph at 3% light, below what can be seen. Ink color-ink-dim, font-family-mono at weight 300.
  • Lit: where a gust passes the ink shows at up to 70% alpha; stroke edges facing the wind catch more light.
  • Touched: a ripple tints the lit ink with the glow, color-amber-base by default, for about three seconds; a wake warms the pointer’s path.
  • Settled: after the budget the wind fades out until the next touch. Reduced motion holds one still frame.
  • Role and name: none. The canvas is aria-hidden with pointer-events: none; the hero’s <h1> names the page.
  • Keyboard: not interactive.
  • Motion: prefers-reduced-motion: reduce or nz-still on <html> holds a still frame; the field stops when hidden or off screen.

Keep the ink neutral: the brand colour is the glow of a touch, so the hero’s one phosphor still belongs to the primary action. Lower data-lull rather than raising data-ink-alpha if the field is too quiet. One field per page.

Hand-written for noiz-brand (components/GlyphField/nz-glyphfield.js).