seepur/resources/scripts/components/navbar.ts

15 lines
391 B
TypeScript
Raw Normal View History

document.addEventListener("DOMContentLoaded", function () {
(function Navbar() {
const menuButton: HTMLAnchorElement = document.getElementById('menu-button') as HTMLAnchorElement;
const navMenu: HTMLDivElement = document.getElementById('nav-menu') as HTMLDivElement;
menuButton.onclick = (event) => {
navMenu.classList.toggle('is-active');
}
})();
//....
});