lokesh341 commited on
Commit
843854f
·
verified ·
1 Parent(s): 0ba22fa

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. templates/menu.html +15 -17
templates/menu.html CHANGED
@@ -537,7 +537,7 @@
537
  display: flex;
538
  justify-content: space-between;
539
  align-items: center;
540
- box-shadow: 0 -bai2px 10px rgba(0, 0, 0, 0.1);
541
  z-index: 1000;
542
  max-width: 900px;
543
  margin: 0 auto;
@@ -818,7 +818,7 @@
818
  height="200"
819
  onmouseover="this.play()"
820
  onmouseout="this.pause(); this.currentTime = 0;"
821
- onerror="this.src='/static/placeholder.mp4'; this.onerror=null;">
822
  <source src="{{ item.Video1__c | default('/static/placeholder.mp4') }}" type="video/mp4">
823
  Your browser does not support the video tag.
824
  </video>
@@ -887,10 +887,15 @@
887
  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
888
  </div>
889
  <div class="modal-body">
 
890
  <img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
 
891
  <h5 id="modal-name" class="fw-bold text-center"></h5>
 
892
  <p id="modal-price" class="text-muted text-center"></p>
 
893
  <p id="modal-description" class="text-secondary"></p>
 
894
  <div id="modal-addons" class="modal-addons mt-4">
895
  <h6>Customization Options</h6>
896
  <div id="addons-list" class="addons-container">Loading customization options...</div>
@@ -901,12 +906,15 @@
901
  </div>
902
  <span id="modal-section" data-section="" data-category="" style="display: none;"></span>
903
  </div>
 
904
  <div class="modal-footer d-flex align-items-center justify-content-between">
 
905
  <div class="d-flex align-items-center gap-2">
906
  <button type="button" class="btn btn-outline-secondary" id="decreaseQuantity">-</button>
907
  <input type="text" class="form-control text-center" id="quantityInput" value="1" readonly style="width: 50px;"/>
908
  <button type="button" class="btn btn-outline-secondary" id="increaseQuantity">+</button>
909
  </div>
 
910
  <button type="button" class="btn btn-primary" onclick="addToCartFromModal()">Add to Cart</button>
911
  </div>
912
  </div>
@@ -943,9 +951,7 @@
943
 
944
  const menuItemDetails = {
945
  "Veg Manchurian": {
946
- ingredients: "Cauliflower, Onion, Ginger, Garlic, Soy Sauce, Corn verdiğiгов
947
-
948
- Cornflour, Green Chilies, Capsicum, Spring Onion",
949
  nutritionalInfo: { calories: 250, protein: 5, carbs: 35, fats: 12, fiber: 3, sugar: 2 },
950
  allergens: "Soy, Gluten"
951
  },
@@ -1033,16 +1039,6 @@
1033
  ingredients: "Chickpeas, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coriander Powder, Cumin Seeds, Lemon Juice",
1034
  nutritionalInfo: { calories: 250, protein: 10, carbs: 45, fats: 5, fiber: 6, sugar: 2 },
1035
  allergens: "None"
1036
- },
1037
- "Sprite": {
1038
- ingredients: "Carbonated Water, Sugar, Citric Acid, Natural Flavors",
1039
- nutritionalInfo: { calories: 140, protein: 0, carbs: 38, fats: 0, fiber: 0, sugar: 38 },
1040
- allergens: "None"
1041
- },
1042
- "Thumbs Up": {
1043
- ingredients: "Carbonated Water, Sugar, Caffeine, Natural Flavors",
1044
- nutritionalInfo: { calories: 150, protein: 0, carbs: 40, fats: 0, fiber: 0, sugar: 40 },
1045
- allergens: "None"
1046
  }
1047
  };
1048
 
@@ -1583,8 +1579,7 @@
1583
  sectionDiv.appendChild(title);
1584
  const optionsContainer = document.createElement('div');
