- Docs
- Components
- Text
- ASCII Ripple
ASCII Ripple
A page of monospace text that behaves like a liquid surface: pointer drops and drags send simulated waves through the grid, bending the words and blooming into heavier glyphs
Customize
Props
31| Name | Type | Default | Description |
|---|---|---|---|
text | string | built-in passage | Passage used to fill the grid. Words wrap row by row and repeat as needed. |
chars | string | "·.,:;-~=+*%#@" | Glyph palette from lightest to heaviest, picked by ripple intensity. |
fontSize | number | 16 | Font size in pixels. |
lineHeight | number | 1.2 | Line height as a multiplier of fontSize. |
fontFamily | string | ui-monospace stack | Monospace font stack. |
fontWeight | number | string | 400 | Font weight. |
textColor | string | "#f5f5f4" | Colour of the resting text. |
rippleColor | string | "#ffffff" | Colour glyphs tint toward on wave crests. |
troughColor | string | "#ad57ff" | Colour glyphs tint toward in wave troughs. |
backgroundColor | string | "transparent" | Canvas background. Transparent inherits the page. |
textOpacity | number | 0.15 | Opacity of the resting text, 0 to 1. |
resolution | number | 3 | Simulation cells per text row, 1 to 4. Higher is smoother and costlier. |
speed | number | 0.55 | Wave propagation speed, 0 to 1. |
damping | number | 0.045 | Fraction of surface velocity lost per step, 0 to 0.5. Lower rings longer. |
viscosity | number | 0.4 | Surface viscosity, 0 to 1. Smooths sharp wavelets into softer swells. |
edges | "reflect" | "absorb" | "absorb" | Whether waves bounce off the edges or fade out at them. |
dropStrength | number | 1.2 | Impulse of a click or tap. |
dropRadius | number | 26 | Radius of a click or tap in pixels. |
dragStrength | number | 0.3 | Impulse deposited by a moving pointer. 0 disables the trail. |
dragRadius | number | 16 | Radius of the pointer trail in pixels. |
rain | number | 0 | Random drops per second while the pointer is away. |
rainStrength | number | 0.6 | Impulse of each rain drop. |
sensitivity | number | 2.2 | How strongly surface height maps to glyph intensity. |
slopeGain | number | 1 | How strongly surface slope adds to glyph intensity. |
refraction | number | 4 | How far the underlying text is displaced by the slope, in cells. |
scramble | number | 1 | How readily disturbed cells swap to palette glyphs, 0 to 1. |
scrambleSpeed | number | 90 | Milliseconds between glyph reshuffles inside a ripple. |
dither | number | 0.5 | Edge texture of the disturbed region, 0 hard to 1 grainy. |
vignette | number | 0.6 | Width of the edge fade as a fraction of the shorter half-side, 0 to 1. |
interactive | boolean | true | Whether the pointer disturbs the surface. |
ref | AsciiRippleHandle | — | Imperative handle exposing drop(x, y, strength?, radius?) and calm(). |
textstringPassage used to fill the grid. Words wrap row by row and repeat as needed.
built-in passagecharsstringGlyph palette from lightest to heaviest, picked by ripple intensity.
"·.,:;-~=+*%#@"fontSizenumberFont size in pixels.
16lineHeightnumberLine height as a multiplier of fontSize.
1.2fontFamilystringMonospace font stack.
ui-monospace stackfontWeightnumber | stringFont weight.
400textColorstringColour of the resting text.
"#f5f5f4"rippleColorstringColour glyphs tint toward on wave crests.
"#ffffff"troughColorstringColour glyphs tint toward in wave troughs.
"#ad57ff"backgroundColorstringCanvas background. Transparent inherits the page.
"transparent"textOpacitynumberOpacity of the resting text, 0 to 1.
0.15resolutionnumberSimulation cells per text row, 1 to 4. Higher is smoother and costlier.
3speednumberWave propagation speed, 0 to 1.
0.55dampingnumberFraction of surface velocity lost per step, 0 to 0.5. Lower rings longer.
0.045viscositynumberSurface viscosity, 0 to 1. Smooths sharp wavelets into softer swells.
0.4edges"reflect" | "absorb"Whether waves bounce off the edges or fade out at them.
"absorb"dropStrengthnumberImpulse of a click or tap.
1.2dropRadiusnumberRadius of a click or tap in pixels.
26dragStrengthnumberImpulse deposited by a moving pointer. 0 disables the trail.
0.3dragRadiusnumberRadius of the pointer trail in pixels.
16rainnumberRandom drops per second while the pointer is away.
0rainStrengthnumberImpulse of each rain drop.
0.6sensitivitynumberHow strongly surface height maps to glyph intensity.
2.2slopeGainnumberHow strongly surface slope adds to glyph intensity.
1refractionnumberHow far the underlying text is displaced by the slope, in cells.
4scramblenumberHow readily disturbed cells swap to palette glyphs, 0 to 1.
1scrambleSpeednumberMilliseconds between glyph reshuffles inside a ripple.
90dithernumberEdge texture of the disturbed region, 0 hard to 1 grainy.
0.5vignettenumberWidth of the edge fade as a fraction of the shorter half-side, 0 to 1.
0.6interactivebooleanWhether the pointer disturbs the surface.
truerefAsciiRippleHandleImperative handle exposing drop(x, y, strength?, radius?) and calm().
—