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
| // please no
| module['exports'] = function zalgo(text, options) {
| text = text || " he is here ";
| var soul = {
| "up" : [
| '̍', '̎', '̄', '̅',
| '̿', '̑', '̆', '̐',
| '͒', '͗', '͑', '̇',
| '̈', '̊', '͂', '̓',
| '̈', '͊', '͋', '͌',
| '̃', '̂', '̌', '͐',
| '̀', '́', '̋', '̏',
| '̒', '̓', '̔', '̽',
| '̉', 'ͣ', 'ͤ', 'ͥ',
| 'ͦ', 'ͧ', 'ͨ', 'ͩ',
| 'ͪ', 'ͫ', 'ͬ', 'ͭ',
| 'ͮ', 'ͯ', '̾', '͛',
| '͆', '̚'
| ],
| "down" : [
| '̖', '̗', '̘', '̙',
| '̜', '̝', '̞', '̟',
| '̠', '̤', '̥', '̦',
| '̩', '̪', '̫', '̬',
| '̭', '̮', '̯', '̰',
| '̱', '̲', '̳', '̹',
| '̺', '̻', '̼', 'ͅ',
| '͇', '͈', '͉', '͍',
| '͎', '͓', '͔', '͕',
| '͖', '͙', '͚', '̣'
| ],
| "mid" : [
| '̕', '̛', '̀', '́',
| '͘', '̡', '̢', '̧',
| '̨', '̴', '̵', '̶',
| '͜', '͝', '͞',
| '͟', '͠', '͢', '̸',
| '̷', '͡', ' ҉'
| ]
| },
| all = [].concat(soul.up, soul.down, soul.mid),
| zalgo = {};
|
| function randomNumber(range) {
| var r = Math.floor(Math.random() * range);
| return r;
| }
|
| function is_char(character) {
| var bool = false;
| all.filter(function (i) {
| bool = (i === character);
| });
| return bool;
| }
|
|
| function heComes(text, options) {
| var result = '', counts, l;
| options = options || {};
| options["up"] = options["up"] || true;
| options["mid"] = options["mid"] || true;
| options["down"] = options["down"] || true;
| options["size"] = options["size"] || "maxi";
| text = text.split('');
| for (l in text) {
| if (is_char(l)) {
| continue;
| }
| result = result + text[l];
| counts = {"up" : 0, "down" : 0, "mid" : 0};
| switch (options.size) {
| case 'mini':
| counts.up = randomNumber(8);
| counts.min = randomNumber(2);
| counts.down = randomNumber(8);
| break;
| case 'maxi':
| counts.up = randomNumber(16) + 3;
| counts.min = randomNumber(4) + 1;
| counts.down = randomNumber(64) + 3;
| break;
| default:
| counts.up = randomNumber(8) + 1;
| counts.mid = randomNumber(6) / 2;
| counts.down = randomNumber(8) + 1;
| break;
| }
|
| var arr = ["up", "mid", "down"];
| for (var d in arr) {
| var index = arr[d];
| for (var i = 0 ; i <= counts[index]; i++) {
| if (options[index]) {
| result = result + soul[index][randomNumber(soul[index].length)];
| }
| }
| }
| }
| return result;
| }
| // don't summon him
| return heComes(text);
| }
|
|