15 lines
397 B
JavaScript
15 lines
397 B
JavaScript
{adc65e16729fd5c5d4f3531744942855caaeb1e8 true 397 main.js 0xc001e46a10}
let toggler = document.querySelector(".toggle");
|
|
let nav = document.querySelector("nav");
|
|
let close = document.querySelector(".close");
|
|
|
|
toggler.onclick = function () {
|
|
nav.classList.add("open");
|
|
};
|
|
close.onclick = function () {
|
|
this.parentElement.classList.remove("open");
|
|
};
|
|
document.onkeyup = function (e) {
|
|
if (e.key === "Escape") {
|
|
nav.classList.remove("open");
|
|
}
|
|
}; |