<html>
<style>
body * {
font-family: 'Open Sans', sans-serif;
color: #222;
}
body {
background: black;
}
.content-box {
border-radius: 2px;
margin-top: 1em;
background: white;
border: 3px solid black;
opacity: .8;
with
}
#input {
width: 100%;
height: 100%;
padding: 1em;
font-size: 20px;
}
#input-wrapper {
height: 70px;
overflow: hidden;
margin-top: 0;
}
#output-wrapper {
height: 70px;
}
#output {
font-size: 20px;
width: 100%;
height: 100%;
padding: 1em;
color: red;
}
#description p:last-child {
margin-bottom: 0;
}
#description h1:first-child {
margin-top: 0;
}
#logo {
text-align: center;
font-size: 60;
font-family: Impact, Charcoal, sans-serif;
color: red;
}
</style>
<body>
<p id="logo">STRING 2 UNKNOWN</p>
<div class="content-box" id="output-wrapper">
<div id="output" style="white-space: pre-wrap;"></div>
</div>
<br>
<div class="content-box" id="input-wrapper">
<textarea id="input" placeholder="Type or paste your text here" value=""></textarea>
</div>
</body>
<script>
var input = document.querySelector("#input");
var output = document.querySelector("#output");
"use strict";
(function() {
output.style.whiteSpace = "pre-wrap";
var genTimeout;
input.addEventListener("keyup", function() {
clearTimeout(genTimeout);
genTimeout = setTimeout(generate, 400);
});
input.addEventListener("paste", generate);
var luni = new Lunicode();
luni.tools.creepify.options.maxHeight = 1000;
function generate() {
var text = input.value.trim();
if (text === "") {
output.innerHTML = "";
return;
}
output.innerHTML = luni.tools.creepify.encode(text);
}
function Lunicode() {
this.tools = {
flip: {
init: function init() {
for (i in this.map) {
this.map[this.map[i]] = i;
}
},
},
creepify: {
init: function init() {
for (var i = 768; 789 >= i; i++) {
this.diacriticsTop.push(String.fromCharCode(i));
}
for (var i = 790; 819 >= i; i++) {
794 != i && 795 != i && this.diacriticsBottom.push(String.fromCharCode(i));
}
this.diacriticsTop.push(String.fromCharCode(794)), this.diacriticsTop.push(String.fromCharCode(795));
for (var i = 820; 824 >= i; i++) {
this.diacriticsMiddle.push(String.fromCharCode(i));
}
for (var i = 825; 828 >= i; i++) {
this.diacriticsBottom.push(String.fromCharCode(i));
}
for (var i = 829; 836 >= i; i++) {
this.diacriticsTop.push(String.fromCharCode(i));
}
this.diacriticsTop.push(String.fromCharCode(836)), this.diacriticsBottom.push(String.fromCharCode(837)), this.diacriticsTop.push(String.fromCharCode(838)), this.diacriticsBottom.push(String.fromCharCode(839)), this.diacriticsBottom.push(String.fromCharCode(840)), this.diacriticsBottom.push(String.fromCharCode(841)), this.diacriticsTop.push(String.fromCharCode(842)), this.diacriticsTop.push(String.fromCharCode(843)), this.diacriticsTop.push(String.fromCharCode(844)), this.diacriticsBottom.push(String.fromCharCode(845)), this.diacriticsBottom.push(String.fromCharCode(846)), this.diacriticsTop.push(String.fromCharCode(848)), this.diacriticsTop.push(String.fromCharCode(849)), this.diacriticsTop.push(String.fromCharCode(850)), this.diacriticsBottom.push(String.fromCharCode(851)), this.diacriticsBottom.push(String.fromCharCode(852)), this.diacriticsBottom.push(String.fromCharCode(853)), this.diacriticsBottom.push(String.fromCharCode(854)), this.diacriticsTop.push(String.fromCharCode(855)), this.diacriticsTop.push(String.fromCharCode(856)), this.diacriticsBottom.push(String.fromCharCode(857)), this.diacriticsBottom.push(String.fromCharCode(858)), this.diacriticsTop.push(String.fromCharCode(859)), this.diacriticsBottom.push(String.fromCharCode(860)), this.diacriticsTop.push(String.fromCharCode(861)), this.diacriticsTop.push(String.fromCharCode(861)), this.diacriticsBottom.push(String.fromCharCode(863)), this.diacriticsTop.push(String.fromCharCode(864)), this.diacriticsTop.push(String.fromCharCode(865));
},
encode: function encode(r) {
var t,
o = "";
for (i in r) {
if (t = r[i], this.options.middle && (t += this.diacriticsMiddle[Math.floor(Math.random() * this.diacriticsMiddle.length)]), this.options.top)
for (var h = this.diacriticsTop.length - 1, n = 0, a = this.options.maxHeight - Math.random() * (this.options.randomization / 100 * this.options.maxHeight); a > n; n++) {
t += this.diacriticsTop[Math.floor(Math.random() * h)];
}
if (this.options.bottom)
for (var s = this.diacriticsBottom.length - 1, n = 0, a = this.options.maxHeight - Math.random() * (this.options.randomization / 100 * this.options.maxHeight); a > n; n++) {
t += this.diacriticsBottom[Math.floor(Math.random() * s)];
}
o += t;
}
return o;
},
decode: function decode(r) {
var t,
o = "";
for (i in r) {
t = r[i].charCodeAt(0), (768 > t || t > 865) && (o += r[i]);
}
return o;
},
diacriticsTop: [],
diacriticsMiddle: [],
diacriticsBottom: [],
options: {
top: !0,
middle: !0,
bottom: !0,
maxHeight: !0,
randomization: !0
}
}
};
for (i in this.tools) {
this.tools[i].init();
}
this.getHTML = function(i) {
for (var r, t = "", o = !0, h = 0, n = 0, a = 0, s = i.length; s > a; a++) {
r = i.charCodeAt(a), 10 == r || 13 == r ? (t += "<br>\n", o = !0) : 32 == r ? o ? (t += " ", o = !1) : (t += " ", o = !0) : (r >= 55296 && 56319 >= r ? (h = r, n = 0) : h > 0 ? (r >= 56320 && 57343 >= r && (n = 1024 * (h - 55296) + (r - 56320) + 65536), h = 0) : n = r, 0 != n && (t += "&#x" + n.toString(16) + ";", o = !0));
}
return t;
};
}
function randomElement(array) {
return array[Math.floor(Math.random() * array.length)];
}
function randInt(min, max) {
return min + Math.floor(Math.random() * (max - min + 1));
}
})();
</script>