index.html 6.2 KB

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