This commit is contained in:
pika 2025-01-04 02:40:01 +01:00
parent 071a4d8a97
commit 4d3ca1c554
39 changed files with 3386 additions and 0 deletions

29
static/js/menu.js Normal file
View 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');
}
});
});
});
});