index.html 7.1 KB

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