Rammohan0504 commited on
Commit
39e31f6
·
verified ·
1 Parent(s): 405c6b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -98,7 +98,7 @@ popup_js = """
98
  function showPopup(name, description, price, image) {
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>
@@ -106,25 +106,25 @@ popup_js = """
106
 
107
  <h4 style="margin-top: 20px;">Choose a Spice Level</h4>
108
  <div style="display: flex; flex-wrap: wrap; gap: 10px;">
109
- ${["American Mild", "American Medium", "American Spicy", "Indian Mild", "Indian Medium", "Indian Spicy", "Indian Very Spicy"].map(spice =>
110
  <label style="margin-right: 10px;">
111
  <input type="radio" name="spice" value="${spice}"> ${spice}
112
  </label>
113
- ).join("")}
114
  </div>
115
 
116
  <h4 style="margin-top: 20px;">Choose Extras</h4>
117
  <div style="display: flex; flex-wrap: wrap; gap: 10px;">
118
- ${["Extra Raitha 4oz + $1.00", "Extra Raitha 8oz + $2.00", "Extra Onion + $1.00", "Extra Onion & Lemon + $2.00"].map(extra =>
119
  <label style="margin-right: 10px;">
120
  <input type="checkbox" name="extras" value="${extra}"> ${extra}
121
  </label>
122
- ).join("")}
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";
130
  }
@@ -200,4 +200,4 @@ with gr.Blocks() as demo:
200
  outputs=dish_display
201
  )
202
 
203
- demo.launch()
 
98
  function showPopup(name, description, price, image) {
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>
 
106
 
107
  <h4 style="margin-top: 20px;">Choose a Spice Level</h4>
108
  <div style="display: flex; flex-wrap: wrap; gap: 10px;">
109
+ ${["American Mild", "American Medium", "American Spicy", "Indian Mild", "Indian Medium", "Indian Spicy", "Indian Very Spicy"].map(spice => `
110
  <label style="margin-right: 10px;">
111
  <input type="radio" name="spice" value="${spice}"> ${spice}
112
  </label>
113
+ `).join("")}
114
  </div>
115
 
116
  <h4 style="margin-top: 20px;">Choose Extras</h4>
117
  <div style="display: flex; flex-wrap: wrap; gap: 10px;">
118
+ ${["Extra Raitha 4oz + $1.00", "Extra Raitha 8oz + $2.00", "Extra Onion + $1.00", "Extra Onion & Lemon + $2.00"].map(extra => `
119
  <label style="margin-right: 10px;">
120
  <input type="checkbox" name="extras" value="${extra}"> ${extra}
121
  </label>
122
+ `).join("")}
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";
130
  }
 
200
  outputs=dish_display
201
  )
202
 
203
+ demo.launch()