dealhub/resources/js/sidebar.js
kusowl 673915887c fix(overflow in dashboard, sidebar animation)
- add sidebar open close animation in broker control panel
- fix overflow issue in broker dashboard page
2026-01-20 12:04:32 +05:30

24 lines
808 B
JavaScript

const sidebarWrapper = document.getElementById('sidebarWrapper');
const closeBtn = document.getElementById('closeSidebarBtn');
const openBtn = document.getElementById('openSidebarBtn');
const sidebarTexts = document.querySelectorAll('.sidebar-text');
closeBtn.addEventListener('click', () => {
sidebarWrapper.classList.remove('w-64');
sidebarWrapper.classList.add('w-20');
closeBtn.classList.add('hidden');
openBtn.classList.remove('hidden');
sidebarTexts.forEach(el => el.classList.add('opacity-0'));
});
openBtn.addEventListener('click', () => {
sidebarWrapper.classList.remove('w-20');
sidebarWrapper.classList.add('w-64');
openBtn.classList.add('hidden');
closeBtn.classList.remove('hidden');
sidebarTexts.forEach(el => el.classList.remove('opacity-0'));
});