-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
93 lines (61 loc) · 2.05 KB
/
app.js
File metadata and controls
93 lines (61 loc) · 2.05 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
const menu = document.querySelector('#mobile_menu');
const menulinks = document.querySelector('.navbar_menu');
menu.addEventListener('click' , function(){
menu.classList.toggle('is-active');
menulinks.classList.toggle('active');
});
const text = "TSHEPO SEPATAKE";
const target = document.getElementById("Hero_class");
let index = 0;
let deleting = false;
function type() {
if (!deleting) {
target.textContent = text.slice(0, index + 1);
index++;
if (index === text.length) {
deleting = true;
setTimeout(type, 1500);
return;
}
setTimeout(type, 100);
} else {
target.textContent = text.slice(0, index - 1);
index--;
if (index === 0) {
deleting = false;
setTimeout(type, 600);
return;
}
setTimeout(type, 60);
}
}
type();
function animateBars(){
setTimeout (() => {
document.querySelector(".progress_html").style.width ="90%";
document.querySelector(".progress_css").style.width = "80%";
document.querySelector(".progress_javascript").style.width="70%";
document.querySelector(".progress_java").style.width="82%";
document.querySelector(".progress_spring-boot").style.width="75%";
document.querySelector(".progress_SQL").style.width="80%";
},300);
}
function resetBars(){
document.querySelector(".progress_html").style.width ="0";
document.querySelector(".progress_css").style.width = "0";
document.querySelector(".progress_javascript").style.width="0";
document.querySelector(".progress_java").style.width="0";
document.querySelector(".progress_spring-boot").style.width="0%";
this.document.querySelector(".progress_SQL").style.width="0";
}
const skillsSection = document.querySelector(".Skills");
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
animateBars();
} else {
resetBars();
}
});
}, { threshold: 0.05 });
observer.observe(skillsSection);