index.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.LanguageCode }}">
  3. {{ partial "head.html" . }}
  4. <body>
  5. <div id="all" style="overflow-x:hidden;">
  6. {{ partial "nav.html" . }}
  7. {{ partial "LP_components/hero.html" . }}
  8. {{ partial "LP_components/use_cases.html" . }}
  9. {{ partial "LP_components/steps.html" . }}
  10. {{ partial "LP_components/features.html" . }}
  11. {{ partial "LP_components/blogs_tab.html" . }}
  12. {{ partial "LP_components/action.html" . }}
  13. {{ partial "LP_components/Footer.html" . }}
  14. {{ partial "LP_components/news.html" . }}
  15. </div>
  16. <!-- /#all -->
  17. {{ partial "scripts.html" . }}
  18. <script>
  19. function tabLP () {
  20. console.log('pass');
  21. if(('.m-tabs').length){
  22. // Show the first tab by default
  23. $('.blog-tabs-stage>div').hide();
  24. $('.blog-tabs-stage>div:first').show();
  25. $('.blog-tabs-nav li:first').addClass('blog-tab-active');
  26. // Change tab class and display content
  27. $('.blog-tabs-nav a').on('click', function(event){
  28. event.preventDefault();
  29. $('.blog-tabs-nav li').removeClass('blog-tab-active');
  30. $(this).parent().addClass('blog-tab-active');
  31. $('.blog-tabs-stage>div').hide();
  32. $($(this).attr('href')).show();
  33. });
  34. }
  35. }
  36. tabLP();
  37. function debounce(func, wait = 20, immediate = true) {
  38. var timeout;
  39. return function() {
  40. var context = this, args = arguments;
  41. var later = function() {
  42. timeout = null;
  43. if (!immediate) func.apply(context, args);
  44. };
  45. var callNow = immediate && !timeout;
  46. clearTimeout(timeout);
  47. timeout = setTimeout(later, wait);
  48. if (callNow) func.apply(context, args);
  49. };
  50. };
  51. const featuresBlock = document.querySelectorAll('.features-block');
  52. const featuresRow = document.querySelectorAll('.sec-features .row');
  53. function checkSlide() {
  54. console.log('pass');
  55. featuresRow.forEach((block, i) => {
  56. // half way through the image
  57. const slideInAt = (window.scrollY + window.innerHeight) - block.offsetHeight / 2;
  58. console.log(slideInAt);
  59. console.log(block.offsetTop);
  60. // bottom of the image
  61. const isHalfShown = slideInAt > block.offsetTop;
  62. if (isHalfShown) {
  63. console.log('active');
  64. featuresBlock[i].classList.add('active');
  65. }
  66. });
  67. }
  68. window.addEventListener('scroll', debounce(checkSlide));
  69. $('.navbar-nav .dropdown:nth-of-type(2)').click(function() {
  70. $('html, body').animate({
  71. scrollTop: $("#sec-features").offset().top
  72. }, 1000);
  73. })
  74. </script>
  75. </body>
  76. </html>