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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -59,9 +59,10 @@ modal_and_cart_js = """
59
  }
60
  const modal = document.getElementById('modal');
61
  modal.style.display = 'block';
62
- modal.style.position = 'absolute';
63
- modal.style.top = `${window.scrollY + window.innerHeight / 2 - modal.offsetHeight / 2}px`;
64
- modal.style.left = `${window.innerWidth / 2 - modal.offsetWidth / 2}px`;
 
65
 
66
  document.getElementById('modal-image').src = image;
67
  document.getElementById('modal-name').innerText = name;
@@ -153,7 +154,7 @@ def app():
153
 
154
  # Modal window
155
  modal_window = gr.HTML("""
156
- <div id="modal" style="display: none; position: absolute; background: white; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); padding: 20px; z-index: 1000;">
157
  <div style="text-align: right;">
158
  <button onclick="closeModal()" style="background: none; border: none; font-size: 18px; cursor: pointer;">&times;</button>
159
  </div>
 
59
  }
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;
 
154
 
155
  # Modal window
156
  modal_window = gr.HTML("""
157
+ <div id="modal" style="display: none; position: fixed; background: white; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); padding: 20px; z-index: 1000;">
158
  <div style="text-align: right;">
159
  <button onclick="closeModal()" style="background: none; border: none; font-size: 18px; cursor: pointer;">&times;</button>
160
  </div>