Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -383,9 +383,14 @@ def app():
|
|
383 |
<script>
|
384 |
function toggleCartModal(show) {
|
385 |
const cartModal = document.getElementById('cart-modal');
|
386 |
-
|
387 |
-
|
388 |
-
|
|
|
|
|
|
|
|
|
|
|
389 |
}
|
390 |
|
391 |
document.getElementById('view-cart-button').onclick = function() {
|
@@ -393,9 +398,10 @@ def app():
|
|
393 |
};
|
394 |
|
395 |
document.getElementById('close-cart').onclick = function() {
|
396 |
-
|
397 |
};
|
398 |
-
|
|
|
399 |
"""
|
400 |
)
|
401 |
|
|
|
383 |
<script>
|
384 |
function toggleCartModal(show) {
|
385 |
const cartModal = document.getElementById('cart-modal');
|
386 |
+
if (show) {
|
387 |
+
const screenHeight = window.innerHeight;
|
388 |
+
cartModal.style.display = 'block';
|
389 |
+
cartModal.style.height = Math.min(screenHeight * 0.7, 500) + 'px'; // Max 70% of screen or 500px
|
390 |
+
cartModal.style.position = 'fixed';
|
391 |
+
} else {
|
392 |
+
cartModal.style.display = 'none';
|
393 |
+
}
|
394 |
}
|
395 |
|
396 |
document.getElementById('view-cart-button').onclick = function() {
|
|
|
398 |
};
|
399 |
|
400 |
document.getElementById('close-cart').onclick = function() {
|
401 |
+
toggleCartModal(false);
|
402 |
};
|
403 |
+
</script>
|
404 |
+
|
405 |
"""
|
406 |
)
|
407 |
|