Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,6 +92,7 @@ extras = [
|
|
| 92 |
{"name": "Extra Onion & Lemon", "price": "$2.00"}
|
| 93 |
]
|
| 94 |
|
|
|
|
| 95 |
# JavaScript for popup modal
|
| 96 |
popup_js = """
|
| 97 |
<script>
|
|
@@ -99,6 +100,7 @@ popup_js = """
|
|
| 99 |
const popup = document.getElementById("custom-popup");
|
| 100 |
const overlay = document.getElementById("overlay");
|
| 101 |
popup.innerHTML = `
|
|
|
|
| 102 |
<img src="${image}" alt="${name}" style="width: 200px; height: auto; border-radius: 10px; margin-bottom: 10px;">
|
| 103 |
<h3 style="margin-top: 10px;">${name}</h3>
|
| 104 |
<p>${description}</p>
|
|
@@ -123,7 +125,6 @@ popup_js = """
|
|
| 123 |
</div>
|
| 124 |
|
| 125 |
<button onclick="closePopup()" style="margin-top: 20px; padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer;">Add to Cart</button>
|
| 126 |
-
<button onclick="closePopup()" style="margin-top: 20px; margin-left: 10px; padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 5px; cursor: pointer;">Close</button>
|
| 127 |
`;
|
| 128 |
popup.style.display = "block";
|
| 129 |
overlay.style.display = "block";
|
|
@@ -142,7 +143,7 @@ popup_js = """
|
|
| 142 |
popup_html = """
|
| 143 |
<div id="overlay" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; z-index: 999;"></div>
|
| 144 |
<div id="custom-popup"
|
| 145 |
-
style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50%; max-width: 400px; background: white; padding: 20px; border-radius: 10px; box-shadow: 0px 4px 6px rgba(0,0,0,0.1); display: none; z-index: 1000; text-align: center;">
|
| 146 |
</div>
|
| 147 |
"""
|
| 148 |
|
|
|
|
| 92 |
{"name": "Extra Onion & Lemon", "price": "$2.00"}
|
| 93 |
]
|
| 94 |
|
| 95 |
+
# JavaScript for popup modal
|
| 96 |
# JavaScript for popup modal
|
| 97 |
popup_js = """
|
| 98 |
<script>
|
|
|
|
| 100 |
const popup = document.getElementById("custom-popup");
|
| 101 |
const overlay = document.getElementById("overlay");
|
| 102 |
popup.innerHTML = `
|
| 103 |
+
<span onclick="closePopup()" style="position: absolute; top: 10px; right: 10px; font-size: 20px; font-weight: bold; cursor: pointer;">×</span>
|
| 104 |
<img src="${image}" alt="${name}" style="width: 200px; height: auto; border-radius: 10px; margin-bottom: 10px;">
|
| 105 |
<h3 style="margin-top: 10px;">${name}</h3>
|
| 106 |
<p>${description}</p>
|
|
|
|
| 125 |
</div>
|
| 126 |
|
| 127 |
<button onclick="closePopup()" style="margin-top: 20px; padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer;">Add to Cart</button>
|
|
|
|
| 128 |
`;
|
| 129 |
popup.style.display = "block";
|
| 130 |
overlay.style.display = "block";
|
|
|
|
| 143 |
popup_html = """
|
| 144 |
<div id="overlay" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; z-index: 999;"></div>
|
| 145 |
<div id="custom-popup"
|
| 146 |
+
style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50%; max-width: 400px; background: white; padding: 20px; border-radius: 10px; box-shadow: 0px 4px 6px rgba(0,0,0,0.1); display: none; z-index: 1000; text-align: center; position: relative;">
|
| 147 |
</div>
|
| 148 |
"""
|
| 149 |
|