-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
44 lines (38 loc) · 1.11 KB
/
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
let i =0;
let j= 0;
let k= 0;
const theName = "Micah Lin";
const theDesc = "Aspiring Software Engineer 🖥️";
const theDescTwo = "USMC Reservist ⚔️";
typingAnimation();
document.getElementById("btn__scroll--white").addEventListener("click", scrollDown);
function typingAnimation(){
if(i<theName.length) {
document.getElementById("name").innerHTML += theName.charAt(i);
i++;
setTimeout(typingAnimation, 140);
}
if(i == theName.length){
typingAnimationDescOne();
}
}
function typingAnimationDescOne(){
if(j<theDesc.length) {
document.getElementById("desc-1").innerHTML += theDesc.charAt(j);
j++;
setTimeout(typingAnimationDescOne, 180);
}
if( j == theDesc.length){
typingAnimationDescTwo();
}
}
function typingAnimationDescTwo(){
if(k<theDescTwo.length) {
document.getElementById("desc-2").innerHTML += theDescTwo.charAt(k);
k++;
setTimeout(typingAnimationDescTwo, 160);
}
}
function scrollDown(){
window.scrollTo({top:980, behavior: 'smooth'});
}