index.html 6.9 KB

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