menu.ejs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <div class="menu">
  2. <div class="menuHead">
  3. <a href="/">
  4. <img class="menuLogo" src="/shared/images/logo.png">
  5. <p>The Subline</p>
  6. </a>
  7. <button onclick="changeMenu()">&#8801;</button>
  8. </div>
  9. <button id="homeBtn" class="active" onclick="changeStrand('homeStrand')">
  10. <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>
  11. <p>Home</p>
  12. </button>
  13. <button id="ingredientsBtn" onclick="changeStrand('ingredientsStrand')">
  14. <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>
  15. <p>Ingredients</p>
  16. </button>
  17. <button id="recipeBookBtn" onclick="changeStrand('recipeBookStrand')">
  18. <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>
  19. <p>Recipe Book</p>
  20. </button>
  21. <button id="ordersBtn" onclick="changeStrand('ordersStrand')">
  22. <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>
  23. <p>Orders</p>
  24. </button>
  25. <a class="logout" href="/logout">
  26. <img src="/shared/images/profile.png" alt="logout">
  27. <p>Logout</p>
  28. </a>
  29. <script>
  30. let changeMenu = ()=>{
  31. let menu = document.querySelector(".menu");
  32. let buttons = document.querySelectorAll(".menu > button");
  33. if(!menu.classList.contains("menuMinimized")){
  34. menu.classList = "menu menuMinimized";
  35. for(let button of buttons){
  36. button.children[1].style.display = "none";
  37. }
  38. document.querySelector(".menuHead p").style.display = "none";
  39. document.querySelector(".menuHead").classList = "menuHead menuHeadMin";
  40. document.querySelector(".logout p").style.display = "none";
  41. setTimeout(()=>{
  42. document.querySelector(".menuLogo").classList = "menuLogo menuLogoMin";
  43. }, 150);
  44. }else if(menu.classList.contains("menuMinimized")){
  45. menu.classList = "menu";
  46. for(let button of buttons){
  47. button.children[1].style.display = "block";
  48. }
  49. document.querySelector(".menuHead p").style.display = "block";
  50. document.querySelector(".menuHead").classList = "menuHead";
  51. document.querySelector(".logout p").style.display = "block";
  52. setTimeout(()=>{
  53. document.querySelector(".menuLogo").classList = "menuLogo";
  54. });
  55. }
  56. }
  57. </script>
  58. </div>