Spaces:
Build error
Build error
Update app.py
Browse files132 unmodified lines1331341351361361381371381401411421431441391401411421481431441501451461521471481491501511571581521531541551564 unmodified lines161162163169164165166167168169170132 unmodified lines alert("You cannot add more items after finalizing your order."); return; }
const modal = document.getElementById('modal'); modal.style.display = 'block'; // Display the modal modal.style.display = 'block'; modal.style.position = 'fixed';
// Reduce modal height for better display modal.style.height = '50%'; // Adjust height to 50% of the viewport modal.style.overflowY = 'auto'; // Add scrolling if content overflows
if (window.innerWidth <= 768) { // Mobile: Use touch Y position modal.style.width = '90%'; modal.style.top = `${event.touches ? event.touches[0].screenY : event.clientY - modal.offsetHeight / 2}px`; modal.style.top = `${event.touches ? event.touches[0].screenY : event.clientY}px`; } else { // Laptop: Use mouse Y position without 7% // Laptop: Use mouse Y position + 7% of the screen height modal.style.width = '30%'; const adjustedY = event.clientY - modal.offsetHeight / 2; // Center based on modal height const adjustedY = event.clientY + (window.innerHeight * 0.01); modal.style.top = `${adjustedY}px`; }
modal.style.left = '50%'; modal.style.transform = 'translate(-50%, 0)'; // Adjust transform to exclude vertical centering
modal.style.transform = 'translate(-50%, -50%)'; // Set modal content document.getElementById('modal-image').src = image; document.getElementById('modal-name').innerText = name;4 unmodified lines const extrasInputs = document.querySelectorAll('input[name="biryani-extra"]'); extrasInputs.forEach(input => input.checked = false); document.getElementById('quantity').value = 1; document.getElementById('special-instructions').value = ''; document.getElementById('special-instructions').value = ''; }
function closeModal() { document.getElementById('modal').style.display = 'none'; }app.py+9-13