GameHub/Global/Global.js
2024-04-21 12:48:12 +02:00

14 lines
549 B
JavaScript

document.addEventListener('DOMContentLoaded', function() {
const toggleBtn = document.getElementById('toggle_btn');
const toggleBtnIcon = document.getElementById('toggle_btn_icon');
const dropDownMenu = document.getElementById('dropdown_menu');
toggleBtn.addEventListener('click', function() {
dropDownMenu.classList.toggle('open');
const isOpen = dropDownMenu.classList.contains('open');
toggleBtnIcon.classList = isOpen
? 'fa-solid fa-xmark'
: 'fa-solid fa-bars';
}, false);
}, false);