Rammohan0504 commited on
Commit
4a9ccfa
·
verified ·
1 Parent(s): a358661

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -1,4 +1,3 @@
1
-
2
  import gradio as gr
3
 
4
  menu_data = [
@@ -149,9 +148,9 @@ popup_html = """
149
 
150
  # Generate dish cards
151
  def display_dishes(category):
152
- html_content = "<div style='display: flex; flex-direction: column; gap: 20px; padding-bottom: 20px; box-sizing: border-box;'>"
153
  for dish in menu_data:
154
- if category == "ALL" or category == dish["category"]:
155
  html_content += f"""
156
  <div style='display: flex; align-items: center; justify-content: space-between; padding: 20px; border: 1px solid #ddd; border-radius: 10px; background-color: #f9f9f9;'>
157
  <div style='flex: 3; text-align: left;'>
@@ -170,7 +169,7 @@ def display_dishes(category):
170
  """
171
  html_content += "</div>"
172
  return html_content
173
-
174
  # Main Gradio App
175
  with gr.Blocks() as demo:
176
  gr.HTML(popup_html) # Add the popup container and overlay
@@ -194,4 +193,4 @@ with gr.Blocks() as demo:
194
  outputs=dish_display
195
  )
196
 
197
- demo.launch()
 
 
1
  import gradio as gr
2
 
3
  menu_data = [
 
148
 
149
  # Generate dish cards
150
  def display_dishes(category):
151
+ html_content = "<div style='display: flex; flex-direction: column; gap: 20px; min-height:100vh; overflow: hidden; width: 80%; box-sizing: border-box; margin: 0;'>"
152
  for dish in menu_data:
153
+ if category == "ALL" or dish["category"] == category:
154
  html_content += f"""
155
  <div style='display: flex; align-items: center; justify-content: space-between; padding: 20px; border: 1px solid #ddd; border-radius: 10px; background-color: #f9f9f9;'>
156
  <div style='flex: 3; text-align: left;'>
 
169
  """
170
  html_content += "</div>"
171
  return html_content
172
+
173
  # Main Gradio App
174
  with gr.Blocks() as demo:
175
  gr.HTML(popup_html) # Add the popup container and overlay
 
193
  outputs=dish_display
194
  )
195
 
196
+ demo.launch()