-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
46 lines (35 loc) · 1.14 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
45
46
window.addEventListener('scroll', reveal);
function reveal(){
var reveals = document.querySelectorAll('.reveal');
for(var i = 0; i < reveals.length; i++){
var height = window.innerHeight;
var revealTop = reveals[i].getBoundingClientRect().top;
var revealPoint = 150;
if(revealTop < height - revealPoint){
reveals[i].classList.add('active');
}else{
reveals[i].classList.remove('active');
}
}
}
document.addEventListener("DOMContentLoaded", function() {
const skillElements = document.querySelectorAll('.skill-per');
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('animate');
}
});
}, { threshold: 0.1 });
skillElements.forEach(skill => {
observer.observe(skill);
});
});
function showSidebar(){
const sidebar = document.querySelector('.sidebar');
sidebar.style.display = 'flex'
}
function hideSidebar(){
const sidebar = document.querySelector('.sidebar');
sidebar.style.display = 'none'
}