Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,16 +3,13 @@ import gradio as gr
|
|
| 3 |
menu_data = [
|
| 4 |
{"name": "Veg Burger", "category": "VEGAN",
|
| 5 |
"image": "https://upload.wikimedia.org/wikipedia/commons/6/6e/Veggie_burger.jpg",
|
| 6 |
-
"description": "A delicious vegan burger with plant-based patty, lettuce, and tomato.",
|
| 7 |
-
"spice_level": "Medium", "portion_size": "Regular"},
|
| 8 |
{"name": "Chicken Biryani", "category": "HALAL",
|
| 9 |
"image": "https://upload.wikimedia.org/wikipedia/commons/7/79/Chicken_Biryani.jpg",
|
| 10 |
-
"description": "Spicy chicken biryani with aromatic basmati rice and tender chicken pieces.",
|
| 11 |
-
"spice_level": "High", "portion_size": "Large"},
|
| 12 |
{"name": "Paneer Butter Masala", "category": "VEGAN",
|
| 13 |
"image": "https://upload.wikimedia.org/wikipedia/commons/3/3d/Paneer_Butter_Masala.jpg",
|
| 14 |
-
"description": "Paneer cooked in a rich and creamy tomato-based gravy."
|
| 15 |
-
"spice_level": "Mild", "portion_size": "Medium"}
|
| 16 |
]
|
| 17 |
|
| 18 |
# Filter dishes by category
|
|
@@ -43,13 +40,16 @@ def get_dish_details(dish_name):
|
|
| 43 |
for dish in menu_data:
|
| 44 |
if dish["name"] == dish_name:
|
| 45 |
return f"""
|
| 46 |
-
<div style="
|
|
|
|
|
|
|
| 47 |
<img src="{dish['image']}" alt="{dish['name']}"
|
| 48 |
style="width: 250px; height: 150px; object-fit: cover; border-radius: 10px;">
|
| 49 |
<h2 style="margin-top: 20px; color: #444;">{dish['name']}</h2>
|
| 50 |
<p style="margin-top: 10px; font-size: 16px; color: #666;">{dish['description']}</p>
|
| 51 |
-
<button
|
| 52 |
-
|
|
|
|
| 53 |
</div>
|
| 54 |
"""
|
| 55 |
return "Dish not found!"
|
|
|
|
| 3 |
menu_data = [
|
| 4 |
{"name": "Veg Burger", "category": "VEGAN",
|
| 5 |
"image": "https://upload.wikimedia.org/wikipedia/commons/6/6e/Veggie_burger.jpg",
|
| 6 |
+
"description": "A delicious vegan burger with plant-based patty, lettuce, and tomato."},
|
|
|
|
| 7 |
{"name": "Chicken Biryani", "category": "HALAL",
|
| 8 |
"image": "https://upload.wikimedia.org/wikipedia/commons/7/79/Chicken_Biryani.jpg",
|
| 9 |
+
"description": "Spicy chicken biryani with aromatic basmati rice and tender chicken pieces."},
|
|
|
|
| 10 |
{"name": "Paneer Butter Masala", "category": "VEGAN",
|
| 11 |
"image": "https://upload.wikimedia.org/wikipedia/commons/3/3d/Paneer_Butter_Masala.jpg",
|
| 12 |
+
"description": "Paneer cooked in a rich and creamy tomato-based gravy."}
|
|
|
|
| 13 |
]
|
| 14 |
|
| 15 |
# Filter dishes by category
|
|
|
|
| 40 |
for dish in menu_data:
|
| 41 |
if dish["name"] == dish_name:
|
| 42 |
return f"""
|
| 43 |
+
<div style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
|
| 44 |
+
background-color: white; padding: 20px; border-radius: 10px;
|
| 45 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 1000; text-align: center;">
|
| 46 |
<img src="{dish['image']}" alt="{dish['name']}"
|
| 47 |
style="width: 250px; height: 150px; object-fit: cover; border-radius: 10px;">
|
| 48 |
<h2 style="margin-top: 20px; color: #444;">{dish['name']}</h2>
|
| 49 |
<p style="margin-top: 10px; font-size: 16px; color: #666;">{dish['description']}</p>
|
| 50 |
+
<button onclick="closePopup()"
|
| 51 |
+
style="margin-top: 10px; padding: 10px 20px; background-color: #28a745; color: white;
|
| 52 |
+
border: none; border-radius: 5px; cursor: pointer;">Close</button>
|
| 53 |
</div>
|
| 54 |
"""
|
| 55 |
return "Dish not found!"
|