-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
25 lines (22 loc) · 853 Bytes
/
main.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
const navToggle = document.querySelector(".nav-toggle")
const navLink = document.querySelectorAll(".nav__link")
const contactBtn = document.getElementById("contact-btn")
const message = document.getElementById("message")
const social = document.getElementById("follow")
const socialBtn = document.getElementById("footer-social")
navToggle.addEventListener("click", function(){
document.body.classList.toggle('nav-open');
})
navLink.forEach(link => {
link.addEventListener("click", function(){
document.body.classList.remove('nav-open');
})
})
contactBtn.addEventListener("click",function(){
document.getElementById("form").style.display = "block"
contactBtn.style.display = "none"
message.textContent = "Get in touch"
socialBtn.style.display = "flex"
social.style.display = "none"
location.href="#form"
})