Spaces:
Build error
Build error
Update app.py
Browse files127 unmodified lines128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159127 unmodified lines"Veg Manchurian": 12};let finalized = false;function openModal(name, image, description, price) {if (finalized) {alert("You cannot add more items after finalizing your order.");return;}const modal = document.getElementById('modal');modal.style.display = 'block';modal.style.position = 'fixed';if (window.innerWidth <= 768) {modal.style.width = '90%';modal.style.top = `${event.touches ? event.touches[0].screenY : event.clientY}px`;} else {modal.style.width = '30%';modal.style.top = `${event.clientY}px`;// Use mouse Y position for laptop}modal.style.left = '50%';modal.style.transform = 'translate(-50%, 0)';document.getElementById('modal-image').src = image;document.getElementById('modal-name').innerText = name;document.getElementById('modal-description').innerText = description;document.getElementById('modal-price').innerText = price;const extrasInputs = document.querySelectorAll('input[name="biryani-extra"]');extrasInputs.forEach(input => input.checked = false);document.getElementById('quantity').value = 1;document.getElementById('special-instructions').value = '';}function closeModal() {document.getElementById('modal').style.display = 'none';}127 unmodified lines128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174127 unmodified lines"Veg Manchurian": 12};let finalized = false;function openModal(name, image, description, price, event) {if (finalized) {alert("You cannot add more items after finalizing your order.");return;}const modal = document.getElementById('modal');modal.style.display = 'block'; // Display the modalmodal.style.position = 'fixed';// Reduce modal height for better displaymodal.style.height = '50%'; // Adjust height to 50% of the viewportmodal.style.overflowY = 'auto'; // Add scrolling if content overflowsif (window.innerWidth <= 768) {// Mobile: Use touch Y positionmodal.style.width = '90%';modal.style.top = `${event.touches ? event.touches[0].screenY : event.clientY - modal.offsetHeight / 2}px`;} else {// Laptop: Use mouse Y position without 7%modal.style.width = '30%';const adjustedY = event.clientY - modal.offsetHeight / 2; // Center based on modal heightmodal.style.top = `${adjustedY}px`;}modal.style.left = '50%';modal.style.transform = 'translate(-50%, 0)'; // Adjust transform to exclude vertical centering// Set modal contentdocument.getElementById('modal-image').src = image;document.getElementById('modal-name').innerText = name;document.getElementById('modal-description').innerText = description;document.getElementById('modal-price').innerText = price;// Reset inputsconst extrasInputs = document.querySelectorAll('input[name="biryani-extra"]');extrasInputs.forEach(input => input.checked = false);document.getElementById('quantity').value = 1;document.getElementById('special-instructions').value = '';}function closeModal() {document.getElementById('modal').style.display = 'none';}
app.py+20-5