-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscroll.js
64 lines (50 loc) · 1.61 KB
/
scroll.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*============================== SCROLL REVEAL =============================*/
/*===== MENU SHOW =====*/
const showMenu = (toggleId, navId) =>{
const toggle = document.getElementById(toggleId),
nav = document.getElementById(navId)
if(toggle && nav){
toggle.addEventListener('click', ()=>{
nav.classList.toggle('show')
})
}
}
showMenu('nav-toggle','nav-menu')
/*===== ACTIVE AND REMOVE MENU =====*/
const navLink = document.querySelectorAll('.nav__link');
function linkAction(){
/*Active link*/
navLink.forEach(n => n.classList.remove('active'));
this.classList.add('active');
/*Remove menu mobile*/
const navMenu = document.getElementById('nav-menu')
navMenu.classList.remove('show')
}
navLink.forEach(n => n.addEventListener('click', linkAction));
/*===== SCROLL REVEAL ANIMATION =====*/
const sr = ScrollReveal({
origin: 'top',
distance: '80px',
duration: 2000,
reset: true
});
/*SCROLL HOME*/
sr.reveal('#home img',{});
sr.reveal('#home h4',{delay: 200});
sr.reveal('#home p',{delay: 400});
sr.reveal('.home_buttons',{delay: 600});
/*SCROLL ABOUT*/
sr.reveal('#about h3',{});
sr.reveal('#about p',{delay: 200});
/*SCROLL SKILLS*/
sr.reveal('.column h3',{});
sr.reveal('.info-list',{delay: 200});
sr.reveal('.skill-bars',{delay: 200});
sr.reveal('.skills-button',{delay: 400});
/*SCROLL WORK*/
sr.reveal('#work h3',{});
sr.reveal('.w-container',{delay: 200});
/*SCROLL PROJECTS*/
sr.reveal('#projects h3',{});
sr.reveal('.box',{delay: 200});
// sr.reveal('.box2',{delay: 200});