-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
32 lines (29 loc) · 965 Bytes
/
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
var typed = new Typed(".auto-type", {
strings: ["I am Rakshit..","I am a", "Freshman At", "IIT Bombay.."],
typeSpeed: 200,
backSpeed: 250,
loop: true
})
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
window.addEventListener('scroll', reveal);
function reveal(){
var reveals = document.querySelectorAll('.reveal')
for(i=0; i < reveals.length; i++){
var windowheight = window.innerHeight;
var revealtop = reveals[i].getBoundingClientRect().top;
var revealpoint = 150;
if(revealtop < windowheight - revealpoint){
reveals[i].classList.add('active');
}
else{
reveals[i].classList.remove('active');
}
}
}