index.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.LanguageCode }}">
  3. {{ partial "components/head.html" . }}
  4. <!-- Start of HubSpot Embed Code -->
  5. <!-- <script type="text/javascript" id="hs-script-loader" async defer src="//js-na1.hs-scripts.com/20485755.js"></script> -->
  6. <!-- End of HubSpot Embed Code -->
  7. <body>
  8. <div id="all" style="overflow: hidden;">
  9. {{ partial "components/nav.html" . }}
  10. <div id="home">
  11. {{ partial "components/carousel.html" . }}
  12. <div class="home-cn">
  13. <!-- {{ partial "components/main.html" . }} -->
  14. <!-- {{ partial "components/serve.html" . }} -->
  15. <!-- {{ partial "components/ai-video.html" . }} -->
  16. <!-- {{ partial "components/ai-saas.html" . }} -->
  17. <!-- {{ partial "components/ai-reporter.html" . }} -->
  18. {{ partial "components/ai-anchor.html" . }}
  19. {{ partial "components/genseo.html" . }}
  20. {{ partial "components/progress.html" . }}
  21. <!-- {{ partial "LP_components/blogs_tab.html" . }} -->
  22. {{ partial "LP_components/action.html" . }}
  23. {{ partial "footer.html" . }}
  24. </div>
  25. <div class="home-en">
  26. <!-- {{ partial "components/en/main.html" . }} -->
  27. <!-- {{ partial "components/en/serve.html" . }} -->
  28. <!-- {{ partial "components/en/ai-video.html" . }} -->
  29. {{ partial "components/en/ai-anchor.html" . }}
  30. {{ partial "components/en/genseo.html" . }}
  31. {{ partial "components/progress.html" . }}
  32. {{ partial "components/en/action.html" . }}
  33. {{ partial "components/en/footer.html" . }}
  34. </div>
  35. </div>
  36. <!-- Modal 測試 -->
  37. <!-- <div class="modal fade" id="aiModal" tabindex="-1" aria-labelledby="aiModalLabel" aria-hidden="true">
  38. <div class="modal-dialog">
  39. <div class="modal-content">
  40. <div class="modal-header">
  41. <h5 class="modal-title" id="aiModalLabel">Modal title</h5>
  42. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  43. </div>
  44. <div class="modal-body">
  45. <div class="row row-cols-2 row-cols-lg-5 g-2 g-lg-3">
  46. <div class="col-6">
  47. <div class="p-3 border bg-light">Row column</div>
  48. </div>
  49. <div class="col-6">
  50. <div class="p-3 border bg-light">Row column</div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div> -->
  57. <!-- <div id="home">
  58. {{ partial "components/carousel.html" . }}
  59. {{ partial "components/main.html" . }}
  60. {{ partial "components/serve.html" . }}
  61. {{ partial "components/ai-video.html" . }}
  62. {{ partial "components/progress.html" . }}
  63. {{ partial "LP_components/blogs_tab.html" . }}
  64. {{ partial "LP_components/action.html" . }}
  65. {{ partial "footer.html" . }}
  66. </div> -->
  67. <!-- {{ partial "nav.html" . }}
  68. {{ partial "LP_components/hero.html" . }}
  69. {{ partial "LP_components/video.html" . }}
  70. {{ partial "LP_components/use_cases.html" . }}
  71. {{ partial "LP_components/steps.html" . }}
  72. {{ partial "LP_components/features.html" . }}
  73. {{ partial "LP_components/blogs_tab.html" . }}
  74. {{ partial "LP_components/action.html" . }}
  75. {{ partial "LP_components/Footer.html" . }}
  76. {{ partial "LP_components/news.html" . }} -->
  77. </div>
  78. <!-- /#all -->
  79. {{ partial "components/scripts.html" . }}
  80. <script>
  81. $('.home-cn').hide();
  82. $('.home-en').show();
  83. localStorage.setItem('lang', 'en'); // 預設為英文
  84. // 切換首頁語言
  85. function toggleLang() {
  86. let currentLang = localStorage.getItem('lang');
  87. if (currentLang === 'en') {
  88. localStorage.setItem('lang', 'cn');
  89. } else {
  90. localStorage.setItem('lang', 'en');
  91. }
  92. let lang = localStorage.getItem('lang');
  93. toggleTemplate(lang);
  94. }
  95. function toggleTemplate(lang) {
  96. if (lang === 'en') {
  97. $('.home-en').show();
  98. $('.home-cn').hide();
  99. } else {
  100. $('.home-en').hide();
  101. $('.home-cn').show();
  102. }
  103. $('html, body').animate({
  104. scrollTop: $(`.home-${lang}`).offset().top
  105. }, 0);
  106. }
  107. function tabLP() {
  108. if (('.m-tabs').length) {
  109. // Show the first tab by default
  110. $('.blog-tabs-stage>div').hide();
  111. $('.blog-tabs-stage>div:first').show();
  112. $('.blog-tabs-nav li:first').addClass('blog-tab-active');
  113. // Change tab class and display content
  114. $('.blog-tabs-nav a').on('click', function (event) {
  115. event.preventDefault();
  116. $('.blog-tabs-nav li').removeClass('blog-tab-active');
  117. $(this).parent().addClass('blog-tab-active');
  118. $('.blog-tabs-stage>div').hide();
  119. $($(this).attr('href')).show();
  120. });
  121. }
  122. }
  123. tabLP();
  124. function debounce(func, wait = 20, immediate = true) {
  125. var timeout;
  126. return function () {
  127. var context = this, args = arguments;
  128. var later = function () {
  129. timeout = null;
  130. if (!immediate) func.apply(context, args);
  131. };
  132. var callNow = immediate && !timeout;
  133. clearTimeout(timeout);
  134. timeout = setTimeout(later, wait);
  135. if (callNow) func.apply(context, args);
  136. };
  137. };
  138. const featuresBlock = document.querySelectorAll('.features-block');
  139. const featuresRow = document.querySelectorAll('.sec-features .row');
  140. function checkSlide() {
  141. featuresRow.forEach((block, i) => {
  142. // half way through the image
  143. const slideInAt = (window.scrollY + window.innerHeight) - block.offsetHeight / 2;
  144. // bottom of the image
  145. const isHalfShown = slideInAt > block.offsetTop;
  146. if (isHalfShown) {
  147. console.log('active');
  148. featuresBlock[i].classList.add('active');
  149. }
  150. });
  151. }
  152. window.addEventListener('scroll', debounce(checkSlide));
  153. var swiper = new Swiper(".carousel", {
  154. pagination: {
  155. el: ".swiper-pagination",
  156. clickable: true,
  157. },
  158. navigation: {
  159. nextEl: '.swiper-button-next',
  160. prevEl: '.swiper-button-prev',
  161. },
  162. loop: true,
  163. observer: true,
  164. observeParents: true,
  165. parallax: true,
  166. slidesPerView: 1,
  167. slidesPerGroup: 1,
  168. });
  169. // let aiModal = new bootstrap.Modal(document.getElementById('aiModal')); // relatedTarget
  170. // aiModal.show();
  171. // 判斷網址是否有語言參數
  172. function getUrlParams() {
  173. const urlParams = new URLSearchParams(window.location.search);
  174. if (urlParams.has('lang')) {
  175. const lang = urlParams.get('lang');
  176. console.log('網址語言參數', lang);
  177. if (lang === 'zh-tw') {
  178. localStorage.setItem('lang', 'cn');
  179. toggleTemplate('cn');
  180. }
  181. }
  182. }
  183. getUrlParams();
  184. </script>
  185. <!-- 進度條 -->
  186. <script src="../js/progress.js"></script>
  187. </body>
  188. </html>