removed assets
This commit is contained in:
parent
4d3ca1c554
commit
b345da8cdc
3 changed files with 0 additions and 0 deletions
44
assets.bak/js/menu.js
Normal file
44
assets.bak/js/menu.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Menu category switching
|
||||
const tabButtons = document.querySelectorAll('[data-tab]');
|
||||
const menuContents = document.querySelectorAll('.menu-content');
|
||||
|
||||
tabButtons.forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
const targetId = `${button.dataset.tab}-content`;
|
||||
|
||||
// Update button styles
|
||||
tabButtons.forEach(btn => {
|
||||
const isActive = btn === button;
|
||||
btn.classList.toggle('bg-pizza-red', isActive);
|
||||
btn.classList.toggle('text-white', isActive);
|
||||
btn.classList.toggle('bg-gray-200', !isActive);
|
||||
btn.classList.toggle('dark:bg-pizza-darker', !isActive);
|
||||
btn.classList.toggle('text-gray-700', !isActive);
|
||||
btn.classList.toggle('dark:text-white', !isActive);
|
||||
});
|
||||
|
||||
// Show/hide content
|
||||
menuContents.forEach(content => {
|
||||
content.classList.toggle('hidden', content.id !== targetId);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Pizza price group toggles
|
||||
const priceGroupHeaders = document.querySelectorAll('.price-group-header');
|
||||
priceGroupHeaders.forEach(header => {
|
||||
header.addEventListener('click', () => {
|
||||
const content = header.nextElementSibling;
|
||||
const arrow = header.querySelector('svg');
|
||||
|
||||
// Toggle content visibility
|
||||
content.classList.toggle('hidden');
|
||||
|
||||
// Rotate arrow
|
||||
arrow.style.transform = content.classList.contains('hidden')
|
||||
? 'rotate(0deg)'
|
||||
: 'rotate(180deg)';
|
||||
});
|
||||
});
|
||||
});
|
95
assets.bak/js/opening-status.js
Normal file
95
assets.bak/js/opening-status.js
Normal file
|
@ -0,0 +1,95 @@
|
|||
function updateTimeAndStatus() {
|
||||
const now = new Date();
|
||||
const timeString = now.toLocaleTimeString('de-DE', {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
|
||||
// Update time display
|
||||
const timeDisplay = document.getElementById('current-time');
|
||||
if (timeDisplay) {
|
||||
timeDisplay.textContent = timeString;
|
||||
}
|
||||
|
||||
fetch('/api/check-open-status')
|
||||
.then(response => response.json())
|
||||
.then(status => {
|
||||
const statusBar = document.getElementById('status-bar');
|
||||
const statusText = document.getElementById('status-text');
|
||||
const deliveryText = document.querySelector('.delivery-text');
|
||||
|
||||
if (statusBar && statusText) {
|
||||
statusBar.className = status.isOpen
|
||||
? 'bg-status-green transition-colors duration-300'
|
||||
: 'bg-status-red transition-colors duration-300';
|
||||
|
||||
const textOpen = statusText.dataset.textOpen;
|
||||
const textClosed = statusText.dataset.textClosed;
|
||||
statusText.textContent = status.isOpen ? textOpen : textClosed;
|
||||
}
|
||||
|
||||
// Debug information
|
||||
const debugInfo = document.getElementById('debug-info');
|
||||
if (debugInfo && !status.isOpen) {
|
||||
const nextOpen = document.getElementById('next-open');
|
||||
const currentDay = document.getElementById('current-day');
|
||||
|
||||
if (currentDay) {
|
||||
currentDay.textContent = now.toLocaleDateString('de-DE', { weekday: 'long' });
|
||||
}
|
||||
|
||||
if (nextOpen) {
|
||||
const hoursRows = document.querySelectorAll('.hours-row');
|
||||
let nextOpenTime = null;
|
||||
let foundToday = false;
|
||||
|
||||
// First check today's remaining times
|
||||
hoursRows.forEach(row => {
|
||||
if (row.dataset.day === status.currentDay) {
|
||||
const openTime = row.dataset.open;
|
||||
if (openTime > timeString) {
|
||||
nextOpenTime = `Today at ${openTime}`;
|
||||
foundToday = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// If no times found today, find next day's opening
|
||||
if (!foundToday) {
|
||||
hoursRows.forEach(row => {
|
||||
const dayIndex = parseInt(row.dataset.dayIndex || 0);
|
||||
const currentDayIndex = now.getDay();
|
||||
|
||||
if (dayIndex > currentDayIndex || (dayIndex === 0 && currentDayIndex !== 0)) {
|
||||
const openTime = row.dataset.open;
|
||||
const dayName = row.dataset.dayName;
|
||||
if (!nextOpenTime) {
|
||||
nextOpenTime = `${dayName} at ${openTime}`;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
nextOpen.textContent = nextOpenTime || 'Check opening hours';
|
||||
}
|
||||
}
|
||||
|
||||
// Update other elements
|
||||
if (deliveryText) {
|
||||
deliveryText.className = status.isOpen
|
||||
? 'delivery-text text-status-green'
|
||||
: 'delivery-text text-status-red';
|
||||
}
|
||||
|
||||
document.querySelectorAll('.hours-row').forEach(row => {
|
||||
const isCurrentDay = row.dataset.day === status.currentDay;
|
||||
row.classList.toggle('border-2', isCurrentDay && status.isOpen);
|
||||
row.classList.toggle('border-status-green', isCurrentDay && status.isOpen);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Update immediately and then every minute
|
||||
updateTimeAndStatus();
|
||||
setInterval(updateTimeAndStatus, 60000);
|
Loading…
Add table
Add a link
Reference in a new issue