-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
38 lines (29 loc) · 884 Bytes
/
script.js
File metadata and controls
38 lines (29 loc) · 884 Bytes
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
// Inputs
const input = document.querySelector('.vname');
const check = document.querySelector('.input');
const range = document.querySelector('.form-range');
// Reset
range.value = 100;
input.value = '';
check.checked = true;
// Ev
range.addEventListener('change',async function () {t = Number(range.value);})
input.addEventListener('input',async function () {q = input.value;})
check.addEventListener('change',async function () {w = check.checked;})
// IO
function io(str) {input.value = str;};
// Random
function rand() {return String.fromCharCode(Math.floor(Math.random() * (122 - 65 + 1)) + 65);}
// Random str
let q = rand();
// Active
let w = check.checked;
// Time
let t = 100;
setInterval(function (){
if (w) {
for (let i = 0; i < 9; i++) {if (w) {setTimeout(function () {io(q + rand());}, t*(i+1));};};
q += rand();
io(q);
};
},t*9);