Update templates/menu.html
Browse files- templates/menu.html +303 -79
templates/menu.html
CHANGED
@@ -140,7 +140,13 @@
|
|
140 |
text-decoration: none;
|
141 |
}
|
142 |
.avatar-dropdown-container {
|
143 |
-
position:
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
.avatar-icon {
|
146 |
width: 40px;
|
@@ -161,28 +167,17 @@
|
|
161 |
top: 100%;
|
162 |
background-color: #fff;
|
163 |
border-radius: 5px;
|
164 |
-
width:
|
165 |
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
166 |
display: none;
|
167 |
}
|
168 |
-
.avatar-dropdown-container:hover .dropdown-menu {
|
169 |
-
display: block;
|
170 |
-
}
|
171 |
-
.avatar-dropdown-container {
|
172 |
-
position: absolute;
|
173 |
-
right: 20px;
|
174 |
-
top: 50%;
|
175 |
-
transform: translateY(-50%);
|
176 |
-
display: flex;
|
177 |
-
align-items: right;
|
178 |
-
justify-content: center;
|
179 |
-
}
|
180 |
.dropdown-menu .dropdown-item {
|
181 |
-
padding:
|
182 |
text-decoration: none;
|
183 |
color: #333;
|
184 |
border-bottom: 1px solid #ddd;
|
185 |
display: block;
|
|
|
186 |
}
|
187 |
.dropdown-menu .dropdown-item:last-child {
|
188 |
border-bottom: none;
|
@@ -284,6 +279,14 @@
|
|
284 |
display: inline-block;
|
285 |
vertical-align: middle;
|
286 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
form.text-center.mb-4 {
|
288 |
display: flex;
|
289 |
flex-direction: column;
|
@@ -291,6 +294,54 @@
|
|
291 |
justify-content: center;
|
292 |
margin-bottom: 5px;
|
293 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
.modal-footer {
|
295 |
display: flex;
|
296 |
align-items: center;
|
@@ -347,12 +398,14 @@
|
|
347 |
color: #333;
|
348 |
}
|
349 |
.item-details .nutritional-info {
|
350 |
-
display:
|
351 |
-
|
|
|
352 |
background-color: #e9ecef;
|
353 |
-
padding:
|
354 |
border-radius: 5px;
|
355 |
font-size: 0.85rem;
|
|
|
356 |
}
|
357 |
.toggle-details {
|
358 |
cursor: pointer;
|
@@ -417,6 +470,23 @@
|
|
417 |
font-size: 12px;
|
418 |
padding: 0 5px;
|
419 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
@media (max-width: 576px) {
|
421 |
.fixed-top-bar {
|
422 |
height: 60px;
|
@@ -439,9 +509,16 @@
|
|
439 |
right: 10px;
|
440 |
}
|
441 |
.avatar-icon {
|
442 |
-
width:
|
443 |
-
height:
|
444 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
}
|
446 |
.category-buttons {
|
447 |
gap: 8px;
|
@@ -451,43 +528,115 @@
|
|
451 |
font-size: 0.85rem;
|
452 |
}
|
453 |
.modal-dialog {
|
454 |
-
max-width:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
}
|
456 |
.modal-footer .btn {
|
457 |
-
height:
|
458 |
-
padding: 0
|
459 |
}
|
460 |
.modal-footer .form-control {
|
461 |
-
width:
|
462 |
-
height:
|
|
|
|
|
463 |
}
|
464 |
-
.btn-
|
465 |
-
|
466 |
-
|
|
|
|
|
|
|
|
|
|
|
467 |
height: 30px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
}
|
469 |
.customisable-text {
|
470 |
-
font-size:
|
471 |
}
|
472 |
.button-container {
|
473 |
-
gap:
|
474 |
}
|
475 |
.quantity-selector .btn {
|
476 |
-
width:
|
477 |
-
height:
|
478 |
-
font-size:
|
479 |
-
line-height:
|
480 |
}
|
481 |
.quantity-selector .quantity-display {
|
482 |
-
width:
|
483 |
-
font-size:
|
484 |
-
line-height:
|
485 |
}
|
486 |
.quantity-selector .quantity-to-add,
|
487 |
.quantity-selector .quantity-to-remove {
|
488 |
-
width:
|
489 |
-
height:
|
490 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
}
|
492 |
}
|
493 |
</style>
|
@@ -618,10 +767,11 @@
|
|
618 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
619 |
</div>
|
620 |
<div class="modal-body">
|
621 |
-
<img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image"
|
622 |
<h5 id="modal-name" class="fw-bold text-center"></h5>
|
623 |
<p id="modal-price" class="text-muted text-center"></p>
|
624 |
<p id="modal-description" class="text-secondary"></p>
|
|
|
625 |
|
626 |
<div id="first-row">
|
627 |
<h6 id="first-row-title" style="display: none;">Customization Options</h6>
|
@@ -634,8 +784,25 @@
|
|
634 |
<div id="type-options"></div>
|
635 |
</div>
|
636 |
<div class="addon-section">
|
637 |
-
<h6>Spice Level</h6>
|
638 |
-
<div id="spice-level-options"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
639 |
</div>
|
640 |
</div>
|
641 |
|
@@ -668,92 +835,92 @@
|
|
668 |
const menuItemDetails = {
|
669 |
"Veg Manchurian": {
|
670 |
ingredients: "Cauliflower, Onion, Ginger, Garlic, Soy Sauce, Cornflour, Green Chilies, Capsicum, Spring Onion",
|
671 |
-
nutritionalInfo: { calories: 250, protein: 5, carbs: 35, fats: 12 },
|
672 |
allergens: "Soy, Gluten"
|
673 |
},
|
674 |
"Veg Biryani": {
|
675 |
ingredients: "Basmati Rice, Mixed Vegetables (Carrot, Peas, Potato, Cauliflower), Ginger, Garlic, Biryani Masala, Mint Leaves, Curd, Onion, Ghee",
|
676 |
-
nutritionalInfo: { calories: 300, protein: 6, carbs: 50, fats: 12 },
|
677 |
allergens: "Dairy"
|
678 |
},
|
679 |
"Sukka Gosht (Goat)": {
|
680 |
ingredients: "Goat Meat, Ginger-Garlic Paste, Green Chilies, Onion, Tomatoes, Garam Masala, Coriander Powder, Cumin Powder, Fresh Coriander",
|
681 |
-
nutritionalInfo: { calories: 450, protein: 35, carbs: 10, fats: 30 },
|
682 |
allergens: "None"
|
683 |
},
|
684 |
"Samosa": {
|
685 |
ingredients: "Potatoes, Peas, Onion, Ginger, Cumin Seeds, Garam Masala, Wheat Flour (for dough), Oil (for frying)",
|
686 |
-
nutritionalInfo: { calories: 150, protein: 3, carbs: 25, fats: 7 },
|
687 |
allergens: "Gluten"
|
688 |
},
|
689 |
"Roti": {
|
690 |
ingredients: "Whole Wheat Flour, Water, Salt",
|
691 |
-
nutritionalInfo: { calories: 150, protein: 4, carbs: 30, fats: 1 },
|
692 |
allergens: "Gluten"
|
693 |
},
|
694 |
"Prawn Fry": {
|
695 |
ingredients: "Prawns, Garlic, Ginger, Chili Powder, Coriander Powder, Cumin Powder, Lemon Juice, Oil",
|
696 |
-
nutritionalInfo: { calories: 350, protein: 25, carbs: 10, fats: 20 },
|
697 |
allergens: "Shellfish"
|
698 |
},
|
699 |
"Paneer Butter Masala": {
|
700 |
ingredients: "Paneer, Butter, Cream, Tomato Puree, Onion, Ginger, Garlic, Garam Masala",
|
701 |
-
nutritionalInfo: { calories: 400, protein: 15, carbs: 20, fats: 25 },
|
702 |
allergens: "Dairy"
|
703 |
},
|
704 |
"Paneer Biryani": {
|
705 |
ingredients: "Paneer, Basmati Rice, Mixed Vegetables (Carrot, Peas, Potato), Onion, Tomatoes, Biryani Masala, Mint Leaves, Curd",
|
706 |
-
nutritionalInfo: { calories: 350, protein: 12, carbs: 55, fats: 15 },
|
707 |
allergens: "Dairy"
|
708 |
},
|
709 |
"Onion Pakoda": {
|
710 |
ingredients: "Onion, Chickpea Flour (Besan), Rice Flour, Green Chilies, Cumin Seeds, Ginger, Turmeric Powder, Oil (for frying)",
|
711 |
-
nutritionalInfo: { calories: 200, protein: 5, carbs: 30, fats: 8 },
|
712 |
allergens: "Gluten (if cross-contamination)"
|
713 |
},
|
714 |
"Mutton Biryani": {
|
715 |
ingredients: "Mutton, Basmati Rice, Onion, Tomatoes, Ginger-Garlic Paste, Biryani Masala, Mint Leaves, Yogurt, Ghee",
|
716 |
-
nutritionalInfo: { calories: 500, protein: 30, carbs: 50, fats: 25 },
|
717 |
allergens: "Dairy"
|
718 |
},
|
719 |
"Fish Curry": {
|
720 |
ingredients: "Fish (any firm fish like Salmon or King Fish), Onion, Tomato, Ginger-Garlic Paste, Curry Leaves, Coconut Milk, Tamarind, Mustard Seeds",
|
721 |
-
nutritionalInfo: { calories: 300, protein: 25, carbs: 10, fats: 20 },
|
722 |
allergens: "Fish"
|
723 |
},
|
724 |
"Fiery Mango Glaze Chicken": {
|
725 |
ingredients: "Chicken, Mango Puree, Chili Sauce, Soy Sauce, Honey, Garlic, Ginger, Lemon Juice",
|
726 |
-
nutritionalInfo: { calories: 350, protein: 30, carbs: 15, fats: 18 },
|
727 |
allergens: "Soy"
|
728 |
},
|
729 |
"Chilli Gobi": {
|
730 |
ingredients: "Cauliflower, Onion, Green Chilies, Soy Sauce, Cornflour, Garlic, Ginger, Cumin Powder",
|
731 |
-
nutritionalInfo: { calories: 250, protein: 6, carbs: 35, fats: 12 },
|
732 |
allergens: "Soy, Gluten"
|
733 |
},
|
734 |
"Chilli Chicken": {
|
735 |
ingredients: "Chicken, Bell Pepper, Onion, Green Chilies, Soy Sauce, Cornflour, Garlic, Ginger",
|
736 |
-
nutritionalInfo: { calories: 400, protein: 35, carbs: 20, fats: 18 },
|
737 |
allergens: "Soy, Gluten"
|
738 |
},
|
739 |
"Chicken Manchurian": {
|
740 |
ingredients: "Chicken, Onion, Garlic, Ginger, Soy Sauce, Cornflour, Green Chilies, Capsicum",
|
741 |
-
nutritionalInfo: { calories: 350, protein: 25, carbs: 20, fats: 18 },
|
742 |
allergens: "Soy, Gluten"
|
743 |
},
|
744 |
"Chicken Curry": {
|
745 |
ingredients: "Chicken, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coconut Milk, Coriander Leaves",
|
746 |
-
nutritionalInfo: { calories:
|
747 |
allergens: "None"
|
748 |
},
|
749 |
"Chicken Biryani": {
|
750 |
ingredients: "Chicken, Basmati Rice, Onion, Tomatoes, Ginger-Garlic Paste, Biryani Masala, Mint Leaves, Curd",
|
751 |
-
nutritionalInfo: { calories: 500, protein: 35, carbs: 60, fats: 20 },
|
752 |
allergens: "Dairy"
|
753 |
},
|
754 |
"Channa Masala": {
|
755 |
ingredients: "Chickpeas, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coriander Powder, Cumin Seeds, Lemon Juice",
|
756 |
-
nutritionalInfo: { calories: 250, protein: 10, carbs: 45, fats: 5 },
|
757 |
allergens: "None"
|
758 |
}
|
759 |
};
|
@@ -797,6 +964,29 @@
|
|
797 |
}
|
798 |
|
799 |
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
800 |
const menuCards = document.querySelectorAll('.menu-card');
|
801 |
|
802 |
menuCards.forEach(card => {
|
@@ -811,8 +1001,8 @@
|
|
811 |
<h6>Nutritional Info</h6>
|
812 |
<div class="nutritional-info">
|
813 |
<span>Calories: ${detailsData.nutritionalInfo.calories} kcal</span>
|
814 |
-
<span>Protein: ${detailsData.nutritionalInfo.protein}g</span>
|
815 |
<span>Carbs: ${detailsData.nutritionalInfo.carbs}g</span>
|
|
|
816 |
<span>Fats: ${detailsData.nutritionalInfo.fats}g</span>
|
817 |
</div>
|
818 |
<h6>Allergens</h6>
|
@@ -904,6 +1094,17 @@
|
|
904 |
modalImg.src = image || '/static/placeholder.jpg';
|
905 |
}
|
906 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
907 |
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
908 |
document.getElementById('modal-instructions').value = '';
|
909 |
|
@@ -934,6 +1135,45 @@
|
|
934 |
addonsTitle.style.display = 'block';
|
935 |
}
|
936 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
937 |
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
|
938 |
.then(response => response.json())
|
939 |
.then(data => {
|
@@ -976,20 +1216,6 @@
|
|
976 |
typeOptions.innerHTML += optionHTML;
|
977 |
});
|
978 |
}
|
979 |
-
if (addon.name.toLowerCase() === "spice level") {
|
980 |
-
addon.options.forEach(option => {
|
981 |
-
const optionId = `addon-spice-level-${option}`;
|
982 |
-
const optionHTML = `
|
983 |
-
<div class="form-check">
|
984 |
-
<input type="checkbox" class="form-check-input spice-level-option" id="${optionId}" value="${option}" data-name="${option}" data-group="Spice Level">
|
985 |
-
<label class="form-check-label" for="${optionId}">
|
986 |
-
${option}
|
987 |
-
</label>
|
988 |
-
</div>
|
989 |
-
`;
|
990 |
-
spiceLevelOptions.innerHTML += optionHTML;
|
991 |
-
});
|
992 |
-
}
|
993 |
});
|
994 |
}
|
995 |
|
@@ -1513,5 +1739,3 @@
|
|
1513 |
</body>
|
1514 |
</html>
|
1515 |
|
1516 |
-
|
1517 |
-
|
|
|
140 |
text-decoration: none;
|
141 |
}
|
142 |
.avatar-dropdown-container {
|
143 |
+
position: absolute;
|
144 |
+
right: 10px;
|
145 |
+
top: 50%;
|
146 |
+
transform: translateY(-50%);
|
147 |
+
display: flex;
|
148 |
+
align-items: right;
|
149 |
+
justify-content: center;
|
150 |
}
|
151 |
.avatar-icon {
|
152 |
width: 40px;
|
|
|
167 |
top: 100%;
|
168 |
background-color: #fff;
|
169 |
border-radius: 5px;
|
170 |
+
width: 220px;
|
171 |
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
172 |
display: none;
|
173 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
.dropdown-menu .dropdown-item {
|
175 |
+
padding: 12px 16px;
|
176 |
text-decoration: none;
|
177 |
color: #333;
|
178 |
border-bottom: 1px solid #ddd;
|
179 |
display: block;
|
180 |
+
font-size: 15px;
|
181 |
}
|
182 |
.dropdown-menu .dropdown-item:last-child {
|
183 |
border-bottom: none;
|
|
|
279 |
display: inline-block;
|
280 |
vertical-align: middle;
|
281 |
}
|
282 |
+
.spice-level-grid {
|
283 |
+
display: grid;
|
284 |
+
grid-template-columns: 1fr 1fr;
|
285 |
+
gap: 10px;
|
286 |
+
}
|
287 |
+
.spice-level-grid .form-check {
|
288 |
+
margin-left: 0;
|
289 |
+
}
|
290 |
form.text-center.mb-4 {
|
291 |
display: flex;
|
292 |
flex-direction: column;
|
|
|
294 |
justify-content: center;
|
295 |
margin-bottom: 5px;
|
296 |
}
|
297 |
+
.modal-header {
|
298 |
+
padding: 10px 15px;
|
299 |
+
}
|
300 |
+
.modal-title {
|
301 |
+
font-size: 16px;
|
302 |
+
font-weight: bold;
|
303 |
+
}
|
304 |
+
.modal-body {
|
305 |
+
max-height: 60vh;
|
306 |
+
overflow-y: auto;
|
307 |
+
padding: 15px;
|
308 |
+
}
|
309 |
+
.modal-body #modal-img {
|
310 |
+
max-height: 200px;
|
311 |
+
width: 100%;
|
312 |
+
object-fit: cover;
|
313 |
+
border-radius: 8px;
|
314 |
+
margin-bottom: 10px;
|
315 |
+
}
|
316 |
+
.modal-body #modal-name {
|
317 |
+
font-size: 20px;
|
318 |
+
font-weight: bold;
|
319 |
+
text-align: center;
|
320 |
+
margin-bottom: 5px;
|
321 |
+
}
|
322 |
+
.modal-body #modal-price {
|
323 |
+
font-size: 16px;
|
324 |
+
font-weight: bold;
|
325 |
+
color: #6c757d;
|
326 |
+
text-align: center;
|
327 |
+
margin-bottom: 10px;
|
328 |
+
}
|
329 |
+
.modal-body #modal-description {
|
330 |
+
font-size: 14px;
|
331 |
+
color: #6c757d;
|
332 |
+
margin-bottom: 10px;
|
333 |
+
}
|
334 |
+
.modal-body .nutritional-info {
|
335 |
+
font-size: 12px;
|
336 |
+
color: #6c757d;
|
337 |
+
margin-bottom: 10px;
|
338 |
+
}
|
339 |
+
.modal-body #modal-addons h6,
|
340 |
+
.modal-body #first-row h6 {
|
341 |
+
font-size: 14px;
|
342 |
+
font-weight: bold;
|
343 |
+
margin-bottom: 10px;
|
344 |
+
}
|
345 |
.modal-footer {
|
346 |
display: flex;
|
347 |
align-items: center;
|
|
|
398 |
color: #333;
|
399 |
}
|
400 |
.item-details .nutritional-info {
|
401 |
+
display: grid;
|
402 |
+
grid-template-columns: 1fr 1fr;
|
403 |
+
gap: 10px;
|
404 |
background-color: #e9ecef;
|
405 |
+
padding: 10px;
|
406 |
border-radius: 5px;
|
407 |
font-size: 0.85rem;
|
408 |
+
line-height: 1.5;
|
409 |
}
|
410 |
.toggle-details {
|
411 |
cursor: pointer;
|
|
|
470 |
font-size: 12px;
|
471 |
padding: 0 5px;
|
472 |
}
|
473 |
+
.modal-dialog {
|
474 |
+
max-height: 90vh;
|
475 |
+
}
|
476 |
+
.modal-body::-webkit-scrollbar {
|
477 |
+
width: 8px;
|
478 |
+
}
|
479 |
+
.modal-body::-webkit-scrollbar-track {
|
480 |
+
background: #f1f1f1;
|
481 |
+
border-radius: 10px;
|
482 |
+
}
|
483 |
+
.modal-body::-webkit-scrollbar-thumb {
|
484 |
+
background: #0FAA39;
|
485 |
+
border-radius: 10px;
|
486 |
+
}
|
487 |
+
.modal-body::-webkit-scrollbar-thumb:hover {
|
488 |
+
background: #0D9232;
|
489 |
+
}
|
490 |
@media (max-width: 576px) {
|
491 |
.fixed-top-bar {
|
492 |
height: 60px;
|
|
|
509 |
right: 10px;
|
510 |
}
|
511 |
.avatar-icon {
|
512 |
+
width: 40px;
|
513 |
+
height: 40px;
|
514 |
+
font-size: 20px;
|
515 |
+
}
|
516 |
+
.dropdown-menu {
|
517 |
+
width: 220px;
|
518 |
+
}
|
519 |
+
.dropdown-menu .dropdown-item {
|
520 |
+
padding: 12px 16px;
|
521 |
+
font-size: 15px;
|
522 |
}
|
523 |
.category-buttons {
|
524 |
gap: 8px;
|
|
|
528 |
font-size: 0.85rem;
|
529 |
}
|
530 |
.modal-dialog {
|
531 |
+
max-width: 96%;
|
532 |
+
margin: 5px auto;
|
533 |
+
}
|
534 |
+
.modal-header {
|
535 |
+
padding: 5px 10px;
|
536 |
+
}
|
537 |
+
.modal-title {
|
538 |
+
font-size: 14px;
|
539 |
+
}
|
540 |
+
.modal-body {
|
541 |
+
max-height: 50vh;
|
542 |
+
padding: 8px;
|
543 |
+
}
|
544 |
+
.modal-body #modal-img {
|
545 |
+
max-height: 150px;
|
546 |
+
width: 100%;
|
547 |
+
max-width: 150px;
|
548 |
+
margin: 0 auto 5px;
|
549 |
+
display: block;
|
550 |
+
}
|
551 |
+
.modal-body #modal-name {
|
552 |
+
font-size: 18px;
|
553 |
+
margin-bottom: 3px;
|
554 |
+
}
|
555 |
+
.modal-body #modal-price {
|
556 |
+
font-size: 14px;
|
557 |
+
margin-bottom: 5px;
|
558 |
+
}
|
559 |
+
.modal-body #modal-description {
|
560 |
+
font-size: 12px;
|
561 |
+
margin-bottom: 5px;
|
562 |
+
}
|
563 |
+
.modal-body .nutritional-info {
|
564 |
+
font-size: 10px;
|
565 |
+
margin-bottom: 5px;
|
566 |
+
}
|
567 |
+
.modal-body #modal-addons h6,
|
568 |
+
.modal-body #first-row h6 {
|
569 |
+
font-size: 12px;
|
570 |
+
margin-bottom: 5px;
|
571 |
+
}
|
572 |
+
.modal-footer {
|
573 |
+
padding: 5px;
|
574 |
}
|
575 |
.modal-footer .btn {
|
576 |
+
height: 30px;
|
577 |
+
padding: 0 10px;
|
578 |
}
|
579 |
.modal-footer .form-control {
|
580 |
+
width: 30px;
|
581 |
+
height: 30px;
|
582 |
+
font-size: 12px;
|
583 |
+
font-weight: bold;
|
584 |
}
|
585 |
+
.modal-footer .btn-outline-secondary {
|
586 |
+
width: 25px;
|
587 |
+
height: 25px;
|
588 |
+
font-size: 12px;
|
589 |
+
line-height: 25px;
|
590 |
+
}
|
591 |
+
.modal-footer .btn-primary {
|
592 |
+
font-size: 12px;
|
593 |
height: 30px;
|
594 |
+
padding: 0 15px;
|
595 |
+
border-radius: 5px;
|
596 |
+
}
|
597 |
+
.btn-primary {
|
598 |
+
font-size: 10px;
|
599 |
+
width: 50px;
|
600 |
+
height: 25px;
|
601 |
}
|
602 |
.customisable-text {
|
603 |
+
font-size: 8px;
|
604 |
}
|
605 |
.button-container {
|
606 |
+
gap: 3px;
|
607 |
}
|
608 |
.quantity-selector .btn {
|
609 |
+
width: 18px;
|
610 |
+
height: 18px;
|
611 |
+
font-size: 9px;
|
612 |
+
line-height: 18px;
|
613 |
}
|
614 |
.quantity-selector .quantity-display {
|
615 |
+
width: 18px;
|
616 |
+
font-size: 9px;
|
617 |
+
line-height: 18px;
|
618 |
}
|
619 |
.quantity-selector .quantity-to-add,
|
620 |
.quantity-selector .quantity-to-remove {
|
621 |
+
width: 35px;
|
622 |
+
height: 18px;
|
623 |
+
font-size: 9px;
|
624 |
+
}
|
625 |
+
.addon-section {
|
626 |
+
padding: 8px;
|
627 |
+
margin-bottom: 5px;
|
628 |
+
}
|
629 |
+
.addon-section .form-check-input {
|
630 |
+
width: 16px;
|
631 |
+
height: 16px;
|
632 |
+
margin-right: 8px;
|
633 |
+
}
|
634 |
+
.addon-section .form-check-label {
|
635 |
+
font-size: 12px;
|
636 |
+
margin-right: 10px;
|
637 |
+
}
|
638 |
+
.spice-level-grid {
|
639 |
+
gap: 5px;
|
640 |
}
|
641 |
}
|
642 |
</style>
|
|
|
767 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
768 |
</div>
|
769 |
<div class="modal-body">
|
770 |
+
<img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image">
|
771 |
<h5 id="modal-name" class="fw-bold text-center"></h5>
|
772 |
<p id="modal-price" class="text-muted text-center"></p>
|
773 |
<p id="modal-description" class="text-secondary"></p>
|
774 |
+
<p class="nutritional-info" id="modal-nutritional-info"></p>
|
775 |
|
776 |
<div id="first-row">
|
777 |
<h6 id="first-row-title" style="display: none;">Customization Options</h6>
|
|
|
784 |
<div id="type-options"></div>
|
785 |
</div>
|
786 |
<div class="addon-section">
|
787 |
+
<h6>Select Spice Level</h6>
|
788 |
+
<div id="spice-level-options" class="spice-level-grid">
|
789 |
+
<div class="form-check">
|
790 |
+
<input type="checkbox" class="form-check-input spice-level-option" id="spice-mild" value="Mild" data-name="Mild" data-group="Spice Level">
|
791 |
+
<label class="form-check-label" for="spice-mild">Mild</label>
|
792 |
+
</div>
|
793 |
+
<div class="form-check">
|
794 |
+
<input type="checkbox" class="form-check-input spice-level-option" id="spice-spicy" value="Spicy" data-name="Spicy" data-group="Spice Level">
|
795 |
+
<label class="form-check-label" for="spice-spicy">Spicy</label>
|
796 |
+
</div>
|
797 |
+
<div class="form-check">
|
798 |
+
<input type="checkbox" class="form-check-input spice-level-option" id="spice-medium" value="Medium" data-name="Medium" data-group="Spice Level">
|
799 |
+
<label class="form-check-label" for="spice-medium">Medium</label>
|
800 |
+
</div>
|
801 |
+
<div class="form-check">
|
802 |
+
<input type="checkbox" class="form-check-input spice-level-option" id="spice-extra-spicy" value="Extra Spicy" data-name="Extra Spicy" data-group="Spice Level">
|
803 |
+
<label class="form-check-label" for="spice-extra-spicy">Extra Spicy</label>
|
804 |
+
</div>
|
805 |
+
</div>
|
806 |
</div>
|
807 |
</div>
|
808 |
|
|
|
835 |
const menuItemDetails = {
|
836 |
"Veg Manchurian": {
|
837 |
ingredients: "Cauliflower, Onion, Ginger, Garlic, Soy Sauce, Cornflour, Green Chilies, Capsicum, Spring Onion",
|
838 |
+
nutritionalInfo: { calories: 250, protein: 5, carbs: 35, fats: 12, fiber: 3, sugar: 2 },
|
839 |
allergens: "Soy, Gluten"
|
840 |
},
|
841 |
"Veg Biryani": {
|
842 |
ingredients: "Basmati Rice, Mixed Vegetables (Carrot, Peas, Potato, Cauliflower), Ginger, Garlic, Biryani Masala, Mint Leaves, Curd, Onion, Ghee",
|
843 |
+
nutritionalInfo: { calories: 300, protein: 6, carbs: 50, fats: 12, fiber: 5, sugar: 3 },
|
844 |
allergens: "Dairy"
|
845 |
},
|
846 |
"Sukka Gosht (Goat)": {
|
847 |
ingredients: "Goat Meat, Ginger-Garlic Paste, Green Chilies, Onion, Tomatoes, Garam Masala, Coriander Powder, Cumin Powder, Fresh Coriander",
|
848 |
+
nutritionalInfo: { calories: 450, protein: 35, carbs: 10, fats: 30, fiber: 2, sugar: 1 },
|
849 |
allergens: "None"
|
850 |
},
|
851 |
"Samosa": {
|
852 |
ingredients: "Potatoes, Peas, Onion, Ginger, Cumin Seeds, Garam Masala, Wheat Flour (for dough), Oil (for frying)",
|
853 |
+
nutritionalInfo: { calories: 150, protein: 3, carbs: 25, fats: 7, fiber: 2, sugar: 1 },
|
854 |
allergens: "Gluten"
|
855 |
},
|
856 |
"Roti": {
|
857 |
ingredients: "Whole Wheat Flour, Water, Salt",
|
858 |
+
nutritionalInfo: { calories: 150, protein: 4, carbs: 30, fats: 1, fiber: 3, sugar: 0 },
|
859 |
allergens: "Gluten"
|
860 |
},
|
861 |
"Prawn Fry": {
|
862 |
ingredients: "Prawns, Garlic, Ginger, Chili Powder, Coriander Powder, Cumin Powder, Lemon Juice, Oil",
|
863 |
+
nutritionalInfo: { calories: 350, protein: 25, carbs: 10, fats: 20, fiber: 1, sugar: 1 },
|
864 |
allergens: "Shellfish"
|
865 |
},
|
866 |
"Paneer Butter Masala": {
|
867 |
ingredients: "Paneer, Butter, Cream, Tomato Puree, Onion, Ginger, Garlic, Garam Masala",
|
868 |
+
nutritionalInfo: { calories: 400, protein: 15, carbs: 20, fats: 25, fiber: 2, sugar: 3 },
|
869 |
allergens: "Dairy"
|
870 |
},
|
871 |
"Paneer Biryani": {
|
872 |
ingredients: "Paneer, Basmati Rice, Mixed Vegetables (Carrot, Peas, Potato), Onion, Tomatoes, Biryani Masala, Mint Leaves, Curd",
|
873 |
+
nutritionalInfo: { calories: 350, protein: 12, carbs: 55, fats: 15, fiber: 4, sugar: 3 },
|
874 |
allergens: "Dairy"
|
875 |
},
|
876 |
"Onion Pakoda": {
|
877 |
ingredients: "Onion, Chickpea Flour (Besan), Rice Flour, Green Chilies, Cumin Seeds, Ginger, Turmeric Powder, Oil (for frying)",
|
878 |
+
nutritionalInfo: { calories: 200, protein: 5, carbs: 30, fats: 8, fiber: 3, sugar: 2 },
|
879 |
allergens: "Gluten (if cross-contamination)"
|
880 |
},
|
881 |
"Mutton Biryani": {
|
882 |
ingredients: "Mutton, Basmati Rice, Onion, Tomatoes, Ginger-Garlic Paste, Biryani Masala, Mint Leaves, Yogurt, Ghee",
|
883 |
+
nutritionalInfo: { calories: 500, protein: 30, carbs: 50, fats: 25, fiber: 4, sugar: 3 },
|
884 |
allergens: "Dairy"
|
885 |
},
|
886 |
"Fish Curry": {
|
887 |
ingredients: "Fish (any firm fish like Salmon or King Fish), Onion, Tomato, Ginger-Garlic Paste, Curry Leaves, Coconut Milk, Tamarind, Mustard Seeds",
|
888 |
+
nutritionalInfo: { calories: 300, protein: 25, carbs: 10, fats: 20, fiber: 2, sugar: 1 },
|
889 |
allergens: "Fish"
|
890 |
},
|
891 |
"Fiery Mango Glaze Chicken": {
|
892 |
ingredients: "Chicken, Mango Puree, Chili Sauce, Soy Sauce, Honey, Garlic, Ginger, Lemon Juice",
|
893 |
+
nutritionalInfo: { calories: 350, protein: 30, carbs: 15, fats: 18, fiber: 1, sugar: 5 },
|
894 |
allergens: "Soy"
|
895 |
},
|
896 |
"Chilli Gobi": {
|
897 |
ingredients: "Cauliflower, Onion, Green Chilies, Soy Sauce, Cornflour, Garlic, Ginger, Cumin Powder",
|
898 |
+
nutritionalInfo: { calories: 250, protein: 6, carbs: 35, fats: 12, fiber: 3, sugar: 2 },
|
899 |
allergens: "Soy, Gluten"
|
900 |
},
|
901 |
"Chilli Chicken": {
|
902 |
ingredients: "Chicken, Bell Pepper, Onion, Green Chilies, Soy Sauce, Cornflour, Garlic, Ginger",
|
903 |
+
nutritionalInfo: { calories: 400, protein: 35, carbs: 20, fats: 18, fiber: 2, sugar: 2 },
|
904 |
allergens: "Soy, Gluten"
|
905 |
},
|
906 |
"Chicken Manchurian": {
|
907 |
ingredients: "Chicken, Onion, Garlic, Ginger, Soy Sauce, Cornflour, Green Chilies, Capsicum",
|
908 |
+
nutritionalInfo: { calories: 350, protein: 25, carbs: 20, fats: 18, fiber: 2, sugar: 2 },
|
909 |
allergens: "Soy, Gluten"
|
910 |
},
|
911 |
"Chicken Curry": {
|
912 |
ingredients: "Chicken, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coconut Milk, Coriander Leaves",
|
913 |
+
nutritionalInfo: { calories: 350, protein: 28, carbs: 15, fats: 12, fiber: 4, sugar: 2 },
|
914 |
allergens: "None"
|
915 |
},
|
916 |
"Chicken Biryani": {
|
917 |
ingredients: "Chicken, Basmati Rice, Onion, Tomatoes, Ginger-Garlic Paste, Biryani Masala, Mint Leaves, Curd",
|
918 |
+
nutritionalInfo: { calories: 500, protein: 35, carbs: 60, fats: 20, fiber: 5, sugar: 3 },
|
919 |
allergens: "Dairy"
|
920 |
},
|
921 |
"Channa Masala": {
|
922 |
ingredients: "Chickpeas, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coriander Powder, Cumin Seeds, Lemon Juice",
|
923 |
+
nutritionalInfo: { calories: 250, protein: 10, carbs: 45, fats: 5, fiber: 6, sugar: 2 },
|
924 |
allergens: "None"
|
925 |
}
|
926 |
};
|
|
|
964 |
}
|
965 |
|
966 |
document.addEventListener('DOMContentLoaded', function () {
|
967 |
+
// Avatar Dropdown Click Toggle
|
968 |
+
const avatarContainer = document.querySelector('.avatar-dropdown-container');
|
969 |
+
const dropdownMenu = document.querySelector('.dropdown-menu');
|
970 |
+
|
971 |
+
avatarContainer.addEventListener('click', function (event) {
|
972 |
+
event.stopPropagation();
|
973 |
+
dropdownMenu.style.display = dropdownMenu.style.display === 'block' ? 'none' : 'block';
|
974 |
+
});
|
975 |
+
|
976 |
+
document.addEventListener('click', function (event) {
|
977 |
+
if (!avatarContainer.contains(event.target)) {
|
978 |
+
dropdownMenu.style.display = 'none';
|
979 |
+
}
|
980 |
+
});
|
981 |
+
|
982 |
+
const dropdownItems = document.querySelectorAll('.dropdown-item');
|
983 |
+
dropdownItems.forEach(item => {
|
984 |
+
item.addEventListener('click', function () {
|
985 |
+
dropdownMenu.style.display = 'none';
|
986 |
+
});
|
987 |
+
});
|
988 |
+
|
989 |
+
// Existing Menu Functionality
|
990 |
const menuCards = document.querySelectorAll('.menu-card');
|
991 |
|
992 |
menuCards.forEach(card => {
|
|
|
1001 |
<h6>Nutritional Info</h6>
|
1002 |
<div class="nutritional-info">
|
1003 |
<span>Calories: ${detailsData.nutritionalInfo.calories} kcal</span>
|
|
|
1004 |
<span>Carbs: ${detailsData.nutritionalInfo.carbs}g</span>
|
1005 |
+
<span>Protein: ${detailsData.nutritionalInfo.protein}g</span>
|
1006 |
<span>Fats: ${detailsData.nutritionalInfo.fats}g</span>
|
1007 |
</div>
|
1008 |
<h6>Allergens</h6>
|
|
|
1094 |
modalImg.src = image || '/static/placeholder.jpg';
|
1095 |
}
|
1096 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
1097 |
+
|
1098 |
+
// Populate nutritional info
|
1099 |
+
const nutritionalInfoEl = document.getElementById('modal-nutritional-info');
|
1100 |
+
const itemDetails = menuItemDetails[name];
|
1101 |
+
if (itemDetails && itemDetails.nutritionalInfo) {
|
1102 |
+
const { calories, protein, carbs, fats, fiber, sugar } = itemDetails.nutritionalInfo;
|
1103 |
+
nutritionalInfoEl.innerText = `[Energy: ${calories} kcal, Protein: ${protein}g, Carbohydrates: ${carbs}g, Fiber: ${fiber}g, Fat: ${fats}g, Sugar: ${sugar}g]`;
|
1104 |
+
} else {
|
1105 |
+
nutritionalInfoEl.innerText = '[No nutritional info available.]';
|
1106 |
+
}
|
1107 |
+
|
1108 |
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
1109 |
document.getElementById('modal-instructions').value = '';
|
1110 |
|
|
|
1135 |
addonsTitle.style.display = 'block';
|
1136 |
}
|
1137 |
|
1138 |
+
const addonsList = document.getElementById('addons-list');
|
1139 |
+
addonsList.innerHTML = '';
|
1140 |
+
|
1141 |
+
const dummySections = [
|
1142 |
+
{ name: "Beverages", options: ["Sprite ($3)", "Thums Up ($3)", "Virgin Mojito ($3)", "Lemonade ($3)", "Blue Lagoon Mocktail ($3)"] },
|
1143 |
+
{ name: "Sauces", options: ["Mint Chutney", "Tomato Sauce"] },
|
1144 |
+
{ name: "Extra Toppings", options: ["Cheese ($2)", "Olives ($1)", "Jalapenos ($1)", "Mushrooms ($2)", "Peppers ($1)"] },
|
1145 |
+
{ name: "Sides", options: ["Fries ($3)", "Salad ($2)", "Garlic Bread ($3)", "Onion Rings ($2)", "Coleslaw ($2)"] },
|
1146 |
+
{ name: "Desserts", options: ["Ice Cream ($3)", "Brownie ($3)", "Cheesecake ($4)", "Gulab Jamun ($3)", "Rasmalai ($4)"] }
|
1147 |
+
];
|
1148 |
+
|
1149 |
+
dummySections.forEach(addon => {
|
1150 |
+
const sectionDiv = document.createElement('div');
|
1151 |
+
sectionDiv.classList.add('addon-section');
|
1152 |
+
sectionDiv.setAttribute('data-addon-name', addon.name);
|
1153 |
+
|
1154 |
+
const title = document.createElement('h6');
|
1155 |
+
title.innerText = addon.name;
|
1156 |
+
sectionDiv.appendChild(title);
|
1157 |
+
|
1158 |
+
const optionsContainer = document.createElement('div');
|
1159 |
+
addon.options.forEach((option, index) => {
|
1160 |
+
const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
|
1161 |
+
const listItem = document.createElement('div');
|
1162 |
+
listItem.classList.add('form-check');
|
1163 |
+
|
1164 |
+
listItem.innerHTML = `
|
1165 |
+
<input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
|
1166 |
+
data-name="${option}" data-group="${addon.name}" data-price="0">
|
1167 |
+
<label class="form-check-label" for="${optionId}">
|
1168 |
+
${option}
|
1169 |
+
</label>
|
1170 |
+
`;
|
1171 |
+
optionsContainer.appendChild(listItem);
|
1172 |
+
});
|
1173 |
+
sectionDiv.appendChild(optionsContainer);
|
1174 |
+
addonsList.appendChild(sectionDiv);
|
1175 |
+
});
|
1176 |
+
|
1177 |
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
|
1178 |
.then(response => response.json())
|
1179 |
.then(data => {
|
|
|
1216 |
typeOptions.innerHTML += optionHTML;
|
1217 |
});
|
1218 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1219 |
});
|
1220 |
}
|
1221 |
|
|
|
1739 |
</body>
|
1740 |
</html>
|
1741 |
|
|
|
|