Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,12 +93,20 @@ extras = [
|
|
| 93 |
]
|
| 94 |
|
| 95 |
# JavaScript for popup modal
|
|
|
|
| 96 |
# JavaScript for popup modal
|
| 97 |
popup_js = """
|
| 98 |
<script>
|
| 99 |
function showPopup(name, description, price, image) {
|
| 100 |
const popup = document.getElementById("custom-popup");
|
| 101 |
const overlay = document.getElementById("overlay");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
popup.innerHTML = `
|
| 103 |
<span onclick="closePopup()" style="position: absolute; top: 10px; right: 10px; font-size: 20px; font-weight: bold; cursor: pointer;">×</span>
|
| 104 |
<img src="${image}" alt="${name}" style="width: 200px; height: auto; border-radius: 10px; margin-bottom: 10px;">
|
|
@@ -133,6 +141,13 @@ popup_js = """
|
|
| 133 |
function closePopup() {
|
| 134 |
const popup = document.getElementById("custom-popup");
|
| 135 |
const overlay = document.getElementById("overlay");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
popup.style.display = "none";
|
| 137 |
overlay.style.display = "none";
|
| 138 |
}
|
|
@@ -149,7 +164,7 @@ popup_html = """
|
|
| 149 |
|
| 150 |
# Generate dish cards
|
| 151 |
def display_dishes(category):
|
| 152 |
-
html_content = "<div style='display: flex; flex-direction: column; gap: 20px; width: 80%; margin: 0 auto;'>"
|
| 153 |
for dish in menu_data:
|
| 154 |
if category == "ALL" or dish["category"] == category:
|
| 155 |
html_content += f"""
|
|
|
|
| 93 |
]
|
| 94 |
|
| 95 |
# JavaScript for popup modal
|
| 96 |
+
|
| 97 |
# JavaScript for popup modal
|
| 98 |
popup_js = """
|
| 99 |
<script>
|
| 100 |
function showPopup(name, description, price, image) {
|
| 101 |
const popup = document.getElementById("custom-popup");
|
| 102 |
const overlay = document.getElementById("overlay");
|
| 103 |
+
const content = document.getElementById("content");
|
| 104 |
+
|
| 105 |
+
// Add blur to the background content
|
| 106 |
+
content.style.filter = "blur(5px)";
|
| 107 |
+
content.style.pointerEvents = "none"; // Disable interaction with the menu while pop-up is open
|
| 108 |
+
|
| 109 |
+
// Set up pop-up content
|
| 110 |
popup.innerHTML = `
|
| 111 |
<span onclick="closePopup()" style="position: absolute; top: 10px; right: 10px; font-size: 20px; font-weight: bold; cursor: pointer;">×</span>
|
| 112 |
<img src="${image}" alt="${name}" style="width: 200px; height: auto; border-radius: 10px; margin-bottom: 10px;">
|
|
|
|
| 141 |
function closePopup() {
|
| 142 |
const popup = document.getElementById("custom-popup");
|
| 143 |
const overlay = document.getElementById("overlay");
|
| 144 |
+
const content = document.getElementById("content");
|
| 145 |
+
|
| 146 |
+
// Remove blur and enable interaction with the menu
|
| 147 |
+
content.style.filter = "none";
|
| 148 |
+
content.style.pointerEvents = "auto";
|
| 149 |
+
|
| 150 |
+
// Hide pop-up and overlay
|
| 151 |
popup.style.display = "none";
|
| 152 |
overlay.style.display = "none";
|
| 153 |
}
|
|
|
|
| 164 |
|
| 165 |
# Generate dish cards
|
| 166 |
def display_dishes(category):
|
| 167 |
+
html_content = "<div id='content' style='display: flex; flex-direction: column; gap: 20px; width: 80%; margin: 0 auto;'>"
|
| 168 |
for dish in menu_data:
|
| 169 |
if category == "ALL" or dish["category"] == category:
|
| 170 |
html_content += f"""
|