Spaces:
Sleeping
Sleeping
Update app.py
Browse files68 unmodified lines6970717273747518 unmodified lines9495969798991003 unmodified lines10410510610710810911011111211311411511611711868 unmodified lineshtml_content += f"""<div style='width: 220px; padding: 10px; border: 1px solid #ddd; border-radius: 10px;background-color: #f9f9f9; text-align: center; cursor: pointer;'onclick="showPopup('{dish['image']}', '{dish['name']}', '{dish['description']}')"><img src='{dish['image']}' alt='{dish['name']}'style='width: 100%; height: 140px; object-fit: cover; border-radius: 10px;'><h4 style='margin: 10px 0; color: #444;'>{dish['name']}</h4>18 unmodified lines# Pop-up HTML and JavaScriptgr.HTML("""<div id="popup" style="display: none; position: fixed; left: 50%; top: 10%; transform: translate(-50%, 0);background-color: white; padding: 20px; border-radius: 10px;box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 1000; text-align: center; width: 300px;"><img id="popup-image" src="" alt="" style="width: 100%; height: auto; border-radius: 10px;">3 unmodified linescolor: white; border: none; border-radius: 5px; cursor: pointer;">Close</button></div><script>function showPopup(image, title, description) {const popup = document.getElementById('popup');document.getElementById('popup-image').src = image;document.getElementById('popup-title').textContent = title;document.getElementById('popup-description').textContent = description;popup.style.display = 'block';}function closePopup() {document.getElementById('popup').style.display = 'none';}</script>""")68 unmodified lines6970717273747518 unmodified lines9495969798991003 unmodified lines10410510610710810911011111211311411511611711811912012112212312412568 unmodified lineshtml_content += f"""<div style='width: 220px; padding: 10px; border: 1px solid #ddd; border-radius: 10px;background-color: #f9f9f9; text-align: center; cursor: pointer;'onclick="showPopup(event, '{dish['image']}', '{dish['name']}', '{dish['description']}')"><img src='{dish['image']}' alt='{dish['name']}'style='width: 100%; height: 140px; object-fit: cover; border-radius: 10px;'><h4 style='margin: 10px 0; color: #444;'>{dish['name']}</h4>18 unmodified lines# Pop-up HTML and JavaScriptgr.HTML("""<div id="popup" style="display: none; position: absolute;background-color: white; padding: 20px; border-radius: 10px;box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 1000; text-align: center; width: 300px;"><img id="popup-image" src="" alt="" style="width: 100%; height: auto; border-radius: 10px;">3 unmodified linescolor: white; border: none; border-radius: 5px; cursor: pointer;">Close</button></div><script>function showPopup(event, image, title, description) {const popup = document.getElementById('popup');document.getElementById('popup-image').src = image;document.getElementById('popup-title').textContent = title;document.getElementById('popup-description').textContent = description;// Set the position of the popup based on the cursor's locationpopup.style.left = `${event.pageX}px`;popup.style.top = `${event.pageY}px`;popup.style.display = 'block';}function closePopup() {const popup = document.getElementById('popup');popup.style.display = 'none';}</script>""")
app.py+11-4