- add sidebar open close animation in broker control panel - fix overflow issue in broker dashboard page
24 lines
808 B
JavaScript
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'));
|
|
});
|