Media & effects
Glyph Matrix
Canvas-driven Matrix digital rain background with glowing phosphor trails.
detent-glyph-matrix
Port status
- Catalog status
- implemented
- Origin
- upstream
- Phase
- 4
- Wave
- phase-4-canvas
- Group
- Media & effects
Wake up, Neo...
The Matrix has you.
6.4 KB gzip for the class module
Variants
The rain is decorative and the heading below it is the readable layer: the canvas is
aria-hidden and every node inside the element stays light DOM. The matrix in the preview uses the
documented defaults, the one here is paused — it keeps its last painted frame and schedules zero frames.
Paused
Zero frames scheduled.
With prefers-reduced-motion: reduce the matrix paints one static glyph field and stops — the same
element keeps its content, its contrast (--detent-glyph-matrix-text) and its focus order.
togglePause() and reset() are the documented methods that mirror the upstream ref handle.
Recorded states
pausedrecorded state; no setterreduced motionrecorded state; no setter
Usage
Import
import '/components/glyph-matrix/define.js';
// or register it yourself
import { DetentGlyphMatrix } from '/components/glyph-matrix/glyph-matrix.js';
Attributes
background-colorcharsetcolorfade-ratefont-sizefull-pagehead-colorinteractiveopacitypausedspeed
Properties
No properties are recorded for this component.
Slots
default
Events
No events are recorded for this component.
Example
Runnable example: site/examples/glyph-matrix.ts. The snippet below is generated from the catalogued attributes.
<detent-glyph-matrix
background-color="#050505"
charset="ヲアウエオカキケコサシスセソタツテナニヌネハヒホマミムメモヤユラリワ0123456789ABCDEF:・."=*+-<>¦|XYZ"
color="#00FF66"
fade-rate="0.06"
font-size="16"
full-page
head-color="#FFFFFF"
interactive
opacity="1"
paused
speed="1"
></detent-glyph-matrix>
Source
The pinned upstream source for this row:
src/components/ui/GlyphMatrix.tsxsha256 7c786e572e4e…
Native files
The native module and its artifacts:
src/components/glyph-matrix/glyph-matrix.tssrc/components/glyph-matrix/styles.csssrc/components/glyph-matrix/define.tsdocs/components/glyph-matrix.mdsite/examples/glyph-matrix.tstests/browser/glyph-matrix.spec.tsevidence/components/glyph-matrix.md
API
Boolean attributes follow HTML presence semantics: present means true, absent means false, and disabled="false" still means disabled.
Attributes
| Attribute | Property | Type | Default | Notes |
|---|---|---|---|---|
background-color | backgroundColor | string | '#050505' | Kebab-case attribute; camelCase property. |
charset | charset | string | 'ヲアウエオカキケコサシスセソタツテナニヌネハヒホマミムメモヤユラリワ0123456789ABCDEF:・."=*+-<>¦|XYZ' | Kebab-case attribute; camelCase property. |
color | color | string | '#00FF66' | Kebab-case attribute; camelCase property. |
fade-rate | fadeRate | number | 0.06 | Kebab-case attribute; camelCase property. |
font-size | fontSize | number | 16 | Kebab-case attribute; camelCase property. |
full-page | fullPage | boolean | false | Presence semantics: present means true, absent means false. |
head-color | headColor | string | '#FFFFFF' | Kebab-case attribute; camelCase property. |
interactive | interactive | boolean | true | Presence semantics: present means true, absent means false. |
opacity | opacity | number | 1 | Kebab-case attribute; camelCase property. |
paused | paused | boolean | false | Presence semantics: present means true, absent means false. |
speed | speed | number | 1 | Kebab-case attribute; camelCase property. |
Properties
No property-only values are recorded for this component.
Events
No custom events are recorded for this component.
Slots
| Slot | Notes |
|---|---|
default | Consumer content; rendered through a slot, never re-created. |
CSS customisation
- React `children`/`ReactNode` props become DOM slots; caller content stays light DOM.
- full-page is implemented: the pinned source destructures it but never uses it, while the row records the full-page feature.
- The imperative GlyphMatrixHandle (reset/togglePause) is exposed as two documented methods; togglePause() writes the documented paused state instead of a private ref.
- Colours are parsed through a scratch 2D context, so rgb(), hsl() and named colours keep their alpha; the pinned hexToRgba returned non-hex input unchanged and silently dropped alpha.
- reset() also clears the decayed trail buffer; upstream only moved the streams.
- The glyph pool is split by code point (Array.from), so surrogate pairs are never cut.
- GlyphText stays an alias of GlyphMatrix; no detent-glyph-text tag is defined.
- Hidden-document pause is added (visibilitychange) because PC-10.6 requires it; upstream paused offscreen via IntersectionObserver only.
- The content layer sets --detent-glyph-matrix-text (#f2f3f6) so slotted text is legible on the pinned #050505 backdrop (18.37:1).
What it does
A canvas-driven digital-rain backdrop with decaying phosphor trails, head highlights, random glyph mutation and pointer-proximity disturbance.
Upstream behaviour
- GPU-friendly HTML5 Canvas implementation running at silky 60fps
- Phosphor decay trails rendered via progressive alpha blending
- Authentic Katakana, matrix operators, and hexadecimal character set
- Interactive pointer disturbance causing streams near the cursor to flare and accelerate
- Supports both bounded containers and full-page fixed background backdrops
Differences from upstream
- React `children`/`ReactNode` props become DOM slots; caller content stays light DOM.
- full-page is implemented: the pinned source destructures it but never uses it, while the row records the full-page feature.
- The imperative GlyphMatrixHandle (reset/togglePause) is exposed as two documented methods; togglePause() writes the documented paused state instead of a private ref.
- Colours are parsed through a scratch 2D context, so rgb(), hsl() and named colours keep their alpha; the pinned hexToRgba returned non-hex input unchanged and silently dropped alpha.
- reset() also clears the decayed trail buffer; upstream only moved the streams.
- The glyph pool is split by code point (Array.from), so surrogate pairs are never cut.
- GlyphText stays an alias of GlyphMatrix; no detent-glyph-text tag is defined.
- Hidden-document pause is added (visibilitychange) because PC-10.6 requires it; upstream paused offscreen via IntersectionObserver only.
- The content layer sets --detent-glyph-matrix-text (#f2f3f6) so slotted text is legible on the pinned #050505 backdrop (18.37:1).