Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,15 +42,19 @@ def filter_dishes(category):
|
|
| 42 |
# Function to generate dish cards
|
| 43 |
def display_dishes(category):
|
| 44 |
filtered_dishes = filter_dishes(category)
|
| 45 |
-
html_content = "<div style='display: flex; flex-
|
| 46 |
for dish in filtered_dishes:
|
| 47 |
html_content += f"""
|
| 48 |
-
<div style='margin: 10px;
|
| 49 |
-
padding: 10px; border
|
|
|
|
| 50 |
onclick="showPopup('{dish['image']}', '{dish['name']}', '{dish['description']}')">
|
| 51 |
<img src='{dish['image']}' alt='{dish['name']}'
|
| 52 |
-
style='width:
|
| 53 |
-
<
|
|
|
|
|
|
|
|
|
|
| 54 |
</div>
|
| 55 |
"""
|
| 56 |
html_content += "</div>"
|
|
|
|
| 42 |
# Function to generate dish cards
|
| 43 |
def display_dishes(category):
|
| 44 |
filtered_dishes = filter_dishes(category)
|
| 45 |
+
html_content = "<div style='display: flex; flex-direction: column; align-items: center; width: 100%;'>"
|
| 46 |
for dish in filtered_dishes:
|
| 47 |
html_content += f"""
|
| 48 |
+
<div style='margin: 10px; display: flex; align-items: center; justify-content: space-between;
|
| 49 |
+
width: 80%; padding: 10px; border: 1px solid #ddd; border-radius: 10px;
|
| 50 |
+
background-color: #f9f9f9; cursor: pointer;'
|
| 51 |
onclick="showPopup('{dish['image']}', '{dish['name']}', '{dish['description']}')">
|
| 52 |
<img src='{dish['image']}' alt='{dish['name']}'
|
| 53 |
+
style='width: 120px; height: 80px; object-fit: cover; border-radius: 10px;'>
|
| 54 |
+
<div style='flex: 1; margin-left: 20px;'>
|
| 55 |
+
<h4 style='font-size: 18px; color: #444; margin: 0;'>{dish['name']}</h4>
|
| 56 |
+
<p style='font-size: 14px; color: #666; margin: 5px 0;'>{dish['description']}</p>
|
| 57 |
+
</div>
|
| 58 |
</div>
|
| 59 |
"""
|
| 60 |
html_content += "</div>"
|