Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,9 +60,18 @@ modal_and_cart_js = """
|
|
60 |
const modal = document.getElementById('modal');
|
61 |
modal.style.display = 'block';
|
62 |
modal.style.position = 'fixed';
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
modal.style.left = '50%';
|
65 |
-
modal.style.transform = 'translate(-50%,
|
66 |
|
67 |
document.getElementById('modal-image').src = image;
|
68 |
document.getElementById('modal-name').innerText = name;
|
|
|
60 |
const modal = document.getElementById('modal');
|
61 |
modal.style.display = 'block';
|
62 |
modal.style.position = 'fixed';
|
63 |
+
|
64 |
+
if (window.innerWidth <= 768) {
|
65 |
+
// For mobile devices
|
66 |
+
modal.style.width = '90%';
|
67 |
+
} else {
|
68 |
+
// For laptops or larger screens
|
69 |
+
modal.style.width = '30%';
|
70 |
+
}
|
71 |
+
|
72 |
+
modal.style.top = '50%';
|
73 |
modal.style.left = '50%';
|
74 |
+
modal.style.transform = 'translate(-50%, -50%)';
|
75 |
|
76 |
document.getElementById('modal-image').src = image;
|
77 |
document.getElementById('modal-name').innerText = name;
|