export function initializeSidebar() {
const menuBtn = document.getElementById('menu-btn');
const sidebar = document.getElementById('sidebar');
const mainContent = document.querySelector('.main-content');
menuBtn.addEventListener('click', () => {
sidebar.classList.toggle('active');
});
mainContent.addEventListener('click', () => {
if (sidebar.classList.contains('active')) {
sidebar.classList.remove('active');
}
});
}
|