Spaces:
Sleeping
Sleeping
Update app.py
Browse files145 unmodified lines1461471481491501511521 unmodified line154155156157158159160161162163164165166167168161162163164165166167169170171172173173174175176145 unmodified lines</div>"""
# Generate dish cards# Generate dish cardsdef display_dishes(category): html_content = "<div style='display: flex; flex-direction: column; gap: 20px; width: 80%; margin: auto;'>"1 unmodified line if category == "ALL" or dish["category"] == category: html_content += f""" <div style='display: flex; align-items: center; justify-content: space-between; padding: 20px; border: 1px solid #ddd; border-radius: 10px; background-color: #f9f9f9;'> <div style='flex: 1; display: flex; align-items: center;'> <img src='{dish['image']}' alt='{dish['name']}' style='width: 120px; height: 80px; object-fit: cover; border-radius: 10px; margin-right: 20px;'> <button onclick="showPopup('{dish['name']}', '{dish['description']}', '{dish['price']}', '{dish['image']}')" style='padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 5px; cursor: pointer;'> Add </button> </div> <div style='flex: 3; text-align: left;'> <h3 style='margin: 0; font-size: 20px;'>{dish['name']}</h3> <p style='margin: 5px 0; font-size: 14px; color: #555;'>{dish['description']}</p> <p style='margin: 0; font-size: 16px; font-weight: bold;'>Price: {dish['price']}</p> </div> <div style='flex: 1; flex-direction: row; text-align: center;'> <img src='{dish['image']}' alt='{dish['name']}' style='width: 120px; height: 80px; object-fit: cover; border-radius: 10px;'> <button onclick="showPopup('{dish['name']}', '{dish['description']}', '{dish['price']}', '{dish['image']}')" style='margin-top: 10px; padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 5px; cursor: pointer;'> Add </button> </div> </div> """ html_content += "</div>" return html_content
# Main Gradio Appwith gr.Blocks() as demo: gr.HTML(popup_html) # Add the popup container and overlayapp.py+8-8