Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,17 +21,20 @@ with gr.Blocks(css="styles.css") as app:
|
|
21 |
|
22 |
# Display all items as a vertical list
|
23 |
with gr.Column(elem_id="food-list"):
|
24 |
-
popup_area = gr.HTML(visible=False) # Popup card display area
|
25 |
for food_name in FOOD_DATA.keys():
|
26 |
gr.Button(
|
27 |
value=food_name,
|
28 |
elem_id=f"food-{food_name.replace(' ', '-').lower()}",
|
29 |
interactive=True,
|
30 |
).click(
|
31 |
-
display_card,
|
32 |
-
inputs=[gr.Textbox(value=food_name, visible=False)],
|
33 |
-
outputs=
|
34 |
)
|
35 |
|
|
|
|
|
|
|
|
|
36 |
# Launch the app
|
37 |
app.launch()
|
|
|
21 |
|
22 |
# Display all items as a vertical list
|
23 |
with gr.Column(elem_id="food-list"):
|
|
|
24 |
for food_name in FOOD_DATA.keys():
|
25 |
gr.Button(
|
26 |
value=food_name,
|
27 |
elem_id=f"food-{food_name.replace(' ', '-').lower()}",
|
28 |
interactive=True,
|
29 |
).click(
|
30 |
+
display_card,
|
31 |
+
inputs=[gr.Textbox(value=food_name, visible=False)],
|
32 |
+
outputs="popup-content" # Update the popup content dynamically
|
33 |
)
|
34 |
|
35 |
+
# Popup container
|
36 |
+
with gr.HTML(elem_id="popup-container", visible=True):
|
37 |
+
gr.HTML(value="", elem_id="popup-content") # Placeholder for popup content
|
38 |
+
|
39 |
# Launch the app
|
40 |
app.launch()
|