Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,39 @@
|
|
1 |
import gradio as gr
|
2 |
-
from components.cards import create_food_card
|
3 |
-
from components.data import FOOD_DATA
|
4 |
|
5 |
-
#
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
#
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
with gr.Row():
|
17 |
-
food_dropdown = gr.Dropdown(label="Select a Dish", choices=food_items)
|
18 |
-
display_area = gr.HTML()
|
19 |
|
20 |
-
|
21 |
-
food_dropdown.change(display_card, inputs=food_dropdown, outputs=display_area)
|
22 |
|
23 |
-
#
|
24 |
-
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
+
# Define menu items
|
4 |
+
menu_items = [
|
5 |
+
{"name": "Chicken Butter Masala"},
|
6 |
+
{"name": "Chicken Biryani"},
|
7 |
+
{"name": "Dosa"},
|
8 |
+
{"name": "Aloo Curry"},
|
9 |
+
]
|
10 |
|
11 |
+
# Create the Gradio interface
|
12 |
+
def render_menu():
|
13 |
+
with gr.Blocks(css="""
|
14 |
+
.menu-item {
|
15 |
+
border: 2px solid black;
|
16 |
+
border-radius: 5px;
|
17 |
+
padding: 15px;
|
18 |
+
margin: 10px 0;
|
19 |
+
font-size: 18px;
|
20 |
+
font-weight: bold;
|
21 |
+
text-align: center;
|
22 |
+
background-color: #fff;
|
23 |
+
}
|
24 |
+
.menu-container {
|
25 |
+
margin-top: 20px;
|
26 |
+
}
|
27 |
+
""") as demo:
|
28 |
+
gr.Markdown("# Menu")
|
29 |
|
30 |
+
with gr.Column(elem_id="menu-container"):
|
31 |
+
for item in menu_items:
|
32 |
+
with gr.Row(className="menu-item"):
|
33 |
+
gr.Markdown(item["name"])
|
|
|
|
|
|
|
34 |
|
35 |
+
return demo
|
|
|
36 |
|
37 |
+
# Render the app
|
38 |
+
demo = render_menu()
|
39 |
+
demo.launch()
|