File size: 117,701 Bytes
5174a69 5e1e5fe 1f925c4 5e1e5fe 1f925c4 50de36b 1f925c4 cf13fed 1f925c4 5174a69 1f925c4 095dd9c 1f925c4 50de36b 46f28e7 1f925c4 095dd9c 1f925c4 50de36b 46f28e7 1f925c4 1313645 1f925c4 50de36b 1f925c4 72acf5c 1f925c4 d454c12 1f925c4 de2814c 1f925c4 5174a69 1f925c4 5174a69 1f925c4 d454c12 5174a69 1f925c4 0d7a729 1f925c4 50de36b 1313645 50de36b 1313645 1f925c4 1313645 1f925c4 5e1e5fe 1313645 5e1e5fe 1313645 50de36b 5e1e5fe 1313645 5e1e5fe 50de36b 1313645 50de36b d454c12 0d7a729 1f925c4 5e1e5fe 72acf5c 1313645 5e1e5fe 1313645 5174a69 5e1e5fe 1313645 5e1e5fe 8f78818 72acf5c 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 d83205a 8f78818 3927896 819bead 3927896 dd87e95 3927896 dd87e95 3927896 dd87e95 d83205a 3927896 d83205a 3927896 d83205a dd87e95 d83205a 3927896 d83205a 3927896 d83205a dd87e95 d83205a dd87e95 d83205a dd87e95 d83205a 3927896 d83205a dd87e95 d83205a dd87e95 d83205a dd87e95 d83205a dd87e95 72acf5c d83205a d454c12 50de36b d454c12 50de36b d454c12 72acf5c d454c12 50de36b d454c12 50de36b d454c12 50de36b d454c12 50de36b d454c12 5174a69 d454c12 5174a69 d454c12 5174a69 d454c12 5174a69 d454c12 5174a69 d454c12 5174a69 d454c12 50de36b d454c12 50de36b 0d7a729 1f925c4 50de36b 1313645 0d7a729 50de36b 1313645 5e1e5fe 1f925c4 5e1e5fe 0d7a729 d454c12 50de36b 5e1e5fe d454c12 1313645 5e1e5fe 1f925c4 1313645 3927896 1f925c4 50de36b 1757ef9 50de36b 1757ef9 50de36b 1757ef9 50de36b 1f925c4 50de36b 5174a69 50de36b 5174a69 50de36b 8f78818 50de36b 8f78818 50de36b 8f78818 50de36b 8f78818 50de36b 8f78818 50de36b d454c12 8f78818 50de36b 8f78818 50de36b 72acf5c 50de36b 8f78818 50de36b 72acf5c 50de36b d454c12 50de36b d454c12 50de36b 3927896 72acf5c 3927896 8f78818 72acf5c d83205a 72acf5c d83205a 72acf5c 8f78818 d83205a 72acf5c 8f78818 d83205a 8f78818 72acf5c 8f78818 72acf5c 8f78818 d83205a 72acf5c 8f78818 d83205a 72acf5c 8f78818 72acf5c d83205a 8f78818 d83205a 3927896 d83205a 3927896 d83205a 3927896 d83205a 3927896 d83205a 3927896 d83205a 8f78818 d83205a 1313645 cf13fed 49038d9 cf13fed 49038d9 cf13fed 49038d9 cf13fed 49038d9 cf13fed 5e1e5fe 50de36b 5e1e5fe 3927896 5174a69 5e1e5fe 5174a69 50de36b 5174a69 d371a7a 50de36b 5e1e5fe 3927896 5e1e5fe 3927896 5e1e5fe dd87e95 d83205a 3927896 d83205a 3927896 d83205a 3927896 d83205a 145bd7d 1f925c4 5e1e5fe dd87e95 50de36b 3927896 5e1e5fe cf13fed 5e1e5fe 3927896 5e1e5fe 5174a69 3927896 5e1e5fe 50de36b 5e1e5fe d83205a 1f925c4 5174a69 1f925c4 de2814c 3927896 0590c97 3927896 0590c97 3927896 0590c97 72acf5c 0590c97 1f925c4 5e1e5fe 0590c97 3927896 0590c97 5174a69 91e16d4 0590c97 5174a69 0590c97 5e1e5fe 50de36b 3927896 5e1e5fe 3927896 5e1e5fe 5174a69 5e1e5fe 1f925c4 5e1e5fe 72acf5c 5e1e5fe 72acf5c 3927896 5e1e5fe 3927896 5e1e5fe 3927896 5e1e5fe 5174a69 1313645 5174a69 1f925c4 8f78818 5174a69 0590c97 8f78818 d83205a 0590c97 5174a69 8f78818 d83205a 8f78818 d83205a 0590c97 5e1e5fe 0590c97 72acf5c 1757ef9 5e1e5fe 5174a69 3927896 5174a69 5e1e5fe d454c12 5e1e5fe 72acf5c 5e1e5fe 50de36b 5e1e5fe 1313645 72acf5c 50de36b 72acf5c 50de36b 5e1e5fe 3927896 0d7a729 72acf5c 8f78818 0590c97 5174a69 0590c97 72acf5c 50de36b 0590c97 3927896 0590c97 8f78818 50de36b 0590c97 50de36b 0590c97 50de36b 5174a69 0590c97 5174a69 50de36b 0590c97 72acf5c 0590c97 50de36b 0590c97 50de36b 0590c97 50de36b 0590c97 50de36b 0590c97 50de36b 0590c97 50de36b 0590c97 50de36b 3927896 4da8e75 de2814c 72acf5c de2814c 72acf5c de2814c 3927896 55bb9ef 3927896 55bb9ef 3927896 72acf5c 4da8e75 3927896 72acf5c de2814c 72acf5c 4601337 3927896 4601337 de2814c 72acf5c de2814c d83205a 3927896 d83205a e0e0b32 89782d0 3927896 5174a69 3927896 de2814c d454c12 6ec77cb 3927896 6ec77cb 3927896 6ec77cb 3927896 6ec77cb 3927896 6ec77cb 3927896 6ec77cb 0d7a729 3927896 6ec77cb 3927896 6ec77cb 3927896 6ec77cb 3927896 6ec77cb 3927896 6ec77cb 3927896 6ec77cb cf13fed a4bbe96 cf13fed 6ec77cb 55bb9ef e86255a |
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 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 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 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 |
<!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">
<!-- Preload Critical Resources -->
<link rel="preload" href="/static/placeholder.mp4" as="video">
{% for section, items in ordered_menu.items() %}
{% for item in items[:1] %}
<link rel="preload" href="{{ item.Video1__c | default('/static/placeholder.mp4') }}" as="video" fetchpriority="high">
{% endfor %}
{% endfor %}
<style>
body {
font-family: Arial, sans-serif;
background-color: #fdf4e3;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
padding-bottom: 70px;
}
.container {
max-width: 900px;
}
.menu-card {
max-width: 350px;
border-radius: 15px;
overflow: hidden;
background-color: #fff;
margin: auto;
display: flex;
flex-direction: column;
opacity: 0;
transition: opacity 0.3s ease-in-out;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.menu-card.visible {
opacity: 1;
}
.menu-card.highlighted {
border: 3px solid #0FAA39;
box-shadow: 0 0 10px rgba(15, 170, 57, 0.5);
}
.menu-video {
height: 200px;
width: 100%;
object-fit: contain;
border-radius: 15px 15px 0 0;
opacity: 0;
transition: opacity 0.5s ease-in-out;
background-color: #000;
}
.menu-video.loaded {
opacity: 1;
}
.menu-card img {
width: 100%; /* Ensure image takes up full width */
height: 200px; /* Set fixed height */
object-fit: cover; /* Ensure the image fills the container without distortion */
object-position: center; /* Center the image within the container */
}
.menu-card:hover .menu-video {
opacity: 1;
transform: scale(1.05);
}
.menu-card .card-body .card-title {
font-size: 1.2rem;
font-weight: 600;
margin: 10px 0;
color: #333333;
}
.menu-card .card-body .card-text.price {
font-size: 1rem;
font-weight: 500;
color: #000000;
margin-bottom: 5px;
}
.addbutton .btn {
background-color: #28a745;
color: white;
padding: 10px 20px;
font-size: 16px;
font-weight: bold;
border-radius: 5px;
border: none;
transition: background-color 0.3s ease;
margin-left: 13px;
}
.addbutton .btn:hover {
background-color: #218838;
}
.button-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
}
.customisable-text {
color: #0FAA39;
font-size: 10px;
font-weight: 500;
margin: 0;
text-align: center;
line-height: 1;
}
.btn-primary {
font-size: 12px;
font-weight: bold;
border-radius: 8px;
width: 70px;
height: 35px;
background-color: #0FAA39;
border-color: #0FAA39;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
transition: background-color 0.3s ease, transform 0.1s ease;
}
.btn-primary:hover {
background-color: #0D9232;
border-color: #0D9232;
transform: scale(1.05);
}
.btn-primary:active,
.btn-primary:focus {
background-color: #0B7A29;
border-color: #0B7A29;
box-shadow: none;
transform: scale(0.98);
}
.avatar-dropdown-container {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.avatar-icon {
width: 40px;
height: 40px;
border-radius: 50%;
background-color: #007bff;
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: #fff8f0;
border-radius: 5px;
width: 220px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
display: none;
border: 1px solid #ffd8b1;
}
.dropdown-menu .dropdown-item {
padding: 12px 16px;
text-decoration: none;
color: #333;
border-bottom: 1px solid #ffd8b1;
display: block;
font-size: 15px;
transition: background-color 0.2s ease;
}
.dropdown-menu .dropdown-item:last-child {
border-bottom: none;
}
.dropdown-menu .dropdown-item:hover {
background-color: #ffe4c4;
color: #333;
}
.fixed-top-bar {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 54px;
background: linear-gradient(45deg, #FFA07A, #FFB347);
color: white;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 1000;
}
.search-bar-container {
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
width: 300px;
max-width: 90%;
position: relative;
}
.search-bar-container input {
width: 100%;
padding: 8px 40px 8px 40px;
font-size: 16px;
border-radius: 25px;
border: none;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
outline: none;
}
.search-bar-container input::placeholder {
color: #888;
}
.search-bar-container input:focus {
border-bottom: 2px solid #FFA07A;
}
.search-icon {
position: absolute;
left: 15px;
font-size: 18px;
color: #888;
}
.mic-icon {
position: absolute;
right: 15px;
font-size: 18px;
color: #888;
cursor: pointer;
transition: color 0.3s ease;
}
.mic-icon.active {
color: #007bff;
}
/* Addon Section */
.addon-section {
background-color: #fff;
border-radius: 10px;
margin-bottom: 15px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
transition: transform 0.2s ease;
}
.addon-section:hover {
transform: translateY(-2px);
}
.addon-section h6 {
margin: 0;
padding: 12px 15px;
font-size: 1.1rem;
font-weight: 600;
color: #fff;
background: linear-gradient(45deg, #FFA07A, #FFB347);
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
}
.addon-section h6::after {
content: '\25BC';
font-size: 0.9rem;
transition: transform 0.2s ease;
}
.addon-section.collapsed h6::after {
transform: rotate(180deg);
}
.addon-section .form-check {
display: flex;
flex-direction: row-reverse;
align-items: center;
justify-content: space-between;
margin: 10px 15px;
padding: 0;
}
.addon-section .form-check-input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border: 2px solid #6c757d;
border-radius: 4px;
background-color: #fff;
position: relative;
margin-left: 10px;
cursor: pointer;
transition: all 0.2s ease;
}
.addon-section .form-check-input:checked {
background-color: #0FAA39;
border-color: #0FAA39;
}
.addon-section .form-check-input:checked::before {
content: '\2713';
font-size: 12px;
position: absolute;
top: 2px;
left: 4px;
color: white;
animation: checkmark 0.2s ease-in-out;
}
.addon-section .form-check-input:hover {
transform: scale(1.1);
border-color: #0FAA39;
}
.addon-section .form-check-input:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(15, 170, 57, 0.2);
}
.addon-section .form-check-label {
font-size: 0.95rem;
color: #343a40;
cursor: pointer;
flex: 1;
padding: 5px 8px;
border-radius: 4px;
transition: background-color 0.2s ease;
text-align: left;
}
.addon-section .form-check-label:hover {
background-color: #e6f4ea;
}
.addon-section .form-check-label .extra-charge {
color: #FFA07A;
font-weight: 600;
margin-left: 8px;
}
.addon-options {
max-height: 500px;
opacity: 1;
overflow: hidden;
transition: max-height 0.3s ease, opacity 0.3s ease;
}
.addon-options.collapsed {
max-height: 0;
opacity: 0;
}
.addon-loading {
display: flex;
justify-content: center;
align-items: center;
padding: 15px;
}
.addon-loading::after {
content: '';
width: 20px;
height: 20px;
border: 3px solid #0FAA39;
border-top: 3px solid transparent;
border-radius: 50%;
animation: spin 1s linear infinite;
}
/* Soft Drinks Modal Styling */
#softDrinkModal .modal-dialog {
max-width: 400px;
margin: 1.75rem auto;
animation: fadeInModal 0.3s ease-out;
}
#softDrinkModal .modal-content {
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
background-color: #fff;
overflow: hidden;
}
#softDrinkModal .modal-header {
background: linear-gradient(45deg, #FFA07A, #FFB347);
border-top-left-radius: 12px;
border-top-right-radius: 12px;
padding: 12px 15px;
border-bottom: none;
}
#softDrinkModal .modal-title {
font-size: 1.3rem;
font-weight: 600;
color: #fff;
}
#softDrinkModal .modal-body {
padding: 20px;
text-align: center;
}
#softDrinkModal .modal-body img {
max-height: 160px;
width: 100%;
object-fit: cover;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
#softDrinkModal .modal-body h5 {
font-size: 1.4rem;
font-weight: 600;
color: #333333;
margin-bottom: 10px;
}
#softDrinkModal .modal-body p {
font-size: 1.2rem;
font-weight: 500;
color: #000000;
margin-bottom: 20px;
}
#softDrinkModal .modal-body p::before {
content: '$';
color: #FFA07A;
font-weight: 600;
margin-right: 2px;
}
#softDrinkModal .quantity-controls {
display: flex;
justify-content: center;
align-items: center;
gap: 12px;
margin-bottom: 20px;
}
#softDrinkModal .quantity-controls .btn {
width: 32px;
height: 32px;
border-radius: 50%;
padding: 0;
font-size: 1.1rem;
line-height: 32px;
text-align: center;
background-color: #e9ecef;
border: none;
color: #333;
transition: background-color 0.2s ease, transform 0.1s ease;
}
#softDrinkModal .quantity-controls .btn:hover {
background-color: #d1d4d7;
transform: scale(1.1);
}
#softDrinkModal .quantity-controls .btn:active {
transform: scale(0.95);
}
#softDrinkModal .quantity-controls input {
width: 50px;
height: 32px;
text-align: center;
font-size: 1rem;
font-weight: 600;
border: 1px solid #ced4da;
border-radius: 6px;
background-color: #f8f9fa;
}
#softDrinkModal .modal-footer {
padding: 15px;
border-top: none;
display: flex;
justify-content: space-between;
align-items: center;
}
#softDrinkModal .modal-footer .btn-primary {
background-color: #0FAA39;
border-color: #0FAA39;
padding: 12px 30px;
font-size: 1.1rem;
font-weight: 600;
border-radius: 8px;
transition: background-color 0.2s ease, transform 0.1s ease;
width: auto;
}
#softDrinkModal .modal-footer .btn-primary:hover {
background-color: #0D9232;
transform: scale(1.05);
}
#softDrinkModal .modal-footer .btn-primary:active {
background-color: #0B7A29;
transform: scale(0.98);
}
#softDrinkModal .modal-footer .quantity-controls-footer {
display: flex;
gap: 12px;
}
#softDrinkModal .modal-footer .quantity-controls-footer .btn {
width: 32px;
height: 32px;
border-radius: 50%;
padding: 0;
font-size: 1.1rem;
line-height: 32px;
text-align: center;
background-color: #e9ecef;
border: none;
color: #333;
transition: background-color 0.2s ease, transform 0.1s ease;
}
#softDrinkModal .modal-footer .quantity-controls-footer .btn:hover {
background-color: #d1d4d7;
transform: scale(1.1);
}
#softDrinkModal .modal-footer .quantity-controls-footer .btn:active {
transform: scale(0.95);
}
/* Filter Form Styling */
#filter-form {
display: flex;
flex-direction: column;
align-items: flex-start; /* Align to the left */
justify-content: flex-start; /* Align to the top */
margin-bottom: 20px;
margin-left: 10px; /* Added 10px gap to the left */
}
.form-label {
font-size: 1.2rem;
font-weight: 600;
color: #333;
margin-bottom: 10px;
}
.toggle-container {
display: flex;
align-items: center;
gap: 10px;
margin: 8px 0;
}
.custom-toggle {
appearance: none;
width: 48px;
height: 24px;
background-color: #ccc;
border-radius: 12px;
position: relative;
cursor: pointer;
transition: background-color 0.3s ease;
}
.custom-toggle:checked {
background: linear-gradient(45deg, #32CD32, #3CB371); /* Changed to green color when checked */
}
.custom-toggle::before {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 20px;
height: 20px;
background-color: #fff;
border-radius: 50%;
transition: transform 0.3s ease;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.custom-toggle:checked::before {
transform: translateX(24px); /* Moves the toggle to the right */
}
.toggle-container label {
font-size: 1rem;
color: #333;
cursor: pointer;
}
@keyframes checkmark {
from { transform: scale(0); }
to { transform: scale(1); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInModal {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
.modal-header {
padding: 10px 15px;
}
.modal-title {
font-size: 16px;
font-weight: bold;
}
.modal-body {
max-height: 60vh;
overflow-y: auto;
padding: 15px;
}
.modal-body #modal-img {
max-height: 200px;
width: 100%;
object-fit: cover;
border-radius: 8px;
margin-bottom: 10px;
}
.modal-body #modal-name {
font-size: 20px;
font-weight: bold;
text-align: center;
margin-bottom: 5px;
color: #333333;
}
.modal-body #modal-price {
font-size: 16px;
font-weight: 500;
color: #000000;
text-align: center;
margin-bottom: 10px;
}
.modal-body #modal-description {
font-size: 14px;
color: #6c757d;
margin-bottom: 15px;
}
.modal-body #modal-addons h5,
.modal-body #first-row h6 {
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 15px;
color: #343a40;
}
.modal-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
}
.modal-footer .d-flex {
display: flex;
align-items: center;
gap: 10px;
}
.modal-footer .btn {
height: 40px;
padding: 0 15px;
}
.modal-footer .form-control {
width: 50px;
height: 40px;
text-align: center;
}
.modal-footer .btn-primary {
background-color: #0FAA39;
border-color: #0FAA39;
font-weight: bold;
padding: 10px 20px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
width: auto;
}
.modal-footer .btn-outline-secondary {
height: 40px;
width: 40px;
}
.item-details {
background-color: #f8f9fa;
border-radius: 8px;
padding: 10px;
margin: 10px 15px;
display: none;
}
.item-details.show {
display: block;
}
.item-details h6 {
font-size: 0.9rem;
font-weight: bold;
margin-bottom: 5px;
color: #333333;
}
.item-details p {
font-size: 0.85rem;
margin-bottom: 5px;
color: #333;
}
.item-details .nutritional-info {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
background-color: #e9ecef;
padding: 10px;
border-radius: 5px;
font-size: 0.85rem;
line-height: 1.5;
}
.toggle-details {
cursor: pointer;
color: #0FAA39;
font-size: 0.9rem;
margin-left: 15px;
margin-bottom: 10px;
display: inline-block;
}
.toggle-details:hover {
text-decoration: underline;
}
.quantity-selector {
display: flex;
align-items: center;
gap: 5px;
}
.quantity-selector .btn {
width: 25px;
height: 25px;
padding: 0;
font-size: 12px;
line-height: 25px;
text-align: center;
}
.quantity-selector .quantity-display {
width: 25px;
text-align: center;
font-size: 12px;
font-weight: bold;
line-height: 25px;
}
.quantity-selector .quantity-to-add,
.quantity-selector .quantity-to-remove {
width: 45px;
height: 25px;
font-size: 12px;
padding: 0 5px;
}
.modal-dialog {
max-height: 90vh;
}
.modal-body::-webkit-scrollbar {
width: 8px;
}
.modal-body::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}
.modal-body::-webkit-scrollbar-thumb {
background: #0FAA39;
border-radius: 10px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
background: #0D9232;
}
.btn-primary:disabled {
opacity: 0.65;
cursor: not-allowed;
}
.quantity-selector select {
width: 60px;
height: 35px;
padding: 5px;
border-radius: 5px;
border: 1px solid #ced4da;
}
#custom-dish-form {
position: relative;
padding-bottom: 80px;
}
#custom-dish-form .btn-primary {
position: absolute;
right: 15px;
bottom: 15px;
width: auto;
padding: 10px 20px;
}
.bottom-action-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: white;
padding: 10px 20px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
max-width: 900px;
margin: 0 auto;
}
.bottom-action-bar .btn {
flex: 1;
margin: 0 5px;
padding: 10px 15px;
border-radius: 8px;
font-weight: bold;
font-size: 16px;
color: white;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
min-width: 0;
white-space: nowrap;
}
.bottom-action-bar .btn-order-history {
background-color: #FFA07A;
border-color: #FFA07A;
}
.bottom-action-bar .btn-order-history:hover {
background-color: #FF8C61;
border-color: #FF8C61;
}
.bottom-action-bar .btn-view-cart {
background-color: #0FAA39;
border-color: #0FAA39;
}
.bottom-action-bar .btn-view-cart:hover {
background-color: #0D9232;
border-color: #0D9232;
}
.cart-icon-badge {
background-color: white;
color: #0FAA39;
border-radius: 50%;
width: 20px;
height: 20px;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 12px;
margin-left: 8px;
}
/* Mobile-Specific Styles */
@media (max-width: 576px) {
.fixed-top-bar {
height: 60px;
padding: 10px;
}
.search-bar-container {
width: 80%;
max-width: 100%;
left: 10px;
top: 50%;
transform: translateY(-50%);
}
.search-bar-container input {
padding: 6px 35px 6px 35px;
font-size: 14px;
border-radius: 20px;
}
.search-icon {
left: 12px;
font-size: 16px;
}
.mic-icon {
right: 12px;
font-size: 16px;
}
.avatar-dropdown-container {
right: 10px;
}
.avatar-icon {
width: 40px;
height: 40px;
font-size: 20px;
}
.dropdown-menu {
width: 220px;
}
.dropdown-menu .dropdown-item {
padding: 12px 16px;
font-size: 15px;
}
.modal-dialog {
max-width: 90%;
margin: 10px auto;
}
.modal-header {
padding: 8px 12px;
}
.modal-title {
font-size: 14px;
}
.modal-body {
max-height: 50vh;
padding: 12px;
}
.modal-body #modal-img {
max-height: 150px;
width: 100%;
max-width: 150px;
margin: 0 auto 8px;
display: block;
}
.modal-body #modal-name {
font-size: 18px;
margin-bottom: 5px;
}
.modal-body #modal-price {
font-size: 14px;
margin-bottom: 8px;
}
.modal-body #modal-description {
font-size: 12px;
margin-bottom: 10px;
}
.modal-body .nutritional-info {
font-size: 10px;
margin-bottom: 5px;
}
.modal-body #modal-addons h5,
.modal-body #first-row h6 {
font-size: 1rem;
margin-bottom: 10px;
}
.modal-footer {
padding: 8px;
}
.modal-footer .btn {
height: 30px;
padding: 0 10px;
}
.modal-footer .form-control {
width: 30px;
height: 30px;
font-size: 12px;
font-weight: bold;
}
.modal-footer .btn-outline-secondary {
width: 25px;
height: 25px;
font-size: 12px;
line-height: 25px;
}
.modal-footer .btn-primary {
font-size: 12px;
height: 30px;
padding: 0 15px;
border-radius: 5px;
}
.btn-primary {
font-size: 10px;
width: 50px;
height: 25px;
}
.customisable-text {
font-size: 8px;
}
.button-container {
gap: 3px;
}
.quantity-selector .btn {
width: 18px;
height: 18px;
font-size: 9px;
line-height: 18px;
}
.quantity-selector .quantity-display {
width: 18px;
font-size: 9px;
line-height: 18px;
}
.quantity-selector .quantity-to-add,
.quantity-selector .quantity-to-remove {
width: 35px;
height: 18px;
font-size: 9px;
}
.quantity-selector select {
width: 50px;
height: 30px;
font-size: 12px;
}
.bottom-action-bar {
padding: 8px 10px;
}
.bottom-action-bar .btn {
padding: 8px 10px;
font-size: 14px;
}
.cart-icon-badge {
width: 18px;
height: 18px;
font-size: 10px;
margin-left: 5px;
}
/* Mobile-Specific Addon Styles */
.addon-section {
margin-bottom: 10px;
}
.addon-section h6 {
font-size: 1rem;
padding: 10px 12px;
}
.addon-section .form-check {
margin: 8px 12px;
}
.addon-section .form-check-input {
width: 18px;
height: 18px;
margin-left: 8px;
}
.addon-section .form-check-input:checked::before {
font-size: 10px;
top: 2px;
left: 3px;
}
.addon-section .form-check-label {
font-size: 0.85rem;
padding: 4px 6px;
}
.addon-section .form-check-label .extra-charge {
margin-left: 6px;
font-size: 0.8rem;
}
/* Mobile-Specific Soft Drinks Modal Styles */
#softDrinkModal .modal-dialog {
max-width: 90%;
}
#softDrinkModal .modal-content {
border-radius: 10px;
}
#softDrinkModal .modal-header {
padding: 10px 12px;
}
#softDrinkModal .modal-title {
font-size: 1.2rem;
}
#softDrinkModal .modal-body {
padding: 15px;
}
#softDrinkModal .modal-body img {
max-height: 130px;
margin-bottom: 12px;
}
#softDrinkModal .modal-body h5 {
font-size: 1.2rem;
margin-bottom: 8px;
}
#softDrinkModal .modal-body p {
font-size: 1rem;
margin-bottom: 15px;
}
#softDrinkModal .quantity-controls .btn {
width: 28px;
height: 28px;
font-size: 1rem;
line-height: 28px;
}
#softDrinkModal .quantity-controls input {
width: 45px;
height: 28px;
font-size: 0.9rem;
}
#softDrinkModal .modal-footer {
padding: 10px;
}
#softDrinkModal .modal-footer .btn-primary {
padding: 10px 25px;
font-size: 1rem;
}
#softDrinkModal .modal-footer .quantity-controls-footer .btn {
width: 28px;
height: 28px;
font-size: 1rem;
line-height: 28px;
}
/* Mobile-Specific Filter Form Styles */
#filter-form {
margin-bottom: 15px;
}
.form-label {
font-size: 1rem;
}
.toggle-container {
margin: 6px 0;
}
.custom-toggle {
width: 40px;
height: 20px;
}
.custom-toggle::before {
width: 16px;
height: 16px;
top: 2px;
left: 2px;
}
.custom-toggle:checked::before {
transform: translateX(20px);
}
.toggle-container label {
font-size: 0.9rem;
}
}
.chat-container {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Segoe UI', Arial, sans-serif;
background-color: #f4f7fa;
overflow-x: hidden;
line-height: 1.5;
}
.chat-container {
width: 100%;
max-width: 800px;
height: 100vh;
margin: 0 auto;
background-color: #ffffff;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
overflow: hidden;
}
.chat-header {
background-color: #0078d4;
color: #ffffff;
padding: 12px;
text-align: center;
font-size: 18px;
font-weight: 600;
flex-shrink: 0;
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 15px;
scroll-behavior: smooth;
}
.bot-message, .user-message {
padding: 10px 15px;
margin: 8px 0;
border-radius: 12px;
max-width: 80%;
font-size: 14px;
line-height: 1.4;
}
.bot-message {
background-color: #e8f0fe;
color: #333;
}
.user-message {
background-color: #0078d4;
color: #ffffff;
margin-left: auto;
}
.chat-input {
display: flex;
padding: 10px;
border-top: 1px solid #e0e0e0;
background-color: #f9f9f9;
flex-shrink: 0;
}
.chat-input input {
flex: 1;
padding: 10px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 14px;
outline: none;
}
.chat-input button {
padding: 10px 20px;
margin-left: 10px;
background-color: #0078d4;
color: #ffffff;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.2s;
}
.chat-input button:hover {
background-color: #005ea2;
}
.ingredients-list, .menu-items-list, .customization-ingredients-list {
display: flex;
flex-wrap: nowrap; /* Ensure items stay in a single row */
overflow-x: auto; /* Allow horizontal scrolling */
padding: 10px;
margin: 10px 0;
background-color: #f5f7fa;
border-radius: 10px;
gap: 15px;
scroll-behavior: smooth;
}
.ingredient-item, .menu-item {
flex: 0 0 auto; /* Ensure items don't stretch */
width: 200px; /* Set a fixed width for each item */
background-color: #ffffff;
border: 1px solid #e0e0e0;
border-radius: 10px;
padding: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
transition: transform 0.2s;
text-align: center;
}
.ingredient-item:hover, .menu-item:hover {
transform: translateY(-2px);
}
.ingredient-item img, .menu-item img {
width: 100%;
height: 120px;
object-fit: cover;
border-radius: 8px;
margin-bottom: 8px;
}
.ingredient-item div, .menu-item div {
font-size: 14px;
font-weight: 600;
color: #333;
margin-bottom: 5px;
}
.ingredient-item button, .menu-item button {
padding: 8px;
background-color: #28a745;
color: #ffffff;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 12px;
width: 100%;
}
.ingredient-item button:hover, .menu-item button:hover {
background-color: #218838;
}
.selected-ingredients, .selected-customization-ingredients {
background-color: #f1f8ff;
padding: 15px;
border: 1px solid #b3d7ff;
border-radius: 10px;
margin: 10px 0;
font-size: 14px;
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.selected-ingredients div, .selected-customization-ingredients div {
background-color: #d6e9ff;
padding: 5px 10px;
border-radius: 6px;
font-size: 13px;
}
.customization-input {
margin: 10px 0;
}
.customization-input textarea, .selected-customization-ingredients textarea {
width: 100%;
padding: 8px;
border: 1px solid #b3d7ff;
border-radius: 6px;
font-size: 14px;
outline: none;
margin-bottom: 10px;
}
.customization-input button, .submit-button, .submit-customization-button, .submit-cart-button {
padding: 10px 20px;
background-color: #0078d4;
color: #ffffff;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.2s;
}
.customization-input button:hover, .submit-button:hover, .submit-customization-button:hover, .submit-cart-button:hover {
background-color: #005ea2;
}
.option-button {
padding: 10px 20px;
color: #ffffff;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
margin: 5px;
transition: background-color 0.2s;
}
.option-button.green {
background-color: #28a745;
}
.option-button.green:hover {
background-color: #218838;
}
.option-button.red {
background-color: #dc3545;
}
.option-button.red:hover {
background-color: #c82333;
}
.cart-items {
background-color: #f1f8ff;
padding: 15px;
border: 1px solid #b3d7ff;
border-radius: 10px;
margin: 10px 0;
font-size: 14px;
}
.cart-item {
display: flex;
align-items: center;
background-color: #d6e9ff;
padding: 5px 10px;
border-radius: 6px;
font-size: 13px;
margin: 5px 0;
}
.cart-item img {
width: 30px;
height: 30px;
object-fit: cover;
border-radius: 6px;
margin-right: 8px;
}
.cart-item .remove-button {
padding: 5px 10px;
margin-left: 8px;
background-color: #dc3545;
color: #ffffff;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 12px;
}
.cart-item .remove-button:hover {
background-color: #c82333;
}
/* Responsive Design */
@media (max-width: 480px) {
.chat-container {
border-radius: 0;
box-shadow: none;
}
.chat-header {
font-size: 16px;
padding: 10px;
}
.chat-messages {
padding: 10px;
}
.bot-message, .user-message {
font-size: 13px;
padding: 8px 12px;
margin: 5px 0;
}
.chat-input input {
font-size: 13px;
padding: 8px;
}
.chat-input button {
font-size: 13px;
padding: 8px 15px;
}
.ingredients-list, .menu-items-list, .customization-ingredients-list {
flex-direction: row; /* Keep the items in a row on mobile */
gap: 10px;
}
.ingredient-item, .menu-item {
flex: 0 0 150px; /* Adjust the item width to fit smaller screens */
}
.ingredient-item img, .menu-item img {
height: 100px;
}
.ingredient-item div, .menu-item div {
font-size: 13px;
}
.ingredient-item button, .menu-item button {
font-size: 11px;
padding: 6px;
}
.option-button {
font-size: 13px;
padding: 8px 15px;
}
.selected-ingredients, .selected-customization-ingredients, .cart-items {
padding: 10px;
gap: 8px;
}
.cart-item {
font-size: 12px;
padding: 4px 8px;
}
.cart-item img {
width: 25px;
height: 25px;
}
}
@media (min-width: 481px) and (max-width: 768px) {
.chat-container {
max-width: 600px;
}
.chat-header {
font-size: 17px;
padding: 11px;
}
.chat-messages {
padding: 12px;
}
.ingredient-item, .menu-item {
flex: 0 0 180px;
}
.ingredient-item img, .menu-item img {
height: 110px;
}
}
</style>
</head>
<body>
<div class="fixed-top-bar">
<div class="avatar-dropdown-container">
<div class="avatar-icon">
<span>{{ first_letter }}</span>
</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('combined_summary.combined_summary') }}" class="dropdown-item">MY Summary</a>
<a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
</div>
</div>
<div class="search-bar-container">
<input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." autocomplete="off">
<i class="bi bi-search search-icon"></i>
<i class="bi bi-mic mic-icon" id="micIcon"></i>
</div>
</div>
<form method="get" action="/menu" class="text-center mb-4" id="filter-form">
<label class="form-label fw-bold">Filters:</label>
<div class="toggle-container">
<!-- Veg Only Toggle -->
<input type="checkbox" id="veg-toggle" name="veg"
{% if selected_category == "Veg" %}checked{% endif %}
class="custom-toggle" onchange="handleToggle('veg')"
aria-label="Toggle Vegetarian filter">
<label for="veg-toggle">Veg</label>
</div>
<div class="toggle-container">
<!-- Customized Dish Toggle -->
<input type="radio" id="category-CustomizedDish" name="category" value="Customized Dish"
{% if selected_category == "Customized Dish" %}checked{% endif %}
class="custom-toggle" onchange="handleToggle('custom')"
aria-label="Toggle Customized Dish filter">
<label for="category-CustomizedDish">Customized Dish</label>
</div>
</form>
<div class="container mt-4">
{% if selected_category == "Customized Dish" %}
<div id="custom-dish-form" class="mt-4">
<div class="chat-container">
<div class="chat-header">🍳 Chef Bot</div>
<div class="chat-messages" id="chatMessages">
<!-- Initial message will be set by JavaScript based on session -->
</div>
<div class="chat-input">
<input type="text" id="userInput" placeholder="Type your name or message...">
<button onclick="sendMessage()">Send</button>
</div>
</div>
</div>
{% else %}
{% if ordered_menu.items()|length == 0 %}
<p>No menu items available for this category.</p>
{% else %}
{% 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" data-item-name="{{ item.Name | default('Unnamed Item') }}" data-item-section="{{ item.Section__c | default(section) }}">
<video
class="card-img-top menu-video"
muted
loop
preload="auto"
data-src="{{ item.Video1__c | default('/static/placeholder.mp4') }}"
poster="{{ item.Image1__c | default('/static/placeholder.jpg') }}"
width="350"
height="200"
onmouseover="this.play()"
onmouseout="this.pause(); this.currentTime = 0;"
onerror="this.poster='/static/placeholder.jpg';">
<source src="{{ item.Video1__c | default('/static/placeholder.mp4') }}" type="video/mp4">
Your browser does not support the video tag.
</video>
<div class="addbutton">
<div class="card-body d-flex align-items-center justify-content-between">
<div>
<h5 class="card-title">{{ item.Name | default('Unnamed Item') }}</h5>
<p class="card-text price">${{ item.Price__c | default('0.00') }}</p>
</div>
<div class="d-flex flex-column align-items-center justify-content-center">
<div class="button-container"
data-item-name="{{ item.Name | default('Unnamed Item') }}"
data-item-price="{{ item.Price__c | default('0.00') }}"
data-item-image="{{ item.Image1__c | default('/static/placeholder.jpg') }}"
data-item-section="{{ item.Section__c | default(section) }}"
data-item-category="{{ selected_category }}"
data-item-description="{{ item.Description__c | default('No description') }}"
data-item-image2="{{ item.Image2__c | default(item.Image1__c) }}">
{% if item.Section__c == 'Soft Drinks' %}
<button class="btn btn-primary add-to-cart-btn" onclick="showSoftDrinkModal(this)">ADD</button>
{% else %}
<button class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#itemModal"
onclick="showItemDetails('{{ item.Name | default('Unnamed Item') }}', '{{ item.Price__c | default('0.00') }}', '{{ item.Image2__c | default(item.Image1__c) }}', '{{ item.Description__c | default('No description') }}', '{{ item.Section__c | default(section) }}', '{{ selected_category }}')">
ADD
</button>
{% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' %}
<span class="customisable-text">Customisable</span>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
{% if item.Section__c != 'Soft Drinks' %}
<div class="toggle-details" data-item-name="{{ item.Name | default('Unnamed Item') }}">Show Details</div>
<div class="item-details" id="details-{{ item.Name | default('unnamed-item') | replace(' ', '-') }}">
<h6>Description</h6>
<p>{{ item.Description__c | default('No description available') }}</p>
<h6>Ingredients</h6>
<p>{{ item.Ingredientsinfo__c | default('Not specified') }}</p>
<h6>Nutritional Info</h6>
<p class="nutritional-info">{{ item.NutritionalInfo__c | default('Not available') }}</p>
<h6>Allergens</h6>
<p>{{ item.Allergens__c | default('None listed') }}</p>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endfor %}
{% endif %}
{% endif %}
</div>
<div class="bottom-action-bar">
<a href="{{ url_for('orderhistory.order_history') }}" class="btn btn-order-history">
<i class="bi bi-clock-history"></i> Order History
</a>
<a href="{{ url_for('cart.cart') }}" class="btn btn-view-cart">
<i class="bi bi-cart"></i> View Cart
<span id="cart-item-count" class="cart-icon-badge" style="display: none;">0</span>
</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">
<img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
<h5 id="modal-name" class="fw-bold text-center"></h5>
<p id="modal-price" class="text-muted text-center"></p>
<p id="modal-description" class="text-secondary"></p>
<div id="modal-addons" class="modal-addons mt-4">
<h5>Customization Options</h5>
<div id="addons-list" class="addons-container addon-loading"></div>
</div>
<div class="mt-4">
<h6>Special Instructions</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>
<div class="modal-footer d-flex align-items-center justify-content-between">
<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>
<button type="button" class="btn btn-primary" onclick="addToCartFromModal()">Add to Cart</button>
</div>
</div>
</div>
</div>
<!-- Modal for Soft Drinks Quantity Selection -->
<div class="modal fade" id="softDrinkModal" tabindex="-1" aria-labelledby="softDrinkModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="softDrinkModalLabel">Select Quantity</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<img id="soft-drink-image" class="img-fluid rounded mb-3 d-block mx-auto" alt="Soft Drink Image">
<div class="text-center mb-3">
<h5 id="soft-drink-name"></h5>
<p id="soft-drink-price"></p>
</div>
<div class="quantity-controls">
<button type="button" class="btn" id="soft-drink-decrease" onclick="updateSoftDrinkQuantity(-1)" aria-label="Decrease quantity by 1">-</button>
<input type="text" class="form-control text-center" id="soft-drink-quantity" value="1" readonly aria-label="Selected quantity">
<button type="button" class="btn" id="soft-drink-increase" onclick="updateSoftDrinkQuantity(1)" aria-label="Increase quantity by 1">+</button>
</div>
</div>
<div class="modal-footer">
<div class="quantity-controls-footer">
<button type="button" class="btn" id="soft-drink-decrease-footer" onclick="updateSoftDrinkQuantity(-1)" aria-label="Decrease quantity by 1">-1</button>
<button type="button" class="btn" id="soft-drink-increase-footer" onclick="updateSoftDrinkQuantity(1)" aria-label="Increase quantity by 1">+1</button>
</div>
<button type="button" class="btn btn-primary" onclick="addSoftDrinkToCart()" aria-label="Add soft drink to cart">Add to Cart</button>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
let isProcessingRequest = false;
let currentSoftDrinkButton = null;
let baseItemPrice = 0;
const menuItems = [
{% for section, items in ordered_menu.items() %}
{% for item in items %}
{
name: "{{ item.Name | default('Unnamed Item') }}",
section: "{{ item.Section__c | default(section) }}"
},
{% endfor %}
{% endfor %}
];
const ingredientsList = [
"Basmati Rice", "Bell Pepper", "Biryani Masala", "Butter", "Capsicum", "Cauliflower",
"Chickpea Flour (Besan)", "Chickpea Flour (for batter)", "Chickpeas (Channa)", "Chili Powder",
"Chili Sauce", "Coconut Milk", "Coriander Powder", "Cornflour", "Cream", "Cumin Powder",
"Cumin Seeds", "Curd (Yogurt)", "Curry Leaves", "Fish (e.g., King Fish or Salmon)",
"Fresh Coriander Leaves", "Garam Masala", "Garlic", "Ghee (Clarified Butter)", "Ginger",
"Ginger-Garlic Paste", "Goat Meat (Mutton)", "Green Chilies", "Honey",
"Kasuri Methi (dried fenugreek leaves)", "Lemon Juice", "Mango Puree", "Mint Leaves",
"Mixed Vegetables (Carrot, Peas, Potato, Cauliflower)", "Mixed Vegetables (Carrot, Peas, Potato)",
"Mustard Seeds", "Mutton (Goat Meat)", "Oil", "Oil (for frying)", "Onion",
"Paneer (Indian Cottage Cheese)", "Peas", "Potatoes", "Prawns", "Red Chili Powder",
"Rice Flour", "Saffron", "Salt", "Soy Sauce", "Spring Onion", "Tamarind (for sourness)",
"Tomato Ketchup", "Tomatoes", "Turmeric Powder", "Vinegar", "Water", "Wheat Flour (for dough)",
"Whole Wheat Flour", "Yogurt (Curd)"
];
function addToCartLocalStorage(payload) {
let cart = JSON.parse(localStorage.getItem('cart')) || [];
const existingItem = cart.find(item =>
item.itemName === payload.itemName &&
item.instructions === payload.instructions &&
JSON.stringify(item.addons) === JSON.stringify(payload.addons)
);
if (existingItem) {
existingItem.quantity = payload.quantity;
} else {
cart.push(payload);
}
localStorage.setItem('cart', JSON.stringify(cart));
return cart;
}
function removeFromCartLocalStorage(itemName, quantityToRemove, instructions, addons) {
let cart = JSON.parse(localStorage.getItem('cart')) || [];
const itemIndex = cart.findIndex(item =>
item.itemName === itemName &&
item.instructions === instructions &&
JSON.stringify(item.addons) === JSON.stringify(addons)
);
if (itemIndex !== -1) {
if (quantityToRemove >= cart[itemIndex].quantity) {
cart.splice(itemIndex, 1);
} else {
cart[itemIndex].quantity -= quantityToRemove;
}
}
localStorage.setItem('cart', JSON.stringify(cart));
return cart;
}
function getCartLocalStorage() {
return JSON.parse(localStorage.getItem('cart')) || [];
}
function debounce(func, wait) {
let timeout;
return function (...args) {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), wait);
};
}
function updateModalPrice() {
const selectedAddOns = Array.from(
document.querySelectorAll('#addons-list input[type="checkbox"]:checked')
).map(addon => parseFloat(addon.getAttribute('data-price')) || 0);
const totalAddOnPrice = selectedAddOns.reduce((sum, price) => sum + price, 0);
const totalPrice = baseItemPrice + totalAddOnPrice;
document.getElementById('modal-price').innerText = `$${totalPrice.toFixed(2)}`;
}
function updateSoftDrinkQuantity(delta) {
const quantityInput = document.getElementById('soft-drink-quantity');
let currentQuantity = parseInt(quantityInput.value) || 1;
currentQuantity = Math.max(1, currentQuantity + delta);
quantityInput.value = currentQuantity;
}
function showSoftDrinkModal(button) {
currentSoftDrinkButton = button;
const buttonContainer = button.closest('.button-container');
const itemName = buttonContainer.getAttribute('data-item-name');
const itemPrice = buttonContainer.getAttribute('data-item-price');
const itemImage = buttonContainer.getAttribute('data-item-image');
document.getElementById('soft-drink-name').textContent = itemName;
document.getElementById('soft-drink-price').textContent = `${itemPrice}`;
document.getElementById('soft-drink-quantity').value = '1';
document.getElementById('soft-drink-image').src = itemImage || '/static/placeholder.jpg';
const modal = new bootstrap.Modal(document.getElementById('softDrinkModal'));
modal.show();
}
function addSoftDrinkToCart() {
if (!currentSoftDrinkButton) return;
const buttonContainer = currentSoftDrinkButton.closest('.button-container');
const quantity = parseInt(document.getElementById('soft-drink-quantity').value) || 1;
const itemName = buttonContainer.getAttribute('data-item-name');
const itemPrice = parseFloat(buttonContainer.getAttribute('data-item-price'));
const itemImage = buttonContainer.getAttribute('data-item-image');
const section = buttonContainer.getAttribute('data-item-section');
const selectedCategory = buttonContainer.getAttribute('data-item-category');
const cartPayload = {
itemName: itemName,
itemPrice: itemPrice,
itemImage: itemImage,
section: section,
category: selectedCategory,
addons: [],
instructions: '',
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) {
updateCartUI(data.cart);
const modal = bootstrap.Modal.getInstance(document.getElementById('softDrinkModal'));
modal.hide();
} else {
console.error('Failed to add item to cart:', data.error);
const cart = addToCartLocalStorage(cartPayload);
updateCartUI(cart);
const modal = bootstrap.Modal.getInstance(document.getElementById('softDrinkModal'));
modal.hide();
}
})
.catch(err => {
console.error('Error adding item to cart:', err);
const cart = addToCartLocalStorage(cartPayload);
updateCartUI(cart);
const modal = bootstrap.Modal.getInstance(document.getElementById('softDrinkModal'));
modal.hide();
});
}
function updateCartUI(cart) {
if (!Array.isArray(cart)) {
console.error('Invalid cart data:', cart);
return;
}
let totalQuantity = 0;
cart.forEach(item => {
totalQuantity += item.quantity;
});
const cartItemCount = document.getElementById('cart-item-count');
if (cartItemCount) {
cartItemCount.innerText = totalQuantity;
cartItemCount.style.display = totalQuantity > 0 ? 'inline-flex' : 'none';
}
}
window.most_common_addons = {{ most_common_addons | tojson }};
console.log("Most common add-ons: ", window.most_common_addons);
function showItemDetails(name, price, image, description, section, selectedCategory) {
document.getElementById('modal-name').innerText = name;
baseItemPrice = parseFloat(price) || 0;
document.getElementById('modal-price').innerText = `$${baseItemPrice.toFixed(2)}`;
const modalImg = document.getElementById('modal-img');
modalImg.src = image || '/static/placeholder.jpg';
document.getElementById('modal-description').innerText = description || 'No description available.';
document.getElementById('addons-list').innerHTML = '';
document.getElementById('addons-list').classList.add('addon-loading');
document.getElementById('modal-instructions').value = '';
const modalSectionEl = document.getElementById('modal-section');
modalSectionEl.setAttribute('data-section', section);
modalSectionEl.setAttribute('data-category', selectedCategory);
document.getElementById('quantityInput').value = 1;
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
.then(response => response.json())
.then(data => {
const addonsList = document.getElementById('addons-list');
addonsList.classList.remove('addon-loading');
addonsList.innerHTML = '';
if (!data.success || !data.addons || data.addons.length === 0) {
addonsList.innerHTML = '<p>No customization options available.</p>';
return;
}
data.addons.forEach(addon => {
const sectionDiv = document.createElement('div');
sectionDiv.classList.add('addon-section');
const title = document.createElement('h6');
title.innerText = addon.name;
sectionDiv.appendChild(title);
const optionsContainer = document.createElement('div');
optionsContainer.classList.add('addon-options');
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}"
aria-label="Select ${option} for ${addon.name}">
<label class="form-check-label" for="${optionId}">
${option} ${addon.extra_charge ? `<span class="extra-charge">($${addon.extra_charge_amount.toFixed(2)})</span>` : ''}
</label>
`;
optionsContainer.appendChild(listItem);
});
sectionDiv.appendChild(optionsContainer);
addonsList.appendChild(sectionDiv);
});
const addonSections = addonsList.querySelectorAll('.addon-section');
addonSections.forEach(section => {
const title = section.querySelector('h6');
const options = section.querySelector('.addon-options');
title.addEventListener('click', () => {
section.classList.toggle('collapsed');
options.classList.toggle('collapsed');
});
});
document.querySelectorAll('.addon-option').forEach(checkbox => {
checkbox.addEventListener('change', updateModalPrice);
});
document.querySelectorAll('.addon-option').forEach(checkbox => {
checkbox.addEventListener('change', function () {
const groupName = this.getAttribute('data-group');
const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo", "Beverages", "Sauces"].includes(groupName);
if (!isMultiSelectGroup && this.checked) {
document.querySelectorAll(`.addon-option[data-group="${groupName}"]`).forEach(otherCheckbox => {
if (otherCheckbox !== this) {
otherCheckbox.checked = false;
}
});
}
});
});
// Pre-select the highest-count spice level
if (window.most_common_addons && window.most_common_addons.length > 0) {
const checkboxes = document.querySelectorAll('.addon-option');
const categorySelection = {
"Select Spice Level": null,
"Choose Spice Level": null,
"Raita/Sides": [],
};
// First pass: Find and select the highest-count spice level
for (let spice of window.most_common_addons) {
const isSpiceLevel = ["Mild", "Medium", "Spicy", "Extra Spicy"].includes(spice); // Define valid spice levels
if (isSpiceLevel) {
checkboxes.forEach(checkbox => {
const checkboxName = checkbox.getAttribute('data-name').trim();
const checkboxGroup = checkbox.getAttribute('data-group');
if ((checkboxGroup === "Select Spice Level" || checkboxGroup === "Choose Spice Level") &&
checkboxName === spice && categorySelection[checkboxGroup] === null) {
console.log(`Pre-selecting highest-count spice level: ${checkboxName}`);
checkbox.checked = true;
categorySelection[checkboxGroup] = checkboxName;
}
});
if (categorySelection["Select Spice Level"] || categorySelection["Choose Spice Level"]) break; // Stop after selecting the first spice
}
}
// Second pass: Select other non-spice add-ons (e.g., Raita/Sides)
checkboxes.forEach(checkbox => {
const checkboxName = checkbox.getAttribute('data-name').trim();
const checkboxGroup = checkbox.getAttribute('data-group');
if (checkboxGroup === "Raita/Sides" && window.most_common_addons.includes(checkboxName)) {
console.log(`Pre-selecting add-on: ${checkboxName}`);
checkbox.checked = true;
categorySelection["Raita/Sides"].push(checkboxName);
}
});
}
})
.catch(err => {
console.error('Error fetching add-ons:', err);
document.getElementById('addons-list').classList.remove('addon-loading');
document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
});
}
function addToCartFromModal() {
if (isProcessingRequest) return;
isProcessingRequest = true;
const modalSectionEl = document.getElementById('modal-section');
const section = modalSectionEl.getAttribute('data-section');
const selectedCategory = modalSectionEl.getAttribute('data-category');
const itemName = document.getElementById('modal-name').innerText;
const itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', '')) || 0;
const itemImage = document.getElementById('modal-img').src;
const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
const instructions = document.getElementById('modal-instructions').value;
const selectedAddOns = Array.from(
document.querySelectorAll('#addons-list input[type="checkbox"]:checked')
).map(addon => ({
name: addon.getAttribute('data-name'),
price: parseFloat(addon.getAttribute('data-price')) || 0
}));
if (!itemName || isNaN(itemPrice) || !section || !itemImage || quantity < 1) {
console.error('Invalid cart item data:', { itemName, itemPrice, section, itemImage, quantity });
alert('Invalid item data. Please try again.');
isProcessingRequest = false;
return;
}
const cartPayload = {
itemName: itemName,
itemPrice: itemPrice,
itemImage: itemImage,
section: section,
category: selectedCategory,
addons: selectedAddOns,
instructions: instructions,
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) {
updateCartUI(data.cart);
const modal = bootstrap.Modal.getInstance(document.getElementById('itemModal'));
modal.hide();
} else {
console.error('Failed to add item to cart:', data.error);
const cart = addToCartLocalStorage(cartPayload);
updateCartUI(cart);
const modal = bootstrap.Modal.getInstance(document.getElementById('itemModal'));
modal.hide();
}
})
.catch(err => {
console.error('Error adding item to cart:', err);
const cart = addToCartLocalStorage(cartPayload);
updateCartUI(cart);
const modal = bootstrap.Modal.getInstance(document.getElementById('itemModal'));
modal.hide();
})
.finally(() => {
isProcessingRequest = false;
});
}
function handleToggle(source) {
const form = document.getElementById("filter-form");
const veg = document.getElementById("veg-toggle");
const custom = document.getElementById("category-CustomizedDish");
if (source === 'veg') {
if (veg.checked) {
custom.checked = false;
}
} else if (source === 'custom') {
if (custom.checked) {
veg.checked = false;
}
}
if (!custom.checked && !veg.checked) {
custom.checked = false;
}
form.submit();
}
document.addEventListener('DOMContentLoaded', function () {
const avatarContainer = document.querySelector('.avatar-dropdown-container');
const dropdownMenu = document.querySelector('.dropdown-menu');
avatarContainer.addEventListener('click', function (event) {
event.stopPropagation();
dropdownMenu.style.display = dropdownMenu.style.display === 'block' ? 'none' : 'block';
});
document.addEventListener('click', function (event) {
if (!avatarContainer.contains(event.target)) {
dropdownMenu.style.display = 'none';
}
});
const dropdownItems = document.querySelectorAll('.dropdown-item');
dropdownItems.forEach(item => {
item.addEventListener('click', function () {
dropdownMenu.style.display = 'none';
});
});
const searchBar = document.getElementById('searchBar');
searchBar.addEventListener('click', function () {
window.location.href = '/search';
});
const selectedItem = localStorage.getItem('selectedItem');
if (selectedItem) {
try {
const { name, section } = JSON.parse(selectedItem);
const menuCards = document.querySelectorAll('.menu-card');
let targetCard = null;
let buttonContainer = null;
menuCards.forEach(card => {
const itemName = card.getAttribute('data-item-name');
const itemSection = card.getAttribute('data-item-section');
if (itemName === name && itemSection === section) {
targetCard = card;
buttonContainer = card.querySelector('.button-container');
card.classList.add('highlighted');
card.scrollIntoView({ behavior: 'smooth', block: 'center' });
const toggleLink = card.querySelector('.toggle-details');
if (toggleLink) {
toggleLink.click();
}
}
});
if (buttonContainer) {
if (section === 'Soft Drinks') {
showSoftDrinkModal(buttonContainer.querySelector('.add-to-cart-btn'));
} else {
const name = buttonContainer.getAttribute('data-item-name');
const price = buttonContainer.getAttribute('data-item-price');
const image = buttonContainer.getAttribute('data-item-image2');
const description = buttonContainer.getAttribute('data-item-description');
const category = buttonContainer.getAttribute('data-item-category');
showItemDetails(name, price, image, description, section, category);
const modal = new bootstrap.Modal(document.getElementById('itemModal'));
modal.show();
}
}
} catch (err) {
console.error('Error parsing selected item:', err);
}
localStorage.removeItem('selectedItem');
}
const menuCards = document.querySelectorAll('.menu-card');
const menuVideos = document.querySelectorAll('.menu-video');
const cardObserver = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target);
}
});
}, {
root: null,
rootMargin: '0px',
threshold: 0.1
});
const videoObserver = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const video = entry.target;
const src = video.getAttribute('data-src');
if (src && !video.querySelector('source[src="' + src + '"]')) {
const nextSibling = video.nextElementSibling;
if (nextSibling && nextSibling.tagName === 'SOURCE') {
nextSibling.src = src;
} else {
const source = video.querySelector('source');
if (source) {
source.src = src;
}
}
video.load();
}
video.classList.add('loaded');
observer.unobserve(video);
}
});
}, {
root: null,
rootMargin: '200px',
threshold: 0.01
});
menuCards.forEach(card => cardObserver.observe(card));
menuVideos.forEach(video => videoObserver.observe(video));
const toggleLinks = document.querySelectorAll('.toggle-details');
toggleLinks.forEach(link => {
link.addEventListener('click', function () {
const itemName = this.getAttribute('data-item-name').replace(/ /g, '-');
const detailsDiv = document.getElementById(`details-${itemName}`);
const isCurrentlyShown = detailsDiv.classList.contains('show');
document.querySelectorAll('.item-details.show').forEach(otherDetails => {
if (otherDetails !== detailsDiv) {
otherDetails.classList.remove('show');
const otherLink = document.querySelector(`.toggle-details[data-item-name="${otherDetails.id.replace('details-', '').replace(/-/g, ' ')}"]`);
if (otherLink) {
otherLink.innerText = 'Show Details';
}
}
});
if (!isCurrentlyShown) {
detailsDiv.classList.add('show');
this.innerText = 'Hide Details';
} else {
detailsDiv.classList.remove('show');
this.innerText = 'Show Details';
}
});
});
const descriptionTextarea = document.getElementById('custom-dish-description');
const descriptionSuggestions = document.getElementById('descriptionSuggestions');
if (descriptionTextarea && descriptionSuggestions) {
let usedIngredients = new Set();
function updateUsedIngredients() {
const inputText = descriptionTextarea.value.trim();
usedIngredients.clear();
if (inputText) {
const words = inputText.split(/,\s*/).map(word => word.trim());
words.forEach(word => {
if (word && ingredientsList.includes(word)) {
usedIngredients.add(word);
}
});
}
}
descriptionTextarea.addEventListener('input', function () {
const inputText = this.value.trim();
const words = inputText.split(/,\s*/);
const lastWord = words[words.length - 1].trim().toLowerCase();
descriptionSuggestions.innerHTML = '';
descriptionSuggestions.style.display = 'none';
updateUsedIngredients();
if (lastWord) {
const filteredIngredients = ingredientsList.filter(ingredient =>
ingredient.toLowerCase().includes(lastWord) && !usedIngredients.has(ingredient)
);
if (filteredIngredients.length > 0) {
filteredIngredients.forEach(ingredient => {
const suggestionDiv = document.createElement('div');
suggestionDiv.classList.add('suggestion-item');
suggestionDiv.innerText = ingredient;
suggestionDiv.addEventListener('click', function () {
const currentValue = descriptionTextarea.value;
const lastCommaIndex = currentValue.lastIndexOf(',');
const baseText = lastCommaIndex !== -1 ? currentValue.substring(0, lastCommaIndex + 1) : '';
descriptionTextarea.value = baseText + (baseText ? ' ' : '') + ingredient + ', ';
descriptionSuggestions.style.display = 'none';
descriptionTextarea.focus();
updateUsedIngredients();
});
descriptionSuggestions.appendChild(suggestionDiv);
});
descriptionSuggestions.style.display = 'block';
}
}
});
document.addEventListener('click', function (event) {
if (!descriptionTextarea.contains(event.target) && !descriptionSuggestions.contains(event.target)) {
descriptionSuggestions.style.display = 'none';
}
});
}
fetch('/cart/get')
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(data => {
if (data.success) {
updateCartUI(data.cart);
} else {
console.error('Failed to fetch cart:', data.error);
const cart = getCartLocalStorage();
updateCartUI(cart);
}
})
.catch(err => {
console.error('Error fetching cart:', err);
const cart = getCartLocalStorage();
updateCartUI(cart);
});
const preloadedVideos = document.querySelectorAll('link[rel="preload"][as="video"]');
preloadedVideos.forEach(link => {
const video = document.createElement('video');
video.src = link.href;
video.preload = 'auto';
});
const decreaseBtn = document.getElementById('decreaseQuantity');
const increaseBtn = document.getElementById('increaseQuantity');
const quantityInput = document.getElementById('quantityInput');
decreaseBtn.addEventListener('click', function () {
let quantity = parseInt(quantityInput.value) || 1;
quantity = Math.max(1, quantity - 1);
quantityInput.value = quantity;
});
increaseBtn.addEventListener('click', function () {
let quantity = parseInt(quantityInput.value) || 1;
quantity += 1;
quantityInput.value = quantity;
});
});
let currentStep = 'greeting'; // other possible values: 'food_type', 'select_ingredients', 'menu_display', 'customization', 'post_cart'
let conversation = [];
let selectedIngredients = [];
let selectedMenuItem = null;
let cart = [];
// Get the user name passed from Flask (via Jinja)
const userName = "{{ user_name }}"; // Jinja syntax to inject user_name from Flask session
window.onload = function() {
if (userName) {
// If user_name exists, greet the user directly and proceed to food preference
conversation.push({ role: 'bot', message: `Nice to meet you, ${userName}! 😊 Let's create your perfect meal! What type of food would you prefer?` });
displayConversation(); // Display the current conversation
displayOptions([
{ text: 'Vegetarian', class: 'green' },
{ text: 'Non-Vegetarian', class: 'red' }
]);
} else {
// Ask for the name if it's not found
conversation.push({ role: 'bot', message: "Hi there! I'm Chef Bot! May I know your name?" });
displayConversation(); // Display the conversation
}
};
// Function to add messages to the chat
function addMessage(role, message) {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found!');
return;
}
const messageDiv = document.createElement('div');
messageDiv.className = role === 'bot' ? 'bot-message' : 'user-message';
messageDiv.textContent = message;
chatMessages.appendChild(messageDiv);
chatMessages.scrollTop = chatMessages.scrollHeight;
}
// Function to display all conversation messages
function displayConversation() {
const chatMessages = document.getElementById('chatMessages');
chatMessages.innerHTML = ''; // Clear previous messages
conversation.forEach(msg => {
const messageDiv = document.createElement('div');
messageDiv.className = msg.role === 'bot' ? 'bot-message' : 'user-message';
messageDiv.textContent = msg.message;
chatMessages.appendChild(messageDiv);
});
chatMessages.scrollTop = chatMessages.scrollHeight; // Scroll to bottom
}
// Function to handle user input
function sendMessage() {
const userInput = document.getElementById('userInput').value.trim();
if (userInput) {
addMessage('user', userInput);
conversation.push({ role: 'user', message: userInput });
document.getElementById('userInput').value = ''; // Clear input field
setTimeout(() => handleResponse(userInput), 500);
} else {
console.warn('Empty message!');
}
}
function handleResponse(userInput) {
const lastMessage = conversation[conversation.length - 1].message.toLowerCase();
let botResponse = '';
let options = [];
// If user has already selected food type, proceed without repeating the question
if (lastMessage.includes('non-vegetarian')) {
conversation.push({ role: 'user', message: 'Non-Vegetarian' });
console.log("Food preference selected: Non-Vegetarian");
botResponse = 'Great choice! 🍽️ Please select a non-vegetarian option:';
fetchIngredients('non-vegetarian');
return;
} else if (lastMessage.includes('vegetarian')) {
conversation.push({ role: 'user', message: 'Vegetarian' });
console.log("Food preference selected: Vegetarian");
botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
fetchIngredients('vegetarian');
return;
} else if (lastMessage.includes('chicken') || lastMessage.includes('beef') || lastMessage.includes('lamb')) {
conversation.push({ role: 'user', message: lastMessage });
console.log(`Non-veg option selected: ${lastMessage}`);
botResponse = `Great! Here are some ${lastMessage} ingredients available:`;
fetchIngredients(lastMessage.toLowerCase());
return;
} else if (lastMessage.includes('yes') && selectedMenuItem) {
botResponse = 'Here are some ingredients to customize your dish:';
handleYesResponse();
return;
} else if (lastMessage.includes('no') && selectedMenuItem) {
// Submit the dish without customization
submitCustomizationIngredients();
return;
} else if (lastMessage.includes('yes') && currentStep === 'post_cart') {
// After user says 'yes', ask again for food preference (veg or non-veg)
botResponse = `Let's get started again! What type of food would you prefer this time?`;
options = [
{ text: 'Vegetarian', class: 'green' },
{ text: 'Non-Vegetarian', class: 'red' }
];
currentStep = 'food_type';
addMessage('bot', botResponse);
displayOptions(options);
return;
} else if (lastMessage.includes('non-vegetarian') && currentStep === 'food_type') {
// Handle non-vegetarian selection
conversation.push({ role: 'user', message: 'Non-Vegetarian' });
console.log("Food preference selected: Non-Vegetarian");
botResponse = 'Great choice! 🍽️ Please select a non-vegetarian option:';
fetchIngredients('non-vegetarian');
return;
} else if (lastMessage.includes('vegetarian') && currentStep === 'food_type') {
// Handle vegetarian selection
conversation.push({ role: 'user', message: 'Vegetarian' });
console.log("Food preference selected: Vegetarian");
botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
fetchIngredients('vegetarian');
return;
} else if (lastMessage.includes('no') && currentStep === 'post_cart') {
addMessage('bot', 'Awesome! 🧾 Here’s your final cart:');
displayCart(); // Optional: show final cart again
addMessage('bot', 'Thank you for your order! 👨🍳🍲');
currentStep = 'end';
return;
}
addMessage('bot', botResponse);
if (options.length > 0) {
displayOptions(options);
}
displayCart();
}
function handleYesResponse() {
if (!selectedMenuItem) {
addMessage('bot', 'No dish selected. Please choose a dish first.');
return;
}
const botResponse = `Here is your selected dish: ${selectedMenuItem.name}`;
addMessage('bot', botResponse);
// Display selected menu item
const chatMessages = document.getElementById('chatMessages');
const menuItemDiv = document.createElement('div');
menuItemDiv.className = 'menu-item';
const img = document.createElement('img');
img.src = selectedMenuItem.image_url || 'https://via.placeholder.com/120';
img.alt = selectedMenuItem.name;
const name = document.createElement('div');
name.textContent = selectedMenuItem.name;
menuItemDiv.appendChild(img);
menuItemDiv.appendChild(name);
chatMessages.appendChild(menuItemDiv);
// Fetch ingredients for customization
fetchIngredientsForCustomization('both');
}
function fetchIngredientsForCustomization(foodPreference) {
fetch('/get_ingredients', { // Reuse existing endpoint
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ dietary_preference: foodPreference })
})
.then(response => response.json())
.then(data => {
if (data.error) {
addMessage('bot', `Sorry, there was an error fetching ingredients: ${data.error}`);
} else {
const ingredients = data.ingredients || [];
addMessage('bot', 'Please select ingredients to customize:');
displayCustomizationIngredients(ingredients);
}
})
.catch(error => {
addMessage('bot', `Error: Unable to connect to the ingredient database. ${error.message}`);
});
}
function displayCustomizationIngredients(ingredients) {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found for customization ingredients!');
return;
}
let ingredientsList = document.querySelector('.customization-ingredients-list');
if (!ingredientsList) {
ingredientsList = document.createElement('div');
ingredientsList.className = 'customization-ingredients-list';
chatMessages.appendChild(ingredientsList);
} else {
ingredientsList.innerHTML = '';
}
ingredients.forEach(ingredient => {
const item = document.createElement('div');
item.className = 'ingredient-item';
const img = document.createElement('img');
img.src = ingredient.image_url || 'https://via.placeholder.com/120';
img.alt = ingredient.name;
const name = document.createElement('div');
name.textContent = ingredient.name;
const button = document.createElement('button');
button.textContent = 'Add';
button.onclick = () => {
if (!selectedIngredients.some(item => item.name === ingredient.name)) {
selectedIngredients.push({ name: ingredient.name, image_url: ingredient.image_url });
displaySelectedCustomizationIngredients();
}
};
item.appendChild(img);
item.appendChild(name);
item.appendChild(button);
ingredientsList.appendChild(item);
});
displaySelectedCustomizationIngredients();
}
function displaySelectedCustomizationIngredients() {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found for selected customization ingredients!');
return;
}
let selectedArea = document.querySelector('.selected-customization-ingredients');
if (!selectedArea) {
selectedArea = document.createElement('div');
selectedArea.className = 'selected-customization-ingredients';
chatMessages.appendChild(selectedArea);
} else {
selectedArea.innerHTML = '';
}
const selectedIngredientsText = selectedIngredients.length > 0
? `${selectedMenuItem.name} with ${selectedIngredients.map(ingredient => ingredient.name).join(', ')}`
: selectedMenuItem.name;
const ingredientsDiv = document.createElement('div');
ingredientsDiv.textContent = selectedIngredientsText;
selectedArea.appendChild(ingredientsDiv);
selectedIngredients.forEach(ingredient => {
const div = document.createElement('div');
div.textContent = ingredient.name;
const removeButton = document.createElement('button');
removeButton.textContent = 'X';
removeButton.style.marginLeft = '5px';
removeButton.style.padding = '2px 5px';
removeButton.style.backgroundColor = '#dc3545';
removeButton.style.color = '#ffffff';
removeButton.style.border = 'none';
removeButton.style.borderRadius = '4px';
removeButton.style.cursor = 'pointer';
removeButton.onclick = () => {
selectedIngredients = selectedIngredients.filter(item => item.name !== ingredient.name);
displaySelectedCustomizationIngredients();
};
div.appendChild(removeButton);
selectedArea.appendChild(div);
});
if (!document.querySelector('.submit-customization-button')) {
const textarea = document.createElement('textarea');
textarea.placeholder = 'Enter any special instructions...';
selectedArea.appendChild(textarea);
const submitButton = document.createElement('button');
submitButton.className = 'submit-customization-button';
submitButton.textContent = 'Submit Customization';
submitButton.onclick = submitCustomizationIngredients;
selectedArea.appendChild(submitButton);
}
}
function submitCustomizationIngredients() {
if (!selectedMenuItem) {
addMessage('bot', 'No dish selected. Please choose a dish first.');
return;
}
const textarea = document.querySelector('.selected-customization-ingredients textarea');
const instructions = textarea ? textarea.value.trim() : '';
fetch('/submit_customization_ingredients', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
menu_item: selectedMenuItem,
ingredients: selectedIngredients,
instructions: instructions
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
addToCart({ ...selectedMenuItem, instructions, ingredients: selectedIngredients });
currentStep = 'post_cart';
addMessage('bot', 'Customization submitted successfully! Item added to cart.');
// Redirect to the cart page
window.location.href = '/cart/cart'; // This will redirect the user to the cart page
} else {
addMessage('bot', `Error: ${data.error}`);
}
})
.catch(error => {
addMessage('bot', `Error submitting customization: ${error.message}`);
});
}
function fetchIngredients(foodPreference) {
fetch('/get_ingredients', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ dietary_preference: foodPreference })
})
.then(response => response.json())
.then(data => {
if (data.error) {
addMessage('bot', `Sorry, there was an error fetching ingredients: ${data.error}`);
} else {
const ingredients = data.ingredients || [];
addMessage('bot', 'Please select ingredients:');
displayIngredientsList(ingredients);
displaySelectedIngredients();
}
})
.catch(error => {
addMessage('bot', `Error: Unable to connect to the ingredient database. ${error.message}`);
});
}
function fetchMenuItems(params) {
fetch('/get_menu_items', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(params)
})
.then(response => response.json())
.then(data => {
if (data.error) {
addMessage('bot', `Sorry, there was an error fetching menu items: ${data.error}`);
} else {
const menuItems = data.menu_items || [];
addMessage('bot', 'Here are some dishes based on your selection:');
displayMenuItems(menuItems);
}
})
.catch(error => {
addMessage('bot', `Error: Unable to connect to the menu database. ${error.message}`);
});
}
function displayIngredientsList(ingredients) {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found for ingredients!');
return;
}
let ingredientsList = document.querySelector('.ingredients-list');
if (!ingredientsList) {
ingredientsList = document.createElement('div');
ingredientsList.className = 'ingredients-list';
chatMessages.appendChild(ingredientsList);
} else {
ingredientsList.innerHTML = '';
}
ingredients.forEach(ingredient => {
const item = document.createElement('div');
item.className = 'ingredient-item';
const img = document.createElement('img');
img.src = ingredient.image_url || 'https://via.placeholder.com/120';
img.alt = ingredient.name;
const name = document.createElement('div');
name.textContent = ingredient.name;
const button = document.createElement('button');
button.textContent = 'Add';
button.onclick = () => {
if (!selectedIngredients.some(item => item.name === ingredient.name)) {
selectedIngredients.push(ingredient);
displaySelectedIngredients();
}
};
item.appendChild(img);
item.appendChild(name);
item.appendChild(button);
ingredientsList.appendChild(item);
});
}
function displayMenuItems(menuItems) {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found for menu items!');
return;
}
let menuItemsList = document.querySelector('.menu-items-list');
if (!menuItemsList) {
menuItemsList = document.createElement('div');
menuItemsList.className = 'menu-items-list';
chatMessages.appendChild(menuItemsList);
} else {
menuItemsList.innerHTML = '';
}
menuItems.forEach(item => {
const menuItem = document.createElement('div');
menuItem.className = 'menu-item';
const img = document.createElement('img');
img.src = item.image_url || 'https://via.placeholder.com/120';
img.alt = item.name;
const name = document.createElement('div');
name.textContent = item.name;
const button = document.createElement('button');
button.textContent = 'Add to Cart';
button.onclick = () => {
selectedMenuItem = item;
addMessage('bot', `World-class selection! Would you like to customize your dish further?`);
const options = [
{ text: 'Yes', class: 'green' },
{ text: 'No', class: 'red' }
];
displayOptions(options);
};
menuItem.appendChild(img);
menuItem.appendChild(name);
menuItem.appendChild(button);
menuItemsList.appendChild(menuItem);
});
}
function displaySelectedIngredients() {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found for selected ingredients!');
return;
}
let selectedArea = document.querySelector('.selected-ingredients');
if (!selectedArea) {
selectedArea = document.createElement('div');
selectedArea.className = 'selected-ingredients';
chatMessages.appendChild(selectedArea);
} else {
selectedArea.innerHTML = '';
}
selectedIngredients.forEach(ingredient => {
const div = document.createElement('div');
div.textContent = ingredient.name;
const removeButton = document.createElement('button');
removeButton.textContent = 'X';
removeButton.style.marginLeft = '5px';
removeButton.style.padding = '2px 5px';
removeButton.style.backgroundColor = '#dc3545';
removeButton.style.color = '#ffffff';
removeButton.style.border = 'none';
removeButton.style.borderRadius = '4px';
removeButton.style.cursor = 'pointer';
removeButton.onclick = () => {
selectedIngredients = selectedIngredients.filter(item => item.name !== ingredient.name);
displaySelectedIngredients();
};
div.appendChild(removeButton);
selectedArea.appendChild(div);
});
if (selectedIngredients.length > 0) {
let submitButton = document.querySelector('.submit-button');
if (!submitButton) {
submitButton = document.createElement('button');
submitButton.className = 'submit-button';
submitButton.textContent = 'Submit Ingredients';
submitButton.onclick = submitIngredients;
chatMessages.appendChild(submitButton);
}
}
}
function submitIngredients() {
if (selectedIngredients.length === 0) {
addMessage('bot', 'No ingredients selected. Please choose some ingredients.');
return;
}
const ingredientNames = selectedIngredients.map(ingredient => ingredient.name.toLowerCase()).join(' ');
fetchMenuItems({ ingredient_names: ingredientNames });
}
function addToCart(item) {
cart.push(item);
console.log('Cart:', cart);
displayCart();
}
function displayCart() {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found for cart!');
return;
}
let cartArea = document.querySelector('.cart-items');
if (!cartArea) {
cartArea = document.createElement('div');
cartArea.className = 'cart-items';
chatMessages.appendChild(cartArea);
} else {
cartArea.innerHTML = '';
}
if (cart.length > 0) {
const label = document.createElement('div');
label.textContent = 'Cart:';
cartArea.appendChild(label);
cart.forEach((item, index) => {
const itemDiv = document.createElement('div');
itemDiv.className = 'cart-item';
const img = document.createElement('img');
img.src = item.image_url || 'https://via.placeholder.com/30';
img.alt = item.name;
const name = document.createElement('div');
const text = item.instructions
? `${item.name} (${item.instructions})`
: item.name;
name.textContent = item.ingredients.length > 0
? `${text} with ${item.ingredients.map(i => i.name).join(', ')}`
: text;
const removeButton = document.createElement('button');
removeButton.className = 'remove-button';
removeButton.textContent = 'X';
removeButton.onclick = () => {
cart.splice(index, 1);
displayCart();
};
itemDiv.appendChild(img);
itemDiv.appendChild(name);
itemDiv.appendChild(removeButton);
cartArea.appendChild(itemDiv);
});
let submitCartButton = document.querySelector('.submit-cart-button');
if (!submitCartButton) {
submitCartButton = document.createElement('button');
submitCartButton.className = 'submit-cart-button';
submitCartButton.textContent = 'Submit Cart';
submitCartButton.onclick = submitCart;
cartArea.appendChild(submitCartButton);
}
}
}
function submitCart() {
if (cart.length === 0) {
addMessage('bot', 'Your cart is empty!');
return;
}
fetch('/submit_customization_ingredients', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ items: cart })
})
.then(response => response.json())
.then(data => {
if (data.success) {
addMessage('bot', 'Cart submitted successfully!');
cart = [];
displayCart();
} else {
addMessage('bot', `Error submitting cart: ${data.error}`);
}
})
.catch(error => {
addMessage('bot', `Error submitting cart: ${error.message}`);
});
}
function displayOptions(options) {
const chatMessages = document.getElementById('chatMessages');
if (!chatMessages) {
console.error('Chat messages container not found for options!');
return;
}
console.log('Displaying options:', options);
options.forEach(opt => {
const button = document.createElement('button');
button.textContent = opt.text;
button.className = `option-button ${opt.class}`;
button.onclick = () => {
addMessage('user', opt.text);
conversation.push({ role: 'user', message: opt.text });
console.log(`User selected option: ${opt.text}`);
setTimeout(() => handleResponse(opt.text), 500);
};
chatMessages.appendChild(button);
});
chatMessages.appendChild(document.createElement('br'));
chatMessages.scrollTop = chatMessages.scrollHeight;
console.log('Options displayed');
}
document.getElementById('userInput').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
sendMessage();
}
});
console.log('Script loaded successfully');
</script>
</body>
</html>
|