Update templates/menu.html
Browse files- templates/menu.html +367 -995
templates/menu.html
CHANGED
@@ -49,14 +49,14 @@
|
|
49 |
border-radius: 15px 15px 0 0;
|
50 |
opacity: 0;
|
51 |
transition: opacity 0.5s ease-in-out;
|
52 |
-
background-color: #000;
|
53 |
}
|
54 |
.menu-video.loaded {
|
55 |
opacity: 1;
|
56 |
}
|
57 |
.menu-card:hover .menu-video {
|
58 |
opacity: 1;
|
59 |
-
transform: scale(1.05);
|
60 |
}
|
61 |
.menu-card .card-body .card-title {
|
62 |
font-size: 1.2rem;
|
@@ -118,34 +118,38 @@
|
|
118 |
border-color: #0D9232;
|
119 |
transform: scale(1.05);
|
120 |
}
|
121 |
-
|
122 |
-
.btn-primary:focus {
|
123 |
-
background-color: #0B7A29;
|
124 |
-
border-color: #0B7A29;
|
125 |
-
box-shadow: none;
|
126 |
-
transform: scale(0.98);
|
127 |
-
}
|
128 |
.avatar-dropdown-container {
|
129 |
position: absolute;
|
130 |
-
right:
|
131 |
top: 50%;
|
132 |
transform: translateY(-50%);
|
133 |
display: flex;
|
134 |
-
align-items:
|
135 |
justify-content: center;
|
136 |
}
|
137 |
.avatar-icon {
|
138 |
width: 40px;
|
139 |
height: 40px;
|
140 |
border-radius: 50%;
|
141 |
-
background-color: #007bff;
|
142 |
cursor: pointer;
|
143 |
display: flex;
|
144 |
align-items: center;
|
145 |
justify-content: center;
|
|
|
|
|
|
|
146 |
color: white;
|
147 |
-
font-size: 20px;
|
148 |
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
.dropdown-menu {
|
151 |
position: absolute;
|
@@ -174,6 +178,21 @@
|
|
174 |
background-color: #ffe4c4;
|
175 |
color: #333;
|
176 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
.fixed-top-bar {
|
178 |
position: relative;
|
179 |
top: 0;
|
@@ -197,7 +216,6 @@
|
|
197 |
align-items: center;
|
198 |
width: 300px;
|
199 |
max-width: 90%;
|
200 |
-
position: relative;
|
201 |
}
|
202 |
.search-bar-container input {
|
203 |
width: 100%;
|
@@ -252,278 +270,7 @@
|
|
252 |
.autocomplete-suggestions .suggestion-item:hover {
|
253 |
background-color: #f1f1f1;
|
254 |
}
|
255 |
-
|
256 |
-
background-color: #fff;
|
257 |
-
border: 2px solid #ffa500;
|
258 |
-
border-radius: 8px;
|
259 |
-
padding: 12px;
|
260 |
-
margin-bottom: 10px;
|
261 |
-
}
|
262 |
-
.addon-section h6 {
|
263 |
-
margin-bottom: 10px;
|
264 |
-
font-size: 1.1rem;
|
265 |
-
font-weight: bold;
|
266 |
-
color: #343a40;
|
267 |
-
}
|
268 |
-
.addon-section .form-check {
|
269 |
-
display: inline-flex;
|
270 |
-
align-items: center;
|
271 |
-
margin-left: 10px;
|
272 |
-
color: #343a40;
|
273 |
-
}
|
274 |
-
.addon-section .form-check-input {
|
275 |
-
-webkit-appearance: none;
|
276 |
-
-moz-appearance: none;
|
277 |
-
appearance: none;
|
278 |
-
width: 20px;
|
279 |
-
height: 20px;
|
280 |
-
border: 2px solid #343a40;
|
281 |
-
border-radius: 5px;
|
282 |
-
background-color: #f0f0f0;
|
283 |
-
position: relative;
|
284 |
-
margin-right: 10px;
|
285 |
-
}
|
286 |
-
.addon-section .form-check-input:checked {
|
287 |
-
background-color: #006400;
|
288 |
-
border-color: #006400;
|
289 |
-
}
|
290 |
-
.addon-section .form-check-input:checked::before {
|
291 |
-
content: '\2713';
|
292 |
-
font-size: 14px;
|
293 |
-
position: absolute;
|
294 |
-
top: 3px;
|
295 |
-
left: 4px;
|
296 |
-
color: white;
|
297 |
-
}
|
298 |
-
.addon-section .form-check-label {
|
299 |
-
font-size: 16px;
|
300 |
-
margin-left: 5px;
|
301 |
-
margin-right: 15px;
|
302 |
-
cursor: pointer;
|
303 |
-
display: inline-block;
|
304 |
-
vertical-align: middle;
|
305 |
-
}
|
306 |
-
form.text-center.mb-4 {
|
307 |
-
display: flex;
|
308 |
-
flex-direction: column;
|
309 |
-
align-items: center;
|
310 |
-
justify-content: center;
|
311 |
-
margin-bottom: 5px;
|
312 |
-
}
|
313 |
-
.modal-header {
|
314 |
-
padding: 10px 15px;
|
315 |
-
}
|
316 |
-
.modal-title {
|
317 |
-
font-size: 16px;
|
318 |
-
font-weight: bold;
|
319 |
-
}
|
320 |
-
.modal-body {
|
321 |
-
max-height: 60vh;
|
322 |
-
overflow-y: auto;
|
323 |
-
padding: 15px;
|
324 |
-
}
|
325 |
-
.modal-body #modal-img {
|
326 |
-
max-height: 200px;
|
327 |
-
width: 100%;
|
328 |
-
object-fit: cover;
|
329 |
-
border-radius: 8px;
|
330 |
-
margin-bottom: 10px;
|
331 |
-
}
|
332 |
-
.modal-body #modal-name {
|
333 |
-
font-size: 20px;
|
334 |
-
font-weight: bold;
|
335 |
-
text-align: center;
|
336 |
-
margin-bottom: 5px;
|
337 |
-
color: #333333;
|
338 |
-
}
|
339 |
-
.modal-body #modal-price {
|
340 |
-
font-size: 16px;
|
341 |
-
font-weight: 500;
|
342 |
-
color: #000000;
|
343 |
-
text-align: center;
|
344 |
-
margin-bottom: 10px;
|
345 |
-
}
|
346 |
-
.modal-body #modal-description {
|
347 |
-
font-size: 14px;
|
348 |
-
color: #6c757d;
|
349 |
-
margin-bottom: 10px;
|
350 |
-
}
|
351 |
-
.modal-body .nutritional-info {
|
352 |
-
font-size: 12px;
|
353 |
-
color: #6c757d;
|
354 |
-
margin-bottom: 10px;
|
355 |
-
}
|
356 |
-
.modal-body #modal-addons h6,
|
357 |
-
.modal-body #first-row h6 {
|
358 |
-
font-size: 14px;
|
359 |
-
font-weight: bold;
|
360 |
-
margin-bottom: 10px;
|
361 |
-
}
|
362 |
-
.modal-footer {
|
363 |
-
display: flex;
|
364 |
-
align-items: center;
|
365 |
-
justify-content: space-between;
|
366 |
-
padding: 10px;
|
367 |
-
}
|
368 |
-
.modal-footer .d-flex {
|
369 |
-
display: flex;
|
370 |
-
align-items: center;
|
371 |
-
gap: 10px;
|
372 |
-
}
|
373 |
-
.modal-footer .btn {
|
374 |
-
height: 40px;
|
375 |
-
padding: 0 15px;
|
376 |
-
}
|
377 |
-
.modal-footer .form-control {
|
378 |
-
width: 50px;
|
379 |
-
height: 40px;
|
380 |
-
text-align: center;
|
381 |
-
}
|
382 |
-
.modal-footer .btn-primary {
|
383 |
-
background-color: #0FAA39;
|
384 |
-
border-color: #0FAA39;
|
385 |
-
font-weight: bold;
|
386 |
-
padding: 10px 20px;
|
387 |
-
height: 40px;
|
388 |
-
display: flex;
|
389 |
-
justify-content: center;
|
390 |
-
align-items: center;
|
391 |
-
width: auto;
|
392 |
-
}
|
393 |
-
.modal-footer .btn-outline-secondary {
|
394 |
-
height: 40px;
|
395 |
-
width: 40px;
|
396 |
-
}
|
397 |
-
.item-details {
|
398 |
-
display: none;
|
399 |
-
padding: 15px;
|
400 |
-
background-color: #f8f9fa;
|
401 |
-
border-radius: 8px;
|
402 |
-
margin-top: 10px;
|
403 |
-
margin: 10px 15px;
|
404 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
405 |
-
}
|
406 |
-
.item-details.show {
|
407 |
-
display: block;
|
408 |
-
}
|
409 |
-
.item-details h6 {
|
410 |
-
color: #0FAA39;
|
411 |
-
margin-bottom: 10px;
|
412 |
-
font-size: 1.1rem;
|
413 |
-
font-weight: bold;
|
414 |
-
}
|
415 |
-
.item-details p {
|
416 |
-
margin-bottom: 15px;
|
417 |
-
color: #555;
|
418 |
-
line-height: 1.5;
|
419 |
-
font-size: 0.9rem;
|
420 |
-
}
|
421 |
-
.toggle-details {
|
422 |
-
cursor: pointer;
|
423 |
-
color: #0FAA39;
|
424 |
-
font-size: 0.9rem;
|
425 |
-
text-align: left;
|
426 |
-
padding: 5px 0;
|
427 |
-
transition: color 0.3s ease;
|
428 |
-
display: block;
|
429 |
-
width: 100%;
|
430 |
-
margin-top: 5px;
|
431 |
-
}
|
432 |
-
.toggle-details:hover {
|
433 |
-
color: #0D9232;
|
434 |
-
text-decoration: underline;
|
435 |
-
}
|
436 |
-
.category-buttons {
|
437 |
-
display: flex;
|
438 |
-
flex-wrap: wrap;
|
439 |
-
gap: 10px;
|
440 |
-
justify-content: center;
|
441 |
-
margin-top: 10px;
|
442 |
-
}
|
443 |
-
.category-button {
|
444 |
-
background-color: #fff;
|
445 |
-
border: 2px solid #0FAA39;
|
446 |
-
color: #0FAA39;
|
447 |
-
padding: 5px 15px;
|
448 |
-
border-radius: 20px;
|
449 |
-
font-size: 0.9rem;
|
450 |
-
cursor: pointer;
|
451 |
-
transition: background-color 0.3s, color 0.3s;
|
452 |
-
}
|
453 |
-
.category-button.selected {
|
454 |
-
background-color: #0FAA39;
|
455 |
-
color: #fff;
|
456 |
-
border-color: #0FAA39;
|
457 |
-
}
|
458 |
-
.category-button:hover {
|
459 |
-
background-color: #e6f4ea;
|
460 |
-
}
|
461 |
-
.quantity-selector {
|
462 |
-
display: flex;
|
463 |
-
align-items: center;
|
464 |
-
gap: 5px;
|
465 |
-
}
|
466 |
-
.quantity-selector .btn {
|
467 |
-
width: 25px;
|
468 |
-
height: 25px;
|
469 |
-
padding: 0;
|
470 |
-
font-size: 12px;
|
471 |
-
line-height: 25px;
|
472 |
-
text-align: center;
|
473 |
-
}
|
474 |
-
.quantity-selector .quantity-display {
|
475 |
-
width: 25px;
|
476 |
-
text-align: center;
|
477 |
-
font-size: 12px;
|
478 |
-
font-weight: bold;
|
479 |
-
line-height: 25px;
|
480 |
-
}
|
481 |
-
.quantity-selector .quantity-to-add,
|
482 |
-
.quantity-selector .quantity-to-remove {
|
483 |
-
width: 45px;
|
484 |
-
height: 25px;
|
485 |
-
font-size: 12px;
|
486 |
-
padding: 0 5px;
|
487 |
-
}
|
488 |
-
.modal-dialog {
|
489 |
-
max-height: 90vh;
|
490 |
-
}
|
491 |
-
.modal-body::-webkit-scrollbar {
|
492 |
-
width: 8px;
|
493 |
-
}
|
494 |
-
.modal-body::-webkit-scrollbar-track {
|
495 |
-
background: #f1f1f1;
|
496 |
-
border-radius: 10px;
|
497 |
-
}
|
498 |
-
.modal-body::-webkit-scrollbar-thumb {
|
499 |
-
background: #0FAA39;
|
500 |
-
border-radius: 10px;
|
501 |
-
}
|
502 |
-
.modal-body::-webkit-scrollbar-thumb:hover {
|
503 |
-
background: #0D9232;
|
504 |
-
}
|
505 |
-
.btn-primary:disabled {
|
506 |
-
opacity: 0.65;
|
507 |
-
cursor: not-allowed;
|
508 |
-
}
|
509 |
-
.quantity-selector select {
|
510 |
-
width: 60px;
|
511 |
-
height: 35px;
|
512 |
-
padding: 5px;
|
513 |
-
border-radius: 5px;
|
514 |
-
border: 1px solid #ced4da;
|
515 |
-
}
|
516 |
-
#custom-dish-form {
|
517 |
-
position: relative;
|
518 |
-
padding-bottom: 80px;
|
519 |
-
}
|
520 |
-
#custom-dish-form .btn-primary {
|
521 |
-
position: absolute;
|
522 |
-
right: 15px;
|
523 |
-
bottom: 15px;
|
524 |
-
width: auto;
|
525 |
-
padding: 10px 20px;
|
526 |
-
}
|
527 |
.bottom-action-bar {
|
528 |
position: fixed;
|
529 |
bottom: 0;
|
@@ -547,29 +294,15 @@
|
|
547 |
font-weight: bold;
|
548 |
font-size: 16px;
|
549 |
color: white;
|
550 |
-
display: flex;
|
551 |
-
align-items: center;
|
552 |
-
justify-content: center;
|
553 |
-
text-align: center;
|
554 |
-
min-width: 0;
|
555 |
-
white-space: nowrap;
|
556 |
}
|
557 |
.bottom-action-bar .btn-order-history {
|
558 |
background-color: #FFA07A;
|
559 |
border-color: #FFA07A;
|
560 |
}
|
561 |
-
.bottom-action-bar .btn-order-history:hover {
|
562 |
-
background-color: #FF8C61;
|
563 |
-
border-color: #FF8C61;
|
564 |
-
}
|
565 |
.bottom-action-bar .btn-view-cart {
|
566 |
background-color: #0FAA39;
|
567 |
border-color: #0FAA39;
|
568 |
}
|
569 |
-
.bottom-action-bar .btn-view-cart:hover {
|
570 |
-
background-color: #0D9232;
|
571 |
-
border-color: #0D9232;
|
572 |
-
}
|
573 |
.cart-icon-badge {
|
574 |
background-color: white;
|
575 |
color: #0FAA39;
|
@@ -582,8 +315,6 @@
|
|
582 |
font-size: 12px;
|
583 |
margin-left: 8px;
|
584 |
}
|
585 |
-
|
586 |
-
/* Mic Popup Styles */
|
587 |
.mic-popup {
|
588 |
position: fixed;
|
589 |
top: 50%;
|
@@ -598,242 +329,43 @@
|
|
598 |
display: none;
|
599 |
width: 300px;
|
600 |
max-width: 90%;
|
601 |
-
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
602 |
}
|
603 |
-
|
604 |
.mic-popup.active {
|
605 |
display: block;
|
606 |
}
|
607 |
-
|
608 |
.mic-popup-icon {
|
609 |
font-size: 48px;
|
610 |
margin-bottom: 20px;
|
611 |
color: #ff4444;
|
612 |
animation: pulse 1.5s infinite;
|
613 |
}
|
614 |
-
|
615 |
-
.mic-popup-text {
|
616 |
-
font-size: 18px;
|
617 |
-
margin-bottom: 15px;
|
618 |
-
min-height: 24px;
|
619 |
-
}
|
620 |
-
|
621 |
-
.mic-popup-cancel {
|
622 |
-
background-color: #ff4444;
|
623 |
-
color: white;
|
624 |
-
border: none;
|
625 |
-
padding: 8px 20px;
|
626 |
-
border-radius: 20px;
|
627 |
-
cursor: pointer;
|
628 |
-
font-weight: bold;
|
629 |
-
}
|
630 |
-
|
631 |
@keyframes pulse {
|
632 |
0% { transform: scale(1); }
|
633 |
50% { transform: scale(1.1); }
|
634 |
100% { transform: scale(1); }
|
635 |
}
|
636 |
-
|
637 |
-
@media (max-width: 576px) {
|
638 |
-
.fixed-top-bar {
|
639 |
-
height: 60px;
|
640 |
-
padding: 10px;
|
641 |
-
}
|
642 |
-
.search-bar-container {
|
643 |
-
width: 80%;
|
644 |
-
max-width: 100%;
|
645 |
-
left: 10px;
|
646 |
-
top: 50%;
|
647 |
-
transform: translateY(-50%);
|
648 |
-
}
|
649 |
-
.search-bar-container input {
|
650 |
-
padding: 6px 35px 6px 35px;
|
651 |
-
font-size: 14px;
|
652 |
-
border-radius: 20px;
|
653 |
-
}
|
654 |
-
.search-icon {
|
655 |
-
left: 12px;
|
656 |
-
font-size: 16px;
|
657 |
-
}
|
658 |
-
.mic-icon {
|
659 |
-
right: 12px;
|
660 |
-
font-size: 16px;
|
661 |
-
}
|
662 |
-
.avatar-dropdown-container {
|
663 |
-
right: 10px;
|
664 |
-
}
|
665 |
-
.avatar-icon {
|
666 |
-
width: 40px;
|
667 |
-
height: 40px;
|
668 |
-
font-size: 20px;
|
669 |
-
}
|
670 |
-
.dropdown-menu {
|
671 |
-
width: 220px;
|
672 |
-
}
|
673 |
-
.dropdown-menu .dropdown-item {
|
674 |
-
padding: 12px 16px;
|
675 |
-
font-size: 15px;
|
676 |
-
}
|
677 |
-
.category-buttons {
|
678 |
-
gap: 8px;
|
679 |
-
}
|
680 |
-
.category-button {
|
681 |
-
padding: 4px 12px;
|
682 |
-
font-size: 0.85rem;
|
683 |
-
}
|
684 |
-
.modal-dialog {
|
685 |
-
max-width: 96%;
|
686 |
-
margin: 5px auto;
|
687 |
-
}
|
688 |
-
.modal-header {
|
689 |
-
padding: 5px 10px;
|
690 |
-
}
|
691 |
-
.modal-title {
|
692 |
-
font-size: 14px;
|
693 |
-
}
|
694 |
-
.modal-body {
|
695 |
-
max-height: 50vh;
|
696 |
-
padding: 8px;
|
697 |
-
}
|
698 |
-
.modal-body #modal-img {
|
699 |
-
max-height: 150px;
|
700 |
-
width: 100%;
|
701 |
-
max-width: 150px;
|
702 |
-
margin: 0 auto 5px;
|
703 |
-
display: block;
|
704 |
-
}
|
705 |
-
.modal-body #modal-name {
|
706 |
-
font-size: 18px;
|
707 |
-
margin-bottom: 3px;
|
708 |
-
}
|
709 |
-
.modal-body #modal-price {
|
710 |
-
font-size: 14px;
|
711 |
-
margin-bottom: 5px;
|
712 |
-
}
|
713 |
-
.modal-body #modal-description {
|
714 |
-
font-size: 12px;
|
715 |
-
margin-bottom: 5px;
|
716 |
-
}
|
717 |
-
.modal-body .nutritional-info {
|
718 |
-
font-size: 10px;
|
719 |
-
margin-bottom: 5px;
|
720 |
-
}
|
721 |
-
.modal-body #modal-addons h6,
|
722 |
-
.modal-body #first-row h6 {
|
723 |
-
font-size: 12px;
|
724 |
-
margin-bottom: 5px;
|
725 |
-
}
|
726 |
-
.modal-footer {
|
727 |
-
padding: 5px;
|
728 |
-
}
|
729 |
-
.modal-footer .btn {
|
730 |
-
height: 30px;
|
731 |
-
padding: 0 10px;
|
732 |
-
}
|
733 |
-
.modal-footer .form-control {
|
734 |
-
width: 30px;
|
735 |
-
height: 30px;
|
736 |
-
font-size: 12px;
|
737 |
-
font-weight: bold;
|
738 |
-
}
|
739 |
-
.modal-footer .btn-outline-secondary {
|
740 |
-
width: 25px;
|
741 |
-
height: 25px;
|
742 |
-
font-size: 12px;
|
743 |
-
line-height: 25px;
|
744 |
-
}
|
745 |
-
.modal-footer .btn-primary {
|
746 |
-
font-size: 12px;
|
747 |
-
height: 30px;
|
748 |
-
padding: 0 15px;
|
749 |
-
border-radius: 5px;
|
750 |
-
}
|
751 |
-
.btn-primary {
|
752 |
-
font-size: 10px;
|
753 |
-
width: 50px;
|
754 |
-
height: 25px;
|
755 |
-
}
|
756 |
-
.customisable-text {
|
757 |
-
font-size: 8px;
|
758 |
-
}
|
759 |
-
.button-container {
|
760 |
-
gap: 3px;
|
761 |
-
}
|
762 |
-
.quantity-selector .btn {
|
763 |
-
width: 18px;
|
764 |
-
height: 18px;
|
765 |
-
font-size: 9px;
|
766 |
-
line-height: 18px;
|
767 |
-
}
|
768 |
-
.quantity-selector .quantity-display {
|
769 |
-
width: 18px;
|
770 |
-
font-size: 9px;
|
771 |
-
line-height: 18px;
|
772 |
-
}
|
773 |
-
.quantity-selector .quantity-to-add,
|
774 |
-
.quantity-selector .quantity-to-remove {
|
775 |
-
width: 35px;
|
776 |
-
height: 18px;
|
777 |
-
font-size: 9px;
|
778 |
-
}
|
779 |
-
.quantity-selector select {
|
780 |
-
width: 50px;
|
781 |
-
height: 30px;
|
782 |
-
font-size: 12px;
|
783 |
-
}
|
784 |
-
.bottom-action-bar {
|
785 |
-
padding: 8px 10px;
|
786 |
-
}
|
787 |
-
.bottom-action-bar .btn {
|
788 |
-
padding: 8px 10px;
|
789 |
-
font-size: 14px;
|
790 |
-
}
|
791 |
-
.cart-icon-badge {
|
792 |
-
width: 18px;
|
793 |
-
height: 18px;
|
794 |
-
font-size: 10px;
|
795 |
-
margin-left: 5px;
|
796 |
-
}
|
797 |
-
.item-details {
|
798 |
-
padding: 10px;
|
799 |
-
margin: 5px 10px;
|
800 |
-
}
|
801 |
-
.item-details h6 {
|
802 |
-
font-size: 0.95rem;
|
803 |
-
}
|
804 |
-
.item-details p {
|
805 |
-
font-size: 0.8rem;
|
806 |
-
}
|
807 |
-
.toggle-details {
|
808 |
-
font-size: 0.8rem;
|
809 |
-
}
|
810 |
-
/* Mic Popup Mobile Styles */
|
811 |
-
.mic-popup {
|
812 |
-
padding: 20px;
|
813 |
-
width: 280px;
|
814 |
-
}
|
815 |
-
.mic-popup-icon {
|
816 |
-
font-size: 36px;
|
817 |
-
margin-bottom: 15px;
|
818 |
-
}
|
819 |
-
.mic-popup-text {
|
820 |
-
font-size: 16px;
|
821 |
-
}
|
822 |
-
.mic-popup-cancel {
|
823 |
-
padding: 6px 16px;
|
824 |
-
font-size: 14px;
|
825 |
-
}
|
826 |
-
}
|
827 |
</style>
|
828 |
</head>
|
829 |
<body>
|
830 |
-
|
831 |
<div class="fixed-top-bar">
|
832 |
<div class="avatar-dropdown-container">
|
833 |
-
<div class="avatar-icon">
|
834 |
-
|
|
|
|
|
|
|
|
|
835 |
</div>
|
836 |
-
<div class="dropdown-menu">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
837 |
<a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
|
838 |
<a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
|
839 |
<a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
|
@@ -847,6 +379,25 @@
|
|
847 |
</div>
|
848 |
</div>
|
849 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
850 |
<form method="get" action="/menu" class="text-center mb-4" id="categoryForm">
|
851 |
<label class="form-label fw-bold">Select a Category:</label>
|
852 |
<div class="category-buttons">
|
@@ -954,6 +505,7 @@
|
|
954 |
{% endif %}
|
955 |
</div>
|
956 |
|
|
|
957 |
<div class="bottom-action-bar">
|
958 |
<a href="{{ url_for('orderhistory.order_history') }}" class="btn btn-order-history">
|
959 |
<i class="bi bi-clock-history"></i> Order History
|
@@ -964,7 +516,7 @@
|
|
964 |
</a>
|
965 |
</div>
|
966 |
|
967 |
-
<!--
|
968 |
<div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
|
969 |
<div class="modal-dialog modal-dialog-centered">
|
970 |
<div class="modal-content">
|
@@ -1004,7 +556,7 @@
|
|
1004 |
</div>
|
1005 |
</div>
|
1006 |
|
1007 |
-
<!--
|
1008 |
<div class="modal fade" id="softDrinkModal" tabindex="-1" aria-labelledby="softDrinkModalLabel" aria-hidden="true">
|
1009 |
<div class="modal-dialog modal-dialog-centered">
|
1010 |
<div class="modal-content" style="border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
|
@@ -1016,7 +568,7 @@
|
|
1016 |
<div class="text-center mb-4">
|
1017 |
<img id="soft-drink-image" class="img-fluid rounded mb-3" alt="Soft Drink Image" style="max-height: 150px; width: auto; object-fit: contain;">
|
1018 |
<h5 id="soft-drink-name" class="fw-bold" style="color: #333;"></h5>
|
1019 |
-
<p id="soft-drink-price"
|
1020 |
</div>
|
1021 |
<div class="d-flex justify-content-center align-items-center mb-4">
|
1022 |
<div class="quantity-selector" style="background-color: #f8f9fa; padding: 10px; border-radius: 10px;">
|
@@ -1044,7 +596,11 @@
|
|
1044 |
|
1045 |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
1046 |
<script>
|
1047 |
-
//
|
|
|
|
|
|
|
|
|
1048 |
const menuItemDetails = {
|
1049 |
{% for section, items in ordered_menu.items() %}
|
1050 |
{% for item in items %}
|
@@ -1071,20 +627,11 @@
|
|
1071 |
|
1072 |
const ingredientsList = [
|
1073 |
"Basmati Rice", "Bell Pepper", "Biryani Masala", "Butter", "Capsicum", "Cauliflower",
|
1074 |
-
"Chickpea Flour (Besan)", "
|
1075 |
-
|
1076 |
-
"Cumin Seeds", "Curd (Yogurt)", "Curry Leaves", "Fish (e.g., King Fish or Salmon)",
|
1077 |
-
"Fresh Coriander Leaves", "Garam Masala", "Garlic", "Ghee (Clarified Butter)", "Ginger",
|
1078 |
-
"Ginger-Garlic Paste", "Goat Meat (Mutton)", "Green Chilies", "Honey",
|
1079 |
-
"Kasuri Methi (dried fenugreek leaves)", "Lemon Juice", "Mango Puree", "Mint Leaves",
|
1080 |
-
"Mixed Vegetables (Carrot, Peas, Potato, Cauliflower)", "Mixed Vegetables (Carrot, Peas, Potato)",
|
1081 |
-
"Mustard Seeds", "Mutton (Goat Meat)", "Oil", "Oil (for frying)", "Onion",
|
1082 |
-
"Paneer (Indian Cottage Cheese)", "Peas", "Potatoes", "Prawns", "Red Chili Powder",
|
1083 |
-
"Rice Flour", "Saffron", "Salt", "Soy Sauce", "Spring Onion", "Tamarind (for sourness)",
|
1084 |
-
"Tomato Ketchup", "Tomatoes", "Turmeric Powder", "Vinegar", "Water", "Wheat Flour (for dough)",
|
1085 |
-
"Whole Wheat Flour", "Yogurt (Curd)"
|
1086 |
];
|
1087 |
|
|
|
1088 |
function addToCartLocalStorage(payload) {
|
1089 |
let cart = JSON.parse(localStorage.getItem('cart')) || [];
|
1090 |
const existingItem = cart.find(item =>
|
@@ -1101,176 +648,176 @@
|
|
1101 |
return cart;
|
1102 |
}
|
1103 |
|
1104 |
-
function removeFromCartLocalStorage(itemName, quantityToRemove, instructions, addons) {
|
1105 |
-
let cart = JSON.parse(localStorage.getItem('cart')) || [];
|
1106 |
-
const itemIndex = cart.findIndex(item =>
|
1107 |
-
item.itemName === itemName &&
|
1108 |
-
item.instructions === instructions &&
|
1109 |
-
JSON.stringify(item.addons) === JSON.stringify(addons)
|
1110 |
-
);
|
1111 |
-
if (itemIndex !== -1) {
|
1112 |
-
if (quantityToRemove >= cart[itemIndex].quantity) {
|
1113 |
-
cart.splice(itemIndex, 1);
|
1114 |
-
} else {
|
1115 |
-
cart[itemIndex].quantity -= quantityToRemove;
|
1116 |
-
}
|
1117 |
-
}
|
1118 |
-
localStorage.setItem('cart', JSON.stringify(cart));
|
1119 |
-
return cart;
|
1120 |
-
}
|
1121 |
-
|
1122 |
function getCartLocalStorage() {
|
1123 |
return JSON.parse(localStorage.getItem('cart')) || [];
|
1124 |
}
|
1125 |
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1132 |
}
|
1133 |
|
1134 |
-
function
|
1135 |
-
|
1136 |
-
const
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
modal.show();
|
1149 |
}
|
1150 |
|
1151 |
-
function
|
1152 |
-
|
1153 |
-
|
1154 |
-
const
|
1155 |
-
const
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1172 |
};
|
1173 |
-
|
1174 |
-
|
|
|
|
|
|
|
1175 |
method: 'POST',
|
1176 |
headers: {
|
1177 |
'Content-Type': 'application/json',
|
1178 |
},
|
1179 |
-
body: JSON.stringify(
|
|
|
|
|
|
|
|
|
1180 |
})
|
1181 |
-
.then(response => response.json())
|
1182 |
.then(data => {
|
1183 |
if (data.success) {
|
1184 |
-
|
1185 |
-
|
1186 |
-
modal.hide();
|
1187 |
-
} else {
|
1188 |
-
console.error('Failed to add item to cart:', data.error);
|
1189 |
-
const cart = addToCartLocalStorage(cartPayload);
|
1190 |
-
updateCartUI(cart);
|
1191 |
-
const modal = bootstrap.Modal.getInstance(document.getElementById('softDrinkModal'));
|
1192 |
-
modal.hide();
|
1193 |
}
|
1194 |
})
|
1195 |
-
.catch(
|
1196 |
-
console.error('Error
|
1197 |
-
|
1198 |
-
updateCartUI(cart);
|
1199 |
-
const modal = bootstrap.Modal.getInstance(document.getElementById('softDrinkModal'));
|
1200 |
-
modal.hide();
|
1201 |
});
|
1202 |
}
|
1203 |
|
1204 |
-
function
|
1205 |
-
if (!
|
1206 |
-
console.error('Invalid cart data:', cart);
|
1207 |
-
return;
|
1208 |
-
}
|
1209 |
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1213 |
});
|
1214 |
-
|
1215 |
-
const cartItemCount = document.getElementById('cart-item-count');
|
1216 |
-
if (cartItemCount) {
|
1217 |
-
cartItemCount.innerText = totalQuantity;
|
1218 |
-
cartItemCount.style.display = totalQuantity > 0 ? 'inline-flex' : 'none';
|
1219 |
-
}
|
1220 |
}
|
1221 |
|
|
|
1222 |
document.addEventListener('DOMContentLoaded', function () {
|
1223 |
-
|
1224 |
-
const dropdownMenu = document.querySelector('.dropdown-menu');
|
1225 |
-
avatarContainer.addEventListener('click', function (event) {
|
1226 |
-
event.stopPropagation();
|
1227 |
-
dropdownMenu.style.display = dropdownMenu.style.display === 'block' ? 'none' : 'block';
|
1228 |
-
});
|
1229 |
-
document.addEventListener('click', function (event) {
|
1230 |
-
if (!avatarContainer.contains(event.target)) {
|
1231 |
-
dropdownMenu.style.display = 'none';
|
1232 |
-
}
|
1233 |
-
});
|
1234 |
-
const dropdownItems = document.querySelectorAll('.dropdown-item');
|
1235 |
-
dropdownItems.forEach(item => {
|
1236 |
-
item.addEventListener('click', function () {
|
1237 |
-
dropdownMenu.style.display = 'none';
|
1238 |
-
});
|
1239 |
-
});
|
1240 |
|
1241 |
const menuCards = document.querySelectorAll('.menu-card');
|
1242 |
const menuVideos = document.querySelectorAll('.menu-video');
|
1243 |
-
const cardObserver = new IntersectionObserver((entries
|
1244 |
entries.forEach(entry => {
|
1245 |
if (entry.isIntersecting) {
|
1246 |
entry.target.classList.add('visible');
|
1247 |
-
|
1248 |
}
|
1249 |
});
|
1250 |
-
}, {
|
1251 |
-
|
1252 |
-
rootMargin: '0px',
|
1253 |
-
threshold: 0.1
|
1254 |
-
});
|
1255 |
-
const videoObserver = new IntersectionObserver((entries, observer) => {
|
1256 |
entries.forEach(entry => {
|
1257 |
if (entry.isIntersecting) {
|
1258 |
const video = entry.target;
|
1259 |
const src = video.getAttribute('data-src');
|
1260 |
if (src && !video.querySelector('source[src="' + src + '"]')) {
|
1261 |
-
|
1262 |
-
source.src = src;
|
1263 |
video.load();
|
1264 |
}
|
1265 |
video.classList.add('loaded');
|
1266 |
-
|
1267 |
}
|
1268 |
});
|
1269 |
-
}, {
|
1270 |
-
root: null,
|
1271 |
-
rootMargin: '200px',
|
1272 |
-
threshold: 0.01
|
1273 |
-
});
|
1274 |
menuCards.forEach(card => cardObserver.observe(card));
|
1275 |
menuVideos.forEach(video => videoObserver.observe(video));
|
1276 |
|
@@ -1280,24 +827,15 @@
|
|
1280 |
const itemName = this.getAttribute('data-item-name').replace(/ /g, '-');
|
1281 |
const detailsDiv = document.getElementById(`details-${itemName}`);
|
1282 |
const isCurrentlyShown = detailsDiv.classList.contains('show');
|
1283 |
-
|
1284 |
document.querySelectorAll('.item-details.show').forEach(otherDetails => {
|
1285 |
if (otherDetails !== detailsDiv) {
|
1286 |
otherDetails.classList.remove('show');
|
1287 |
const otherLink = otherDetails.previousElementSibling.querySelector('.toggle-details');
|
1288 |
-
if (otherLink)
|
1289 |
-
otherLink.innerText = 'Show Details';
|
1290 |
-
}
|
1291 |
}
|
1292 |
});
|
1293 |
-
|
1294 |
-
|
1295 |
-
detailsDiv.classList.add('show');
|
1296 |
-
this.innerText = 'Hide Details';
|
1297 |
-
} else {
|
1298 |
-
detailsDiv.classList.remove('show');
|
1299 |
-
this.innerText = 'Show Details';
|
1300 |
-
}
|
1301 |
});
|
1302 |
});
|
1303 |
|
@@ -1316,6 +854,7 @@
|
|
1316 |
categoryForm.submit();
|
1317 |
});
|
1318 |
});
|
|
|
1319 |
const searchBar = document.getElementById('searchBar');
|
1320 |
const suggestionsContainer = document.getElementById('autocompleteSuggestions');
|
1321 |
searchBar.addEventListener('input', function () {
|
@@ -1343,211 +882,182 @@
|
|
1343 |
}
|
1344 |
filterMenu();
|
1345 |
});
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1365 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1366 |
}
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1391 |
});
|
1392 |
-
|
1393 |
});
|
1394 |
-
descriptionSuggestions.style.display = 'block';
|
1395 |
}
|
1396 |
-
}
|
1397 |
-
});
|
1398 |
-
document.addEventListener('click', function (event) {
|
1399 |
-
if (!descriptionTextarea.contains(event.target) && !descriptionSuggestions.contains(event.target)) {
|
1400 |
-
descriptionSuggestions.style.display = 'none';
|
1401 |
-
}
|
1402 |
-
});
|
1403 |
}
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1410 |
})
|
|
|
1411 |
.then(data => {
|
1412 |
if (data.success) {
|
1413 |
updateCartUI(data.cart);
|
|
|
1414 |
} else {
|
1415 |
-
|
1416 |
-
const cart = getCartLocalStorage();
|
1417 |
updateCartUI(cart);
|
|
|
1418 |
}
|
1419 |
-
})
|
1420 |
-
.catch(err => {
|
1421 |
-
console.error('Error fetching cart:', err);
|
1422 |
-
const cart = getCartLocalStorage();
|
1423 |
-
updateCartUI(cart);
|
1424 |
});
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
const decreaseBtn = document.getElementById('decreaseQuantity');
|
1432 |
-
const increaseBtn = document.getElementById('increaseQuantity');
|
1433 |
-
const quantityInput = document.getElementById('quantityInput');
|
1434 |
-
decreaseBtn.addEventListener('click', function () {
|
1435 |
-
let currentQuantity = parseInt(quantityInput.value);
|
1436 |
-
if (currentQuantity > 1) {
|
1437 |
-
currentQuantity--;
|
1438 |
-
quantityInput.value = currentQuantity;
|
1439 |
-
}
|
1440 |
});
|
1441 |
-
|
1442 |
-
let
|
1443 |
-
|
1444 |
-
quantityInput.value = currentQuantity;
|
1445 |
});
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
const softDrinkQuantityInput = document.getElementById('soft-drink-quantity');
|
1450 |
-
|
1451 |
-
softDrinkDecreaseBtn.addEventListener('click', function() {
|
1452 |
-
let currentQuantity = parseInt(softDrinkQuantityInput.value);
|
1453 |
-
if (currentQuantity > 1) {
|
1454 |
-
currentQuantity--;
|
1455 |
-
softDrinkQuantityInput.value = currentQuantity;
|
1456 |
-
}
|
1457 |
});
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
if (currentQuantity < 1000) {
|
1462 |
-
currentQuantity++;
|
1463 |
-
softDrinkQuantityInput.value = currentQuantity;
|
1464 |
-
}
|
1465 |
});
|
1466 |
|
1467 |
-
//
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
if ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {
|
1474 |
-
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
1475 |
-
const recognition = new SpeechRecognition();
|
1476 |
-
recognition.continuous = false;
|
1477 |
-
recognition.interimResults = true;
|
1478 |
-
recognition.lang = 'en-US';
|
1479 |
-
|
1480 |
-
recognition.onstart = () => {
|
1481 |
-
micIcon.classList.add('active');
|
1482 |
-
micPopup.classList.add('active');
|
1483 |
-
micPopupText.textContent = 'Listening...';
|
1484 |
-
};
|
1485 |
-
|
1486 |
-
recognition.onresult = (event) => {
|
1487 |
-
let interimTranscript = '';
|
1488 |
-
let finalTranscript = '';
|
1489 |
-
|
1490 |
-
for (let i = event.resultIndex; i < event.results.length; i++) {
|
1491 |
-
const transcript = event.results[i][0].transcript;
|
1492 |
-
if (event.results[i].isFinal) {
|
1493 |
-
finalTranscript += transcript;
|
1494 |
-
} else {
|
1495 |
-
interimTranscript += transcript;
|
1496 |
-
}
|
1497 |
-
}
|
1498 |
-
|
1499 |
-
// Display interim results
|
1500 |
-
if (interimTranscript) {
|
1501 |
-
micPopupText.textContent = interimTranscript;
|
1502 |
-
}
|
1503 |
-
|
1504 |
-
// When we have a final result
|
1505 |
-
if (finalTranscript) {
|
1506 |
-
searchBar.value = finalTranscript.trim();
|
1507 |
-
filterMenu();
|
1508 |
-
micPopup.classList.remove('active');
|
1509 |
-
}
|
1510 |
-
};
|
1511 |
-
|
1512 |
-
recognition.onend = () => {
|
1513 |
-
micIcon.classList.remove('active');
|
1514 |
-
if (micPopup.classList.contains('active')) {
|
1515 |
-
// If still active, it means it ended unexpectedly
|
1516 |
-
setTimeout(() => {
|
1517 |
-
micPopup.classList.remove('active');
|
1518 |
-
}, 1000);
|
1519 |
-
}
|
1520 |
-
};
|
1521 |
-
|
1522 |
-
recognition.onerror = (event) => {
|
1523 |
-
micIcon.classList.remove('active');
|
1524 |
-
micPopupText.textContent = 'Error: ' + event.error;
|
1525 |
-
setTimeout(() => {
|
1526 |
-
micPopup.classList.remove('active');
|
1527 |
-
}, 2000);
|
1528 |
-
console.error('Speech error:', event.error);
|
1529 |
-
};
|
1530 |
-
|
1531 |
-
micIcon.addEventListener('click', () => {
|
1532 |
-
try {
|
1533 |
-
recognition.start();
|
1534 |
-
} catch (e) {
|
1535 |
-
micPopupText.textContent = 'Error starting microphone';
|
1536 |
-
setTimeout(() => {
|
1537 |
-
micPopup.classList.remove('active');
|
1538 |
-
}, 2000);
|
1539 |
-
console.error('Recognition start error:', e);
|
1540 |
-
}
|
1541 |
-
});
|
1542 |
-
|
1543 |
-
micPopupCancel.addEventListener('click', () => {
|
1544 |
-
recognition.stop();
|
1545 |
-
micPopup.classList.remove('active');
|
1546 |
-
micIcon.classList.remove('active');
|
1547 |
});
|
1548 |
-
} else {
|
1549 |
-
micIcon.style.display = 'none';
|
1550 |
-
}
|
1551 |
});
|
1552 |
|
1553 |
function filterMenu() {
|
@@ -1558,7 +1068,7 @@
|
|
1558 |
items.forEach(item => {
|
1559 |
const itemName = item.querySelector('.card-title').innerText.toLowerCase();
|
1560 |
const itemSection = item.closest('.row').previousElementSibling.innerText.toLowerCase();
|
1561 |
-
if (itemName.includes(input) ||
|
1562 |
item.style.display = 'block';
|
1563 |
item.classList.add('visible');
|
1564 |
matchedSections.add(item.closest('.row'));
|
@@ -1587,144 +1097,6 @@
|
|
1587 |
});
|
1588 |
}
|
1589 |
}
|
1590 |
-
|
1591 |
-
function showItemDetails(name, price, image, description, ingredients, nutritionalInfo, allergens, section, selectedCategory) {
|
1592 |
-
document.getElementById('modal-name').innerText = name;
|
1593 |
-
document.getElementById('modal-price').innerText = `$${price}`;
|
1594 |
-
const modalImg = document.getElementById('modal-img');
|
1595 |
-
modalImg.src = image || '/static/placeholder.jpg';
|
1596 |
-
document.getElementById('modal-description').innerText = description || 'No description available.';
|
1597 |
-
document.getElementById('modal-ingredients').innerText = ingredients || 'Not specified';
|
1598 |
-
document.getElementById('modal-nutrition').innerText = nutritionalInfo || 'Not available';
|
1599 |
-
document.getElementById('modal-allergens').innerText = allergens || 'None listed';
|
1600 |
-
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
1601 |
-
document.getElementById('modal-instructions').value = '';
|
1602 |
-
const modalSectionEl = document.getElementById('modal-section');
|
1603 |
-
modalSectionEl.setAttribute('data-section', section);
|
1604 |
-
modalSectionEl.setAttribute('data-category', selectedCategory);
|
1605 |
-
document.getElementById('quantityInput').value = 1;
|
1606 |
-
|
1607 |
-
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
|
1608 |
-
.then(response => response.json())
|
1609 |
-
.then(data => {
|
1610 |
-
const addonsList = document.getElementById('addons-list');
|
1611 |
-
addonsList.innerHTML = '';
|
1612 |
-
if (!data.success || !data.addons || data.addons.length === 0) {
|
1613 |
-
addonsList.innerHTML = '<p>No customization options available.</p>';
|
1614 |
-
return;
|
1615 |
-
}
|
1616 |
-
data.addons.forEach(addon => {
|
1617 |
-
const sectionDiv = document.createElement('div');
|
1618 |
-
sectionDiv.classList.add('addon-section');
|
1619 |
-
const title = document.createElement('h6');
|
1620 |
-
title.innerText = addon.name;
|
1621 |
-
sectionDiv.appendChild(title);
|
1622 |
-
const optionsContainer = document.createElement('div');
|
1623 |
-
addon.options.forEach((option, index) => {
|
1624 |
-
const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
|
1625 |
-
const listItem = document.createElement('div');
|
1626 |
-
listItem.classList.add('form-check');
|
1627 |
-
listItem.innerHTML = `
|
1628 |
-
<input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
|
1629 |
-
data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
|
1630 |
-
<label class="form-check-label" for="${optionId}">
|
1631 |
-
${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
|
1632 |
-
</label>
|
1633 |
-
`;
|
1634 |
-
optionsContainer.appendChild(listItem);
|
1635 |
-
});
|
1636 |
-
sectionDiv.appendChild(optionsContainer);
|
1637 |
-
addonsList.appendChild(sectionDiv);
|
1638 |
-
});
|
1639 |
-
})
|
1640 |
-
.catch(err => {
|
1641 |
-
console.error('Error fetching add-ons:', err);
|
1642 |
-
document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
|
1643 |
-
});
|
1644 |
-
}
|
1645 |
-
|
1646 |
-
document.addEventListener('click', function(event) {
|
1647 |
-
if (event.target.classList.contains('addon-option')) {
|
1648 |
-
handleAddonClick(event.target);
|
1649 |
-
}
|
1650 |
-
});
|
1651 |
-
|
1652 |
-
function handleAddonClick(checkbox) {
|
1653 |
-
const groupName = checkbox.getAttribute('data-group');
|
1654 |
-
const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo","Beverages","Sauces"].includes(groupName);
|
1655 |
-
if (!isMultiSelectGroup) {
|
1656 |
-
const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
|
1657 |
-
checkboxes.forEach(otherCheckbox => {
|
1658 |
-
if (otherCheckbox !== checkbox) {
|
1659 |
-
otherCheckbox.checked = false;
|
1660 |
-
}
|
1661 |
-
});
|
1662 |
-
}
|
1663 |
-
}
|
1664 |
-
|
1665 |
-
function addToCartFromModal() {
|
1666 |
-
const itemName = document.getElementById('modal-name').innerText;
|
1667 |
-
let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
|
1668 |
-
if (isNaN(itemPrice)) {
|
1669 |
-
alert('Invalid price for the item. Please check the item details.');
|
1670 |
-
return;
|
1671 |
-
}
|
1672 |
-
const itemImage = document.getElementById('modal-img').src;
|
1673 |
-
const modalSectionEl = document.getElementById('modal-section');
|
1674 |
-
const section = modalSectionEl.getAttribute('data-section');
|
1675 |
-
const selectedCategory = modalSectionEl.getAttribute('data-category');
|
1676 |
-
if (!itemName || !itemPrice || !section || !itemImage) {
|
1677 |
-
console.error('Missing data for cart item:', { itemName, itemPrice, section, itemImage });
|
1678 |
-
return;
|
1679 |
-
}
|
1680 |
-
const selectedAddOns = Array.from(
|
1681 |
-
document.querySelectorAll('#addons-list input[type="checkbox"]:checked')
|
1682 |
-
).map(addon => ({
|
1683 |
-
name: addon.getAttribute('data-name') || 'Default Name',
|
1684 |
-
price: parseFloat(addon.getAttribute('data-price') || 0)
|
1685 |
-
}));
|
1686 |
-
const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
|
1687 |
-
const instructions = document.getElementById('modal-instructions').value;
|
1688 |
-
const cartPayload = {
|
1689 |
-
itemName: itemName,
|
1690 |
-
itemPrice: itemPrice,
|
1691 |
-
itemImage: itemImage,
|
1692 |
-
section: section,
|
1693 |
-
category: selectedCategory,
|
1694 |
-
addons: selectedAddOns,
|
1695 |
-
instructions: instructions,
|
1696 |
-
quantity: quantity
|
1697 |
-
};
|
1698 |
-
|
1699 |
-
fetch('/cart/add', {
|
1700 |
-
method: 'POST',
|
1701 |
-
headers: {
|
1702 |
-
'Content-Type': 'application/json',
|
1703 |
-
},
|
1704 |
-
body: JSON.stringify(cartPayload)
|
1705 |
-
})
|
1706 |
-
.then(response => response.json())
|
1707 |
-
.then(data => {
|
1708 |
-
if (data.success) {
|
1709 |
-
alert('Item added to cart successfully!');
|
1710 |
-
updateCartUI(data.cart);
|
1711 |
-
const modal = document.getElementById('itemModal');
|
1712 |
-
const modalInstance = bootstrap.Modal.getInstance(modal);
|
1713 |
-
modalInstance.hide();
|
1714 |
-
} else {
|
1715 |
-
console.error('Failed to add item to cart:', data.error);
|
1716 |
-
alert(data.error || 'Failed to add item to cart.');
|
1717 |
-
}
|
1718 |
-
})
|
1719 |
-
.catch(err => {
|
1720 |
-
console.error('Error adding item to cart:', err);
|
1721 |
-
const cart = addToCartLocalStorage(cartPayload);
|
1722 |
-
updateCartUI(cart);
|
1723 |
-
const modal = document.getElementById('itemModal');
|
1724 |
-
const modalInstance = bootstrap.Modal.getInstance(modal);
|
1725 |
-
modalInstance.hide();
|
1726 |
-
});
|
1727 |
-
}
|
1728 |
</script>
|
1729 |
</body>
|
1730 |
</html>
|
|
|
49 |
border-radius: 15px 15px 0 0;
|
50 |
opacity: 0;
|
51 |
transition: opacity 0.5s ease-in-out;
|
52 |
+
background-color: #000;
|
53 |
}
|
54 |
.menu-video.loaded {
|
55 |
opacity: 1;
|
56 |
}
|
57 |
.menu-card:hover .menu-video {
|
58 |
opacity: 1;
|
59 |
+
transform: scale(1.05);
|
60 |
}
|
61 |
.menu-card .card-body .card-title {
|
62 |
font-size: 1.2rem;
|
|
|
118 |
border-color: #0D9232;
|
119 |
transform: scale(1.05);
|
120 |
}
|
121 |
+
/* Avatar Styles */
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
.avatar-dropdown-container {
|
123 |
position: absolute;
|
124 |
+
right: 20px;
|
125 |
top: 50%;
|
126 |
transform: translateY(-50%);
|
127 |
display: flex;
|
128 |
+
align-items: center;
|
129 |
justify-content: center;
|
130 |
}
|
131 |
.avatar-icon {
|
132 |
width: 40px;
|
133 |
height: 40px;
|
134 |
border-radius: 50%;
|
|
|
135 |
cursor: pointer;
|
136 |
display: flex;
|
137 |
align-items: center;
|
138 |
justify-content: center;
|
139 |
+
overflow: hidden;
|
140 |
+
background-color: #007bff;
|
141 |
+
transition: transform 0.2s ease;
|
142 |
color: white;
|
|
|
143 |
font-weight: bold;
|
144 |
+
font-size: 18px;
|
145 |
+
}
|
146 |
+
.avatar-icon img {
|
147 |
+
width: 100%;
|
148 |
+
height: 100%;
|
149 |
+
object-fit: cover;
|
150 |
+
}
|
151 |
+
.avatar-icon:hover {
|
152 |
+
transform: scale(1.1);
|
153 |
}
|
154 |
.dropdown-menu {
|
155 |
position: absolute;
|
|
|
178 |
background-color: #ffe4c4;
|
179 |
color: #333;
|
180 |
}
|
181 |
+
/* Avatar Modal Styles */
|
182 |
+
.avatar-modal .modal-content {
|
183 |
+
border-radius: 20px;
|
184 |
+
overflow: hidden;
|
185 |
+
}
|
186 |
+
.avatar-modal-img {
|
187 |
+
width: 300px;
|
188 |
+
height: 300px;
|
189 |
+
border-radius: 50%;
|
190 |
+
object-fit: cover;
|
191 |
+
margin: 20px auto;
|
192 |
+
border: 4px solid #0FAA39;
|
193 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
|
194 |
+
display: block;
|
195 |
+
}
|
196 |
.fixed-top-bar {
|
197 |
position: relative;
|
198 |
top: 0;
|
|
|
216 |
align-items: center;
|
217 |
width: 300px;
|
218 |
max-width: 90%;
|
|
|
219 |
}
|
220 |
.search-bar-container input {
|
221 |
width: 100%;
|
|
|
270 |
.autocomplete-suggestions .suggestion-item:hover {
|
271 |
background-color: #f1f1f1;
|
272 |
}
|
273 |
+
/* Add rest of your existing CSS here */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
.bottom-action-bar {
|
275 |
position: fixed;
|
276 |
bottom: 0;
|
|
|
294 |
font-weight: bold;
|
295 |
font-size: 16px;
|
296 |
color: white;
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
}
|
298 |
.bottom-action-bar .btn-order-history {
|
299 |
background-color: #FFA07A;
|
300 |
border-color: #FFA07A;
|
301 |
}
|
|
|
|
|
|
|
|
|
302 |
.bottom-action-bar .btn-view-cart {
|
303 |
background-color: #0FAA39;
|
304 |
border-color: #0FAA39;
|
305 |
}
|
|
|
|
|
|
|
|
|
306 |
.cart-icon-badge {
|
307 |
background-color: white;
|
308 |
color: #0FAA39;
|
|
|
315 |
font-size: 12px;
|
316 |
margin-left: 8px;
|
317 |
}
|
|
|
|
|
318 |
.mic-popup {
|
319 |
position: fixed;
|
320 |
top: 50%;
|
|
|
329 |
display: none;
|
330 |
width: 300px;
|
331 |
max-width: 90%;
|
|
|
332 |
}
|
|
|
333 |
.mic-popup.active {
|
334 |
display: block;
|
335 |
}
|
|
|
336 |
.mic-popup-icon {
|
337 |
font-size: 48px;
|
338 |
margin-bottom: 20px;
|
339 |
color: #ff4444;
|
340 |
animation: pulse 1.5s infinite;
|
341 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
@keyframes pulse {
|
343 |
0% { transform: scale(1); }
|
344 |
50% { transform: scale(1.1); }
|
345 |
100% { transform: scale(1); }
|
346 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
</style>
|
348 |
</head>
|
349 |
<body>
|
350 |
+
<!-- Fixed Top Bar with Avatar Dropdown -->
|
351 |
<div class="fixed-top-bar">
|
352 |
<div class="avatar-dropdown-container">
|
353 |
+
<div class="avatar-icon" id="avatarIcon">
|
354 |
+
{% if user_avatar %}
|
355 |
+
<img src="{{ user_avatar }}" alt="User Avatar" onerror="this.parentElement.innerHTML = '{{ first_letter }}';">
|
356 |
+
{% else %}
|
357 |
+
<span>{{ first_letter }}</span>
|
358 |
+
{% endif %}
|
359 |
</div>
|
360 |
+
<div class="dropdown-menu" id="avatarDropdown">
|
361 |
+
{% if user_avatar %}
|
362 |
+
<div class="dropdown-item" id="viewAvatar">View Avatar</div>
|
363 |
+
<div class="dropdown-item" id="deleteAvatar">Delete Avatar</div>
|
364 |
+
{% endif %}
|
365 |
+
<div class="dropdown-item">
|
366 |
+
<label for="avatarUpload" style="cursor: pointer;">Upload Avatar</label>
|
367 |
+
<input type="file" id="avatarUpload" accept="image/*" hidden>
|
368 |
+
</div>
|
369 |
<a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
|
370 |
<a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
|
371 |
<a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
|
|
|
379 |
</div>
|
380 |
</div>
|
381 |
|
382 |
+
<!-- Avatar Modal -->
|
383 |
+
<div class="modal fade avatar-modal" id="avatarModal" tabindex="-1" aria-labelledby="avatarModalLabel" aria-hidden="true">
|
384 |
+
<div class="modal-dialog modal-dialog-centered">
|
385 |
+
<div class="modal-content">
|
386 |
+
<div class="modal-header">
|
387 |
+
<h5 class="modal-title" id="avatarModalLabel">Profile Picture</h5>
|
388 |
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
389 |
+
</div>
|
390 |
+
<div class="modal-body text-center">
|
391 |
+
<img id="avatarModalImage" class="avatar-modal-img" alt="Avatar" src="{{ user_avatar | default('/static/default-avatar.jpg') }}">
|
392 |
+
</div>
|
393 |
+
<div class="modal-footer">
|
394 |
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
395 |
+
</div>
|
396 |
+
</div>
|
397 |
+
</div>
|
398 |
+
</div>
|
399 |
+
|
400 |
+
<!-- Menu Content -->
|
401 |
<form method="get" action="/menu" class="text-center mb-4" id="categoryForm">
|
402 |
<label class="form-label fw-bold">Select a Category:</label>
|
403 |
<div class="category-buttons">
|
|
|
505 |
{% endif %}
|
506 |
</div>
|
507 |
|
508 |
+
<!-- Bottom Action Bar -->
|
509 |
<div class="bottom-action-bar">
|
510 |
<a href="{{ url_for('orderhistory.order_history') }}" class="btn btn-order-history">
|
511 |
<i class="bi bi-clock-history"></i> Order History
|
|
|
516 |
</a>
|
517 |
</div>
|
518 |
|
519 |
+
<!-- Item Modal -->
|
520 |
<div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
|
521 |
<div class="modal-dialog modal-dialog-centered">
|
522 |
<div class="modal-content">
|
|
|
556 |
</div>
|
557 |
</div>
|
558 |
|
559 |
+
<!-- Soft Drink Modal -->
|
560 |
<div class="modal fade" id="softDrinkModal" tabindex="-1" aria-labelledby="softDrinkModalLabel" aria-hidden="true">
|
561 |
<div class="modal-dialog modal-dialog-centered">
|
562 |
<div class="modal-content" style="border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
|
|
|
568 |
<div class="text-center mb-4">
|
569 |
<img id="soft-drink-image" class="img-fluid rounded mb-3" alt="Soft Drink Image" style="max-height: 150px; width: auto; object-fit: contain;">
|
570 |
<h5 id="soft-drink-name" class="fw-bold" style="color: #333;"></h5>
|
571 |
+
<p id="soft-drink-price" style="font-size: 1.1rem;"></p>
|
572 |
</div>
|
573 |
<div class="d-flex justify-content-center align-items-center mb-4">
|
574 |
<div class="quantity-selector" style="background-color: #f8f9fa; padding: 10px; border-radius: 10px;">
|
|
|
596 |
|
597 |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
598 |
<script>
|
599 |
+
// Initial data from Flask
|
600 |
+
const firstLetter = "{{ first_letter | default('G') }}";
|
601 |
+
let userAvatar = "{{ user_avatar | default('') }}";
|
602 |
+
|
603 |
+
// Menu item details
|
604 |
const menuItemDetails = {
|
605 |
{% for section, items in ordered_menu.items() %}
|
606 |
{% for item in items %}
|
|
|
627 |
|
628 |
const ingredientsList = [
|
629 |
"Basmati Rice", "Bell Pepper", "Biryani Masala", "Butter", "Capsicum", "Cauliflower",
|
630 |
+
"Chickpea Flour (Besan)", "Chickpeas (Channa)", "Chili Powder", "Chili Sauce",
|
631 |
+
// Add rest of your ingredients here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
];
|
633 |
|
634 |
+
// LocalStorage cart functions
|
635 |
function addToCartLocalStorage(payload) {
|
636 |
let cart = JSON.parse(localStorage.getItem('cart')) || [];
|
637 |
const existingItem = cart.find(item =>
|
|
|
648 |
return cart;
|
649 |
}
|
650 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
651 |
function getCartLocalStorage() {
|
652 |
return JSON.parse(localStorage.getItem('cart')) || [];
|
653 |
}
|
654 |
|
655 |
+
// Avatar functions
|
656 |
+
function updateAvatarUI(imageSrc) {
|
657 |
+
const avatarIcon = document.getElementById('avatarIcon');
|
658 |
+
const avatarDropdown = document.getElementById('avatarDropdown');
|
659 |
+
avatarIcon.innerHTML = `<img src="${imageSrc}" alt="User Avatar" onerror="this.parentElement.innerHTML = '${firstLetter}';">`;
|
660 |
+
avatarDropdown.innerHTML = `
|
661 |
+
<div class="dropdown-item" id="viewAvatar">View Avatar</div>
|
662 |
+
<div class="dropdown-item" id="deleteAvatar">Delete Avatar</div>
|
663 |
+
<div class="dropdown-item">
|
664 |
+
<label for="avatarUpload" style="cursor: pointer;">Upload Avatar</label>
|
665 |
+
<input type="file" id="avatarUpload" accept="image/*" hidden>
|
666 |
+
</div>
|
667 |
+
<a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
|
668 |
+
<a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
|
669 |
+
<a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
|
670 |
+
`;
|
671 |
+
attachAvatarEventListeners();
|
672 |
}
|
673 |
|
674 |
+
function resetAvatarUI() {
|
675 |
+
const avatarIcon = document.getElementById('avatarIcon');
|
676 |
+
const avatarDropdown = document.getElementById('avatarDropdown');
|
677 |
+
avatarIcon.innerHTML = `<span>${firstLetter}</span>`;
|
678 |
+
avatarDropdown.innerHTML = `
|
679 |
+
<div class="dropdown-item">
|
680 |
+
<label for="avatarUpload" style="cursor: pointer;">Upload Avatar</label>
|
681 |
+
<input type="file" id="avatarUpload" accept="image/*" hidden>
|
682 |
+
</div>
|
683 |
+
<a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
|
684 |
+
<a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
|
685 |
+
<a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
|
686 |
+
`;
|
687 |
+
attachAvatarEventListeners();
|
|
|
688 |
}
|
689 |
|
690 |
+
function attachAvatarEventListeners() {
|
691 |
+
const avatarIcon = document.getElementById('avatarIcon');
|
692 |
+
const avatarDropdown = document.getElementById('avatarDropdown');
|
693 |
+
const avatarUpload = document.getElementById('avatarUpload');
|
694 |
+
const viewAvatar = document.getElementById('viewAvatar');
|
695 |
+
const deleteAvatar = document.getElementById('deleteAvatar');
|
696 |
+
|
697 |
+
avatarIcon.addEventListener('click', (e) => {
|
698 |
+
e.stopPropagation();
|
699 |
+
avatarDropdown.style.display = avatarDropdown.style.display === 'block' ? 'none' : 'block';
|
700 |
+
});
|
701 |
+
|
702 |
+
document.addEventListener('click', (e) => {
|
703 |
+
if (!avatarIcon.contains(e.target) && !avatarDropdown.contains(e.target)) {
|
704 |
+
avatarDropdown.style.display = 'none';
|
705 |
+
}
|
706 |
+
});
|
707 |
+
|
708 |
+
if (avatarUpload) {
|
709 |
+
avatarUpload.addEventListener('change', handleAvatarUpload);
|
710 |
+
}
|
711 |
+
if (viewAvatar) {
|
712 |
+
viewAvatar.addEventListener('click', () => {
|
713 |
+
const avatarImg = avatarIcon.querySelector('img');
|
714 |
+
if (avatarImg) {
|
715 |
+
document.getElementById('avatarModalImage').src = avatarImg.src;
|
716 |
+
const modal = new bootstrap.Modal(document.getElementById('avatarModal'));
|
717 |
+
modal.show();
|
718 |
+
}
|
719 |
+
});
|
720 |
+
}
|
721 |
+
if (deleteAvatar) {
|
722 |
+
deleteAvatar.addEventListener('click', handleAvatarDelete);
|
723 |
+
}
|
724 |
+
}
|
725 |
+
|
726 |
+
function handleAvatarUpload(e) {
|
727 |
+
const file = e.target.files[0];
|
728 |
+
if (!file) return;
|
729 |
+
|
730 |
+
const maxSizeMB = 50;
|
731 |
+
if (file.size > maxSizeMB * 1024 * 1024) {
|
732 |
+
alert(`File size exceeds ${maxSizeMB}MB limit`);
|
733 |
+
return;
|
734 |
+
}
|
735 |
+
|
736 |
+
const reader = new FileReader();
|
737 |
+
reader.onload = (e) => {
|
738 |
+
const imageData = e.target.result;
|
739 |
+
uploadAvatarToServer(imageData);
|
740 |
};
|
741 |
+
reader.readAsDataURL(file);
|
742 |
+
}
|
743 |
+
|
744 |
+
function uploadAvatarToServer(imageData) {
|
745 |
+
fetch('/upload_avatar', {
|
746 |
method: 'POST',
|
747 |
headers: {
|
748 |
'Content-Type': 'application/json',
|
749 |
},
|
750 |
+
body: JSON.stringify({ image: imageData })
|
751 |
+
})
|
752 |
+
.then(response => {
|
753 |
+
if (!response.ok) throw new Error('Upload failed');
|
754 |
+
return response.json();
|
755 |
})
|
|
|
756 |
.then(data => {
|
757 |
if (data.success) {
|
758 |
+
userAvatar = data.image_url || imageData;
|
759 |
+
updateAvatarUI(userAvatar);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
760 |
}
|
761 |
})
|
762 |
+
.catch(error => {
|
763 |
+
console.error('Error uploading avatar:', error);
|
764 |
+
alert('Failed to upload avatar. Please try again.');
|
|
|
|
|
|
|
765 |
});
|
766 |
}
|
767 |
|
768 |
+
function handleAvatarDelete() {
|
769 |
+
if (!confirm('Are you sure you want to delete your avatar?')) return;
|
|
|
|
|
|
|
770 |
|
771 |
+
fetch('/delete_avatar', {
|
772 |
+
method: 'POST',
|
773 |
+
headers: {
|
774 |
+
'Content-Type': 'application/json'
|
775 |
+
}
|
776 |
+
})
|
777 |
+
.then(response => {
|
778 |
+
if (!response.ok) throw new Error('Deletion failed');
|
779 |
+
return response.json();
|
780 |
+
})
|
781 |
+
.then(data => {
|
782 |
+
if (data.success) {
|
783 |
+
userAvatar = '';
|
784 |
+
resetAvatarUI();
|
785 |
+
}
|
786 |
+
})
|
787 |
+
.catch(error => {
|
788 |
+
console.error('Error deleting avatar:', error);
|
789 |
+
alert('Failed to delete avatar. Please try again.');
|
790 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
791 |
}
|
792 |
|
793 |
+
// Main DOMContentLoaded event listener
|
794 |
document.addEventListener('DOMContentLoaded', function () {
|
795 |
+
attachAvatarEventListeners();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
796 |
|
797 |
const menuCards = document.querySelectorAll('.menu-card');
|
798 |
const menuVideos = document.querySelectorAll('.menu-video');
|
799 |
+
const cardObserver = new IntersectionObserver((entries) => {
|
800 |
entries.forEach(entry => {
|
801 |
if (entry.isIntersecting) {
|
802 |
entry.target.classList.add('visible');
|
803 |
+
cardObserver.unobserve(entry.target);
|
804 |
}
|
805 |
});
|
806 |
+
}, { rootMargin: '0px', threshold: 0.1 });
|
807 |
+
const videoObserver = new IntersectionObserver((entries) => {
|
|
|
|
|
|
|
|
|
808 |
entries.forEach(entry => {
|
809 |
if (entry.isIntersecting) {
|
810 |
const video = entry.target;
|
811 |
const src = video.getAttribute('data-src');
|
812 |
if (src && !video.querySelector('source[src="' + src + '"]')) {
|
813 |
+
video.querySelector('source').src = src;
|
|
|
814 |
video.load();
|
815 |
}
|
816 |
video.classList.add('loaded');
|
817 |
+
videoObserver.unobserve(video);
|
818 |
}
|
819 |
});
|
820 |
+
}, { rootMargin: '200px', threshold: 0.01 });
|
|
|
|
|
|
|
|
|
821 |
menuCards.forEach(card => cardObserver.observe(card));
|
822 |
menuVideos.forEach(video => videoObserver.observe(video));
|
823 |
|
|
|
827 |
const itemName = this.getAttribute('data-item-name').replace(/ /g, '-');
|
828 |
const detailsDiv = document.getElementById(`details-${itemName}`);
|
829 |
const isCurrentlyShown = detailsDiv.classList.contains('show');
|
|
|
830 |
document.querySelectorAll('.item-details.show').forEach(otherDetails => {
|
831 |
if (otherDetails !== detailsDiv) {
|
832 |
otherDetails.classList.remove('show');
|
833 |
const otherLink = otherDetails.previousElementSibling.querySelector('.toggle-details');
|
834 |
+
if (otherLink) otherLink.innerText = 'Show Details';
|
|
|
|
|
835 |
}
|
836 |
});
|
837 |
+
detailsDiv.classList.toggle('show');
|
838 |
+
this.innerText = isCurrentlyShown ? 'Show Details' : 'Hide Details';
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
});
|
840 |
});
|
841 |
|
|
|
854 |
categoryForm.submit();
|
855 |
});
|
856 |
});
|
857 |
+
|
858 |
const searchBar = document.getElementById('searchBar');
|
859 |
const suggestionsContainer = document.getElementById('autocompleteSuggestions');
|
860 |
searchBar.addEventListener('input', function () {
|
|
|
882 |
}
|
883 |
filterMenu();
|
884 |
});
|
885 |
+
|
886 |
+
// Soft Drink Modal Logic
|
887 |
+
function showSoftDrinkModal(button) {
|
888 |
+
currentSoftDrinkButton = button;
|
889 |
+
const buttonContainer = button.closest('.button-container');
|
890 |
+
const itemName = buttonContainer.getAttribute('data-item-name');
|
891 |
+
const itemPrice = buttonContainer.getAttribute('data-item-price');
|
892 |
+
const itemImage = buttonContainer.getAttribute('data-item-image');
|
893 |
+
|
894 |
+
document.getElementById('soft-drink-name').textContent = itemName;
|
895 |
+
document.getElementById('soft-drink-price').textContent = `$${itemPrice}`;
|
896 |
+
document.getElementById('soft-drink-quantity').value = '1';
|
897 |
+
document.getElementById('soft-drink-image').src = itemImage || '/static/placeholder.jpg';
|
898 |
+
|
899 |
+
const modal = new bootstrap.Modal(document.getElementById('softDrinkModal'));
|
900 |
+
modal.show();
|
901 |
+
}
|
902 |
+
|
903 |
+
function addSoftDrinkToCart() {
|
904 |
+
if (!currentSoftDrinkButton) return;
|
905 |
+
|
906 |
+
const buttonContainer = currentSoftDrinkButton.closest('.button-container');
|
907 |
+
const quantity = parseInt(document.getElementById('soft-drink-quantity').value) || 1;
|
908 |
+
const itemName = buttonContainer.getAttribute('data-item-name');
|
909 |
+
const itemPrice = parseFloat(buttonContainer.getAttribute('data-item-price'));
|
910 |
+
const itemImage = buttonContainer.getAttribute('data-item-image');
|
911 |
+
const section = buttonContainer.getAttribute('data-item-section');
|
912 |
+
const selectedCategory = buttonContainer.getAttribute('data-item-category');
|
913 |
+
|
914 |
+
const cartPayload = {
|
915 |
+
itemName: itemName,
|
916 |
+
itemPrice: itemPrice,
|
917 |
+
itemImage: itemImage,
|
918 |
+
section: section,
|
919 |
+
category: selectedCategory,
|
920 |
+
addons: [],
|
921 |
+
instructions: '',
|
922 |
+
quantity: quantity
|
923 |
+
};
|
924 |
+
|
925 |
+
fetch('/cart/add', {
|
926 |
+
method: 'POST',
|
927 |
+
headers: { 'Content-Type': 'application/json' },
|
928 |
+
body: JSON.stringify(cartPayload)
|
929 |
+
})
|
930 |
+
.then(response => response.json())
|
931 |
+
.then(data => {
|
932 |
+
if (data.success) {
|
933 |
+
updateCartUI(data.cart);
|
934 |
+
const modal = bootstrap.Modal.getInstance(document.getElementById('softDrinkModal'));
|
935 |
+
modal.hide();
|
936 |
+
} else {
|
937 |
+
const cart = addToCartLocalStorage(cartPayload);
|
938 |
+
updateCartUI(cart);
|
939 |
+
const modal = bootstrap.Modal.getInstance(document.getElementById('softDrinkModal'));
|
940 |
+
modal.hide();
|
941 |
}
|
942 |
+
});
|
943 |
+
}
|
944 |
+
|
945 |
+
function updateCartUI(cart) {
|
946 |
+
if (!Array.isArray(cart)) return;
|
947 |
+
let totalQuantity = cart.reduce((sum, item) => sum + item.quantity, 0);
|
948 |
+
const cartItemCount = document.getElementById('cart-item-count');
|
949 |
+
if (cartItemCount) {
|
950 |
+
cartItemCount.innerText = totalQuantity;
|
951 |
+
cartItemCount.style.display = totalQuantity > 0 ? 'inline-flex' : 'none';
|
952 |
}
|
953 |
+
}
|
954 |
+
|
955 |
+
function showItemDetails(name, price, image, description, ingredients, nutritionalInfo, allergens, section, selectedCategory) {
|
956 |
+
document.getElementById('modal-name').innerText = name;
|
957 |
+
document.getElementById('modal-price').innerText = `$${price}`;
|
958 |
+
document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
|
959 |
+
document.getElementById('modal-description').innerText = description;
|
960 |
+
document.getElementById('modal-ingredients').innerText = ingredients;
|
961 |
+
document.getElementById('modal-nutrition').innerText = nutritionalInfo;
|
962 |
+
document.getElementById('modal-allergens').innerText = allergens;
|
963 |
+
document.getElementById('modal-instructions').value = '';
|
964 |
+
document.getElementById('modal-section').setAttribute('data-section', section);
|
965 |
+
document.getElementById('modal-section').setAttribute('data-category', selectedCategory);
|
966 |
+
document.getElementById('quantityInput').value = 1;
|
967 |
+
|
968 |
+
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
|
969 |
+
.then(response => response.json())
|
970 |
+
.then(data => {
|
971 |
+
const addonsList = document.getElementById('addons-list');
|
972 |
+
addonsList.innerHTML = data.success && data.addons.length ? '' : '<p>No customization options available.</p>';
|
973 |
+
if (data.success && data.addons) {
|
974 |
+
data.addons.forEach(addon => {
|
975 |
+
const sectionDiv = document.createElement('div');
|
976 |
+
sectionDiv.classList.add('addon-section');
|
977 |
+
sectionDiv.innerHTML = `<h6>${addon.name}</h6>`;
|
978 |
+
addon.options.forEach((option, index) => {
|
979 |
+
const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
|
980 |
+
sectionDiv.innerHTML += `
|
981 |
+
<div class="form-check">
|
982 |
+
<input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
|
983 |
+
data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
|
984 |
+
<label class="form-check-label" for="${optionId}">${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}</label>
|
985 |
+
</div>
|
986 |
+
`;
|
987 |
});
|
988 |
+
addonsList.appendChild(sectionDiv);
|
989 |
});
|
|
|
990 |
}
|
991 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
992 |
}
|
993 |
+
|
994 |
+
function addToCartFromModal() {
|
995 |
+
const itemName = document.getElementById('modal-name').innerText;
|
996 |
+
let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
|
997 |
+
const itemImage = document.getElementById('modal-img').src;
|
998 |
+
const section = document.getElementById('modal-section').getAttribute('data-section');
|
999 |
+
const selectedCategory = document.getElementById('modal-section').getAttribute('data-category');
|
1000 |
+
const selectedAddOns = Array.from(document.querySelectorAll('#addons-list input[type="checkbox"]:checked')).map(addon => ({
|
1001 |
+
name: addon.getAttribute('data-name'),
|
1002 |
+
price: parseFloat(addon.getAttribute('data-price') || 0)
|
1003 |
+
}));
|
1004 |
+
const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
|
1005 |
+
const instructions = document.getElementById('modal-instructions').value;
|
1006 |
+
|
1007 |
+
const cartPayload = {
|
1008 |
+
itemName: itemName,
|
1009 |
+
itemPrice: itemPrice,
|
1010 |
+
itemImage: itemImage,
|
1011 |
+
section: section,
|
1012 |
+
category: selectedCategory,
|
1013 |
+
addons: selectedAddOns,
|
1014 |
+
instructions: instructions,
|
1015 |
+
quantity: quantity
|
1016 |
+
};
|
1017 |
+
|
1018 |
+
fetch('/cart/add', {
|
1019 |
+
method: 'POST',
|
1020 |
+
headers: { 'Content-Type': 'application/json' },
|
1021 |
+
body: JSON.stringify(cartPayload)
|
1022 |
})
|
1023 |
+
.then(response => response.json())
|
1024 |
.then(data => {
|
1025 |
if (data.success) {
|
1026 |
updateCartUI(data.cart);
|
1027 |
+
bootstrap.Modal.getInstance(document.getElementById('itemModal')).hide();
|
1028 |
} else {
|
1029 |
+
const cart = addToCartLocalStorage(cartPayload);
|
|
|
1030 |
updateCartUI(cart);
|
1031 |
+
bootstrap.Modal.getInstance(document.getElementById('itemModal')).hide();
|
1032 |
}
|
|
|
|
|
|
|
|
|
|
|
1033 |
});
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
// Quantity controls
|
1037 |
+
document.getElementById('decreaseQuantity').addEventListener('click', () => {
|
1038 |
+
let qty = parseInt(document.getElementById('quantityInput').value);
|
1039 |
+
if (qty > 1) document.getElementById('quantityInput').value = qty - 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1040 |
});
|
1041 |
+
document.getElementById('increaseQuantity').addEventListener('click', () => {
|
1042 |
+
let qty = parseInt(document.getElementById('quantityInput').value);
|
1043 |
+
document.getElementById('quantityInput').value = qty + 1;
|
|
|
1044 |
});
|
1045 |
+
document.getElementById('soft-drink-decrease').addEventListener('click', () => {
|
1046 |
+
let qty = parseInt(document.getElementById('soft-drink-quantity').value);
|
1047 |
+
if (qty > 1) document.getElementById('soft-drink-quantity').value = qty - 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1048 |
});
|
1049 |
+
document.getElementById('soft-drink-increase').addEventListener('click', () => {
|
1050 |
+
let qty = parseInt(document.getElementById('soft-drink-quantity').value);
|
1051 |
+
if (qty < 1000) document.getElementById('soft-drink-quantity').value = qty + 1;
|
|
|
|
|
|
|
|
|
1052 |
});
|
1053 |
|
1054 |
+
// Initial cart fetch
|
1055 |
+
fetch('/cart/get')
|
1056 |
+
.then(response => response.json())
|
1057 |
+
.then(data => {
|
1058 |
+
if (data.success) updateCartUI(data.cart);
|
1059 |
+
else updateCartUI(getCartLocalStorage());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1060 |
});
|
|
|
|
|
|
|
1061 |
});
|
1062 |
|
1063 |
function filterMenu() {
|
|
|
1068 |
items.forEach(item => {
|
1069 |
const itemName = item.querySelector('.card-title').innerText.toLowerCase();
|
1070 |
const itemSection = item.closest('.row').previousElementSibling.innerText.toLowerCase();
|
1071 |
+
if (itemName.includes(input) || itemSection.includes(input)) {
|
1072 |
item.style.display = 'block';
|
1073 |
item.classList.add('visible');
|
1074 |
matchedSections.add(item.closest('.row'));
|
|
|
1097 |
});
|
1098 |
}
|
1099 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1100 |
</script>
|
1101 |
</body>
|
1102 |
</html>
|