furniture_design.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <div class="furniture-design">
  2. <section class="bhouseweb_loc_banner">
  3. <img src="/img/banner/bn_product@2x.png" class="banner-img card-img" alt="...">
  4. </section>
  5. <!-- 手機版型 -->
  6. <div class="mobile-tab d-block d-md-none">
  7. <div class="row">
  8. <div class="col-4 m-auto all-tab">
  9. <a href="/furniture_design/sofa" id="all-design-tab" class="nav-link">全部設計單品</a>
  10. </div>
  11. </div>
  12. <ul class="nav nav-pills mt-0 mt-lg-4 justify-content-center tab-title b-bottom" id="pills-tab" role="tablist">
  13. <div class="row w-100">
  14. <div class="col-4">
  15. <li class="nav-item tab-item" role="presentation">
  16. <a href="/system_furniture" id="systeam-furniture-tab" class="nav-link">關於系統櫃</a>
  17. </li>
  18. </div>
  19. <div class="col-4">
  20. <li class="nav-item tab-item" role="presentation">
  21. <a href="/solid_wood_furniture" id="furniture-tab" class="nav-link">關於家具</a>
  22. </li>
  23. </div>
  24. <div class="col-4">
  25. <li class="nav-item tab-item" role="presentation">
  26. <a href="/about_mattress" id="mattress-tab" class="nav-link">關於床墊</a>
  27. </li>
  28. </div>
  29. </div>
  30. </ul>
  31. </div>
  32. <!-- 電腦版型 -->
  33. <div class="d-none d-md-block">
  34. <ul class="nav nav-pills mt-0 mt-lg-4 justify-content-center tab-title b-bottom" id="pills-tab" role="tablist">
  35. <li class="nav-item" role="presentation">
  36. <a href="/furniture_design/sofa" id="all-design-tab" class="nav-link design-border">全部設計單品</a>
  37. </li>
  38. <li class="nav-item tab-item" role="presentation">
  39. <a href="/system_furniture" id="systeam-furniture-tab" class="nav-link">關於系統櫃</a>
  40. </li>
  41. <li class="nav-item tab-item" role="presentation">
  42. <a href="/solid_wood_furniture" id="furniture-tab" class="nav-link">關於家具</a>
  43. </li>
  44. <li class="nav-item tab-item" role="presentation">
  45. <a href="/about_mattress" id="mattress-tab" class="nav-link">關於床墊</a>
  46. </li>
  47. </ul>
  48. </div>
  49. <div class="bhouseweb_loc_content">
  50. <ul class="design-list mb-3 m-md-0">
  51. <li><a id="sofa" class="nav-link" href="/furniture_design/sofa/">沙發</a></li>
  52. <li><a id="side_table" class="nav-link" href="/furniture_design/side_table">茶几</a></li>
  53. <li><a id="dining_table" class="nav-link" href="/furniture_design/dining_table">餐桌</a></li>
  54. <li><a id="dining_chair" class="nav-link" href="/furniture_design/dining_chair">餐椅/中島椅</a></li>
  55. <li><a id="mattress" class="nav-link" href="/furniture_design/mattress/">床組</a></li>
  56. <li><a id="cabinet" class="nav-link" href="/furniture_design/cabinet">電視櫃</a></li>
  57. <li><a id="wardrobe" class="nav-link" href="/furniture_design/wardrobe">衣櫃/收納櫃/中島</a></li>
  58. <li><a id="Side_Cabinet" class="nav-link" href="/furniture_design/side_cabinet">邊櫃/邊几</a></li>
  59. <li><a id="desk" class="nav-link" href="/furniture_design/desk">書桌/工作桌</a></li>
  60. <li><a id="other_furniture" class="nav-link" href="/furniture_design/other_furniture">其他設計單品</a></li>
  61. </ul>
  62. </div>
  63. <div style="border-top: 1px solid grey; position: absolute; width: 100%; left: 0;"></div>
  64. <div class="reserve d-flex flex-column">
  65. <a href="https://maac.io/1Pife" target="_blank">
  66. <img src="/img/home/reserve.png" alt="">
  67. </a>
  68. <a href="/store/">
  69. <img src="/img/home/store-reserve.png" alt="">
  70. </a>
  71. </div>
  72. </div>
  73. <script>
  74. // 儲存點擊的 Link ID 後加上 Class Name
  75. // 預設沙發頁
  76. if (window.location.pathname === '/furniture_design/sofa/') {
  77. localStorage.setItem('assignLink', 'sofa');
  78. }
  79. let linkList = document.querySelectorAll(".furniture-design .nav-link");
  80. for (let i = 0; i < linkList.length; i++) {
  81. linkList[i].addEventListener("click", function (e) {
  82. console.log('e.target.id', e.target.id);
  83. localStorage.setItem('assignLink', e.target.id);
  84. });
  85. }
  86. let linkID = localStorage.getItem('assignLink');
  87. let link = document.querySelector(`.design-list #${linkID}`);
  88. link.classList.add("assign-link");
  89. </script>