Spaces:
Sleeping
Sleeping
Update components/popup_card.py
Browse files- components/popup_card.py +14 -11
components/popup_card.py
CHANGED
@@ -1,14 +1,17 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
def generate_popup_card(name, model_path):
|
4 |
"""
|
5 |
-
Generates
|
6 |
"""
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def generate_popup_card(name, model_path):
|
2 |
"""
|
3 |
+
Generates an HTML popup card dynamically for the selected menu item.
|
4 |
"""
|
5 |
+
html_content = f"""
|
6 |
+
<div style="border: 1px solid #ddd; padding: 20px; border-radius: 10px; background-color: #fff;">
|
7 |
+
<h2>{name}</h2>
|
8 |
+
<model-viewer src="{model_path}" alt="3D Model of {name}" camera-controls auto-rotate></model-viewer>
|
9 |
+
<label for="instructions">Special Instructions:</label>
|
10 |
+
<textarea id="instructions" placeholder="Add any requests here..."></textarea>
|
11 |
+
<label for="quantity">Quantity:</label>
|
12 |
+
<input type="number" id="quantity" min="1" max="10" value="1">
|
13 |
+
<button style="margin-top: 10px;">Add to Cart</button>
|
14 |
+
<button style="margin-left: 10px; background-color: #ccc;">Close</button>
|
15 |
+
</div>
|
16 |
+
"""
|
17 |
+
return html_content
|