menu.ejs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
  17. <p>Home</p>
  18. </button>
  19. <button id="ingredientsBtn" onclick="changeStrand('ingredientsStrand')">
  20. <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-archive"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>
  21. <p>Ingredients</p>
  22. </button>
  23. <button id="recipeBookBtn" onclick="changeStrand('recipeBookStrand')">
  24. <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-book"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><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></svg>
  25. <p>Recipe Book</p>
  26. </button>
  27. <button id="ordersBtn" onclick="changeStrand('ordersStrand')">
  28. <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-cart"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>
  29. <p>Orders</p>
  30. </button>
  31. <a class="logout" href="/logout">
  32. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  33. <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
  34. <polyline points="16 17 21 12 16 7"></polyline>
  35. <line x1="21" y1="12" x2="9" y2="12"></line>
  36. </svg>
  37. <p>Logout</p>
  38. </a>
  39. <script>
  40. let changeMenu = ()=>{
  41. let menu = document.querySelector(".menu");
  42. let buttons = document.querySelectorAll(".menu > button");
  43. if(!menu.classList.contains("menuMinimized")){
  44. menu.classList = "menu menuMinimized";
  45. for(let button of buttons){
  46. button.children[1].style.display = "none";
  47. }
  48. document.querySelector("#max").style.display = "none";
  49. document.querySelector("#min").style.display = "flex";
  50. }else if(menu.classList.contains("menuMinimized")){
  51. menu.classList = "menu";
  52. for(let button of buttons){
  53. button.children[1].style.display = "block";
  54. }
  55. setTimeout(()=>{
  56. document.querySelector("#max").style.display = "flex";
  57. document.querySelector("#min").style.display = "none";
  58. }, 150);
  59. }
  60. }
  61. </script>
  62. </div>