menu.ejs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <div class="menu">
  2. <div id="max" class="menuHead">
  3. <a href="/">
  4. <img class="menuLogo" src="/shared/images/logo.png" alt="The Subline">
  5. <p>The Subline</p>
  6. </a>
  7. <button onclick="changeMenu()">&#8801;</button>
  8. </div>
  9. <div id="min" class="menuHead menuHeadMin">
  10. <a href="/">
  11. <img class="menuLogoMin" src="/shared/images/logo.png" alt="The Subline">
  12. </a>
  13. <button onclick="changeMenu()">&#8801;</button>
  14. </div>
  15. <button id="homeBtn" class="active" onclick="changeStrand('homeStrand')">
  16. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  17. <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
  18. <polyline points="9 22 9 12 15 12 15 22"></polyline>
  19. </svg>
  20. <p>Home</p>
  21. </button>
  22. <button id="ingredientsBtn" onclick="changeStrand('ingredientsStrand')">
  23. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  24. <polyline points="21 8 21 21 3 21 3 8"></polyline>
  25. <rect x="1" y="3" width="22" height="5"></rect>
  26. <line x1="10" y1="12" x2="14" y2="12"></line>
  27. </svg>
  28. <p>Ingredients</p>
  29. </button>
  30. <button id="recipeBookBtn" onclick="changeStrand('recipeBookStrand')">
  31. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  32. <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
  33. <path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
  34. </svg>
  35. <p>Recipe Book</p>
  36. </button>
  37. <button id="ordersBtn" onclick="changeStrand('ordersStrand')">
  38. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  39. <circle cx="9" cy="21" r="1"></circle>
  40. <circle cx="20" cy="21" r="1"></circle>
  41. <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
  42. </svg>
  43. <p>Orders</p>
  44. </button>
  45. <a class="logout" href="/logout">
  46. <p>Logout</p>
  47. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  48. <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
  49. <polyline points="16 17 21 12 16 7"></polyline>
  50. <line x1="21" y1="12" x2="9" y2="12"></line>
  51. </svg>
  52. </a>
  53. <script>
  54. let changeMenu = ()=>{
  55. let menu = document.querySelector(".menu");
  56. let buttons = document.querySelectorAll(".menu > button");
  57. if(!menu.classList.contains("menuMinimized")){
  58. menu.classList = "menu menuMinimized";
  59. for(let button of buttons){
  60. button.children[1].style.display = "none";
  61. }
  62. document.querySelector(".logout p").style.display = "none"
  63. document.querySelector("#max").style.display = "none";
  64. document.querySelector("#min").style.display = "flex";
  65. }else if(menu.classList.contains("menuMinimized")){
  66. menu.classList = "menu";
  67. for(let button of buttons){
  68. button.children[1].style.display = "block";
  69. }
  70. document.querySelector(".logout p").style.display = "flex"
  71. setTimeout(()=>{
  72. document.querySelector("#max").style.display = "flex";
  73. document.querySelector("#min").style.display = "none";
  74. }, 150);
  75. }
  76. }
  77. </script>
  78. </div>