-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
37 lines (32 loc) · 1.18 KB
/
index.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
// ============================== MENU SHOW Y HIDDEN ================================
const navMenu = document.getElementById('nav-menu'),
navToggle = document.getElementById('nav-toggle'),
navClose = document.getElementById('nav-close')
// ============= MENU SHOW =============
// VALIDATE IF CONSTANT EXISTS
if(navToggle){
navToggle.addEventListener('click', ()=>{
navMenu.classList.add('show-menu');
})
}
// ============== MENU HIDDEN ============
//VALIDATE IF CONSTANT EXISTS
if(navClose){
navClose.addEventListener('click' , ()=>{
navMenu.classList.remove('show-menu')
})
}
// ============== REMOVE MOBILE MENU ============
const navLink = document.querySelectorAll('.nav__link');
function linkAction(){
const navMenu = document.getElementById('nav-menu');
//When we click on each nav__link, we remove the show-menu class
navMenu.classList.remove('show-menu');
}
navLink.forEach(n => n.addEventListener('click', linkAction));
var typed = new Typed(".typing", {
strings: ["A Full Stack Developer","A Java Backend Developer", "A Sport Enthusiast"],
typeSpeed: 100,
backSpeed: 90,
loop: true,
})