Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -67,21 +67,14 @@ with gr.Blocks() as demo:
|
|
| 67 |
cart.append(dish_name)
|
| 68 |
return cart, update_cart(cart)
|
| 69 |
|
| 70 |
-
add_to_cart_button = gr.Button("Add to Cart")
|
| 71 |
selected_item = gr.Textbox(label="Selected Item", visible=False)
|
| 72 |
|
| 73 |
-
add_to_cart_button.click(
|
| 74 |
-
handle_add_to_cart,
|
| 75 |
-
inputs=[cart, selected_item],
|
| 76 |
-
outputs=[cart, cart_display]
|
| 77 |
-
)
|
| 78 |
-
|
| 79 |
gr.HTML("""
|
| 80 |
<div id='cart-icon' style='position: fixed; top: 10px; right: 10px; cursor: pointer;'>
|
| 81 |
<img src='https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Shopping_cart_icon.svg/512px-Shopping_cart_icon.svg.png' alt='Cart' style='width: 40px;' onclick='toggleCartPopup()'>
|
| 82 |
</div>
|
| 83 |
<div id='cart-popup' style='display: none; position: fixed; top: 50px; right: 10px; background: white; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);'>
|
| 84 |
-
<div id='cart-content'>
|
| 85 |
<button onclick='toggleCartPopup()' style='margin-top: 10px; padding: 5px 10px; background-color: #007bff; color: white; border: none; border-radius: 3px;'>Close</button>
|
| 86 |
</div>
|
| 87 |
|
|
|
|
| 67 |
cart.append(dish_name)
|
| 68 |
return cart, update_cart(cart)
|
| 69 |
|
|
|
|
| 70 |
selected_item = gr.Textbox(label="Selected Item", visible=False)
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
gr.HTML("""
|
| 73 |
<div id='cart-icon' style='position: fixed; top: 10px; right: 10px; cursor: pointer;'>
|
| 74 |
<img src='https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Shopping_cart_icon.svg/512px-Shopping_cart_icon.svg.png' alt='Cart' style='width: 40px;' onclick='toggleCartPopup()'>
|
| 75 |
</div>
|
| 76 |
<div id='cart-popup' style='display: none; position: fixed; top: 50px; right: 10px; background: white; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);'>
|
| 77 |
+
<div id='cart-content'></div>
|
| 78 |
<button onclick='toggleCartPopup()' style='margin-top: 10px; padding: 5px 10px; background-color: #007bff; color: white; border: none; border-radius: 3px;'>Close</button>
|
| 79 |
</div>
|
| 80 |
|