Spaces:
Sleeping
Sleeping
File size: 46,189 Bytes
cfd7e45 6cca62e cfd7e45 6cca62e cfd7e45 6cca62e 5808600 c5af6b0 f339271 62e5374 bf21ea3 62e5374 f339271 a13aecc f339271 62e5374 8b10ac4 f339271 62e5374 f339271 62e5374 4ccf2c2 1c3e0e1 8b10ac4 cca05d3 c382b75 eb4c992 9db9aae 7f69bb5 9db9aae 7f69bb5 eb4c992 f339271 67733fa f339271 f5bf323 346957f b31f0bb 9944db1 b31f0bb b278325 b31f0bb b278325 48c94c2 b278325 346957f 97c9072 346957f 97c9072 346957f f5bf323 346957f f5bf323 346957f 53c7c69 346957f f5bf323 346957f 93a7a7a a79edb2 346957f a79edb2 346957f b31f0bb f3a9c7e b31f0bb f3a9c7e 7b24b17 53c7c69 346957f 53c7c69 346957f 53c7c69 346957f 53c7c69 2b306e2 53c7c69 346957f 1d9239f 9b9af15 346957f 1d9239f 346957f f5bf323 346957f f5bf323 346957f a79edb2 346957f 9b9af15 346957f 1d9239f 9b9af15 346957f 9b9af15 346957f 1d9239f 346957f 1d9239f 346957f 9b9af15 f5bf323 9b9af15 346957f 9b9af15 346957f 9b9af15 346957f 1d9239f 346957f 9b9af15 346957f a79edb2 c5c7dcb 9db9aae 7f69bb5 82770c8 c5c7dcb 82770c8 c5c7dcb 82770c8 c5c7dcb 82770c8 c5c7dcb 82770c8 c5c7dcb 82770c8 1d9239f 82770c8 26e37f3 df40741 53c7c69 cfd7e45 346957f 690eb1e 53c7c69 f3a9c7e 53c7c69 559170c ddd5fdc 4feea18 53c7c69 00fc9cd d9ea887 b35554e 53c7c69 f3a9c7e 53c7c69 4d845ce 53c7c69 4d845ce bf68e16 53c7c69 bf68e16 53c7c69 bf68e16 b31f0bb bf68e16 53c7c69 bf68e16 6cca62e 53c7c69 df40741 314a610 53c7c69 df40741 2406853 df40741 6cca62e d22d613 6cd98ab 89dc310 813bd2f 89dc310 813bd2f 89dc310 813bd2f 89dc310 813bd2f d22d613 6cd98ab 9f871cf d22d613 9f871cf d22d613 9f871cf d22d613 9f871cf d22d613 9f871cf d22d613 9f871cf d22d613 9f871cf d22d613 061a460 d22d613 cae83b4 d22d613 26e37f3 df40741 364a449 29fa242 364a449 29fa242 364a449 29fa242 364a449 29fa242 26e37f3 473a621 26e37f3 473a621 26e37f3 29fa242 473a621 29fa242 473a621 29fa242 473a621 26e37f3 473a621 29fa242 473a621 29fa242 df40741 29fa242 d22d613 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Menu</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
<style>
/* subbu */
.addbutton .btn {
background: linear-gradient(135deg, #ffffff, #f0f0f0); /* Gradient white background */
color: green; /* Make text color transparent */
background-clip: text; /* Apply the gradient to the text */
-webkit-background-clip: text; /* For Safari compatibility */
border: 1px solid #90ee90; /* Light green border */
padding: 6px 15px; /* Smaller padding */
font-size: 14px; /* Smaller font size */
font-weight:bold;
border-radius: 5px; /* Optional: round the corners */
transition: background 0.3s ease, border-color 0.3s ease; /* Add transition effect for hover */
margin-left: 13px; /* Margin for positioning */
}
.addbutton .btn:hover {
background: linear-gradient(135deg, #f0f0f0, #ffffff); /* Reverse gradient for hover effect */
border-color: #28a745; /* Darker green border on hover */
background-clip: text; /* Ensure the gradient is clipped to the text on hover */
-webkit-background-clip: text; /* Safari compatibility */
}
.customisable-text {
color: #28a745; /* Same color as the "ADD" button */
font-size: 12px; /* Same font size as the "ADD" button */
margin-left: 5px;
margin-top:1px;
}
/* model */
/* .modal-footer {
display: flex;
align-items: center;
justify-content: space-between; /* Space between quantity controls and Add to Cart button */
padding: 10px;
}
.modal-footer .d-flex {
display: flex;
align-items: center;
gap: 10px; /* Space between quantity buttons */
}
.modal-footer .btn {
height: 40px; /* Set consistent button height */
padding: 0 15px; /* Adjust padding to fit inside the buttons */
}
.modal-footer .form-control {
width: 50px; /* Fixed width for quantity input */
height: 40px; /* Match the height of buttons */
text-align: center; /* Center the value inside the input */
}
.modal-footer .btn-primary {
background-color: #0FAA39; /* Green background for Add to Cart button */
border-color: #0FAA39; /* Border color to match button background */
font-weight: bold; /* Bold text */
padding: 10px 20px; /* Adjust padding to make the button look better */
height: 40px; /* Match the height with quantity buttons */
display: flex;
justify-content: center;
align-items: center;
width: auto; /* Auto width to adjust to button text */
border-radius: 5px; /* Rounded corners for the button */
}
.modal-footer .btn-outline-secondary {
height: 40px; /* Ensure quantity buttons are the same size */
width: 40px; /* Make sure the buttons are square */
border-radius: 5px; /* Rounded corners for the buttons */
}
@media (max-width: 576px) {
/* Responsive adjustments for smaller screens */
.modal-dialog {
max-width: 98%; /* Adjust modal width for smaller screens */
}
.modal-footer .btn {
height: 35px; /* Smaller buttons for small screens */
padding: 0 12px; /* Adjust padding to make the button look proportional */
}
.modal-footer .form-control {
width: 40px; /* Adjust input size for smaller screens */
height: 35px;
}
.modal-footer .d-flex {
gap: 8px; /* Reduce space between quantity buttons on smaller screens */
}
} */
body {
font-family: Arial, sans-serif;
background-color: #fdf4e3; /* Updated background color */
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
}
.container {
max-width: 900px;
}
.menu-card {
max-width: 350px;
border-radius: 15px;
overflow: hidden;
background-color: #fff;
margin: auto;
display: flex;
flex-direction: column;
}
.menu-image {
height: 200px; /* Fixed height */
width: 100%; /* Full width of the card */
object-fit: fill; /* Ensure the image covers the area and maintains the aspect ratio */
border-radius: 15px 15px 0 0; /* Rounded top corners */
}
.card-title {
font-size: 1.2rem;
font-weight: bold;
margin: 10px 0;
}
.card-text {
font-size: 1rem;
color: #6c757d;
}
.customize-btn {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
z-index: 2;
background: linear-gradient(92.29deg, rgba(63, 63, 63, 0.7) 4.75%, rgba(0, 0, 0, 0.7) 93.57%);
color: #fff;
border: none;
padding: 4px 12px; /* Reduced padding for smaller height */
border-radius: 5px 0px 0px 5px ;
display: flex;
align-items: center;
font-size: 12px; /* Slightly smaller text */
}
.customize-btn i {
margin-left: 5px; /* Icon spacing */
}
/* .customize-btn:hover {
background-color: #e08c00; /* Darker shade for hover effect */
transition: background-color 0.3s ease;
} *
.btn-primary {
font-size: 13px;
font-weight: bold;
border-radius: 5px;
width: 100px;
background-color: #0FAA39; /* Updated button background color */
border-color: #0FAA39;
}
.btn-primary:hover {
background-color: #0FAA39;
border-color: #0FAA39;
}
.btn-primary:active,
.btn-primary:focus {
background-color: #0FAA39;
border-color: #ffffff;
box-shadow: none;
}
.view-cart-container {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 999;
}
.view-cart-button {
background-color: #0FAA39; /* Updated View Cart button background color */
color: #fff;
padding: 10px 20px;
border-radius: 30px;
font-size: 1rem;
font-weight: bold;
text-decoration: none;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
}
.view-cart-button:hover {
background-color: #109835; /* Slightly darker shade for hover effect */
text-decoration: none;
}
.avatar-dropdown-container {
position: relative;
}
.avatar-icon {
width: 40px;
height: 40px;
border-radius: 50%;
background-color: #5bbfc1;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 20px;
font-weight: bold;
}
.dropdown-menu {
position: absolute;
right: 0;
top: 100%;
background-color: #fff;
border-radius: 5px;
width: 200px; /* Adjust width as needed */
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
display: none;
}
.avatar-dropdown-container:hover .dropdown-menu {
display: block;
}
.avatar-dropdown-container {
position: absolute;
right: 20px; /* Adjust the value as needed to position it properly */
top: 50%; /* Adjust top to place it within the header */
transform: translateY(-50%); /* Correct the alignment to be perfectly centered */
display: flex;
align-items: right;
justify-content: center;
}
.dropdown-menu .dropdown-item {
padding: 10px 15px;
text-decoration: none;
color: #333;
border-bottom: 1px solid #ddd;
display: block; /* Make each item stack vertically */
}
.dropdown-menu .dropdown-item:last-child {
border-bottom: none; /* Remove the bottom border from the last item */
}
.dropdown-menu .dropdown-item:hover {
background-color: #f1f1f1;
}
.fixed-search-container {
position: absolute;
top: 90px; /* Move it slightly lower */
left: 50%;
transform: translateX(-50%);
width: 80%;
max-width: 600px;
z-index: 999; /* Keep it above content */
background-color: white;
padding: 10px;
border-radius: 25px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}
/* Ensure the category filter dropdown does not overlap */
form.text-center.mb-4 {
margin-top: 10px; /* No margin at the top */
margin-bottom: 0px; /* Small space at the bottom */
}
/* Ensure the container has enough margin so nothing is overlapped */
.container {
margin-top: 10px; /* Adjust spacing based on navbar and search bar */
padding-top: 0 !important; /* Ensure no padding is added by default */
}
h1.text-center {
margin-top: 10px; /* Reduced space above */
padding-top: 0 !important; /* Removed padding */
font-weight: semi-bold; /* Make the "Menu" text bold */
}
.fixed-top-bar {
/* Remove the fixed positioning */
position: relative; /* Change from fixed to relative */
top: 0;
left: 0;
width: 100%;
height: 54px;
background-color: #FF6B35;
color: white;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center; /* Vertically align items */
z-index: 1000; /* Make sure it's still above other content */
}
.search-bar-container {
padding: 10px;
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
display: flex;
justify-content: flex-start;
align-items: center;
width: 300px; /* Adjust width as needed */
}
.search-bar-container input {
width: 85%;
padding: 8px 10px 8px 30px; /* Add padding for the icon */
font-size: 16px;
border-radius: 10px;
border: none;
}
.search-icon {
position: absolute;
left: 15px; /* Position the icon inside the input box */
font-size: 20px;
color: #888; /* Icon color */
}
/* Style for customization sections */
.addon-section {
background-color: #fff; /* Light gray background */
border: 2px solid #6c757d; /* Border color */
border-radius: 8px;
padding: 12px;
margin-bottom: 10px; /* Spacing between sections */
}
/* Customization section title */
.addon-section h6 {
margin-bottom: 10px;
font-size: 1.1rem;
font-weight: bold;
color: #343a40; /* Darker title text */
}
/* Style for add-on checkboxes */
.addon-section .form-check {
display: inline-flex; /* Display checkboxes horizontally */
align-items: center; /* Align checkboxes and labels */
margin-left: 10px; /* Space between checkboxes */
color: #343a40; /* Darker text color */
}
/* Customize the default checkbox */
.addon-section .form-check-input {
-webkit-appearance: none; /* Remove default checkbox styling in Webkit browsers (e.g. Chrome, Safari) */
-moz-appearance: none; /* Remove default checkbox styling in Firefox */
appearance: none; /* Remove default checkbox styling in all browsers */
width: 20px;
height: 20px;
border: 2px solid #343a40; /* Darker border color */
border-radius: 5px; /* Rounded corners */
background-color: #f0f0f0; /* Lighter gray background when unchecked */
position: relative;
margin-right: 10px; /* Add space between the checkbox and label */
}
/* Checked state for the custom checkbox */
.addon-section .form-check-input:checked {
background-color: #006400; /* Dark green background when checked */
border-color: #006400; /* Dark green border when checked */
}
/* Add the check mark when checkbox is checked */
.addon-section .form-check-input:checked::before {
content: ''; /* Unicode check mark */
font-size: 14px;
position: absolute;
top: 3px;
left: 4px;
color: white; /* White color for the check mark */
}
/* Hover effect for the checkboxes */
.addon-section .form-check-input:hover {
/* background-color: #006400; /* Slightly darker background on hover */
}
/* Focus effect on custom checkbox */
.addon-section .form-check-input:focus {
outline: none;
box-shadow: 0 0 0 2px #006400; /* Green focus outline */
}
/* Custom checkbox label styles */
.addon-section .form-check-label {
font-size: 16px;
margin-left: 5px;
cursor: pointer;
display: inline-block; /* Ensure label aligns correctly with checkbox */
vertical-align: middle; /* Align text vertically with the checkbox */
}
/* Fix alignment of text and checkbox */
.addon-section .form-check input[type="checkbox"],
.addon-section .form-check label {
display: inline-block;
/* vertical-align: middle; /* Align text and checkboxes vertically */
}
/* Category Filter with Custom Radio Buttons */
form.text-center.mb-4 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 5px; /* Reduce bottom margin */
}
.form-check {
display: inline-block;
margin-right: 5px; /* Reduced space between radio button and label */
margin-bottom: 0; /* Remove bottom margin */
margin-top: 10px; /* Adds space between categories and Customized Dish */
vertical-align: middle; /* Align radio buttons vertically */
}
.form-check-inline {
display: inline-block;
margin-right: 5px; /* Decrease space between each radio button */
}
.form-check-label {
display: inline-block;
font-size: 16px;
margin-left: 5px; /* Spacing between radio button and label */
vertical-align: middle; /* Align label vertically */
}
form-check-input addon-option{
color: #333d47;
}
.custom-radio {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
width: 20px;
height: 20px;
border: 3px solid #4CAF50; /* Green border */
border-radius: 50%;
margin-right: -5px; /* Reduced spacing between button and label */
outline: none;
cursor: pointer;
position: relative;
display: inline-block;
vertical-align: middle; /* Align vertically with text */
}
.custom-radio:checked {
background-color: #4CAF50; /* Green color when checked */
border-color: #4CAF50; /* Matching border color */
}
.custom-radio:checked::after {
content: '';
position: relative;
top: 5px;
left: 5px;
border-radius: 50%;
}
.custom-radio:hover {
border-color: #388E3C;
}
/* Optional: Style the labels */
.form-check-label {
font-size: 16px;
margin-left: 8px; /* Space between the radio button and the label */
}
.cart-container {
display: flex;
align-items: center;
gap: 10px;
}
/* modal################## */
.modal-footer {
display: flex;
align-items: center;
justify-content: space-between; /* Space between quantity and Add to Cart button */
padding: 10px;
}
.modal-footer .d-flex {
display: flex;
align-items: center;
gap: 10px; /* Space between quantity buttons */
}
.modal-footer .btn {
height: 40px; /* Set consistent button height */
padding: 0 15px; /* Adjust padding to fit inside the buttons */
}
.modal-footer .form-control {
width: 50px; /* Fixed width for quantity input */
height: 40px; /* Match the height of buttons */
text-align: center; /* Center the value inside the input */
}
.modal-footer .btn-primary {
background-color: #0FAA39; /* Green background for Add to Cart button */
border-color: #0FAA39; /* Border color to match button background */
font-weight: bold; /* Bold text */
padding: 10px 20px; /* Adjust padding to make the button look better */
height: 40px; /* Match the height with quantity buttons */
display: flex;
justify-content: center;
align-items: center;
width: auto; /* Auto width to adjust to button text */
}
.modal-footer .btn-outline-secondary {
height: 40px; /* Ensure quantity buttons are the same size */
width: 40px; /* Make sure the buttons are square */
}
@media (max-width: 576px) {
/* Responsive adjustments for smaller screens */
.modal-dialog {
max-width: 98%; /* Adjust modal width for smaller screens */
}
.modal-footer .btn {
height: 35px; /* Smaller buttons for small screens */
}
.modal-footer .form-control {
width: 40px; /* Adjust input size for smaller screens */
height: 35px;
}
}
.quantity-control {
display: flex;
align-items: center;
gap: 5px;
}
.quantity {
font-size: 14px;
font-weight: bold;
min-width: 20px;
text-align: center;
}
.btn-sm {
padding: 2px 8px;
font-size: 12px;
}
#view-cart-container {
position: fixed;
right: 20px;
bottom: 20px;
display: none; /* Hide the container initially */
transition: right 0.3s ease; /* Smooth transition for movement */
}
.view-cart-button {
background-color: #007bff; /* Adjust color as needed */
color: white;
padding: 10px 20px;
border-radius: 5px;
text-decoration: none;
position: relative;
}
.cart-count {
position: absolute;
top: -10px;
right: -10px;
background-color: red;
color: white;
border-radius: 50%;
padding: 5px 10px;
font-size: 12px;
}
.show-cart {
right: 20px; /* Move the button to the right */
}
.hide-cart {
right: -300px; /* Hide it off-screen if needed */
}
</style>
</head>
<body>
<div class="fixed-top-bar">
<!-- Avatar and Dropdown -->
<div class="avatar-dropdown-container">
<div class="avatar-icon">
<span>{{ first_letter }}</span> <!-- Display the first letter of the customer's name -->
</div>
<div class="dropdown-menu">
<a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
<a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
<a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
</div>
</div>
<!-- Search Bar Section -->
<div class="search-bar-container">
<input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." onkeyup="filterMenu()">
<i class="bi bi-search search-icon"></i> <!-- Search icon inside the input -->
</div>
</div>
<!-- Category Filter with Custom Radio Buttons -->
<form method="get" action="/menu" class="text-center mb-4">
<label class="form-label fw-bold">Select a Category:</label>
<div class="form-check form-check-inline">
{% for category in categories %}
<input type="radio" id="category-{{ category }}" name="category" value="{{ category }}" class="custom-radio"
{% if selected_category == category %}checked{% endif %} onchange="this.form.submit()">
<label class="form-check-label" for="category-{{ category }}">{{ category }}</label>
{% endfor %}
</div>
<!-- Separate Customized Dish radio button in a new div to align it properly -->
<div class="form-check">
<input type="radio" id="category-CustomizedDish" name="category" value="Customized Dish" class="custom-radio"
{% if selected_category == "Customized Dish" %}checked{% endif %} onchange="this.form.submit()">
<label class="form-check-label" for="category-CustomizedDish">Customized Dish</label>
</div>
</form>
<!-- Show menu items only when Customized Dish is not selected -->
<div class="container mt-4">
<h1 class="text-center">Menu</h1>
<!-- Display text boxes for Customized Dish -->
{% if selected_category == "Customized Dish" %}
<div id="custom-dish-form" class="mt-4">
<h3>Create Your Custom Dish</h3>
<form method="POST" action="/customdish/generate_custom_dish">
<div class="mb-3">
<label for="custom-dish-name" class="form-label">Dish Name</label>
<input type="text" class="form-control" id="custom-dish-name" name="name" required>
</div>
<div class="mb-3">
<label for="custom-dish-description" class="form-label">Dish Description</label>
<textarea class="form-control" id="custom-dish-description" name="description" required></textarea>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
{% else %}
<!-- Menu Sections -->
{% for section, items in ordered_menu.items() %}
<h3>{{ section }}</h3>
<div class="row">
{% for item in items %}
<div class="col-md-6 mb-4">
<div class="card menu-card">
<img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}"
onerror="this.src='/static/placeholder.jpg';" loading="lazy">
<div class="addbutton">
<div class="card-body d-flex align-items-center justify-content-between">
<div>
<h5 class="card-title">{{ item.Name }}</h5>
<p class="card-text">${{ item.Price__c }}</p>
</div>
<div class="d-flex flex-column align-items-center justify-content-center">
{% if item.Section__c == 'Soft Drinks' %}
<!-- Soft Drinks: Direct Add-to-Cart Button -->
<div id="quantity-control-{{ loop.index }}" class="quantity-control" style="display: none;">
<button class="btn btn-outline-secondary btn-sm" onclick="decreaseQuantity('{{ item.Name }}', {{ loop.index }})">−</button>
<span class="quantity mx-2" id="quantity-{{ loop.index }}">1</span>
<button class="btn btn-outline-secondary btn-sm" onclick="increaseQuantity('{{ item.Name }}', {{ loop.index }})">+</button>
</div>
<button class="btn btn-primary" id="add-btn-{{ loop.index }}"
onclick="addSoftDrinkToCart('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image1__c }}', '{{ item.Section__c }}', '{{ selected_category }}', {{ loop.index }})">
ADD
</button>
{% else %}
<!-- Other Items: Modal Button -->
<button class="btn btn-primary"
data-bs-toggle="modal" data-bs-target="#itemModal"
onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}', '{{ selected_category }}')">
ADD
</button>
<div class="w-100 text-center">
{% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' and item.Section__c != 'Soft Drinks' %}
<h5 class="customisable-text">Customisable</h5>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
{% endif %}
</div>
<!-- View Cart Button -->
<!-- <div class="view-cart-container">
<a href="{{ url_for('cart.cart') }}" class="view-cart-button">
View Cart
</a>
</div> -->
<div class="view-cart-container" id="view-cart-container">
<a href="{{ url_for('cart.cart') }}" class="view-cart-button" id="view-cart-button">
<span id="" class="cart-count">0</span>
View Cart
</a>
</div>
<!-- Modal for Item Details -->
<div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="itemModalLabel">Item Details</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Item Image -->
<img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
<!-- Item Name -->
<h5 id="modal-name" class="fw-bold text-center"></h5>
<!-- Item Price -->
<p id="modal-price" class="text-muted text-center"></p>
<!-- Item Description -->
<p id="modal-description" class="text-secondary"></p>
<!-- Add-ons -->
<div id="modal-addons" class="modal-addons mt-4">
<h6>Customization Options</h6>
<div id="addons-list" class="addons-container">Loading customization options...</div>
</div>
<div class="mt-4">
<h6>Custom Request</h6>
<textarea id="modal-instructions" class="form-control" placeholder="Enter any special instructions here..."></textarea>
</div>
<span id="modal-section" data-section="" data-category="" style="display: none;"></span>
</div>
<!-- Quantity Controls and Add to Cart Button -->
<div class="modal-footer d-flex align-items-center justify-content-between">
<!-- Quantity Controls -->
<div class="d-flex align-items-center gap-2">
<button type="button" class="btn btn-outline-secondary" id="decreaseQuantity">-</button>
<input type="text" class="form-control text-center" id="quantityInput" value="1" readonly style="width: 50px;"/>
<button type="button" class="btn btn-outline-secondary" id="increaseQuantity">+</button>
</div>
<!-- Add to Cart Button -->
<button type="button" class="btn btn-primary" onclick="addToCartFromModal()">Add to Cart</button>
</div>
</div>
</div>
</div>
<!-- JavaScript -->
<script>
// Show item details and fetch customization options
function showItemDetails(name, price, image, description, section, selectedCategory) {
document.getElementById('modal-name').innerText = name;
document.getElementById('modal-price').innerText = `$${price}`;
document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
document.getElementById('modal-description').innerText = description || 'No description available.';
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
document.getElementById('modal-instructions').value = '';
const modalSectionEl = document.getElementById('modal-section');
modalSectionEl.setAttribute('data-section', section);
modalSectionEl.setAttribute('data-category', selectedCategory);
// Set the default quantity to 1
document.getElementById('quantityInput').value = 1;
// Fetch customization options based on the section
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
.then(response => response.json())
.then(data => {
const addonsList = document.getElementById('addons-list');
addonsList.innerHTML = ''; // Clear previous content
if (!data.success || !data.addons || data.addons.length === 0) {
addonsList.innerHTML = '<p>No customization options available.</p>';
return;
}
// Display customization options inside styled divs
data.addons.forEach(addon => {
const sectionDiv = document.createElement('div');
sectionDiv.classList.add('addon-section'); // Add styling class
// Add section title
const title = document.createElement('h6');
title.innerText = addon.name;
sectionDiv.appendChild(title);
// Create options list
const optionsContainer = document.createElement('div');
addon.options.forEach((option, index) => {
const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
const listItem = document.createElement('div');
listItem.classList.add('form-check');
listItem.innerHTML = `
<input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
<label class="form-check-label" for="${optionId}">
${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
</label>
`;
optionsContainer.appendChild(listItem);
});
sectionDiv.appendChild(optionsContainer);
addonsList.appendChild(sectionDiv);
});
})
.catch(err => {
console.error('Error fetching add-ons:', err);
document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
});
}
// Handle single-select/deselect logic for checkbox groups in all modals
document.addEventListener('click', function(event) {
if (event.target.classList.contains('addon-option')) {
handleAddonClick(event.target);
}
});
// Handle checkbox selection logic
function handleAddonClick(checkbox) {
const groupName = checkbox.getAttribute('data-group');
const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides","Select Dip/Sauce","Extra Add-ons","Make it a Combo", "Beverages"].includes(groupName);
// If it's not multi-select, uncheck all other checkboxes in the same group
if (!isMultiSelectGroup) {
const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
checkboxes.forEach(otherCheckbox => {
if (otherCheckbox !== checkbox) {
otherCheckbox.checked = false;
}
});
}
}
function filterMenu() {
let input = document.getElementById('searchBar').value.toLowerCase(); // Get the value from search bar
let sections = document.querySelectorAll('h3'); // Select section headers
let items = document.querySelectorAll('.menu-card'); // Select all items
let matchedSections = new Set(); // Store matched sections
// Hide all items initially
items.forEach(item => {
let itemName = item.querySelector('.card-title').innerText.toLowerCase(); // Get item name
let itemSection = item.closest('.row').previousElementSibling.innerText.toLowerCase(); // Get section name
// If the search matches item name or section, show the item
if (itemName.includes(input) || (itemSection && itemSection.includes(input))) {
item.style.display = 'block'; // Show item if it matches search
matchedSections.add(item.closest('.row')); // Add section to matched list
} else {
item.style.display = 'none'; // Hide item if not matched
}
});
// Show or hide sections based on matched items
sections.forEach(section => {
let sectionRow = section.nextElementSibling; // The row containing items
if (matchedSections.has(sectionRow)) {
section.style.display = 'block'; // Show section header
sectionRow.style.display = 'flex'; // Show section items
} else {
section.style.display = 'none'; // Hide section header
sectionRow.style.display = 'none'; // Hide section items
}
});
}
function addToCartFromModal() {
const itemName = document.getElementById('modal-name').innerText;
let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
// Validate item price
if (isNaN(itemPrice)) {
alert('Invalid price for the item. Please check the item details.');
return;
}
const itemImage = document.getElementById('modal-img').src;
console.log(itemName, itemPrice, itemImage); // Log values for debugging
const modalSectionEl = document.getElementById('modal-section');
const section = modalSectionEl.getAttribute('data-section');
const selectedCategory = modalSectionEl.getAttribute('data-category');
if (!itemName || !itemPrice || !section || !itemImage) {
console.error('Missing data for cart item:', { itemName, itemPrice, section, itemImage});
return;
}
// Collect selected add-ons
let selectedAddOns = Array.from(
document.querySelectorAll('#addons-list input[type="checkbox"]:checked')
).map(addon => ({
name: addon.getAttribute('data-name') || 'Default Name', // Fallback Name
price: parseFloat(addon.getAttribute('data-price') || 0)
}));
// Get the selected quantity
const quantity = parseInt(document.getElementById('quantityInput').value) || 1; // Default to 1 if invalid
const instructions = document.getElementById('modal-instructions').value;
// Prepare data for the cart
const cartPayload = {
itemName: itemName,
itemPrice: itemPrice,
itemImage: itemImage,
section: section,
category: selectedCategory,
addons: selectedAddOns,
instructions: instructions,
quantity: quantity // Include the quantity
};
// Send the cart data to the server
fetch('/cart/add', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(cartPayload)
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Item added to cart successfully!');
updateCartUI(data.cart); // Update cart UI after adding an item
const modal = document.getElementById('itemModal');
const modalInstance = bootstrap.Modal.getInstance(modal);
modalInstance.hide();
showCartButton();
} else {
alert(data.error || 'Failed to add item to cart.');
}
})
.catch(err => {
console.error('Error adding item to cart:', err);
alert('An error occurred while adding the item to the cart.');
});
}
function updateCartUI(cart) {
if (!Array.isArray(cart)) {
console.error('Invalid cart data:', cart);
return;
}
const cartIcon = document.getElementById('cart-icon');
cartIcon.innerText = cart.length; // Assuming cart is an array of items
}
function updateCartDisplay(cart) {
if (!Array.isArray(cart)) {
console.error('Invalid cart data:', cart);
return;
}
// Optional: Update quantity on the cart page
const cartCountElement = document.getElementById('cart-count');
cartCountElement.innerText = cart.reduce((total, item)=> total+item.quantity,0); // Update cart item count //Sum of all quantities
// Optionally, show a small success notification that the item was added
const successNotification = document.createElement('div');
successNotification.classList.add('success-notification');
successNotification.innerText = 'Item added to cart!';
document.body.appendChild(successNotification);
setTimeout(() => {
successNotification.remove(); // Remove success notification after a few seconds
}, 2000);
}
document.addEventListener('DOMContentLoaded', function () {
// Get references to the quantity buttons and the input field
const decreaseBtn = document.getElementById('decreaseQuantity');
const increaseBtn = document.getElementById('increaseQuantity');
const quantityInput = document.getElementById('quantityInput');
// Add event listener to decrease button
decreaseBtn.addEventListener('click', function () {
let currentQuantity = parseInt(quantityInput.value);
if (currentQuantity > 1) {
currentQuantity--;
quantityInput.value = currentQuantity;
}
});
// Add event listener to increase button
increaseBtn.addEventListener('click', function () {
let currentQuantity = parseInt(quantityInput.value);
currentQuantity++;
quantityInput.value = currentQuantity;
});
});
// Function to add Soft Drink to cart directly
// function addSoftDrinkToCart(name, price, image, section, category, index) {
// const itemPrice = parseFloat(price);
// const quantity = 1; // Default quantity
// const cartPayload = {
// itemName: name,
// itemPrice: itemPrice,
// itemImage: image || '/static/placeholder.jpg',
// section: section,
// category: category,
// addons: [], // No add-ons for Soft Drinks
// instructions: '', // No instructions for Soft Drinks
// quantity: quantity
// };
// fetch('/cart/add', {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// },
// body: JSON.stringify(cartPayload)
// })
// .then(response => response.json())
// .then(data => {
// if (data.success) {
// // Hide the ADD button and show quantity controls
// document.getElementById(`add-btn-${index}`).style.display = 'none';
// document.getElementById(`quantity-control-${index}`).style.display = 'flex';
// updateCartUI(data.cart);
// alert('Soft Drink added to cart successfully!');
// } else {
// alert(data.error || 'Failed to add Soft Drink to cart.');
// }
// })
// .catch(err => {
// console.error('Error adding Soft Drink to cart:', err);
// alert('An error occurred while adding the Soft Drink to the cart.');
// });
// }
// function addSoftDrinkToCart(name, price, image, section, category, index) {
// const itemPrice = parseFloat(price);
// const quantity = 1; // Default quantity
// const cartPayload = {
// itemName: name,
// itemPrice: itemPrice,
// itemImage: image || '/static/placeholder.jpg',
// section: section,
// category: category,
// addons: [], // No add-ons for Soft Drinks
// instructions: '', // No instructions for Soft Drinks
// quantity: quantity
// };
// // Add item to cart
// fetch('/cart/add', {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// },
// body: JSON.stringify(cartPayload)
// })
// .then(response => response.json())
// .then(data => {
// if (data.success) {
// // Hide the "Add" button and show quantity controls
// document.getElementById(`add-btn-${index}`).style.display = 'none';
// document.getElementById(`quantity-control-${index}`).style.display = 'flex';
// updateCartQuantity(data.cart);
// alert('{item.name} added to cart successfully!');
// } else {
// alert(data.error || 'Failed to add Soft Drink to cart.');
// }
// })
// .catch(err => {
// console.error('Error adding Soft Drink to cart:', err);
// alert('An error occurred while adding the Soft Drink to the cart.');
// });
// }
// Function to increase quantity
// function increaseQuantity(name, index) {
// let quantityElement = document.getElementById(`quantity-${index}`);
// let currentQuantity = parseInt(quantityElement.innerText);
// currentQuantity++;
// quantityElement.innerText = currentQuantity;
// updateQuantity(name, currentQuantity);
// }
// Function to decrease quantity
// function decreaseQuantity(name, index) {
// let quantityElement = document.getElementById(`quantity-${index}`);
// let currentQuantity = parseInt(quantityElement.innerText);
// if (currentQuantity > 1) {
// currentQuantity--;
// quantityElement.innerText = currentQuantity;
// updateCartQuantity(name, currentQuantity);
// } else {
// // Remove from cart and revert to ADD button
// removeFromCart(name, index);
// }
// }
// function decreaseQuantity(name, index) {
// let quantityElement = document.getElementById(`quantity-${index}`);
// let currentQuantity = parseInt(quantityElement.innerText);
// // If quantity > 0, decrease the quantity
// if (currentQuantity > 0) {
// currentQuantity--;
// quantityElement.innerText = currentQuantity;
// // If quantity becomes 0, show "Add" button and hide quantity controls
// if (currentQuantity === 0) {
// document.getElementById(`add-btn-${index}`).style.display = 'block'; // Show "Add" button
// document.getElementById(`quantity-control-${index}`).style.display = 'none'; // Hide quantity controls
// removeFromCart(name, index); // Remove item from the cart when quantity reaches 0
// } else {
// // Otherwise, update cart quantity
// updateQuantity(name, currentQuantity);
// }
// }
// }
// Existing updateCartUI function (unchanged, but included for reference)
// function updateCartUI(cart) {
// if (!Array.isArray(cart)) {
// console.error('Invalid cart data:', cart);
// return;
// }
// const cartIcon = document.getElementById('cart-icon');
// if (cartIcon) {
// cartIcon.innerText = cart.length; // Update cart icon if it exists
// }
// }
// // Remove Item from Cart when quantity reaches 0
// function removeFromCart(name, index) {
// fetch('/cart/remove_item', {
// method: 'DELETE',
// headers: { 'Content-Type': 'application/json' },
// body: JSON.stringify({ item_name: name.trim() })
// })
// .then(response => response.json())
// .then(data => {
// if (data.success) {
// updateCartDisplay(data.cart); // Update the cart UI after removal
// } else {
// alert(data.error || "Failed to remove item from cart.");
// }
// })
// .catch(err => console.error("Error removing item from cart:", err));
// }
function addSoftDrinkToCart(name, price, image, section, category, index) {
const itemPrice = parseFloat(price);
const quantity = 1; // Default quantity
const cartPayload = {
itemName: name,
itemPrice: itemPrice,
itemImage: image || '/static/placeholder.jpg',
section: section,
category: category,
addons: [], // No add-ons for Soft Drinks
instructions: '', // No instructions for Soft Drinks
quantity: quantity
};
fetch('/cart/add', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(cartPayload)
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Hide the ADD button and show quantity controls
document.getElementById(`add-btn-${index}`).style.display = 'none';
document.getElementById(`quantity-control-${index}`).style.display = 'flex';
updateCartUI(data.cart);
showCartButton(); // Show the cart button when an item is added
alert('Soft Drink added to cart successfully!');
} else {
alert(data.error || 'Failed to add Soft Drink to cart.');
}
})
.catch(err => {
console.error('Error adding Soft Drink to cart:', err);
alert('An error occurred while adding the Soft Drink to the cart.');
});
}
// Function to show the "View Cart" button and update the count
function showCartButton() {
var cartContainer = document.getElementById("view-cart-container");
var cartButton = document.getElementById("view-cart-button");
var cartCountElement = document.getElementById("cart-count");
// Make the cart container visible
cartContainer.style.display = "block";
// Apply transition to move the button from right to left
setTimeout(function() {
cartContainer.classList.add("show-cart");
}, 10);
updateCartCount(cartCountElement);
}
// Function to update the cart item count
function updateCartCount(cartCountElement) {
// Get the number of items in the cart from your cart data (adjust as needed)
fetch('/cart/total-items') // Replace this with your actual endpoint for cart data
.then(response => response.json())
.then(data => {
if (data.success) {
cartCountElement.textContent = data.totalItems; // Update count
} else {
cartCountElement.textContent = 0; // In case of an error, show 0
}
})
.catch(err => {
console.error('Error fetching cart count:', err);
cartCountElement.textContent = 0; // Fallback in case of an error
});
}
</script>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
|