Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,18 +74,20 @@ def display_dishes(category):
|
|
| 74 |
html_content = "<div style='display: flex; flex-direction: column; align-items: center; width: 100%;'>"
|
| 75 |
for dish in filtered_dishes:
|
| 76 |
html_content += f"""
|
| 77 |
-
<div style='margin: 10px; display: flex;
|
| 78 |
width: 80%; padding: 10px; border: 1px solid #ddd; border-radius: 10px;
|
| 79 |
background-color: #f9f9f9;'>
|
| 80 |
-
<
|
| 81 |
-
style='width: 100%; height: auto; object-fit: cover; border-radius: 10px;'>
|
| 82 |
-
<div style='flex: 1; margin-top: 10px; text-align: center;'>
|
| 83 |
<h4 style='font-size: 18px; color: #444; margin: 0;'>{dish['name']}</h4>
|
| 84 |
<p style='font-size: 14px; color: #666; margin: 5px 0;'>{dish['description']}</p>
|
| 85 |
</div>
|
| 86 |
-
<
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
</div>
|
| 90 |
"""
|
| 91 |
html_content += "</div>"
|
|
@@ -150,4 +152,4 @@ with gr.Blocks() as demo:
|
|
| 150 |
outputs=dish_display
|
| 151 |
)
|
| 152 |
|
| 153 |
-
demo.launch()
|
|
|
|
| 74 |
html_content = "<div style='display: flex; flex-direction: column; align-items: center; width: 100%;'>"
|
| 75 |
for dish in filtered_dishes:
|
| 76 |
html_content += f"""
|
| 77 |
+
<div style='margin: 10px; display: flex; align-items: center; justify-content: space-between;
|
| 78 |
width: 80%; padding: 10px; border: 1px solid #ddd; border-radius: 10px;
|
| 79 |
background-color: #f9f9f9;'>
|
| 80 |
+
<div style='flex: 1; margin-right: 20px; text-align: left;'>
|
|
|
|
|
|
|
| 81 |
<h4 style='font-size: 18px; color: #444; margin: 0;'>{dish['name']}</h4>
|
| 82 |
<p style='font-size: 14px; color: #666; margin: 5px 0;'>{dish['description']}</p>
|
| 83 |
</div>
|
| 84 |
+
<div style='text-align: center;'>
|
| 85 |
+
<img src='{dish['image']}' alt='{dish['name']}'
|
| 86 |
+
style='width: 150px; height: 100px; object-fit: cover; border-radius: 10px; margin-bottom: 10px;'>
|
| 87 |
+
<button onclick="showPopup('{dish['image']}', '{dish['name']}', '{dish['description']}')"
|
| 88 |
+
style="padding: 10px 20px; background-color: #28a745; color: white; border: none;
|
| 89 |
+
border-radius: 5px; cursor: pointer;">Add</button>
|
| 90 |
+
</div>
|
| 91 |
</div>
|
| 92 |
"""
|
| 93 |
html_content += "</div>"
|
|
|
|
| 152 |
outputs=dish_display
|
| 153 |
)
|
| 154 |
|
| 155 |
+
demo.launch()
|