Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,7 +33,7 @@ def filter_menu(preference):
|
|
| 33 |
</div>
|
| 34 |
<div style=\"flex-shrink: 0; text-align: center;\">
|
| 35 |
<img src=\"{item['Image URL']}\" alt=\"{item['Dish Name']}\" style=\"width: 100px; height: 100px; border-radius: 8px; object-fit: cover; margin-bottom: 10px;\">
|
| 36 |
-
<button style=\"background-color: #28a745; color: white; border: none; padding: 8px 15px; font-size: 14px; border-radius: 5px; cursor: pointer
|
| 37 |
</div>
|
| 38 |
</div>
|
| 39 |
"""
|
|
@@ -68,12 +68,12 @@ modal_and_cart_js = """
|
|
| 68 |
"Extra Onion & Lemon": 2,
|
| 69 |
"Extra Fried Onion 4oz": 2
|
| 70 |
};
|
| 71 |
-
function openModal(name, price, description) {
|
| 72 |
document.getElementById('modal').style.display = 'block';
|
| 73 |
document.getElementById('modal-name').innerText = name;
|
| 74 |
document.getElementById('modal-price').innerText = price;
|
| 75 |
document.getElementById('modal-description').innerText = description;
|
| 76 |
-
document.getElementById('modal-image').src =
|
| 77 |
|
| 78 |
const spiceLevelInputs = document.querySelectorAll('input[name="spice-level"]');
|
| 79 |
spiceLevelInputs.forEach(input => input.checked = false);
|
|
@@ -143,7 +143,7 @@ def app():
|
|
| 143 |
|
| 144 |
# Modal window for item customization
|
| 145 |
modal_window = gr.HTML("""
|
| 146 |
-
<div id="modal" style="display: none; position: fixed; top:
|
| 147 |
<div style="text-align: right;">
|
| 148 |
<button onclick="closeModal()" style="background: none; border: none; font-size: 18px; cursor: pointer;">×</button>
|
| 149 |
</div>
|
|
|
|
| 33 |
</div>
|
| 34 |
<div style=\"flex-shrink: 0; text-align: center;\">
|
| 35 |
<img src=\"{item['Image URL']}\" alt=\"{item['Dish Name']}\" style=\"width: 100px; height: 100px; border-radius: 8px; object-fit: cover; margin-bottom: 10px;\">
|
| 36 |
+
<button style=\"background-color: #28a745; color: white; border: none; padding: 8px 15px; font-size: 14px; border-radius: 5px; cursor: pointer;" onclick=\"openModal('{item['Dish Name']}', '{item['Price ($)']}', '{item['Description']}', '{item['Image URL']}')\">Add</button>
|
| 37 |
</div>
|
| 38 |
</div>
|
| 39 |
"""
|
|
|
|
| 68 |
"Extra Onion & Lemon": 2,
|
| 69 |
"Extra Fried Onion 4oz": 2
|
| 70 |
};
|
| 71 |
+
function openModal(name, price, description, image) {
|
| 72 |
document.getElementById('modal').style.display = 'block';
|
| 73 |
document.getElementById('modal-name').innerText = name;
|
| 74 |
document.getElementById('modal-price').innerText = price;
|
| 75 |
document.getElementById('modal-description').innerText = description;
|
| 76 |
+
document.getElementById('modal-image').src = image;
|
| 77 |
|
| 78 |
const spiceLevelInputs = document.querySelectorAll('input[name="spice-level"]');
|
| 79 |
spiceLevelInputs.forEach(input => input.checked = false);
|
|
|
|
| 143 |
|
| 144 |
# Modal window for item customization
|
| 145 |
modal_window = gr.HTML("""
|
| 146 |
+
<div id="modal" style="display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50%; background: white; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); padding: 20px; z-index: 1000;">
|
| 147 |
<div style="text-align: right;">
|
| 148 |
<button onclick="closeModal()" style="background: none; border: none; font-size: 18px; cursor: pointer;">×</button>
|
| 149 |
</div>
|