Spaces:
Runtime error
Runtime error
File size: 103,583 Bytes
628d97b 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 1f925c4 aefd7aa 5e1e5fe 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 aefd7aa 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 aefd7aa 8e24a61 aefd7aa 8e24a61 aefd7aa 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 aefd7aa 8e24a61 1f925c4 18e1521 1f925c4 18e1521 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 18e1521 8e24a61 1f925c4 8e24a61 1f925c4 aefd7aa 1f925c4 18e1521 8e24a61 1f925c4 8e24a61 1f925c4 aefd7aa 1f925c4 8e24a61 5e1e5fe 8e24a61 1313645 8e24a61 1f925c4 8e24a61 1313645 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 aefd7aa 8e24a61 5e1e5fe 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 145bd7d 8e24a61 145bd7d 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 a2262a9 8e24a61 5e1e5fe 8e24a61 1f925c4 f77e19a 8e24a61 1f925c4 8e24a61 1f925c4 18e1521 8e24a61 18e1521 1f925c4 18e1521 8e24a61 18e1521 1f925c4 8e24a61 1f925c4 8e24a61 1313645 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 1f925c4 8e24a61 1313645 8e24a61 1313645 8e24a61 1313645 8e24a61 1313645 8e24a61 1f925c4 8e24a61 aefd7aa 8e24a61 aefd7aa 8e24a61 aefd7aa 8e24a61 aefd7aa 1313645 aefd7aa 1f925c4 5e1e5fe aefd7aa 8e24a61 aefd7aa 8e24a61 aefd7aa 1f925c4 1313645 aefd7aa 1f925c4 1313645 aefd7aa 1f925c4 1313645 aefd7aa 1f925c4 1313645 17bd459 8e24a61 17bd459 8e24a61 17bd459 aefd7aa 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 1f925c4 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 aefd7aa 5e1e5fe 8e24a61 1f925c4 5e1e5fe 8e24a61 1313645 5e1e5fe aefd7aa 18e1521 8e24a61 5e1e5fe 18e1521 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 aefd7aa 8e24a61 1f925c4 8e24a61 1f925c4 18e1521 1f925c4 18e1521 1f925c4 8e24a61 1f925c4 18e1521 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 aefd7aa 8e24a61 aefd7aa 8e24a61 1f925c4 8e24a61 18e1521 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 17bd459 18e1521 8e24a61 18e1521 8e24a61 1313645 5e1e5fe 8e24a61 5e1e5fe 8e24a61 1f925c4 145bd7d 5e1e5fe 8e24a61 1f925c4 8e24a61 145bd7d 8e24a61 1f925c4 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 9dbcb20 aefd7aa 5e1e5fe 9dbcb20 17bd459 9dbcb20 5e1e5fe 17bd459 5e1e5fe 9dbcb20 17bd459 9dbcb20 5e1e5fe 9dbcb20 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 18e1521 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 e30adb9 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe aefd7aa 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 18e1521 9dbcb20 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 5e1e5fe 8e24a61 5e1e5fe aefd7aa 8e24a61 aefd7aa 18e1521 aefd7aa 18e1521 8e24a61 aefd7aa 8e24a61 aefd7aa 1313645 aefd7aa 1f925c4 8e24a61 aefd7aa 1313645 aefd7aa 8e24a61 1f925c4 8e24a61 aefd7aa 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 1313645 1f925c4 8e24a61 1f925c4 8e24a61 18e1521 aefd7aa 8e24a61 1f925c4 1313645 8e24a61 aefd7aa 8e24a61 1f925c4 1313645 1f925c4 8e24a61 18e1521 8e24a61 1f925c4 8e24a61 1313645 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 8e24a61 5e1e5fe 145bd7d 5e1e5fe 8e24a61 5e1e5fe 9dbcb20 8e24a61 17bd459 8e24a61 17bd459 8e24a61 1f925c4 8e24a61 17bd459 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 18e1521 1f925c4 8e24a61 1f925c4 18e1521 1f925c4 18e1521 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1313645 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 8e24a61 18e1521 aefd7aa 8e24a61 aefd7aa 8e24a61 aefd7aa 8e24a61 aefd7aa 8e24a61 1f925c4 8e24a61 1f925c4 5e1e5fe 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 721e03f 1f925c4 625fcfa 8e24a61 1f925c4 1313645 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 8e24a61 1f925c4 9cbf19b fb8ba83 |
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 |
<!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/bootstrap@5.3.0-alpha1/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;
padding: 0 15px;
}
.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, transform 0.3s ease;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.menu-card.visible {
opacity: 1;
transform: translateY(0);
}
.menu-video {
height: 200px;
width: 100%;
object-fit: cover;
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: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, transform 0.2s ease;
margin-left: 13px;
}
.addbutton .btn:hover {
background-color: #218838;
transform: scale(1.05);
}
.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;
position: relative;
transition: transform 0.2s ease;
}
.avatar-icon:hover {
transform: scale(1.1);
}
.avatar-icon img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
transition: transform 0.2s ease;
}
.avatar-icon img:hover {
transform: scale(1.1);
}
.dropdown-menu {
position: absolute;
right: 0;
top: 100%;
background-color: #fff8f0;
border-radius: 8px;
width: 200px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
display: none;
border: 1px solid #ffd8b1;
padding: 5px 0;
z-index: 1000;
animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}
.dropdown-menu .dropdown-item {
padding: 10px 16px;
text-decoration: none;
color: #333;
font-size: 14px;
transition: background-color 0.2s ease, color 0.2s ease;
cursor: pointer;
}
.dropdown-menu .dropdown-item:hover {
background-color: #ffe4c4;
color: #2c2c2c;
}
.upload-item,
.delete-item,
.view-item {
padding: 10px 16px;
text-decoration: none;
color: #333;
font-size: 14px;
transition: background-color 0.2s ease;
cursor: pointer;
}
.upload-item:hover,
.delete-item:hover,
.view-item:hover {
background-color: #ffe4c4;
color: #2c2c2c;
}
.fixed-top-bar {
position: fixed;
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;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.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;
transition: box-shadow 0.3s ease;
}
.search-bar-container input:focus {
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.search-bar-container input::placeholder {
color: #888;
}
.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;
}
.mic-unsupported {
display: none;
position: absolute;
right: 15px;
font-size: 14px;
color: #888;
background-color: #fff;
padding: 2px 8px;
border-radius: 10px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.autocomplete-suggestions {
position: absolute;
top: 100%;
left: 0;
width: 100%;
max-height: 200px;
overflow-y: auto;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
z-index: 1000;
display: none;
}
.autocomplete-suggestions .suggestion-item {
padding: 8px 15px;
cursor: pointer;
font-size: 14px;
color: #333;
transition: background-color 0.2s ease;
}
.autocomplete-suggestions .suggestion-item:hover {
background-color: #f1f1f1;
}
.addon-section {
background-color: #fff;
border: 2px solid #ffa500;
border-radius: 8px;
padding: 12px;
margin-bottom: 10px;
}
.addon-section h6 {
margin-bottom: 10px;
font-size: 1.1rem;
font-weight: bold;
color: #343a40;
}
.addon-section .form-check {
display: inline-flex;
align-items: center;
margin-left: 10px;
color: #343a40;
}
.addon-section .form-check-input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border: 2px solid #343a40;
border-radius: 5px;
background-color: #f0f0f0;
position: relative;
margin-right: 10px;
}
.addon-section .form-check-input:checked {
background-color: #006400;
border-color: #006400;
}
.addon-section .form-check-input:checked::before {
content: '\2713';
font-size: 14px;
position: absolute;
top: 3px;
left: 4px;
color: white;
}
.addon-section .form-check-label {
font-size: 16px;
margin-left: 5px;
margin-right: 15px;
cursor: pointer;
display: inline-block;
vertical-align: middle;
}
form.text-center.mb-4 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 5px;
}
.modal-header {
padding: 10px 15px;
}
.modal-title {
font-size: 16px;
font-weight: bold;
}
.modal-body {
max-height: 60vh;
overflow-y: auto;
padding: 15px;
text-align: center;
}
.modal-body #avatar-modal-img {
max-width: 100%;
max-height: 400px;
object-fit: contain;
border-radius: 8px;
margin: 0 auto;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.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: 10px;
}
.modal-body .nutritional-info {
font-size: 12px;
color: #6c757d;
margin-bottom: 10px;
}
.modal-body #modal-addons h6,
.modal-body #first-row h6 {
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
}
.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 {
display: none;
padding: 15px;
background-color: #f8f9fa;
border-radius: 8px;
margin-top: 10px;
margin: 10px 15px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.item-details.show {
display: block;
}
.item-details h6 {
color: #0FAA39;
margin-bottom: 10px;
font-size: 1.1rem;
font-weight: bold;
}
.item-details p {
margin-bottom: 15px;
color: #555;
line-height: 1.5;
font-size: 0.9rem;
}
.toggle-details {
cursor: pointer;
color: #0FAA39;
font-size: 0.9rem;
text-align: left;
padding: 5px 0;
transition: color 0.3s ease;
display: block;
width: 100%;
margin-top: 5px;
}
.toggle-details:hover {
color: #0D9232;
text-decoration: underline;
}
.category-buttons {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
margin-top: 10px;
}
.category-button {
background-color: #fff;
border: 2px solid #0FAA39;
color: #0FAA39;
padding: 5px 15px;
border-radius: 20px;
font-size: 0.9rem;
cursor: pointer;
transition: background-color 0.3s, color 0.3s;
}
.category-button.selected {
background-color: #0FAA39;
color: #fff;
border-color: #0FAA39;
}
.category-button:hover {
background-color: #e6f4ea;
}
.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;
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
margin-bottom: 20px;
max-height: 70vh;
overflow-y: auto;
}
#custom-dish-form h3 {
font-size: 1.3rem;
color: #0FAA39;
margin-bottom: 20px;
text-align: center;
}
#custom-dish-form .btn-primary {
position: relative;
right: auto;
bottom: auto;
width: 100%;
padding: 10px 20px;
margin-top: 15px;
}
#custom-dish-form::-webkit-scrollbar {
width: 8px;
}
#custom-dish-form::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}
#custom-dish-form::-webkit-scrollbar-thumb {
background: #0FAA39;
border-radius: 10px;
}
#custom-dish-form::-webkit-scrollbar-thumb:hover {
background: #0D9232;
}
#dishNameSuggestions {
position: absolute;
width: calc(100% - 30px);
max-height: 200px;
overflow-y: auto;
background: white;
border: 1px solid #ddd;
border-radius: 0 0 4px 4px;
z-index: 1000;
display: none;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.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;
transition: transform 0.2s ease;
}
.bottom-action-bar .btn:hover {
transform: scale(1.05);
}
.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;
transition: all 0.3s ease;
}
.mic-popup {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 30px;
border-radius: 15px;
text-align: center;
z-index: 2000;
display: none;
width: 300px;
max-width: 90%;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.mic-popup.active {
display: block;
}
.mic-popup-icon {
font-size: 48px;
margin-bottom: 20px;
color: #ff4444;
animation: pulse 1.5s infinite;
}
.mic-popup-text {
font-size: 18px;
margin-bottom: 15px;
min-height: 24px;
}
.mic-popup-cancel {
background-color: #ff4444;
color: white;
border: none;
padding: 8px 20px;
border-radius: 20px;
cursor: pointer;
font-weight: bold;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
@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: 180px;
}
.dropdown-menu .dropdown-item {
padding: 8px 12px;
font-size: 13px;
}
.upload-item,
.delete-item,
.view-item {
padding: 8px 12px;
font-size: 13px;
}
.category-buttons {
gap: 8px;
}
.category-button {
padding: 4px 12px;
font-size: 0.85rem;
}
.modal-dialog {
max-width: 96%;
margin: 5px auto;
}
.modal-header {
padding: 5px 10px;
}
.modal-title {
font-size: 14px;
}
.modal-body {
max-height: 50vh;
padding: 8px;
}
.modal-body #avatar-modal-img {
max-height: 300px;
}
.modal-body #modal-img {
max-height: 150px;
width: 100%;
max-width: 150px;
margin: 0 auto 5px;
display: block;
}
.modal-body #modal-name {
font-size: 18px;
margin-bottom: 3px;
}
.modal-body #modal-price {
font-size: 14px;
margin-bottom: 5px;
}
.modal-body #modal-description {
font-size: 12px;
margin-bottom: 5px;
}
.modal-body .nutritional-info {
font-size: 10px;
margin-bottom: 5px;
}
.modal-body #modal-addons h6,
.modal-body #first-row h6 {
font-size: 12px;
margin-bottom: 5px;
}
.modal-footer {
padding: 5px;
}
.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;
}
.item-details {
padding: 10px;
margin: 5px 10px;
}
.item-details h6 {
font-size: 0.95rem;
}
.item-details p {
font-size: 0.8rem;
}
.toggle-details {
font-size: 0.8rem;
}
.mic-popup {
padding: 20px;
width: 280px;
}
.mic-popup-icon {
font-size: 36px;
margin-bottom: 15px;
}
.mic-popup-text {
font-size: 16px;
}
.mic-popup-cancel {
padding: 6px 16px;
font-size: 14px;
}
#custom-dish-form {
padding: 15px;
max-height: 60vh;
}
}
</style>
</head>
<body>
<div class="fixed-top-bar" role="banner">
<div class="avatar-dropdown-container">
<div class="avatar-icon" id="avatarIcon" role="button" aria-label="User Menu">
{% if user_image %}
<img src="{{ user_image }}" alt="User Avatar" class="avatar-image">
{% else %}
<span>{{ first_letter }}</span>
{% endif %}
</div>
<div class="dropdown-menu" id="avatarDropdown" role="menu">
{% if user_image %}
<div class="dropdown-item delete-item" id="deleteAvatar" role="menuitem">Delete Image</div>
<div class="dropdown-item view-item" id="viewAvatar" role="menuitem">View Avatar</div>
{% endif %}
<a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item" role="menuitem">Order History</a>
<a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item" role="menuitem">View Profile</a>
<div class="dropdown-item upload-item" role="menuitem">
<label for="avatarUpload" style="cursor: pointer; margin: 0; width: 100%;">
Upload Image
</label>
<input type="file" id="avatarUpload" accept="image/*" style="display: none;" aria-label="Upload Avatar">
</div>
<a href="{{ url_for('logout') }}" class="dropdown-item" role="menuitem">Logout</a>
</div>
</div>
<div class="search-bar-container">
<input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." autocomplete="off" aria-label="Search menu items">
<i class="bi bi-search search-icon"></i>
<i class="bi bi-mic mic-icon" id="micIcon" role="button" aria-label="Voice Search"></i>
<span class="mic-unsupported" id="micUnsupported">Mic not supported</span>
<div id="autocompleteSuggestions" class="autocomplete-suggestions"></div>
</div>
</div>
<form method="get" action="/menu" class="text-center mb-4" id="categoryForm" role="form">
<label class="form-label fw-bold" for="selectedCategoryInput">Select a Category:</label>
<div class="category-buttons">
{% for category in categories %}
<button type="button" class="category-button {% if selected_category == category %}selected{% endif %}" data-category="{{ category }}" aria-pressed="{% if selected_category == category %}true{% else %}false{% endif %}">{{ category }}</button>
{% endfor %}
<button type="button" class="category-button {% if selected_category == 'Customized Dish' %}selected{% endif %}" data-category="Customized Dish" aria-pressed="{% if selected_category == 'Customized Dish' %}true{% else %}false{% endif %}">Customized Dish</button>
</div>
<input type="hidden" name="category" id="selectedCategoryInput" value="{{ selected_category }}">
</form>
<div class="container mt-4" role="main">
{% if selected_category == "Customized Dish" %}
<div id="custom-dish-form" class="mt-4">
<h3>Create Your Custom Dish</h3>
<form id="customDishForm" role="form">
<div class="mb-3 position-relative">
<label for="custom-dish-name" class="form-label">Dish Name</label>
<input type="text" class="form-control" id="custom-dish-name" name="name" required autocomplete="off" placeholder="e.g., Spicy Chicken Curry" aria-label="Custom Dish Name">
<div id="dishNameSuggestions" class="autocomplete-suggestions"></div>
</div>
<div class="mb-3">
<label for="custom-dish-ingredients" class="form-label">Ingredients List</label>
<textarea class="form-control" id="custom-dish-ingredients" name="ingredients" required rows="3" placeholder="e.g., Chicken, Tomatoes, Spices" aria-label="Ingredients List"></textarea>
</div>
<div class="mb-3">
<label for="custom-dish-description" class="form-label">Dish Description</label>
<textarea class="form-control" id="custom-dish-description" name="description" required rows="3" placeholder="e.g., A spicy and flavorful chicken dish" aria-label="Dish Description"></textarea>
</div>
<div class="mb-3">
<label for="custom-dish-price" class="form-label">Price ($)</label>
<input type="number" class="form-control" id="custom-dish-price" name="price" step="0.01" min="0.01" required placeholder="e.g., 12.99" aria-label="Price">
</div>
<button type="submit" class="btn btn-primary" id="submitCustomDish" aria-label="Submit Custom Dish">Submit Custom Dish</button>
<div id="form-feedback" class="mt-3" style="display: none; text-align: center;"></div>
</form>
</div>
{% else %}
{% if ordered_menu.items()|length == 0 %}
<p class="text-center">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" data-item-name="{{ item.Name | default('Unnamed Item') | e }}">
<div class="card menu-card">
<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';"
aria-label="Video preview of {{ item.Name | default('Unnamed Item') }}">
<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>
{% if item.Section__c != 'Soft Drinks' %}
<div class="toggle-details" data-item-name="{{ item.Name | default('Unnamed Item') }}" role="button" aria-expanded="false" aria-controls="details-{{ item.Name | default('unnamed-item') | replace(' ', '-') }}">Show Details</div>
{% endif %}
</div>
<div class="d-flex flex-column align-item-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.Image2__c | default(item.Image1__c) | default('/static/placeholder.jpg') }}"
data-item-section="{{ item.Section__c | default(section) }}"
data-item-category="{{ selected_category }}">
{% if item.Section__c == 'Soft Drinks' %}
<button class="btn btn-primary add-to-cart-btn" onclick="showSoftDrinkModal(this)" aria-label="Add {{ item.Name | default('Unnamed Item') }} to cart">ADD</button>
{% else %}
<button class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#itemModal"
onclick="showItemDetails('{{ item.Name | default('Unnamed Item') | e }}', '{{ item.Price__c | default('0.00') }}', '{{ item.Image2__c | default(item.Image1__c) | default('/static/placeholder.jpg') }}', '{{ item.Description__c | default('No description') | e }}', '{{ item.IngredientsInfo__c | default('Not specified') | e }}', '{{ item.NutritionalInfo__c | default('Not available') | e }}', '{{ item.Allergens__c | default('None listed') | e }}', '{{ item.Section__c | default(section) | e }}', '{{ selected_category | e }}')"
aria-label="Add {{ item.Name | default('Unnamed Item') }} to cart">
ADD
</button>
{% endif %}
{% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' and item.Section__c != 'Soft Drinks' %}
<span class="customisable-text">Customisable</span>
{% endif %}
</div>
</div>
</div>
</div>
{% if item.Section__c != 'Soft Drinks' %}
<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 Info</h6>
<p>{{ item.Ingredientsinfo__c | default('Not specified') }}</p>
<h6>Nutritional Info</h6>
<p>{{ 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" role="navigation">
<a href="{{ url_for('orderhistory.order_history') }}" class="btn btn-order-history" aria-label="View Order History">
<i class="bi bi-clock-history"></i> Order History
</a>
<a href="{{ url_for('cart.cart') }}" class="btn btn-view-cart" aria-label="View Cart">
<i class="bi bi-cart"></i> View Cart
<span class="cart-icon-badge" id="cart-item-count">{{ cart_item_count }}</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 class="nutritional-info">
<strong>Ingredients:</strong> <span id="modal-ingredients"></span><br>
<strong>Nutrition:</strong> <span id="modal-nutrition"></span><br>
<strong>Allergens:</strong> <span id="modal-allergens"></span>
</div>
<div id="modal-addons" class="modal-addons mt-4">
<h6>Customization Options</h6>
<div id="addons-list" class="addons-container">Loading customization options...</div>
</div>
<div class="mt-4">
<h6>Custom Request</h6>
<textarea id="modal-instructions" class="form-control" placeholder="Enter any special instructions here..." aria-label="Special Instructions"></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" aria-label="Decrease Quantity">-</button>
<input type="text" class="form-control text-center" id="quantityInput" value="1" readonly style="width: 50px;" aria-label="Quantity"/>
<button type="button" class="btn btn-outline-secondary" id="increaseQuantity" aria-label="Increase Quantity">+</button>
</div>
<button type="button" class="btn btn-primary" onclick="addToCartFromModal()" aria-label="Add to Cart">Add to Cart</button>
</div>
</div>
</div>
</div>
<!-- Modal for Avatar View -->
<div class="modal fade" id="avatarModal" tabindex="-1" aria-labelledby="avatarModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="avatarModalLabel">View Avatar</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<img id="avatar-modal-img" class="img-fluid rounded mx-auto d-block" alt="Avatar Image" style="max-height: 400px; object-fit: contain;">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Close Avatar Modal">Close</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" style="border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
<div class="modal-header" style="background: linear-gradient(45deg, #0FAA39, #0D9232); color: white; border-radius: 15px 15px 0 0;">
<h5 class="modal-title" id="softDrinkModalLabel">Select Your Drink</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" style="padding: 20px;">
<div class="text-center mb-4">
<img id="soft-drink-image" class="img-fluid rounded mb-3" alt="Soft Drink Image" style="max-height: 150px; width: auto; object-fit: contain;">
<h5 id="soft-drink-name" class="fw-bold" style="color: #333;"></h5>
<p id="soft-drink-price" class="text-muted" style="font-size: 1.1rem;"></p>
</div>
<div class="d-flex justify-content-center align-items-center mb-
4">
<div class="quantity-selector" style="background-color: #f8f9fa; padding: 10px; border-radius: 10px;">
<button type="button" class="btn btn-outline-secondary" id="soft-drink-decrease" style="width: 40px; height: 40px;" aria-label="Decrease Drink Quantity">-</button>
<input type="text" class="form-control text-center mx-2" id="soft-drink-quantity" value="1" readonly style="width: 60px; font-weight: bold; font-size: 1.1rem;" aria-label="Drink Quantity">
<button type="button" class="btn btn-outline-secondary" id="soft-drink-increase" style="width: 40px; height: 40px;" aria-label="Increase Drink Quantity">+</button>
</div>
</div>
</div>
<div class="modal-footer" style="border-top: none; padding: 0 20px 20px 20px; justify-content: center;">
<button type="button" class="btn btn-primary" onclick="addSoftDrinkToCart()" style="width: 200px; padding: 12px; font-size: 1.1rem; background-color: #0FAA39; border-color: #0FAA39;" aria-label="Add Drink to Cart">Add to Cart</button>
</div>
</div>
</div>
</div>
<!-- Mic Popup -->
<div class="mic-popup" id="micPopup" role="alert" aria-live="polite">
<div class="mic-popup-icon">
<i class="bi bi-mic-fill"></i>
</div>
<div class="mic-popup-text" id="micPopupText">Listening...</div>
<button class="mic-popup-cancel" id="micPopupCancel" aria-label="Cancel Voice Search">Cancel</button>
</div>
<!-- Confirmation Modal -->
<div class="modal fade" id="confirmationModal" tabindex="-1" aria-labelledby="confirmationModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirmationModalLabel">Confirm Action</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p id="confirmationMessage"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Cancel">Cancel</button>
<button type="button" class="btn btn-primary" id="confirmAction" aria-label="Confirm">Confirm</button>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script>
let isProcessingRequest = false;
let currentSoftDrinkButton = null;
const menuItems = [
{% for section, items in ordered_menu.items() %}
{% for item in items %}
"{{ item.Name | default('Unnamed Item') | e }}",
{% endfor %}
{% endfor %}
];
const sections = [
{% for section in ordered_menu.keys() %}
"{{ section | e }}",
{% 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)"
];
const dishDatabase = {
"Aloo Paratha": {
ingredients: "Wheat flour, potatoes, spices (cumin, coriander), ghee",
description: "Stuffed potato flatbread cooked with ghee, a North Indian breakfast favorite.",
price: 8.99
},
"Appam": {
ingredients: "Rice flour, coconut milk, yeast, sugar",
description: "Soft and lacy Kerala rice pancakes, perfect with stew or curry.",
price: 7.49
},
"Aamras": {
ingredients: "Ripe mangoes, sugar, cardamom",
description: "Sweet mango pulp dessert, a summer specialty from Rajasthan and Gujarat.",
price: 6.99
},
"Biryani": {
ingredients: "Basmati rice, meat (chicken/mutton), spices (saffron, bay leaf), yogurt, fried onions",
description: "Fragrant layered rice dish with spiced meat, a celebration favorite.",
price: 14.99
},
"Butter Chicken": {
ingredients: "Chicken, tomato puree, butter, cream, garam masala",
description: "Creamy Punjabi curry with tender chicken pieces in rich tomato sauce.",
price: 15.99
},
"Bhel Puri": {
ingredients: "Puffed rice, sev, tamarind chutney, onions, tomatoes",
description: "Mumbai's famous sweet-sour-spicy street snack with crunchy textures.",
price: 6.49
},
"Chole Bhature": {
ingredients: "Chickpeas, flour (for bhature), onions, tomatoes, chole masala",
description: "Spicy chickpea curry with deep-fried bread, a North Indian classic.",
price: 9.99
},
"Chicken Chettinad": {
ingredients: "Chicken, coconut, black pepper, fennel, curry leaves",
description: "Fiery Tamil Nadu chicken curry with aromatic spices and coconut.",
price: 16.99
},
"Dosa": {
ingredients: "Rice, urad dal, salt (fermented batter)",
description: "Crispy South Indian crepe, typically served with sambar and chutney.",
price: 8.99
},
"Dal Tadka": {
ingredients: "Toor dal, garlic, cumin, ghee, tomatoes",
description: "Tempered lentil dish with aromatic spices, a staple across India.",
price: 7.99
},
"Dhokla": {
ingredients: "Gram flour, yogurt, eno fruit salt, mustard seeds",
description: "Steamed Gujarati snack with spongy texture and mild sweet-sour taste.",
price: 6.99
},
"Egg Curry": {
ingredients: "Boiled eggs, onion-tomato gravy, turmeric, coriander powder",
description: "Hard-boiled eggs in spiced gravy, popular in Bengal and Kerala.",
price: 9.49
},
"Fish Curry": {
ingredients: "Fish (pomfret/rohu), coconut milk, tamarind, curry leaves",
description: "Goan/Kerala style fish in tangy coconut gravy with spices.",
price: 17.99
},
"Gulab Jamun": {
ingredients: "Khoya, flour, sugar syrup, cardamom",
description: "Deep-fried milk dumplings soaked in rose-scented sugar syrup.",
price: 5.99
},
"Gajar ka Halwa": {
ingredients: "Carrots, milk, sugar, ghee, nuts",
description: "Slow-cooked carrot pudding with milk and dry fruits, winter special.",
price: 7.49
},
"Hyderabadi Biryani": {
ingredients: "Basmati rice, marinated meat, saffron, fried onions, mint",
description: "Famous layered biryani from Hyderabad with dum cooking technique.",
price: 18.99
},
"Idli": {
ingredients: "Rice, urad dal, fenugreek seeds (fermented batter)",
description: "Steamed rice cakes, South India's healthiest breakfast option.",
price: 6.99
},
"Jalebi": {
ingredients: "Maida, yogurt, sugar syrup, saffron",
description: "Crispy orange swirls soaked in sugar syrup, served hot.",
price: 5.49
},
"Kaju Katli": {
ingredients: "Cashew paste, sugar, ghee, cardamom",
description: "Diamond-shaped cashew fudge, a festive favorite.",
price: 8.99
},
"Korma": {
ingredients: "Meat (chicken/lamb), yogurt, cashew paste, cream",
description: "Mughlai creamy curry with mild spices and nutty flavor.",
price: 16.49
},
"Litti Chokha": {
ingredients: "Whole wheat flour, sattu (roasted gram flour), eggplant, potatoes",
description: "Bihar's rustic roasted dough balls with spicy vegetable mash.",
price: 10.99
},
"Masala Dosa": {
ingredients: "Dosa batter, potato filling, mustard seeds, curry leaves",
description: "Crispy crepe stuffed with spiced potatoes, served with chutney.",
price: 9.99
},
"Nihari": {
ingredients: "Beef/mutton, bone marrow, ginger-garlic, wheat flour (for thickening)",
description: "Slow-cooked meat stew, a Mughlai breakfast delicacy.",
price: 17.99
},
"Onion Pakoda": {
ingredients: "Besan (gram flour), onions, chili powder, carom seeds",
description: "Crispy onion fritters, perfect monsoon snack with tea.",
price: 5.99
},
"Pani Puri": {
ingredients: "Puris, tamarind water, mashed potatoes, chickpeas",
description: "Hollow crispy puris filled with spicy-sour water and fillings.",
price: 6.99
},
"Pav Bhaji": {
ingredients: "Mixed veggies (potatoes, peas, capsicum), butter, pav bread",
description: "Mumbai's famous buttery vegetable mash with soft bread rolls.",
price: 10.49
},
"Rajma Chawal": {
ingredients: "Kidney beans, onions, tomatoes, cumin, rice",
description: "Comfort food from Punjab - red kidney beans curry with rice.",
price: 11.99
},
"Sambar": {
ingredients: "Toor dal, tamarind, sambar powder, veggies (drumstick, pumpkin)",
description: "South Indian lentil stew with vegetables and tangy tamarind.",
price: 8.49
},
"Tandoori Chicken": {
ingredients: "Chicken, yogurt, red chili, tandoori masala, lemon",
description: "Clay oven-roasted chicken marinated in yogurt and spices.",
price: 15.99
},
"Vada Pav": {
ingredients: "Potatoes, pav bread, garlic chutney, green chutney",
description: "Mumbai's vegetarian burger - spicy potato patty in bread.",
price: 6.99
},
"Wada (Medu Vada)": {
ingredients: "Urad dal, black pepper, curry leaves, coconut chutney",
description: "South Indian savory donuts made from lentil batter.",
price: 7.49
},
"Xacuti": {
ingredients: "Chicken/lamb, roasted coconut, poppy seeds, Kashmiri chilies",
description: "Goan coconut-based curry with complex spice flavors.",
price: 16.99
},
"Yakhni Pulao": {
ingredients: "Mutton, yogurt, fennel, ghee, basmati rice",
description: "Kashmiri aromatic rice cooked in meat stock with mild spices.",
price: 15.99
},
"Zunka": {
ingredients: "Besan (gram flour), onions, mustard seeds, turmeric",
description: "Maharashtra's spiced gram flour dish, typically served with bhakri.",
price: 7.99
}
};
function sanitizeInput(input) {
const div = document.createElement('div');
div.textContent = input;
return div.innerHTML;
}
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 showConfirmation(message, callback) {
document.getElementById('confirmationMessage').innerText = message;
const confirmBtn = document.getElementById('confirmAction');
confirmBtn.onclick = function() {
callback();
bootstrap.Modal.getInstance(document.getElementById('confirmationModal')).hide();
};
const modal = new bootstrap.Modal(document.getElementById('confirmationModal'));
modal.show();
}
function showSoftDrinkModal(button) {
currentSoftDrinkButton = button;
const buttonContainer = button.closest('.button-container');
const itemName = sanitizeInput(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';
const softDrinkImage = document.getElementById('soft-drink-image');
softDrinkImage.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;
if (quantity < 1 || quantity > 99) {
alert('Quantity must be between 1 and 99.');
return;
}
const itemName = sanitizeInput(buttonContainer.getAttribute('data-item-name'));
const itemPrice = parseFloat(buttonContainer.getAttribute('data-item-price'));
const itemImage = buttonContainer.getAttribute('data-item-image');
const section = sanitizeInput(buttonContainer.getAttribute('data-item-section'));
const selectedCategory = sanitizeInput(buttonContainer.getAttribute('data-item-category'));
const cartPayload = {
itemName: itemName,
itemPrice: itemPrice,
itemImage: itemImage,
section: section,
category: selectedCategory,
addons: [],
instructions: '',
quantity: quantity,
timestamp: new Date().toISOString()
};
fetch('/cart/add', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(cartPayload)
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Item added to cart successfully!');
updateCartUI(data.cart);
bootstrap.Modal.getInstance(document.getElementById('softDrinkModal')).hide();
} else {
throw new Error(data.error || 'Failed to add item to cart');
}
})
.catch(err => {
console.error('Error adding item to cart:', err);
alert('Error adding item to cart. Using local storage as fallback.');
const cart = addToCartLocalStorage(cartPayload);
updateCartUI(cart);
bootstrap.Modal.getInstance(document.getElementById('softDrinkModal')).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';
}
}
document.addEventListener('DOMContentLoaded', function () {
const avatarContainer = document.querySelector('.avatar-dropdown-container');
const dropdownMenu = document.querySelector('.dropdown-menu');
const avatarIcon = document.getElementById('avatarIcon');
const avatarUpload = document.getElementById('avatarUpload');
const deleteAvatar = document.getElementById('deleteAvatar');
const viewAvatar = document.getElementById('viewAvatar');
function loadAvatar() {
const savedAvatar = localStorage.getItem('userAvatar');
const avatarImage = avatarIcon.querySelector('.avatar-image');
if (savedAvatar && !avatarImage) {
const img = document.createElement('img');
img.src = savedAvatar;
img.alt = 'User Avatar';
img.className = 'avatar-image';
img.style.cssText = 'width: 100%; height: 100%; object-fit: cover; border-radius: 50%;';
avatarIcon.innerHTML = '';
avatarIcon.appendChild(img);
ensureAvatarOptions();
} else if (!savedAvatar && avatarImage) {
avatarIcon.innerHTML = `<span>{{ first_letter }}</span>`;
removeAvatarOptions();
}
}
function ensureAvatarOptions() {
if (!document.querySelector('#deleteAvatar')) {
const deleteItem = document.createElement('div');
deleteItem.className = 'dropdown-item delete-item';
deleteItem.id = 'deleteAvatar';
deleteItem.innerText = 'Delete Image';
dropdownMenu.insertBefore(deleteItem, dropdownMenu.firstChild);
addDeleteListener(deleteItem);
}
if (!document.querySelector('#viewAvatar')) {
const viewItem = document.createElement('div');
viewItem.className = 'dropdown-item view-item';
viewItem.id = 'viewAvatar';
viewItem.innerText = 'View Avatar';
const firstChild = dropdownMenu.firstChild;
if (firstChild) dropdownMenu.insertBefore(viewItem, firstChild.nextSibling);
addViewListener(viewItem);
}
}
function removeAvatarOptions() {
const deleteItem = document.getElementById('deleteAvatar');
const viewItem = document.getElementById('viewAvatar');
if (deleteItem) deleteItem.remove();
if (viewItem) viewItem.remove();
}
function saveAvatar(imageUrl) {
localStorage.setItem('userAvatar', imageUrl);
}
function clearAvatar() {
localStorage.removeItem('userAvatar');
avatarIcon.innerHTML = `<span>{{ first_letter }}</span>`;
removeAvatarOptions();
}
avatarIcon.addEventListener('click', function(event) {
event.stopPropagation();
dropdownMenu.style.display = dropdownMenu.style.display === 'block' ? 'none' : 'block';
});
avatarUpload.addEventListener('change', function(event) {
const file = event.target.files[0];
if (file) {
const maxSize = 15 * 1024 * 1024; // 15MB in bytes
if (file.size > maxSize) {
alert('Image size must not exceed 15MB.');
this.value = '';
return;
}
const reader = new FileReader();
reader.onload = function(e) {
const base64Image = e.target.result;
fetch('/upload_avatar', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ image: base64Image })
})
.then(response => {
if (!response.ok) throw new Error('Upload failed');
return response.json();
})
.then(data => {
if (data.success) {
const img = document.createElement('img');
img.src = data.image || '/static/default-avatar.jpg';
img.alt = 'User Avatar';
img.className = 'avatar-image';
img.style.cssText = 'width: 100%; height: 100%; object-fit: cover; border-radius: 50%;';
avatarIcon.innerHTML = '';
avatarIcon.appendChild(img);
saveAvatar(data.image);
ensureAvatarOptions();
dropdownMenu.style.display = 'none';
} else {
throw new Error(data.error || 'Unknown error');
}
})
.catch(error => {
console.error('Upload error:', error);
alert('Error uploading image. Using default image as fallback.');
const img = document.createElement('img');
img.src = '/static/default-avatar.jpg';
img.alt = 'User Avatar';
img.className = 'avatar-image';
img.style.cssText = 'width: 100%; height: 100%; object-fit: cover; border-radius: 50%;';
avatarIcon.innerHTML = '';
avatarIcon.appendChild(img);
saveAvatar('/static/default-avatar.jpg');
ensureAvatarOptions();
dropdownMenu.style.display = 'none';
});
};
reader.onerror = function() {
alert('Error reading the image file.');
};
reader.readAsDataURL(file);
}
});
function addDeleteListener(deleteElement) {
deleteElement.addEventListener('click', function() {
showConfirmation('Are you sure you want to delete your avatar?', function() {
fetch('/delete_avatar', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
if (!response.ok) throw new Error('Delete failed');
return response.json();
})
.then(data => {
if (data.success) {
clearAvatar();
dropdownMenu.style.display = 'none';
} else {
throw new Error(data.error || 'Unknown error');
}
})
.catch(error => {
console.error('Delete error:', error);
alert('Error deleting image. Cleared locally.');
clearAvatar();
dropdownMenu.style.display = 'none';
});
});
});
}
function addViewListener(viewElement) {
viewElement.addEventListener('click', function() {
const avatarImage = avatarIcon.querySelector('.avatar-image');
if (avatarImage) {
const modalImg = document.getElementById('avatar-modal-img');
modalImg.src = avatarImage.src;
const modal = new bootstrap.Modal(document.getElementById('avatarModal'));
modal.show();
} else {
alert('No avatar image to view.');
}
dropdownMenu.style.display = 'none';
});
}
if (deleteAvatar) addDeleteListener(deleteAvatar);
if (viewAvatar) addViewListener(viewAvatar);
loadAvatar();
document.addEventListener('click', function(event) {
if (!avatarContainer.contains(event.target)) {
dropdownMenu.style.display = 'none';
}
});
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 source = video.querySelector('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 = otherDetails.previousElementSibling.querySelector('.toggle-details');
if (otherLink) {
otherLink.innerText = 'Show Details';
otherLink.setAttribute('aria-expanded', 'false');
}
}
});
if (!isCurrentlyShown) {
detailsDiv.classList.add('show');
this.innerText = 'Hide Details';
this.setAttribute('aria-expanded', 'true');
} else {
detailsDiv.classList.remove('show');
this.innerText = 'Show Details';
this.setAttribute('aria-expanded', 'false');
}
});
});
const categoryButtons = document.querySelectorAll('.category-button');
const categoryForm = document.getElementById('categoryForm');
const selectedCategoryInput = document.getElementById('selectedCategoryInput');
if (!selectedCategoryInput.value) {
selectedCategoryInput.value = "All";
const allBtn = document.querySelector('.category-button[data-category="All"]');
if (allBtn) allBtn.classList.add('selected');
}
categoryButtons.forEach(button => {
button.addEventListener('click', function () {
categoryButtons.forEach(btn => btn.classList.remove('selected'));
this.classList.add('selected');
selectedCategoryInput.value = this.getAttribute('data-category');
categoryForm.submit();
});
});
const searchBar = document.getElementById('searchBar');
const suggestionsContainer = document.getElementById('autocompleteSuggestions');
const debouncedFilterMenu = debounce(filterMenu, 300);
// Redirect to search page on click
searchBar.addEventListener('click', function (event) {
event.stopPropagation();
window.location.href = '/search';
});
searchBar.addEventListener('input', function () {
const input = sanitizeInput(this.value.trim().toLowerCase());
suggestionsContainer.innerHTML = '';
suggestionsContainer.style.display = 'none';
if (input) {
const filteredItems = menuItems.filter(item =>
item.toLowerCase().includes(input)
);
if (filteredItems.length > 0) {
filteredItems.forEach(item => {
const suggestionDiv = document.createElement('div');
suggestionDiv.classList.add('suggestion-item');
suggestionDiv.innerText = item;
suggestionDiv.addEventListener('click', function () {
searchBar.value = item;
suggestionsContainer.style.display = 'none';
debouncedFilterMenu();
});
suggestionsContainer.appendChild(suggestionDiv);
});
suggestionsContainer.style.display = 'block';
}
}
debouncedFilterMenu();
});
document.addEventListener('click', function (event) {
if (!searchBar.contains(event.target) && !suggestionsContainer.contains(event.target)) {
suggestionsContainer.style.display = 'none';
}
});
// Dish name autocomplete functionality
const dishNameInput = document.getElementById('custom-dish-name');
const dishIngredients = document.getElementById('custom-dish-ingredients');
const dishDescription = document.getElementById('custom-dish-description');
const dishPrice = document.getElementById('custom-dish-price');
const dishSuggestions = document.getElementById('dishNameSuggestions');
dishNameInput.addEventListener('input', function() {
const input = this.value.trim().toLowerCase();
dishSuggestions.innerHTML = '';
dishSuggestions.style.display = 'none';
if (input.length > 0) {
const matches = Object.keys(dishDatabase).filter(dish =>
dish.toLowerCase().includes(input)
);
if (matches.length > 0) {
matches.slice(0, 5).forEach(dish => {
const suggestion = document.createElement('div');
suggestion.classList.add('suggestion-item');
suggestion.textContent = dish;
suggestion.addEventListener('click', function() {
dishNameInput.value = dish;
// Auto-fill the other fields
if (dishDatabase[dish]) {
dishIngredients.value = dishDatabase[dish].ingredients;
dishDescription.value = dishDatabase[dish].description;
dishPrice.value = dishDatabase[dish].price.toFixed(2);
}
dishSuggestions.style.display = 'none';
});
dishSuggestions.appendChild(suggestion);
});
dishSuggestions.style.display = 'block';
}
}
});
// Close suggestions when clicking elsewhere
document.addEventListener('click', function(e) {
if (e.target !== dishNameInput) {
dishSuggestions.style.display = 'none';
}
});
// Allow manual editing after auto-fill
dishIngredients.addEventListener('focus', function() {
if (!this.value && dishNameInput.value && dishDatabase[dishNameInput.value]) {
this.value = dishDatabase[dishNameInput.value].ingredients;
}
});
dishDescription.addEventListener('focus', function() {
if (!this.value && dishNameInput.value && dishDatabase[dishNameInput.value]) {
this.value = dishDatabase[dishNameInput.value].description;
}
});
const customDishForm = document.getElementById('customDishForm');
if (customDishForm) {
customDishForm.addEventListener('submit', function(event) {
const dishName = document.getElementById('custom-dish-name').value.trim();
const description = document.getElementById('custom-dish-description').value.trim();
if (!dishName || !description) {
event.preventDefault();
alert('Please fill in both the dish name and description.');
return;
}
event.preventDefault();
fetch('/customdish/generate_custom_dish', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams({
'name': dishName,
'description': description,
'ingredients': document.getElementById('custom-dish-ingredients').value,
'price': document.getElementById('custom-dish-price').value
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Custom dish submitted successfully!');
window.location.reload();
} else {
alert('Failed to submit custom dish: ' + (data.error || 'Unknown error'));
}
})
.catch(error => {
console.error('Error submitting custom dish:', error);
alert('Error submitting custom dish. Please try again.');
});
});
}
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 currentQuantity = parseInt(quantityInput.value);
if (currentQuantity > 1) {
currentQuantity--;
quantityInput.value = currentQuantity;
}
});
increaseBtn.addEventListener('click', function () {
let currentQuantity = parseInt(quantityInput.value);
currentQuantity++;
quantityInput.value = currentQuantity;
});
const softDrinkDecreaseBtn = document.getElementById('soft-drink-decrease');
const softDrinkIncreaseBtn = document.getElementById('soft-drink-increase');
const softDrinkQuantityInput = document.getElementById('soft-drink-quantity');
softDrinkDecreaseBtn.addEventListener('click', function() {
let currentQuantity = parseInt(softDrinkQuantityInput.value);
if (currentQuantity > 1) {
currentQuantity--;
softDrinkQuantityInput.value = currentQuantity;
}
});
softDrinkIncreaseBtn.addEventListener('click', function() {
let currentQuantity = parseInt(softDrinkQuantityInput.value);
if (currentQuantity < 1000) {
currentQuantity++;
softDrinkQuantityInput.value = currentQuantity;
}
});
// Mic Popup Functionality
const micIcon = document.getElementById('micIcon');
const micUnsupported = document.getElementById('micUnsupported');
const micPopup = document.getElementById('micPopup');
const micPopupText = document.getElementById('micPopupText');
const micPopupCancel = document.getElementById('micPopupCancel');
if ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
const recognition = new SpeechRecognition();
recognition.continuous = false;
recognition.interimResults = true;
recognition.lang = 'en-US';
recognition.onstart = () => {
micIcon.classList.add('active');
micPopup.classList.add('active');
micPopupText.textContent = 'Listening...';
};
recognition.onresult = (event) => {
let interimTranscript = '';
let finalTranscript = '';
for (let i = event.resultIndex; i < event.results.length; i++) {
const transcript = event.results[i][0].transcript;
if (event.results[i].isFinal) {
finalTranscript += transcript;
} else {
interimTranscript += transcript;
}
}
if (interimTranscript) {
micPopupText.textContent = interimTranscript;
}
if (finalTranscript) {
searchBar.value = sanitizeInput(finalTranscript.trim());
debouncedFilterMenu();
micPopup.classList.remove('active');
}
};
recognition.onend = () => {
micIcon.classList.remove('active');
if (micPopup.classList.contains('active')) {
setTimeout(() => {
micPopup.classList.remove('active');
}, 1000);
}
};
recognition.onerror = (event) => {
micIcon.classList.remove('active');
micPopupText.textContent = 'Error: ' + event.error;
setTimeout(() => {
micPopup.classList.remove('active');
}, 2000);
console.error('Speech error:', event.error);
};
micIcon.addEventListener('click', () => {
try {
recognition.start();
} catch (e) {
micPopupText.textContent = 'Error starting microphone';
setTimeout(() => {
micPopup.classList.remove('active');
}, 2000);
console.error('Recognition start error:', e);
}
});
micPopupCancel.addEventListener('click', () => {
recognition.stop();
micPopup.classList.remove('active');
micIcon.classList.remove('active');
});
} else {
micIcon.style.display = 'none';
micUnsupported.style.display = 'block';
}
// Highlight and open modal for item from search redirect
const highlightItem = "{{ highlight_item | e }}";
if (highlightItem) {
const itemElement = document.querySelector(`[data-item-name="${highlightItem}"]`);
if (itemElement) {
itemElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
itemElement.style.backgroundColor = '#FFFFE0'; // Light yellow highlight
setTimeout(() => {
itemElement.style.backgroundColor = ''; // Remove highlight after 2 seconds
}, 2000);
// Find the ADD button and trigger the appropriate modal
const addButton = itemElement.querySelector('.btn-primary');
const buttonContainer = addButton.closest('.button-container');
const section = buttonContainer.getAttribute('data-item-section');
if (section === 'Soft Drinks') {
showSoftDrinkModal(addButton);
} else {
const name = sanitizeInput(buttonContainer.getAttribute('data-item-name'));
const price = buttonContainer.getAttribute('data-item-price');
const image = buttonContainer.getAttribute('data-item-image');
const category = buttonContainer.getAttribute('data-item-category');
// Use data from the button's onclick attribute or fetch from server
const onclickAttr = addButton.getAttribute('onclick');
if (onclickAttr) {
const argsMatch = onclickAttr.match(/showItemDetails\((.*?)\)/);
if (argsMatch) {
const args = argsMatch[1].split(',').map(arg => arg.trim().replace(/['"]/g, ''));
const [name, price, image, description, ingredients, nutrition, allergens, section, category] = args;
showItemDetails(name, price, image, description, ingredients, nutrition, allergens, section, category);
}
} else {
// Fallback if onclick isn't sufficient
showItemDetails(name, price, image, 'No description available', 'Not specified', 'Not available', 'None listed', section, category);
}
}
}
}
});
function filterMenu() {
const input = sanitizeInput(document.getElementById('searchBar').value.trim().toLowerCase());
const sections = document.querySelectorAll('h3');
const items = document.querySelectorAll('.menu-card');
let matchedSections = new Set();
items.forEach(item => {
const itemName = item.querySelector('.card-title').innerText.toLowerCase();
const itemSection = item.closest('.row').previousElementSibling.innerText.toLowerCase();
if (itemName.includes(input) || (itemSection && itemSection.includes(input))) {
item.style.display = 'block';
item.classList.add('visible');
matchedSections.add(item.closest('.row'));
} else {
item.style.display = 'none';
}
});
sections.forEach(section => {
const sectionRow = section.nextElementSibling;
if (matchedSections.has(sectionRow)) {
section.style.display = 'block';
sectionRow.style.display = 'flex';
} else {
section.style.display = 'none';
sectionRow.style.display = 'none';
}
});
if (!input) {
sections.forEach(section => {
section.style.display = 'block';
section.nextElementSibling.style.display = 'flex';
});
items.forEach(item => {
item.style.display = 'block';
item.classList.add('visible');
});
}
}
function showItemDetails(name, price, image, description, ingredients, nutrition, allergens, section, selectedCategory) {
document.getElementById('modal-name').innerText = name;
document.getElementById('modal-price').innerText = `$${price}`;
const modalImg = document.getElementById('modal-img');
modalImg.src = image || '/static/placeholder.jpg';
document.getElementById('modal-description').innerText = description || 'No description available.';
document.getElementById('modal-ingredients').innerText = ingredients || 'Not specified';
document.getElementById('modal-nutrition').innerText = nutrition || 'Not available';
document.getElementById('modal-allergens').innerText = allergens || 'None listed';
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
document.getElementById('modal-instructions').value = '';
const modalSectionEl = document.getElementById('modal-section');
modalSectionEl.setAttribute('data-section', section);
modalSectionEl.setAttribute('data-category', selectedCategory);
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.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');
addon.options.forEach((option, index) => {
const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
const listItem = document.createElement('div');
listItem.classList.add('form-check');
listItem.innerHTML = `
<input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
<label class="form-check-label" for="${optionId}">
${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
</label>
`;
optionsContainer.appendChild(listItem);
});
sectionDiv.appendChild(optionsContainer);
addonsList.appendChild(sectionDiv);
});
})
.catch(err => {
console.error('Error fetching add-ons:', err);
document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
});
}
document.addEventListener('click', function(event) {
if (event.target.classList.contains('addon-option')) {
handleAddonClick(event.target);
}
});
function handleAddonClick(checkbox) {
const groupName = checkbox.getAttribute('data-group');
const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it"].includes(groupName);
const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
if (!isMultiSelectGroup) {
checkboxes.forEach(cb => {
if (cb !== checkbox) cb.checked = false;
});
}
}
function addToCartFromModal() {
const itemName = document.getElementById('modal-name').innerText;
const itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
const itemImage = document.getElementById('modal-img').src;
const instructions = document.getElementById('modal-instructions').value.trim();
const quantity = parseInt(document.getElementById('quantityInput').value);
const section = document.getElementById('modal-section').getAttribute('data-section');
const selectedCategory = document.getElementById('modal-section').getAttribute('data-category');
const addons = Array.from(document.querySelectorAll('.addon-option:checked')).map(cb => ({
name: cb.getAttribute('data-name'),
price: parseFloat(cb.getAttribute('data-price') || 0)
}));
const cartPayload = {
itemName: itemName,
itemPrice: itemPrice,
itemImage: itemImage,
section: section,
category: selectedCategory,
addons: addons,
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) {
alert('Item added to cart successfully!');
updateCartUI(data.cart);
const modal = bootstrap.Modal.getInstance(document.getElementById('itemModal'));
modal.hide();
} else {
console.error('Failed to add item to cart:', data.error);
alert(data.error || 'Failed to add item to cart. Using local storage as fallback.');
const cart = addToCartLocalStorage(cartPayload);
updateCartUI(cart);
const modal = document.getElementById('itemModal');
const modalInstance = bootstrap.Modal.getInstance(modal);
modalInstance.hide();
}
})
.catch(err => {
console.error('Error adding item to cart:', err);
alert('Error adding item to cart. Using local storage as fallback.');
const cart = addToCartLocalStorage(cartPayload);
updateCartUI(cart);
const modal = document.getElementById('itemModal');
const modalInstance = bootstrap.Modal.getInstance(modal);
modalInstance.hide();
});
}
</script>
</body>
</html>
|