-
Notifications
You must be signed in to change notification settings - Fork 0
/
FunFeatures.js
167 lines (155 loc) · 3.95 KB
/
FunFeatures.js
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
//MoronText
function capitalizeEverySecondCharacter() {
let input = document.getElementById('input9').value;
let newText = "";
for (let i = 0; i < input.length; i++) {
if (i % 2 === 0) {
newText += input[i].toUpperCase();
} else {
newText += input[i];
}
}
document.getElementById('output9').innerHTML = newText;
};
//Scramble Text
function scrambleText() {
let input = document.getElementById('input10').value;
const inputArray = input.split('');
for (let i = inputArray.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[inputArray[i], inputArray[j]] = [inputArray[j], inputArray[i]];
}
let output = inputArray.join('');
document.getElementById('output10').innerHTML = output;
};
//Flip Text Upside Down
function flipText() {
let input11 = document.getElementById("input11").value;
let invertedChars = {
"a": "ɐ",
"b": "q",
"c": "ɔ",
"d": "p",
"e": "ǝ",
"f": "ɟ",
"g": "ƃ",
"h": "ɥ",
"i": "ı",
"j": "ɾ",
"k": "ʞ",
"l": "ן",
"m": "ɯ",
"n": "u",
"o": "o",
"p": "d",
"q": "b",
"r": "ɹ",
"s": "s",
"t": "ʇ",
"u": "n",
"v": "ʌ",
"w": "ʍ",
"x": "x",
"y": "ʎ",
"z": "z",
"z": "z",
"A": "∀",
"B": "q",
"C": "Ɔ",
"D": "p",
"E": "Ǝ",
"F": "Ⅎ",
"G": "פ",
"H": "H",
"I": "I",
"J": "ſ",
"K": "ʞ",
"L": "˥",
"M": "W",
"N": "N",
"O": "O",
"P": "d",
"Q": "b",
"R": "R",
"S": "S",
"T": "┴",
"U": "∩",
"V": "Λ",
"W": "M",
"X": "X",
"Y": "⅄",
"Z": "Z",
"?": "¿",
"!": "¡",
"&": "⅋"
};
let invertedText = "";
for (let char of input11) {
if (char in invertedChars) {
invertedText += invertedChars[char];
} else {
invertedText += char;
}
}
document.getElementById("output11").innerHTML = invertedText;
};
//Kerning
function addKerning() {
let inputText = document.getElementById("input13").value;
let kernedText = "";
for (let i = 0; i < inputText.length; i++) {
kernedText += inputText[i];
if (i !== inputText.length - 1) {
kernedText += " ".repeat(5);
}
}
document.getElementById("output13").innerHTML = kernedText;
};
//Zalgo Glitch
function zalgoGlitch1() {
let input12 = document.getElementById("input12").value;
let zalgoChars = ["́","̀","̂","̃","̄","̅","̆","̇","̈","̉","̊","̋","̌","̍","̎","̏","̐","̑","̒","̓","̔","̕","̖","̗",
"̘","̙","̚","̛","̜","̝","̞","̟","̠","̡","̢","̣","̤","̥","̦","̧","̨","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̴","̵","̶","̷","̸","̹","̺","̻","̼","̽","̾","̿"];
let output12 = "";
for (let char of input12) {
output12 += char;
for (let i = 0; i < Math.floor(Math.random() * 7); i++) {
output12 += zalgoChars[Math.floor(Math.random() * zalgoChars.length)];
}
}
document.getElementById("output12").innerHTML = output12;
};
//áéíñóúü¿¡ ÁÉÍÑÓÚ Üü
//Accent Mark Letters
function replaceVowels() {
var input = document.getElementById("input14").value;
var output = input.replace(/[AEIOUaeiou!?]/gi, function(match) {
switch (match) {
case "a":
return "á";
case "e":
return "é";
case "i":
return "í";
case "o":
return "ó";
case "u":
return "ú";
case "?":
return "¿";
case "!":
return "¡";
case "A":
return "Á";
case "E":
return "É";
case "I":
return "Í";
case "O":
return "Ó";
case "U":
return "Ú";
}
});
document.getElementById("output14").innerHTML = output;
}