Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -108,8 +108,9 @@ with gr.Blocks() as demo:
|
|
| 108 |
# JavaScript for managing the pop-up
|
| 109 |
gr.HTML("""
|
| 110 |
<div id="popup" style="
|
| 111 |
-
display: none; position:
|
| 112 |
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
|
|
| 113 |
<img id="popup-image" src="" alt="" style="width: 100%; height: auto; border-radius: 10px;">
|
| 114 |
<h2 id="popup-title" style="margin-top: 20px; color: #444;"></h2>
|
| 115 |
<p id="popup-description" style="margin-top: 10px; font-size: 16px; color: #666;"></p>
|
|
@@ -117,6 +118,8 @@ with gr.Blocks() as demo:
|
|
| 117 |
margin-top: 10px; padding: 10px 20px; background-color: #28a745; color: white; border: none;
|
| 118 |
border-radius: 5px; cursor: pointer;">Close</button>
|
| 119 |
</div>
|
|
|
|
|
|
|
| 120 |
<script>
|
| 121 |
function showPopup(image, title, description, element) {
|
| 122 |
// Get the item's position
|
|
|
|
| 108 |
# JavaScript for managing the pop-up
|
| 109 |
gr.HTML("""
|
| 110 |
<div id="popup" style="
|
| 111 |
+
display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
|
| 112 |
+
background-color: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
| 113 |
+
z-index: 1000; text-align: center; width: 300px;">
|
| 114 |
<img id="popup-image" src="" alt="" style="width: 100%; height: auto; border-radius: 10px;">
|
| 115 |
<h2 id="popup-title" style="margin-top: 20px; color: #444;"></h2>
|
| 116 |
<p id="popup-description" style="margin-top: 10px; font-size: 16px; color: #666;"></p>
|
|
|
|
| 118 |
margin-top: 10px; padding: 10px 20px; background-color: #28a745; color: white; border: none;
|
| 119 |
border-radius: 5px; cursor: pointer;">Close</button>
|
| 120 |
</div>
|
| 121 |
+
""")
|
| 122 |
+
|
| 123 |
<script>
|
| 124 |
function showPopup(image, title, description, element) {
|
| 125 |
// Get the item's position
|