-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharacters.html
522 lines (484 loc) · 26.5 KB
/
characters.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
<!DOCTYPE html>
<html lang="ru">
<head>
<title>Range Randoms</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/characters.css">
</head>
<body>
<div>
<div class='backimage'></div>
<div id='ownernavshadow'>
<svg class='navshadow'></svg>
</div>
<div id ="ownertt"s>
<svg class = 'tt'>
<lineargradient id = 'lgr1' gradientTransform="rotate(-11)" >
<stop offset="0%" stop-color="rgba(86,52,138,0.76)" />
<stop offset="40%" stop-color="rgba(163,100,166,0.76)">
<animate
dur="5s"
attributeName="offset"
values="40%;60%;40%"
repeatCount="indefinite"
></animate>
<animate
dur="5s"
attributeName="stop-color"
values="rgba(163,100,166,0.76);rgba(163,100,166,1);rgba(163,100,166,0.76)"
repeatCount="indefinite"
></animate>
</stop>
<stop offset="100%" stop-color=rgba(144,40,79,0.76) />
</lineargradient>
<polyline style='stroke-width:2; fill: url(#lgr1)'>
<animate
attributeName="points"
dur="1.5s"
values="5 5,0 10, 5 15, 2 20, 5 25, 0 30, 5 35, 2 40, 5 45, 0 50, 5 55, 2 60, 5 65, 0 70, 5 75, 2 80, 5 85, 0 90, 5 95, 2 100, 5 105, 0 110, 5 115, 10 120, 15 115, 20, 118, 25 115, 30 120, 35 115, 40 118, 45 115, 50 120, 55 115, 60 118, 65 115, 70 120, 75 115, 80 118, 85 115, 90 120, 95 115, 100 118, 105 115, 110 120, 115 115, 120 118, 125 115, 130 120, 135 115, 140 118, 145 115, 150 120, 155 115, 160 118, 165 115, 170 120, 175 115, 180 118, 185 115, 190 120, 195 115, 200 118, 205 115, 210 120, 215 115, 220 118, 225 115, 230 120, 235 115, 240 118, 245 115, 250 120, 255 115, 260 118, 265 115, 270 120, 275 115, 280 118, 285 115, 290 120, 295 115, 300 118, 305 115, 310 120, 315 115, 320 118, 325 115, 330 120, 335 115, 340 118, 345 115, 350 120, 355 115, 360 118, 365 115, 370 120, 375 115, 380 110, 375 105, 378 100, 375 95, 380 90, 375 85, 378 80, 375 75, 380 70, 375 65, 378 60, 375 55, 380 50, 375 45, 378, 40, 375 35, 380 30, 375 25, 378 20, 375 15, 380, 10;
5 5,0 12, 5 15, 2 18, 5 25, 0 32, 5 35, 2 38, 5 45, 0 52, 5 55, 2 58, 5 65, 0 72, 5 75, 2 78, 5 85, 0 92, 5 95, 2 98, 5 105, 0 112, 5 115, 8 120, 15 115, 22, 118, 25 115, 28 120, 35 115, 42 118, 45 115, 48 120, 55 115, 62 118, 65 115, 68 120, 75 115, 82 118, 85 115, 88 120, 95 115, 102 118, 105 115, 108 120, 115 115, 122 118, 125 115, 128 120, 135 115, 142 118, 145 115, 148 120, 155 115, 162 118, 165 115, 168 120, 175 115, 182 118, 185 115, 188 120, 195 115, 202 118, 205 115, 208 120, 215 115, 222 118, 225 115, 228 120, 235 115, 242 118, 245 115, 248 120, 255 115, 262 118, 265 115, 268 120, 275 115, 282 118, 285 115, 288 120, 295 115, 302 118, 305 115, 308 120, 315 115, 322 118, 325 115, 328 120, 335 115, 342 118, 345 115, 348 120, 355 115, 362 118, 365 115, 368 120, 375 115, 380 108, 375 105, 378 102, 375 95, 380 88, 375 85, 378 78, 375 75, 380 72, 375 65, 378 58, 375 55, 380 52, 375 45, 378, 38, 375 35, 380 32, 375 25, 378 18, 375 15, 380, 12;
5 5,0 10, 5 15, 2 20, 5 25, 0 30, 5 35, 2 40, 5 45, 0 50, 5 55, 2 60, 5 65, 0 70, 5 75, 2 80, 5 85, 0 90, 5 95, 2 100, 5 105, 0 110, 5 115, 10 120, 15 115, 20, 118, 25 115, 30 120, 35 115, 40 118, 45 115, 50 120, 55 115, 60 118, 65 115, 70 120, 75 115, 80 118, 85 115, 90 120, 95 115, 100 118, 105 115, 110 120, 115 115, 120 118, 125 115, 130 120, 135 115, 140 118, 145 115, 150 120, 155 115, 160 118, 165 115, 170 120, 175 115, 180 118, 185 115, 190 120, 195 115, 200 118, 205 115, 210 120, 215 115, 220 118, 225 115, 230 120, 235 115, 240 118, 245 115, 250 120, 255 115, 260 118, 265 115, 270 120, 275 115, 280 118, 285 115, 290 120, 295 115, 300 118, 305 115, 310 120, 315 115, 320 118, 325 115, 330 120, 335 115, 340 118, 345 115, 350 120, 355 115, 360 118, 365 115, 370 120, 375 115, 380 110, 375 105, 378 100, 375 95, 380 90, 375 85, 378 80, 375 75, 380 70, 375 65, 378 60, 375 55, 380 50, 375 45, 378, 40, 375 35, 380 30, 375 25, 378 20, 375 15, 380, 10;
5 5,0 8, 5 15, 2 22, 5 25, 0 28, 5 35, 2 42, 5 45, 0 48, 5 55, 2 62, 5 65, 0 68, 5 75, 2 82, 5 85, 0 88, 5 95, 2 102, 5 105, 0 108, 5 115, 12 120, 15 115, 18, 118, 25 115, 32 120, 35 115, 38 118, 45 115, 52 120, 55 115, 58 118, 65 115, 72 120, 75 115, 78 118, 85 115, 92 120, 95 115, 98 118, 105 115, 112 120, 115 115, 118 118, 125 115, 132 120, 135 115, 138 118, 145 115, 152 120, 155 115, 158 118, 165 115, 172 120, 175 115, 178 118, 185 115, 192 120, 195 115, 198 118, 205 115, 212 120, 215 115, 218 118, 225 115, 232 120, 235 115, 238 118, 245 115, 252 120, 255 115, 258 118, 265 115, 272 120, 275 115, 278 118, 285 115, 292 120, 295 115, 298 118, 305 115, 312 120, 315 115, 318 118, 325 115, 332 120, 335 115, 338 118, 345 115, 352 120, 355 115, 358 118, 365 115, 372 120, 375 115, 380 112, 375 105, 378 98, 375 95, 380 92, 375 85, 378 82, 375 75, 380 68, 375 65, 378 62, 375 55, 380 48, 375 45, 378, 42, 375 35, 380 28, 375 25, 378 22, 375 15, 380, 8;
5 5,0 10, 5 15, 2 20, 5 25, 0 30, 5 35, 2 40, 5 45, 0 50, 5 55, 2 60, 5 65, 0 70, 5 75, 2 80, 5 85, 0 90, 5 95, 2 100, 5 105, 0 110, 5 115, 10 120, 15 115, 20, 118, 25 115, 30 120, 35 115, 40 118, 45 115, 50 120, 55 115, 60 118, 65 115, 70 120, 75 115, 80 118, 85 115, 90 120, 95 115, 100 118, 105 115, 110 120, 115 115, 120 118, 125 115, 130 120, 135 115, 140 118, 145 115, 150 120, 155 115, 160 118, 165 115, 170 120, 175 115, 180 118, 185 115, 190 120, 195 115, 200 118, 205 115, 210 120, 215 115, 220 118, 225 115, 230 120, 235 115, 240 118, 245 115, 250 120, 255 115, 260 118, 265 115, 270 120, 275 115, 280 118, 285 115, 290 120, 295 115, 300 118, 305 115, 310 120, 315 115, 320 118, 325 115, 330 120, 335 115, 340 118, 345 115, 350 120, 355 115, 360 118, 365 115, 370 120, 375 115, 380 110, 375 105, 378 100, 375 95, 380 90, 375 85, 378 80, 375 75, 380 70, 375 65, 378 60, 375 55, 380 50, 375 45, 378, 40, 375 35, 380 30, 375 25, 378 20, 375 15, 380, 10"
repeatCount="indefinite"
></animate>
<animate
dur="10s"
attributeName="stroke"
values="white;orange;cyan;blueviolet;white"
repeatCount="indefinite"
></animate>
</polyline>
</svg>
</div>
<div class='rc1'></div>
<div class='rc2'></div>
<nav class = nav>
<h1>Range Randoms</h1>
<ul>
<li id='link2'><a href="https://github.com/Immersive-programs/Range-Randoms">Github</a></li>
<li id='link1'><a href="index.html">Числа</a></li>
<li id='thislink1'><a href="">Буквы</a></li>
<li id='link3'><a href="passwords.html">Пароли</a></li>
</ul>
</nav>
<article>
<h2 id = 'cx'>Случайная буква:</h2>
<button id='copygen' onclick = "copygen()"></button>
<h3 id = 'ci'></h3>
<button id = 'button' onclick = "clicked()" > Генерация!</button>
<ul class='random_options'>
<li><label>Настройки:</label></li>
<li>
<input type="range" id='range1' oninput="
countr1.value = this.value.replace(/[^\d]/g,'');
if (countr1.value != 1)
countrl1.innerHTML = 'символов будет создано';
else
countrl1.innerHTML = 'символ будет создан';
" min="1" max="100" step="1" value="1">
<div>
<input id='countr1' onkeyup="this.value = this.value.replace(/[^\d]/g,'')" oninput="
range1.value = this.value.replace(/[^\d]/g,'')
if (countr1.value != 1)
countrl1.innerHTML = 'символов будет создано';
else
countrl1.innerHTML = 'символ будет создан';
"/>
<label id='countrl1'>символ будет создан</label>
<label class="tooltip">?
<span class="tooltiptext">Значение определяет количество создаваемых символов</span>
</label>
</div>
</li>
<li>
<input type="range" id='range2' oninput="
countr2.value = this.value.replace(/[^\d]/g,'');
if (countr2.value != 1)
countrl2.innerHTML = 'последовательностей ';
else
countrl2.innerHTML = 'последовательность ';
" min="1" max="100" step="1" value="1">
<div>
<input id='countr2' onkeyup="this.value = this.value.replace(/[^\d]/g,'')" oninput="
range2.value = this.value.replace(/[^\d]/g,'')
if (countr2.value != 1)
countrl2.innerHTML = 'последовательностей ';
else
countrl2.innerHTML = 'последовательность ';
"/>
<label id='countrl2'>последовательность</label>
<label class="tooltip">?
<span class="tooltiptext">значение определяет количество последовательностей</span>
</label>
</div>
</li>
<li>
<div><label>Алфавит:</label></div>
<div>
<input type="radio" id='alph1' onchange="
alph2.checked = false;
alph3.checked = false;
document.getElementById('list').hidden = true;
"/>
<label>Русский</label>
<input type="radio" id='alph2' onchange="
alph1.checked = false;
alph3.checked = false;
document.getElementById('list').hidden = true;
"/>
<label>Англиский</label>
<input type="radio" id='alph3' onchange="
alph1.checked = false;
alph2.checked = false;
document.getElementById('list').hidden = false;
"/>
<label>Другой</label>
<label class="tooltip">?
<span class="tooltiptext">Позволяет выбирать алфавит для создания последовательностей</span>
</label>
</div>
</li>
<li>
<ul style="padding: 0">
<li>
<label>Регистр:</label>
<select id='regsel' onchange="
if (this.value == 3)
opthide.style = 'width:\'\';height:\'\';overflow:show;padding:2;';
else
opthide.style = 'width:0;height:0;overflow:hidden;padding:0;';
"/>
<option value="1">Низкий</option>
<option value="2">Высокий</option>
<option value="3">Случайный</option>
</select>
<label class="tooltip">?
<span class="tooltiptext">Определяет, будут буквы большими или маленькими</span>
</label>
</li>
<li class='opthide'>
<input type="range" id='range3' oninput="countr3.value = this.value.replace(/[^\d]/g,'');" min="1" max="99" step="1" value="1">
<div>
<input id='countr3' disabled="true"/>
<label id='countrl3'>% шанс большого символа</label>
<!--<label class="tooltip">?
<span class="tooltiptext">???</span>
</label>-->
</div>
</li>
</ul>
</li>
<li>
<input type="checkbox" id='checkspliter'>
<label>Разделитель:</label>
<input id='spliter'/>
<label class="tooltip">?
<span class="tooltiptext">Значение заменяет отступы между числами (пример: ' ' ',' ';' 'abc')</span>
</label>
</li>
<li>
<input type="checkbox" id='checkfirstadd'>
<label>Добавить в начало:</label>
<input id='firstadd'/>
<label class="tooltip">?
<span class="tooltiptext">Добавляет в начало текст</span>
</li>
<li>
<input type="checkbox" id='checklaststadd'>
<label>Добавить в конец:</label>
<input id='laststadd'/>
<label class="tooltip">?
<span class="tooltiptext">Добавляет в конец текст</span>
</li>
<li>
<div>
<input type="checkbox" id='de1'/>
<label>исключить повторы в последовательности</label>
<label class="tooltip">?
<span class="tooltiptext">Исключает повторение одинаковых символов</span>
</label>
</div>
</li>
<li>
<div>
<input type="checkbox" id='de2'/>
<label>исключить повторы последовательностей</label>
<label class="tooltip">?
<span class="tooltiptext">Исключает повторение одинаковых последовательностей (!BETA!)</span>
</label>
</div>
</li>
<li style="margin-right: 10px">
<textarea id="list" onkeyup="this.value = this.value.replace(' ','').replace(' ','').replace(' ','')"/></textarea>
</li>
</ul>
</article>
</div>
</body>
<script type="text/javascript">
var r1 = document.getElementById('range1');
var r2 = document.getElementById('range2');
var r3 = document.getElementById('range3');
var c1 = document.getElementById('countr1');
var c2 = document.getElementById('countr2');
var c3 = document.getElementById('countr3');
var regs = document.getElementById('regsel');
var alph1 = document.getElementById('alph1');
var alph2 = document.getElementById('alph2');
var alph3 = document.getElementById('alph3');
var de1 = document.getElementById('de1');
var de2 = document.getElementById('de2');
var list = document.getElementById('list');
var opthide = document.getElementsByClassName('opthide')[0];
var checkspliter = document.getElementById('checkspliter');
var spliter = document.getElementById('spliter');
var cfa = document.getElementById('checkfirstadd');
var cla = document.getElementById('checklaststadd');
var fa = document.getElementById('firstadd');
var la = document.getElementById('laststadd');
r1.value = 1;
r2.value = 1;
r3.value = 50;
c1.value = 1;
c2.value = 1;
c3.value = 50;
regs.value = 1;
alph1.checked = true;
alph2.checked = false;
alph3.checked = false;
de1.checked = false;
de2.checked = false;
list.hidden = true;
list.value = '';
checkspliter.checked = false;
spliter.value = '';
opthide.style = 'width:0;height:0;overflow:hidden;padding:0;';
cfa.checked = false;
cla.checked = false;
fa.value = '';
la.value = '';
var rc1 = document.getElementsByClassName('rc1')[0];
var rc2 = document.getElementsByClassName('rc2')[0];
var enchar = ['a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z'];
var ruchar = ['а','б','в','г','д','е','ё','ж','з','и','й','к','л',
'м','н','о','п','р','с','т','у','ф','х','ц','ч',
'ш','щ','ъ','Ы','ь','э','ю','я'];
var chararray = enchar.concat(ruchar);
for (j = 0; 30 > j; j++)
{
var p = document.createElement('p');
p.innerText = chararray[Math.floor(Math.random()*chararray.length)]
s = Math.floor((Math.random()*(40-20))+20)+'px';
m = Math.floor((Math.random()*(100-50))+50)+'px';
t = Math.floor(Math.random()*20)+'deg';
c = '';
a = '';
hh =';';
if (Math.random() < 0.5){
t = '-'+t;
}
if(Math.random() < 0.5){
hh=';text-transform: uppercase;';
}
switch(Math.floor(Math.random()*3))
{
case 0:
a = 'left';
break;
case 1:
a = 'center';
break;
case 2:
a = 'right';
break;
}
switch(Math.floor(Math.random()*5))
{
case 0:
c = 'white';
break;
case 1:
c = 'gray';
break;
case 2:
c = '#9999ff';
break;
case 3:
c = 'purple';
break;
case 4:
c = 'cyan';
break;
case 5:
c = 'greenyellow';
break;
}
p.style.cssText = 'font-size:'+s+';text-align:'+a+';height: '+m+'; transform: rotate('+t+'); color:'+c+hh;
if (j < 15)
{
rc1.appendChild(p);
}
else
{
rc2.appendChild(p);
}
}
function clicked()
{
var buff1 = [];
var buff2 = [];
var alf = ['ERR'];
if (alph1.checked) alf = ruchar;
if (alph2.checked) alf = enchar;
if (alph3.checked) alf = Array.from(new Set(list.value));
var reg = 0;
if (regsel.value == 2)
reg = 100;
if (regsel.value == 3)
reg = countr3.value;
var c1p = countr1.value;
var c2p = countr2.value;
var d1c = de1.checked;
var d2c = de2.checked;
if (c1p == 1 && c2p == 1)
cx.innerHTML = "Случайная буква:";
else
cx.innerHTML = "Случайные буквы:";
if (c1p > 1 && c2p > 1)
cx.innerHTML = "Случайные последовательности:";
if (d1c && !d2c)
{
if (c1p > alf.length)
{
c1p = alf.length
if (c2p == 1)
cx.innerHTML = "Cлучайных "+ c1p + " символов в последовательности:";
else
cx.innerHTML = "Cлучайных "+ c1p + " символов в последовательностях:";
}
}
if (d2c && !d1c)
{
if (c2p > c1p*alf.length)
{
c2p = c1p*alf.length;
cx.innerHTML = "Cлучайных "+ c2p + " последовательностей:";
}
}
if (d2c && d1c)
{
var b1 = false;
var b2 = false;
if (c1p > alf.length)
{
b1 = true;
c1p = alf.length;
if (c2p == 1)
cx.innerHTML = "Cлучайных "+ c1p + " символов в последовательности:";
else
cx.innerHTML = "Cлучайных "+ c1p + " символов в последовательностях:";
}
var m = alf.length;
if (c1p != 0 && c1p != 1)
m = Math.round(Math.log(c1p*alf.length) / Math.log(c1p))*c1p;
if(c2p > m)
{
b2 = true;
c2p = m;
cx.innerHTML = "Cлучайных "+ c2p + " последовательностей:";
}
if(b1 && b2)
{
cx.innerHTML = "Cлучайных "+ c1p +" символов в "+c2p +" последовательностях:";
}
}
var g = '';
for(i = 0; c2p >i; i++)
{
var gd = '';
for (b = 0; c1p > b; b++)
{
var gc = generatevchar(alf,reg);
if (d1c)
{
if (buff1.filter(co => co == gc).length == 0)
{
buff1.push(gc);
gd += gc;
}
else
{
b--;
}
}
else
{
gd += gc;
}
}
buff1 = [];
if (d2c)
{
if (buff2.filter(co => co == gd).length == 0)
{
buff2.push(gd);
g += gd;
if (countr2.value != i+1)
{
if (checkspliter.checked && spliter.value.length > 0)
g += spliter.value;
else
g += ' ';
}
}
else
{
i--;
}
}
else
{
g += gd;
if (countr2.value != i+1)
{
if (checkspliter.checked && spliter.value.length > 0)
g += spliter.value;
else
g += ' ';
}
}
}
buff2 = [];
ci.innerHTML = g;
if (cfa.checked)
ci.innerHTML = fa.value+g;
if (cla.checked)
ci.innerHTML += la.value;
}
ci.innerHTML = generatevchar(ruchar,0);
function generatevchar(list,ch)
{
var get = Math.floor(Math.random()*list.length);
if (Math.random() > ch/100)
{
return list[get].toLowerCase();
}
else
{
return list[get].toUpperCase();
}
}
function copygen()
{
const elem = document.createElement('textarea');
elem.value = ci.innerHTML;
document.body.appendChild(elem);
elem.select();
document.execCommand('copy');
document.body.removeChild(elem);
}
</script>
</html>