Spaces:
Sleeping
Sleeping
Update components/popup_card.py
Browse files- components/popup_card.py +10 -26
components/popup_card.py
CHANGED
|
@@ -1,26 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
<textarea id="instructions" placeholder="Add any requests here..." style="width: 100%; margin-bottom: 10px; padding: 5px; border: 1px solid #ccc; border-radius: 5px;"></textarea>
|
| 12 |
-
<label for="quantity" style="display: block; font-weight: bold; margin-bottom: 5px;">Quantity:</label>
|
| 13 |
-
<input type="number" id="quantity" min="1" max="10" value="1" style="width: 100%; margin-bottom: 10px; padding: 5px; border: 1px solid #ccc; border-radius: 5px;">
|
| 14 |
-
<div style="text-align: center;">
|
| 15 |
-
<button style="padding: 10px 20px; background-color: #008cba; color: white; border: none; border-radius: 5px; cursor: pointer;">Add to Cart</button>
|
| 16 |
-
<button id="closeButton" style="padding: 10px 20px; background-color: #ccc; color: black; border: none; border-radius: 5px; margin-left: 10px; cursor: pointer;">Close</button>
|
| 17 |
-
</div>
|
| 18 |
-
</div>
|
| 19 |
-
</div>
|
| 20 |
-
<script>
|
| 21 |
-
document.getElementById('closeButton').onclick = function() {{
|
| 22 |
-
document.getElementById('overlay').style.display = 'none';
|
| 23 |
-
}};
|
| 24 |
-
</script>
|
| 25 |
-
"""
|
| 26 |
-
return html_content
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def show_popup_card(dish_name, image_path, portion_size):
|
| 4 |
+
with gr.Modal():
|
| 5 |
+
gr.Markdown(f"### {dish_name}")
|
| 6 |
+
gr.Image(image_path, elem_id="popup_image")
|
| 7 |
+
gr.Markdown(f"#### Portion Size: {portion_size}")
|
| 8 |
+
gr.TextArea(label="Add custom preferences", lines=4, placeholder="E.g., Less Spicy, No Onions")
|
| 9 |
+
gr.Slider(1, 5, step=1, label="Select Portion Size")
|
| 10 |
+
gr.Button("Add to Cart")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|