1585
  addon.options.forEach((option, index) => {
1586
-
1587
- const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
1588
  const listItem = document.createElement('div');
1589
  listItem.classList.add('form-check');
1590
  listItem.innerHTML = `
@@ -1605,11 +1600,13 @@
1605
  document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
1606
  });
1607
  }
 
1608
  document.addEventListener('click', function(event) {
1609
  if (event.target.classList.contains('addon-option')) {
1610
  handleAddonClick(event.target);
1611
  }
1612
  });
 
1613
  function handleAddonClick(checkbox) {
1614
  const groupName = checkbox.getAttribute('data-group');
1615
  const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo"].includes(groupName);
@@ -1622,6 +1619,7 @@
1622
  });
1623
  }
1624
  }
 
1625
  function addToCartFromModal() {
1626
  const itemName = document.getElementById('modal-name').innerText;
1627
  let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
 
537
  display: flex;
538
  justify-content: space-between;
539
  align-items: center;
540
+ box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
541
  z-index: 1000;
542
  max-width: 900px;
543
  margin: 0 auto;
 
818
  height="200"
819
  onmouseover="this.play()"
820
  onmouseout="this.pause(); this.currentTime = 0;"
821
+ onerror="this.poster='/static/placeholder.jpg';">
822
  <source src="{{ item.Video1__c | default('/static/placeholder.mp4') }}" type="video/mp4">
823
  Your browser does not support the video tag.
824
  </video>
 
887
  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
888
  </div>
889
  <div class="modal-body">
890
+ <!-- Item Image -->
891
  <img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
892
+ <!-- Item Name -->
893
  <h5 id="modal-name" class="fw-bold text-center"></h5>
894
+ <!-- Item Price -->
895
  <p id="modal-price" class="text-muted text-center"></p>
896
+ <!-- Item Description -->
897
  <p id="modal-description" class="text-secondary"></p>
898
+ <!-- Add-ons -->
899
  <div id="modal-addons" class="modal-addons mt-4">
900
  <h6>Customization Options</h6>
901
  <div id="addons-list" class="addons-container">Loading customization options...</div>
 
906
  </div>
907
  <span id="modal-section" data-section="" data-category="" style="display: none;"></span>
908
  </div>
909
+ <!-- Quantity Controls and Add to Cart Button -->
910
  <div class="modal-footer d-flex align-items-center justify-content-between">
911
+ <!-- Quantity Controls -->
912
  <div class="d-flex align-items-center gap-2">
913
  <button type="button" class="btn btn-outline-secondary" id="decreaseQuantity">-</button>
914
  <input type="text" class="form-control text-center" id="quantityInput" value="1" readonly style="width: 50px;"/>
915
  <button type="button" class="btn btn-outline-secondary" id="increaseQuantity">+</button>
916
  </div>
917
+ <!-- Add to Cart Button -->
918
  <button type="button" class="btn btn-primary" onclick="addToCartFromModal()">Add to Cart</button>
919
  </div>
920
  </div>
 
951
 
952
  const menuItemDetails = {
953
  "Veg Manchurian": {
954
+ ingredients: "Cauliflower, Onion, Ginger, Garlic, Soy Sauce, Cornflour, Green Chilies, Capsicum, Spring Onion",
 
 
955
  nutritionalInfo: { calories: 250, protein: 5, carbs: 35, fats: 12, fiber: 3, sugar: 2 },
956
  allergens: "Soy, Gluten"
957
  },
 
1039
  ingredients: "Chickpeas, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coriander Powder, Cumin Seeds, Lemon Juice",
1040
  nutritionalInfo: { calories: 250, protein: 10, carbs: 45, fats: 5, fiber: 6, sugar: 2 },
1041
  allergens: "None"
 
 
 
 
 
 
 
 
 
 
1042
  }
1043
  };
1044
 
 
1579
  sectionDiv.appendChild(title);
1580
  const optionsContainer = document.createElement('div');
1581
  addon.options.forEach((option, index) => {
1582
+ const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
 
1583
  const listItem = document.createElement('div');
1584
  listItem.classList.add('form-check');
1585
  listItem.innerHTML = `
 
1600
  document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
1601
  });
1602
  }
1603
+
1604
  document.addEventListener('click', function(event) {
1605
  if (event.target.classList.contains('addon-option')) {
1606
  handleAddonClick(event.target);
1607
  }
1608
  });
1609
+
1610
  function handleAddonClick(checkbox) {
1611
  const groupName = checkbox.getAttribute('data-group');
1612
  const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo"].includes(groupName);
 
1619
  });
1620
  }
1621
  }
1622
+
1623
  function addToCartFromModal() {
1624
  const itemName = document.getElementById('modal-name').innerText;
1625
  let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));