Rammohan0504 commited on
Commit
28dcb32
Β·
verified Β·
1 Parent(s): 0f9134e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -86,6 +86,7 @@ with gr.Blocks() as demo:
86
  gr.HTML("<h1 style='text-align: center; color: #333;'>πŸ› Biryani Hub Menu πŸ›</h1>")
87
 
88
  with gr.Row():
 
89
  btn_cart = gr.Button("View Cart")
90
 
91
  cart_display = gr.HTML(value=display_cart())
@@ -97,13 +98,13 @@ with gr.Blocks() as demo:
97
 
98
  dish_display = gr.HTML(value=display_dishes("ALL"))
99
 
100
- gr.HTML("""
101
  <div id="popup" style="display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 1000; text-align: center; width: 400px;">
102
  <span onclick="closePopup()" style="position: absolute; top: 10px; right: 15px; cursor: pointer; font-size: 18px;">&times;</span>
103
- <img id="popup-image" src="" alt="" style="width: 100%; height: auto; border-radius: 10px;">
104
  <h2 id="popup-title" style="margin-top: 20px; color: #444;"></h2>
105
  <p id="popup-description" style="margin-top: 10px; font-size: 16px; color: #666;"></p>
106
  <p id="popup-price" style="margin-top: 10px; font-size: 16px; color: #444;"></p>
 
107
 
108
  <label for="popup-quantity" style="margin-top: 20px; display: block; text-align: left;">Quantity:</label>
109
  <input id="popup-quantity" type="number" min="1" value="1" style="width: 100%; margin-top: 10px; padding: 5px; border: 1px solid #ddd; border-radius: 5px;">
@@ -114,11 +115,11 @@ with gr.Blocks() as demo:
114
  <button onclick="submitPopup()" style="margin-top: 20px; padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer;">Add to Cart</button>
115
  </div>
116
  <script>
117
- function showPopup(name, description, price, image) {
118
  document.getElementById('popup-title').textContent = name;
119
  document.getElementById('popup-description').textContent = description;
120
  document.getElementById('popup-price').textContent = price;
121
- document.getElementById('popup-image').src = image;
122
  document.getElementById('popup').style.display = 'block';
123
  }
124
 
 
86
  gr.HTML("<h1 style='text-align: center; color: #333;'>πŸ› Biryani Hub Menu πŸ›</h1>")
87
 
88
  with gr.Row():
89
+ gr.HTML("<span style='font-size: 24px; cursor: pointer;'>πŸ›’</span>")
90
  btn_cart = gr.Button("View Cart")
91
 
92
  cart_display = gr.HTML(value=display_cart())
 
98
 
99
  dish_display = gr.HTML(value=display_dishes("ALL"))
100
 
101
+ gr.HTML(f"""
102
  <div id="popup" style="display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 1000; text-align: center; width: 400px;">
103
  <span onclick="closePopup()" style="position: absolute; top: 10px; right: 15px; cursor: pointer; font-size: 18px;">&times;</span>
 
104
  <h2 id="popup-title" style="margin-top: 20px; color: #444;"></h2>
105
  <p id="popup-description" style="margin-top: 10px; font-size: 16px; color: #666;"></p>
106
  <p id="popup-price" style="margin-top: 10px; font-size: 16px; color: #444;"></p>
107
+ <p id="popup-image-url" style="margin-top: 10px; font-size: 14px; color: #666;"></p>
108
 
109
  <label for="popup-quantity" style="margin-top: 20px; display: block; text-align: left;">Quantity:</label>
110
  <input id="popup-quantity" type="number" min="1" value="1" style="width: 100%; margin-top: 10px; padding: 5px; border: 1px solid #ddd; border-radius: 5px;">
 
115
  <button onclick="submitPopup()" style="margin-top: 20px; padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer;">Add to Cart</button>
116
  </div>
117
  <script>
118
+ function showPopup(name, description, price, imageUrl) {
119
  document.getElementById('popup-title').textContent = name;
120
  document.getElementById('popup-description').textContent = description;
121
  document.getElementById('popup-price').textContent = price;
122
+ document.getElementById('popup-image-url').textContent = imageUrl;
123
  document.getElementById('popup').style.display = 'block';
124
  }
125