.
This commit is contained in:
parent
071a4d8a97
commit
4d3ca1c554
39 changed files with 3386 additions and 0 deletions
29
static/js/menu.js
Normal file
29
static/js/menu.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Menu category handling
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Handle tab switching
|
||||
const allTabButtons = document.querySelectorAll('[data-tab]');
|
||||
allTabButtons.forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
const tabId = this.getAttribute('data-tab');
|
||||
|
||||
// Hide all content
|
||||
document.querySelectorAll('.menu-content').forEach(content => {
|
||||
content.classList.add('hidden');
|
||||
});
|
||||
|
||||
// Show selected content
|
||||
document.getElementById(tabId + '-content').classList.remove('hidden');
|
||||
|
||||
// Update active states for all buttons with same data-tab
|
||||
allTabButtons.forEach(btn => {
|
||||
if (btn.getAttribute('data-tab') === tabId) {
|
||||
btn.classList.add('bg-pizza-red', 'text-white');
|
||||
btn.classList.remove('bg-gray-200', 'dark:bg-pizza-darker', 'text-gray-700');
|
||||
} else {
|
||||
btn.classList.remove('bg-pizza-red', 'text-white');
|
||||
btn.classList.add('bg-gray-200', 'dark:bg-pizza-darker', 'text-gray-700');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue