js Zalgo Scrambled Text + slightly code-golf
original code and description by @aTakaakiSeki
[].concat(...[...document.all].map(e => [...e.childNodes])).filter(n => n.nodeType === Node.TEXT_NODE).map(n => n.textContent = n.textContent.replace(/([a-zA-Z])/g, (_, c) => c + [...Array(Math.floor(Math.random()*30))].map(() => String.fromCharCode(0x300 + Math.floor(Math.random()*79))).join('')))
Codes below are under the same license
for(e of document.all)for(n of e.childNodes)n.nodeType^3?r=Math.random:n[t='textContent']=n[t].replace(/[a-z]/ig,c=>(f=i=>~i?f(~-i)+String.fromCharCode(768+r()*79):c)(r()*30))
- There are 112 valid combining characters, not 79
- All printable characters except space can be accompanied with combining characters
- Text nodes are tested with its
data
property script
andstyle
are also text nodes, so filter them out- Add at least one combining character for each alphanumeric character
for(e of document.all)for(n of e.childNodes)/Sc|ty/.test(e)|!n[d='data']?r=Math.random:n[d]=n[d].replace(/\w/g,c=>(f=i=>~i?f(~-i)+String.fromCharCode(768+r()*112):c)(r()*30))
- Make the length of added combining characters more random
- Choose from U+0310-0319,0320-0329,0330-0339,0340-0349,0350-0359,0360-0363
for(e of document.all)for(n of e.childNodes)/Sc|ty/.test(e)|!n[d='data']?0:n[d]=n[d].replace(/\w/g,c=>(f=r=>r()<.06?c:f(r)+eval(`'\\u03${63^r()*54}'`))(Math.random))