html head title String Tool title link rel stylesheet type text css hr

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<html>
<head>
<title>String Tool</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<br>
<pre class="label"> >> Output</pre>
<center>
<div class="upper-box" id="output-wrapper">
<div id="output" style="white-space: pre-wrap;"></div>
</div>
</center>
<br>
<pre class="label"> >> Input</pre>
<center>
<div class="upper-box" id="input-wrapper">
<textarea id="input" placeholder="Input text here"></textarea>
</div>
</center>
<br>
<pre class="label"> >> Options / Generator</pre>
<center>
<div class="lower-box" id="options-wrapper">
<pre class="options"> Max Height: </pre>
<input id="maxheight" type="number" class="options" style="width: 75" value="100" />
</div>
<div class="lower-box" id="generator-wrapper">
<pre class="generator"> Prefix: </pre>
<input type="text" id="prefix" class="generator" placeholder="u">
<pre class="generator"> Min:</pre>
<input type="number" id="minnumber" class="minmax" value="1">
<pre class="generator"> Max:</pre>
<input type="number" id="maxnumber" class="minmax" value="10">
</div>
</center>
</body>
<script>
function getNumber() {
var minNumber = document.getElementById("minnumber").value;
var maxNumber = document.getElementById("maxnumber").value;
var randomnumber = Math.floor(Math.random() * (maxNumber + 1) + minNumber);
$('#myNumber').html(randomnumber);
return false;
}
var input = document.querySelector("#input");
var output = document.querySelector("#output");
"use strict";
(function() {
output.style.whiteSpace = "pre-wrap";
var genTimeout;
input.addEventListener("keyup", function() {
luni.tools.creepify.options.maxHeight = document.getElementById("maxheight").value;
clearTimeout(genTimeout);
genTimeout = setTimeout(generate, 400);
});
input.addEventListener("paste", generate);
var luni = new Lunicode();
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>