-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
35 lines (28 loc) · 1.05 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
const navbar = document.querySelector('.header .navbar');
const menuButton = document.querySelector('.header .menu');
menuButton.addEventListener('click', () => {
navbar.classList.toggle('show');
});
document.onscroll = () => {
navbar.classList.remove('show');
if (window.scrollY > 0) {
document.querySelector('.header').classList.add('active');
} else {
document.querySelector('.header').classList.remove('active');
}
};
document.onload = () => {
if (window.scrollY > 0) {
document.querySelector('.header').classList.add('active');
} else {
document.querySelector('.header').classList.remove('active');
}
};
function sendMail(){
var subject = document.getElementById("subject").value;
var mailBody = document.getElementById("mailBody").value;
window.location.href = "mailto:deviprasadofficial@gmail.com?subject=" + subject + "&body=" + mailBody;
}
let currentYearElement = document.getElementById('currentYear');
let currentYear = new Date().getFullYear();
currentYearElement.innerHTML = currentYear;