index.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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_en').hide();
  82. localStorage.setItem('lang', 'cn'); // 預設為中文
  83. // 切換首頁語言
  84. function toggleLang() {
  85. let currentLang = localStorage.getItem('lang');
  86. if (currentLang === 'en') {
  87. localStorage.setItem('lang', 'cn');
  88. } else if (currentLang === 'cn') {
  89. localStorage.setItem('lang', 'en');
  90. }
  91. let lang = localStorage.getItem('lang');
  92. toggleTemplate(lang);
  93. }
  94. function toggleTemplate(lang) {
  95. if (lang === 'en') {
  96. $('.home-en').show();
  97. $('.home-cn').hide();
  98. } else {
  99. $('.home-en').hide();
  100. $('.home-cn').show();
  101. }
  102. $('html, body').animate({
  103. scrollTop: $(`.home-${lang}`).offset().top
  104. }, 0);
  105. }
  106. function tabLP() {
  107. if (('.m-tabs').length) {
  108. // Show the first tab by default
  109. $('.blog-tabs-stage>div').hide();
  110. $('.blog-tabs-stage>div:first').show();
  111. $('.blog-tabs-nav li:first').addClass('blog-tab-active');
  112. // Change tab class and display content
  113. $('.blog-tabs-nav a').on('click', function (event) {
  114. event.preventDefault();
  115. $('.blog-tabs-nav li').removeClass('blog-tab-active');
  116. $(this).parent().addClass('blog-tab-active');
  117. $('.blog-tabs-stage>div').hide();
  118. $($(this).attr('href')).show();
  119. });
  120. }
  121. }
  122. tabLP();
  123. function debounce(func, wait = 20, immediate = true) {
  124. var timeout;
  125. return function () {
  126. var context = this, args = arguments;
  127. var later = function () {
  128. timeout = null;
  129. if (!immediate) func.apply(context, args);
  130. };
  131. var callNow = immediate && !timeout;
  132. clearTimeout(timeout);
  133. timeout = setTimeout(later, wait);
  134. if (callNow) func.apply(context, args);
  135. };
  136. };
  137. const featuresBlock = document.querySelectorAll('.features-block');
  138. const featuresRow = document.querySelectorAll('.sec-features .row');
  139. function checkSlide() {
  140. featuresRow.forEach((block, i) => {
  141. // half way through the image
  142. const slideInAt = (window.scrollY + window.innerHeight) - block.offsetHeight / 2;
  143. // bottom of the image
  144. const isHalfShown = slideInAt > block.offsetTop;
  145. if (isHalfShown) {
  146. console.log('active');
  147. featuresBlock[i].classList.add('active');
  148. }
  149. });
  150. }
  151. window.addEventListener('scroll', debounce(checkSlide));
  152. var swiper = new Swiper(".carousel", {
  153. pagination: {
  154. el: ".swiper-pagination",
  155. clickable: true,
  156. },
  157. navigation: {
  158. nextEl: '.swiper-button-next',
  159. prevEl: '.swiper-button-prev',
  160. },
  161. loop: true,
  162. observer: true,
  163. observeParents: true,
  164. parallax: true,
  165. slidesPerView: 1,
  166. slidesPerGroup: 1,
  167. });
  168. // let aiModal = new bootstrap.Modal(document.getElementById('aiModal')); // relatedTarget
  169. // aiModal.show();
  170. // 判斷網址是否有語言參數
  171. function getUrlParams() {
  172. const urlParams = new URLSearchParams(window.location.search);
  173. if (urlParams.has('lang')) {
  174. const lang = urlParams.get('lang');
  175. console.log('網址語言參數', lang);
  176. if (lang === 'en') {
  177. localStorage.setItem('lang', 'en');
  178. } else {
  179. localStorage.setItem('lang', 'cn');
  180. }
  181. toggleTemplate(lang);
  182. }
  183. }
  184. getUrlParams();
  185. </script>
  186. <!-- 進度條 -->
  187. <script src="../js/progress.js"></script>
  188. </body>
  189. </html>