-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabout.js
45 lines (37 loc) · 988 Bytes
/
about.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
let count = 0;
const increment = () => {
for (let i = 0; i < 100; i++) {
document.querySelector(".gradient").style.width = `${count}%`;
count++;
console.log(count);
}
count = 0;
};
increment();
document.getElementById("projects").addEventListener("click", increment);
var i = 0;
var j = 0;
var txt = "Hello! My name is";
var myName = "Ankita Zaveri.";
var speed = 200;
function typeWriter() {
if (i < txt.length) {
document.getElementById("typeEffect").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
console.log(i);
}
}
let nameWriter = () => {
document.getElementById("secondCursor").innerHTML = "|";
document.getElementById("blinkingCursor").classList.add("hide");
if (j < myName.length) {
document.getElementById("nameEffect").innerHTML += myName.charAt(j);
j++;
setTimeout(nameWriter, speed);
console.log(j);
}
console.log("exit");
};
setTimeout(typeWriter, 1000);
setTimeout(nameWriter, 5000);