Menu lateral

This commit is contained in:
2026-08-05 07:34:47 -05:00
parent 2080f396dc
commit 0baf9ab9f0
4 changed files with 167 additions and 15 deletions
+26
View File
@@ -0,0 +1,26 @@
document.addEventListener('DOMContentLoaded', function () {
const menuButtons = document.querySelectorAll('.menu-btn');
const sections = document.querySelectorAll('.section');
const sectionTitle = document.getElementById('section-title');
const titles = {
trabajadores: 'Trabajadores',
nominas: 'Nóminas',
liquidaciones: 'Liquidaciones',
licencia: 'Licencia'
};
menuButtons.forEach(button => {
button.addEventListener('click', function () {
const target = this.dataset.section;
menuButtons.forEach(btn => btn.classList.remove('active'));
this.classList.add('active');
sections.forEach(section => section.classList.remove('active'));
document.getElementById(target).classList.add('active');
sectionTitle.textContent = titles[target] || '';
});
});
});