retro-text-effects.js
Demo Effects Usage GitHub
Open Source · Zero dependencies · v0.4.0

retro-text-effects.js

A browser port of TerminalTextEffects (TTE), the Python terminal-effects library - rebuilt in vanilla JavaScript. Thirty text and canvas effects, no dependencies, no external requests, one self-contained file you can drop into any page.

See it live GitHub Repository
Live

Try the effects

Every button below runs the real library, right here in your browser. Pick an effect and watch the text resolve.

text
canvas
crt persistent screen mode - flip it on, flip it off
text
canvas
crt persistent screen mode - flip it on, flip it off
=== Link scan started ===
14 domains loaded from blacklist
fields: title, body, url, summary, code

[staging.example.com] 3 matches in content_items
[staging.example.com] 3 entries repaired
[www.example.org] 1 match in content_items
[www.example.org] 1 entry repaired

=== Scan finished in 7.2s ===
domains scanned: 14   found: 4   repaired: 4   errors: 0
Effects

Thirty effects, two flavours

Text effects rewrite the element's text content - no canvas, the text stays selectable. Canvas effects lay a temporary canvas over the element for free 2D character motion, then fade out to reveal the untouched text. The *2 effects are canvas twins of their text counterparts.

Text effects (no canvas)

decryptCells flicker through random glyphs, then lock onto the final text.
printReveals the text in reading order with a moving print head.
matrixEach column resolves top-to-bottom behind a falling bright glyph.
overflowRows scroll and reshuffle, then settle into order.
errorcorrectCharacter pairs start swapped and swap back one by one.
randomsequenceThe characters appear one after another in random order.
middleoutThe text grows from the centre of the block outward.
sweepA noisy band sweeps across and leaves the resolved text behind.
pourThe text fills up from the bottom like a liquid, snaking back and forth.
slideThe rows slide in as blocks, alternating from the left and the right.
burnAn ember front with a ragged edge burns the text in.
vhstapeGlitch bands shift rows and sprinkle noise until the tracking settles.
crtPersistent CRT style treatment: glow, scanlines, flicker. Toggle on, cancel() removes it.

Canvas effects

matrix2The classic falling-glyph screen: katakana rain, then reveal (canvas twin of matrix).
decrypt2Canvas twin of decrypt: the text emerges bright from dimmed ciphertext.
print2Canvas twin of print: glowing print head with a hot afterglow on fresh characters.
overflow2Canvas twin of overflow: the block spins past sub-pixel-smooth and decelerates onto the text.
beamsBright beams sweep the rows and columns, then a wipe brings the text to full brightness.
rainEvery character falls from above straight into its place.
bouncyballsCharacters drop in as coloured balls and bounce into position.
bubblesEvery character floats down in its own swaying bubble and pops into place.
scatteredCharacters start scattered across the stage and glide to their spot.
expandThe whole text bursts outward from the centre.
sprayA nozzle in the corner sprays the characters onto the block in curved arcs.
swarmThe characters arrive in wobbling swarms that settle area by area.
fireworksRockets launch, explode into sparks and throw their characters to the text.
blackholeCharacters spiral into a singularity, then erupt back out to the text.
ringsCharacters orbit on concentric spinning rings, then disperse to their positions.
unstableThe text shakes, explodes towards the edges and reassembles.
laseretchA laser beam traces the text in and throws off falling sparks.
Getting started

Usage

Download retro-text-effects.min.js from the releases and include it with a plain script tag. No build step, no dependencies.

<script src="retro-text-effects.min.js"></script>
<script>
  RetroTextEffects.decrypt('#log');
  RetroTextEffects.print('#banner', { cps: 80 });
  RetroTextEffects.fireworks('#log', { speed: 1.2 });
  const screen = RetroTextEffects.crt('#log');  // screen.cancel() removes it
</script>
OptionTypeDefaultEffects
speednumber1all
onDonefunction-all
fpsnumber30text effects
glyphsstringbuilt-in pooldecrypt, decrypt2, matrix, matrix2, sweep
preserveWhitespacebooleantruedecrypt
cpsnumber60print, print2
headstringprint
cyclesnumber3overflow, overflow2
rationumber0.1errorcorrect
bandnumber6sweep
durationnumber (ms)1500matrix2
fontSizenumber20matrix2
colorstring#00ff00 / #33ff33matrix2, crt
scanlineOpacitynumber0.15crt
glowbooleantruecrt
flickerbooleantruecrt

Each effect takes an element or a CSS selector and returns { finished, cancel }.

Technology

Tech Stack

Vanilla JS Zero dependencies esbuild Single file ~25 KB minified