-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (32 loc) · 1.05 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
38
39
40
41
42
//mobile menu links toggling
let navbar = document.querySelector('.links-wrapper');
function Toggle() {
navbar.classList.toggle('active');
}
document.querySelectorAll('.link').forEach(n => n.addEventListener('click', () =>{
navbar.classList.remove('active');
}));
let full_year = document.getElementById("year");
full_year.innerHTML = new Date().getFullYear();
//menu button toggling
let toggle = document.getElementById('toggle-btn');
let bt = document.getElementById('bt');
let cross = document.getElementById('cross');
cross.style.display = 'none';
toggle.addEventListener('click', (e) => {
e.preventDefault();
if (cross.style.display === 'none') {
cross.style.display = 'block';
bt.style.display = 'none';
} else {
cross.style.display = 'none';
bt.style.display = 'block';
}
});
//email form toggling
/*let btn = document.getElementById('email-btn');
let form = document.getElementById('form');
btn.addEventListener('click', (e) => {
e.preventDefault();
form.classList.toggle('show');
});*/