-
Notifications
You must be signed in to change notification settings - Fork 2
/
deluxe_munger.html
executable file
·180 lines (178 loc) · 5.85 KB
/
deluxe_munger.html
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
<!doctype html>
<html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Fake Russian Generator</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<script type='text/javascript' charset='utf-8'>
window.addEventListener('load', function(e) {
setTimeout(function() { window.scrollTo(0, 1); }, 1);
}, false);
</script>
<style type="text/css">
body {
font:100%/1.5 sans-serif;
background:#bc0000;
margin:0;
padding:0;
}
h1 { font-size:3em;
font-weight:900;
font-family: sans-serif;
text-align:center;
border-bottom:0.1em solid #ffd700;
color:#ffd700;
padding:0.25em;
margin:0;
}
#main { background:#d52b1e; margin:0; padding:0; overflow:hidden }
p { padding:1em; }
textarea { display:block; width:98%; min-height:2em; margin:0 auto; }
button {
width:40%;
margin:0.5em 30%;
font-size:1.5em;
font-weight:900;
background-image: -o-linear-gradient(bottom, #A68A00 20%, #FFD900 80%);
background-image: -moz-linear-gradient(bottom, #A68A00 20%, #FFD900 80%);
background-image: -webkit-linear-gradient(bottom, #A68A00 20%, #FFD900 80%);
background-image: -ms-linear-gradient(bottom, #A68A00 20%, #FFD900 80%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.2, #A68A00),
color-stop(0.8, #FFD900)
);
background-image: linear-gradient(bottom, #A68A00 20%, #FFD900 80%);
border-radius:0.25em;
padding:0.5em;
border:1px solid #A68A00;
box-shadow:inset 0 0.1em 0.2em 0.1em #FFD900,
0em 0em 0em 0.05em #936900,
0.2em 0.2em 0px 0px #662222;
}
button:hover {
background:#FD0;
background-image:none;
}
button:active {
background-image: -o-linear-gradient(bottom, #ffd900 30%, #a68a00 90%);
background-image: -moz-linear-gradient(bottom, #ffd900 30%, #a68a00 90%);
background-image: -webkit-linear-gradient(bottom, #ffd900 30%, #a68a00 90%);
background-image: -ms-linear-gradient(bottom, #ffd900 30%, #a68a00 90%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.3, #ffd900),
color-stop(0.9, #a68a00)
);
background-image: linear-gradient(bottom, #ffd900 30%, #a68a00 90%);
margin:0.6em 30% 0.4em 30%;
box-shadow:inset 0 0.1em 0.3em 0.1em #FFD900,
0em 0em 0em 0.05em #936900,
0.1em 0.1em 0px 0px #662222;
}
#output-wrapper {
padding:1em;
}
#output-wrapper h2 {
color:#FFd700;
}
#out {
border:1px solid #FFd700;
font-size:2em;
font-weight:600;
padding:0.25em;
}
@media (max-width: 40em) {
button {
margin:0.5em 10%;
width:80%;
}
button:active {
margin:0.6em 10% 0.4em 10%;
width:80%;
}
}
</style>
<script type="text/javascript">
var dm = {
alpha: {
'russian': {
'A': ['Д'],
'B': ['Б', 'Ъ', 'Ь'],
'C': ['Ҫ'],
'E': ['Ԑ', 'Є', 'Э'],
'F': ['Ӻ', 'Ғ'],
'H': ['Њ', 'Ҥ', 'Ӊ', 'Ң'],
'I': ['Ї'],
'K': ['Қ', 'Ҡ', 'Ҝ', 'Ԟ'],
'M': ['Ԡ'],
'N': ['И', 'Ѝ', 'Й'],
'O': ['Ф'],
'R': ['Я'],
'T': ['Г', 'Ґ', 'Ҭ'],
'U': ['Ц','Џ'],
'W': ['Ш', 'Щ'],
'X': ['Ӿ', 'Ҳ', 'Ӽ', 'Ж'],
'Y': ['Ч', 'Ұ']
},
'leet': {
'A' : ['4', '@'],
'C' : ['('],
'E' : ['3'],
'H' : ['|-|'],
'I' : ['|', '1'],
'L' : ['|_'],
'T' : ['7']
}
},
random: function(len) {
if (len == 1) return 0;
return !!len ? Math.floor(Math.random() * len + 1) - 1 : Math.random();
},
generate: function(m,str) {
var str_arr = str.toUpperCase().split(''),
output = str_arr.map(function(a) {
if (!dm.alpha[m].hasOwnProperty(a)) return a;
return dm.alpha[m][a][dm.random(dm.alpha[m][a].length)];
});
return output.join('');
}
};
window.onload = function() {
var h1 = document.getElementsByTagName("h1")[0],
input = document.getElementById("in"),
munger_select = document.getElementById("mungers"),
out = document.getElementById("out"),
change_btn = document.getElementById("change"),
worker = function(e) {
var munger = munger_select.options[munger_select.selectedIndex].value;
out.innerHTML = dm.generate(munger, input.value);
};
for(var item in dm.alpha) {
var option = new Option(dm.generate(item, item), item);
munger_select.appendChild(option);
}
input.onkeyup = change_btn.onclick = worker;
};
</script>
</head>
<body>
<h1>Deluxe Munger</h1>
<div id="main">
<p>Alter appearance of input text.</p>
<textarea id="in" placeholder="input"></textarea>
<div>
<select id="mungers"><option>Select munger...</option></select>
<button id="change">GENERATE</button>
</div>
</div>
<div id="output-wrapper">
<h2>OUTPUT:</h2>
<div id="out"></div>
</div>
</body>
</html>