nagasurendra commited on
Commit
d178474
·
verified ·
1 Parent(s): 7b28d94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
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
- modal.style.top = '10%';
 
 
 
 
 
 
 
 
 
64
  modal.style.left = '50%';
65
- modal.style.transform = 'translate(-50%, 0)';
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;