Animation

Decrypt Text

Reveals a string by scrambling characters and progressively replacing scramble glyphs with the originals. Sequential reveal in three directions, or non-sequential settle after N iterations. Four trigger modes: hover, click, view, in-view + hover. Dependency-free port — signals + setInterval.

Angular adaptation of an effect by David Haz / reactbits.dev.

Import

import { WrDecryptText } from 'ngwr/decrypt-text';

Playground

Hover to decrypt!
<wr-decrypt-text
  text="Hover to decrypt!"
  [speed]="50"
  [sequential]="false"
  revealDirection="start"
  animateOn="hover"
  [useOriginalCharsOnly]="false"
/>

Customize

Animate On
Speed (ms)
50 ms
Sequential
Reveal Direction
Original Chars Only
Text

API

NameDescriptionTypeDefault
textrequiredText to reveal.string— (required)
speedTick interval in ms.number50
maxIterationsNon-sequential mode only — total scramble ticks before snapping to plain.number10
sequentialReveal one char per tick instead of scrambling all of them.booleanfalse
revealDirectionOrder in which chars are revealed in sequential mode.'start' | 'end' | 'center''start'
useOriginalCharsOnlyScramble using only glyphs present in text (minus spaces).booleanfalse
charactersPool of glyphs to scramble through.string'ABC…!@#$…'
animateOnWhen to start the animation.'hover' | 'click' | 'view' | 'inViewHover''hover'
clickModeClick behaviour: 'once' decrypts then stops; 'toggle' flips state on each click.'once' | 'toggle''once'