-
Notifications
You must be signed in to change notification settings - Fork 0
/
leetify.js
68 lines (65 loc) · 1.73 KB
/
leetify.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
//leetify v1.0 by surajk95
function leetifyRoutine(firstString, index){
var index=(index+3)%firstString.length;
var leetifyDiv = document.getElementById('leetify');
let options = codes[firstString[index]];
let secondString = firstString;
secondString[index]=options[parseInt(Math.random()*options.length)];
const finalString=firstString.join('');
leetifyDiv.innerHTML=`${finalString}`;
setTimeout(leetifyRoutine, 25, firstString, index);
}
function leetify(inputString='LEETIFY', color='white', fontSize='32px', speed='25'){
inputString = inputString.toUpperCase();
console.log(`leetifying...`);
var leetifyDiv = document.getElementById('leetify');
leetifyDiv.style.color=`${color}`;
leetifyDiv.style.fontSize=`${fontSize}`;
var baseString=inputString.split('');
var firstString=baseString;
leetifyRoutine(firstString, 0);
}
var codes={
"A":["A","4","@"],
"B":["B","E","3","8"],
"C":["C","G","<"],
"D":["D"],
"E":["E","B","3","8"],
"F":["F","H","#"],
"G":["G","C","<"],
"H":["H","F","#"],
"I":["I","J","L","!","1"],
"J":["J","I","L","1","!"],
"K":["K","X"],
"L":["L","J","I","!","1"],
"M":["M"],
"N":["N"],
"O":["O","0","Q","&"],
"P":["P","6","9"],
"Q":["Q","O","0","&"],
"R":["R"],
"S":["S","5","$"],
"T":["T","7"],
"U":["U","V","Y"],
"V":["V","U","Y"],
"W":["W"],
"X":["X","K"],
"Y":["Y","V"],
"Z":["Z","2"],
"0":["0","O","Q","&"],
"1":["1","I","J","L","!"],
"2":["2","Z"],
"3":["3", "E", "B", "8"],
"4":["4", "A", "@"],
"5":["5","S","$"],
"6":["6","P","9"],
"7":["7", "T"],
"8":["8", "B", "3", "E"],
"9":["9","6","P"],
"@":["@","A","4"],
"<":["<","C","G"],
"#":["#","F","H"],
"!":["!","I","1","J","L"],
"&":["&","Q","O","0"],
"$":["$","S","5"]
}