Scramble Text Decode
Random characters settle into the real text from left to right; pick the phrase and speed, then replay.
AI prompt
Close-up of a dark terminal-style interface showing the word SIGNAL RECEIVED in bright green monospace letters, the first half already clear and the remaining letters still a blur of random symbols and characters, faint scanlines, subtle glow, deep black background, centred, high contrast, graphic and clean. Variants: the phrase fully scrambled, and fully resolved. Negative: readable noise paragraphs, colour clutter, borders, text errors, photo realism. Reduced motion: show the final text only.About this pattern
Definition
A decode effect swaps every letter for random characters and locks them to the real letter one by one. It feels like data resolving, and works for headings, loading messages and reveals where the content matters more than the surprise.
When to use it
- Reveal in order, with a few frames of randomness before each letter locks.
- Use a monospace or tabular font so the width does not jitter as characters change.
- Keep spaces and punctuation fixed.
What the controls do
- Three phrases, a Speed slider and a Replay button.
Motion & timing
- About 40ms per random frame; each letter locks after a delay that grows with its position.
- Reduced motion: the final text is shown at once with no scrambling.
Tips & variations
- Expose the real text to screen readers; do not let them read the random characters.
- Keep the effect under about 1.5 seconds so it never blocks reading.
Code of this live preview
<div class="bx"><div class="sc" role="img" aria-label="" id="sc"><span id="tx" aria-hidden="true"></span></div><div class="pre" id="pre" role="group" aria-label="Phrase"><button data-p="0" aria-pressed="true">Signal received</button><button data-p="1" aria-pressed="false">Access granted</button><button data-p="2" aria-pressed="false">Loading data</button></div><div class="row2"><label class="rw" style="flex:1">Speed <b id="sv">3</b><input id="sp" type="range" min="1" max="6" value="3"></label><button class="rp" id="rp" type="button">Replay</button></div></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sc{height:100px;border-radius:12px;background:#0b0f0c;display:grid;place-items:center}.sc span{font:700 24px/1 ui-monospace,Menlo,Consolas,monospace;color:#5dff9a;letter-spacing:.04em;text-shadow:0 0 10px rgba(93,255,154,.5)}
.row2{display:flex;gap:12px;align-items:end}.rp{height:30px;padding:0 16px;border-radius:99px;background:var(--accent);color:var(--accent-ink);font-size:12px;font-weight:600}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const T=['SIGNAL RECEIVED','ACCESS GRANTED','LOADING DATA'],G='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&@$*',tx=document.getElementById('tx'),sc=document.getElementById('sc'),sp=document.getElementById('sp'),bs=[...document.querySelectorAll('#pre button')];let p=0,id=0;
const calm=matchMedia('(prefers-reduced-motion:reduce)').matches;
function run(){cancelAnimationFrame(id);const t=T[p],sp_=+sp.value;sc.setAttribute('aria-label',t);document.getElementById('sv').textContent=sp.value;if(calm){tx.textContent=t;return;}
const st=performance.now(),per=130/sp_,fr=[];(function f(now){const e=now-st;let s='',done=true;for(let i=0;i<t.length;i++){const c=t[i];if(c===' '){s+=' ';continue;}if(e>i*per+260/sp_*2){s+=c;}else{done=false;s+=G[Math.floor(Math.random()*G.length)];}}tx.textContent=s;if(!done)id=requestAnimationFrame(f);else tx.textContent=t;})(st);}
function up(){bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));run();}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));sp.addEventListener('input',run);document.getElementById('rp').addEventListener('click',run);up();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Scramble Text Decode — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sc{height:100px;border-radius:12px;background:#0b0f0c;display:grid;place-items:center}.sc span{font:700 24px/1 ui-monospace,Menlo,Consolas,monospace;color:#5dff9a;letter-spacing:.04em;text-shadow:0 0 10px rgba(93,255,154,.5)}
.row2{display:flex;gap:12px;align-items:end}.rp{height:30px;padding:0 16px;border-radius:99px;background:var(--accent);color:var(--accent-ink);font-size:12px;font-weight:600}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="sc" role="img" aria-label="" id="sc"><span id="tx" aria-hidden="true"></span></div><div class="pre" id="pre" role="group" aria-label="Phrase"><button data-p="0" aria-pressed="true">Signal received</button><button data-p="1" aria-pressed="false">Access granted</button><button data-p="2" aria-pressed="false">Loading data</button></div><div class="row2"><label class="rw" style="flex:1">Speed <b id="sv">3</b><input id="sp" type="range" min="1" max="6" value="3"></label><button class="rp" id="rp" type="button">Replay</button></div></div>
</div>
<script>
const T=['SIGNAL RECEIVED','ACCESS GRANTED','LOADING DATA'],G='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&@$*',tx=document.getElementById('tx'),sc=document.getElementById('sc'),sp=document.getElementById('sp'),bs=[...document.querySelectorAll('#pre button')];let p=0,id=0;
const calm=matchMedia('(prefers-reduced-motion:reduce)').matches;
function run(){cancelAnimationFrame(id);const t=T[p],sp_=+sp.value;sc.setAttribute('aria-label',t);document.getElementById('sv').textContent=sp.value;if(calm){tx.textContent=t;return;}
const st=performance.now(),per=130/sp_,fr=[];(function f(now){const e=now-st;let s='',done=true;for(let i=0;i<t.length;i++){const c=t[i];if(c===' '){s+=' ';continue;}if(e>i*per+260/sp_*2){s+=c;}else{done=false;s+=G[Math.floor(Math.random()*G.length)];}}tx.textContent=s;if(!done)id=requestAnimationFrame(f);else tx.textContent=t;})(st);}
function up(){bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));run();}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));sp.addEventListener('input',run);document.getElementById('rp').addEventListener('click',run);up();
</script>
</body></html>