Text Scrambler (Decoder Effect) Documentation
The Text Scrambler block provides a high-performance character-shuffling animation to reveal text. It is built using modern JavaScript techniques to ensure smooth transitions and full compatibility with the OutSystems Reactive and Mobile platforms.
The component works by calculating the progress of a reveal over a set Duration.
Duration
Scrambling phase: For each frame, the script replaces "yet-to-be-revealed" characters with random symbols from a defined set.
Locking phase: As the animation progresses, characters from the original text are "locked" into place from left to right.
Performance: Unlike setInterval, this component uses requestAnimationFrame, which syncs the animation with the browser's refresh rate (usually 60fps), preventing UI lag.
setInterval
requestAnimationFrame
To ensure the JavaScript targets the correct element, follow this structure:
Enclose the Placeholder inside a Container named ScramblerWrapper.
ScramblerWrapper
The Placeholder must have the Style Class scrambler-content.
scrambler-content
Pass ScramblerWrapper.Id to the WidgetId input of the OnReady JavaScript node.
ScramblerWrapper.Id
WidgetId
""
1500
01
ABC#@$
True
Drag the block to your screen.
Place a Title or Text widget inside the Content placeholder.
Content
Leave all inputs as default.
The title will scramble once upon page load and stay fixed.
Set the FullText input to: "Secure Data, Real-time Alerts, AI Powered".
"Secure Data, Real-time Alerts, AI Powered"
Set Loop to True.
Set Duration to 1000 for a faster, snappier reveal.
1000
The component is styled to be as flexible as possible:
Font Choice: We highly recommend using a Monospace font (like Courier, Roboto Mono, or Consolas). This prevents "text jumping" because every character (scrambled or final) occupies the exact same width.
Cursor Styling: The cursor color is controlled via the color property of the text. To change the cursor blink speed, modify the tw-blink animation in the block's CSS.
color
tw-blink