forked from reenphygeorge/Hacker-Typer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
45 lines (36 loc) · 866 Bytes
/
script.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
window.onkeydown = function nam() {
console.log("Hello")
}
var cursor = true;
var speed = 500;
setInterval(() => {
if(cursor) {
document.getElementById('cursor').style.opacity = 0;
cursor = false;
}else {
document.getElementById('cursor').style.opacity = 1;
cursor = true;
}
}, speed);
var code
var i=0
var j=0
const xhr = new XMLHttpRequest();
xhr.open('GET','mytext.txt', true);
xhr.onload = function() {
code = this.responseText
// for(var i=0 ; i<100 ; i++) {
window.onkeydown = function print() {
var temp = ''
while(code[j] != ' ') {
temp += code[j]
j++
}
j++;
temp += ' '
document.getElementById("code").innerHTML += temp;
// console.log(temp)
temp = ''
}
}
xhr.send();