-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (24 loc) · 776 Bytes
/
script.js
File metadata and controls
26 lines (24 loc) · 776 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
const addCharacter = (element, character) => {
return new Promise((resolve) => {
setTimeout(() => {
element.textContent = element.textContent + character;
resolve();
}, 100);
});
};
const initialize = async (string, id) => {
const element = document.getElementById(id);
const length = string.length;
element.textContent = "> ";
for (let index = 0; index < length; index++) {
await addCharacter(element, string[index]);
}
element.classList.remove("active");
};
const start = async () => {
await initialize("Hey I am hacker...", "line-1");
await initialize("Hacking Ashish's username...", "line-2");
await initialize("Username found aashish17...", "line-3");
await initialize("Connecting to facebook...", "line-4");
};
start();