Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -81,40 +81,75 @@ def filter_menu(preference):
|
|
81 |
modal_and_cart_js = """
|
82 |
<style>
|
83 |
.cart-container {
|
84 |
-
|
85 |
-
|
86 |
-
padding: 15px;
|
87 |
-
margin-bottom: 15px;
|
88 |
-
background-color: #f9f9f9;
|
89 |
display: flex;
|
90 |
flex-direction: column;
|
91 |
-
gap: 10px;
|
92 |
-
|
93 |
-
|
|
|
94 |
display: flex;
|
95 |
-
|
96 |
-
align-items: center;
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
border-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
105 |
margin-right: 10px;
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
108 |
display: flex;
|
109 |
align-items: center;
|
110 |
gap: 5px;
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
font-weight: bold;
|
115 |
-
text-align:
|
|
|
|
|
|
|
116 |
margin-top: 10px;
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
</style>
|
119 |
<script>
|
120 |
let cart = [];
|
|
|
81 |
modal_and_cart_js = """
|
82 |
<style>
|
83 |
.cart-container {
|
84 |
+
width: 90%; /* Ensure it fits the screen */
|
85 |
+
margin: auto;
|
|
|
|
|
|
|
86 |
display: flex;
|
87 |
flex-direction: column;
|
88 |
+
gap: 10px; /* Add space between cart items */
|
89 |
+
}
|
90 |
+
|
91 |
+
.cart-item {
|
92 |
display: flex;
|
93 |
+
flex-wrap: wrap; /* Wrap content to the next line if needed */
|
94 |
+
align-items: center; /* Vertically align items */
|
95 |
+
justify-content: space-between; /* Distribute space between items */
|
96 |
+
width: 100%; /* Ensure it takes full width */
|
97 |
+
padding: 10px;
|
98 |
+
border: 1px solid #ccc;
|
99 |
+
border-radius: 5px;
|
100 |
+
background-color: #f9f9f9;
|
101 |
+
}
|
102 |
+
|
103 |
+
.cart-item span {
|
104 |
margin-right: 10px;
|
105 |
+
flex: 1; /* Allow text to take available space */
|
106 |
+
min-width: 50px; /* Prevent collapsing */
|
107 |
+
}
|
108 |
+
|
109 |
+
.cart-item .quantity-container {
|
110 |
display: flex;
|
111 |
align-items: center;
|
112 |
gap: 5px;
|
113 |
+
}
|
114 |
+
|
115 |
+
.cart-item button {
|
116 |
+
background-color: red;
|
117 |
+
color: white;
|
118 |
+
border: none;
|
119 |
+
padding: 5px 10px;
|
120 |
+
cursor: pointer;
|
121 |
+
border-radius: 5px;
|
122 |
+
flex-shrink: 0; /* Prevent the button from shrinking */
|
123 |
+
}
|
124 |
+
|
125 |
+
.cart-total {
|
126 |
+
font-size: 1.2em;
|
127 |
font-weight: bold;
|
128 |
+
text-align: center;
|
129 |
+
}
|
130 |
+
|
131 |
+
button {
|
132 |
margin-top: 10px;
|
133 |
+
background-color: #007bff;
|
134 |
+
color: white;
|
135 |
+
border: none;
|
136 |
+
padding: 10px;
|
137 |
+
border-radius: 5px;
|
138 |
+
width: 100%;
|
139 |
+
cursor: pointer;
|
140 |
+
}
|
141 |
+
|
142 |
+
@media (max-width: 768px) {
|
143 |
+
.cart-item {
|
144 |
+
flex-direction: column; /* Stack items on mobile */
|
145 |
+
align-items: flex-start; /* Align to the left */
|
146 |
+
}
|
147 |
+
.cart-item button {
|
148 |
+
align-self: flex-end; /* Place the remove button at the end */
|
149 |
+
margin-top: 5px; /* Add some space on top */
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
</style>
|
154 |
<script>
|
155 |
let cart = [];
|