2021-07-29 19:02:18 +02:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const burger = document.querySelector(".burger");
|
|
|
|
const burgerOpen = document.querySelector(".burger__button--open");
|
|
|
|
const burgerClose = document.querySelector(".burger__button--close");
|
|
|
|
const menuMobile = document.querySelector(".nav-mobile");
|
2021-07-30 18:00:52 +02:00
|
|
|
const menuLinks = document.querySelectorAll(".nav__link");
|
2021-07-29 19:02:18 +02:00
|
|
|
const overlay = document.querySelector(".overlay");
|
2021-08-04 12:26:31 +02:00
|
|
|
const form = document.querySelector(".footer__form");
|
|
|
|
const confirmation = document.querySelector(".footer__confirm");
|
2021-07-29 19:02:18 +02:00
|
|
|
|
2021-07-30 18:00:52 +02:00
|
|
|
const closeMobileMenu = () => {
|
2021-07-29 19:02:18 +02:00
|
|
|
burgerOpen.classList.toggle("hidden");
|
|
|
|
burgerClose.classList.toggle("hidden");
|
|
|
|
menuMobile.classList.toggle("hidden");
|
|
|
|
overlay.classList.toggle("hidden");
|
2021-07-30 18:00:52 +02:00
|
|
|
};
|
|
|
|
|
2021-08-05 17:42:11 +02:00
|
|
|
burger.addEventListener("click", closeMobileMenu);
|
|
|
|
overlay.addEventListener("click", closeMobileMenu);
|
2021-07-30 18:00:52 +02:00
|
|
|
menuLinks.forEach(function (link) {
|
2021-08-05 17:42:11 +02:00
|
|
|
link.addEventListener("click", closeMobileMenu);
|
2021-07-29 19:02:18 +02:00
|
|
|
});
|
2021-08-04 12:26:31 +02:00
|
|
|
|
|
|
|
form.addEventListener("submit", function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
form.classList.toggle("hidden");
|
|
|
|
confirmation.classList.toggle("hidden");
|
|
|
|
});
|