index.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.LanguageCode }}">
  3. {{ partial "head.html" . }}
  4. <body>
  5. <div id="all">
  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. </div>
  15. <!-- /#all -->
  16. {{ partial "scripts.html" . }}
  17. <script>
  18. function tabLP () {
  19. console.log('pass');
  20. if(('.m-tabs').length){
  21. // Show the first tab by default
  22. $('.blog-tabs-stage>div').hide();
  23. $('.blog-tabs-stage>div:first').show();
  24. $('.blog-tabs-nav li:first').addClass('blog-tab-active');
  25. // Change tab class and display content
  26. $('.blog-tabs-nav a').on('click', function(event){
  27. event.preventDefault();
  28. $('.blog-tabs-nav li').removeClass('blog-tab-active');
  29. $(this).parent().addClass('blog-tab-active');
  30. $('.blog-tabs-stage>div').hide();
  31. $($(this).attr('href')).show();
  32. });
  33. }
  34. }
  35. tabLP();
  36. function debounce(func, wait = 20, immediate = true) {
  37. var timeout;
  38. return function() {
  39. var context = this, args = arguments;
  40. var later = function() {
  41. timeout = null;
  42. if (!immediate) func.apply(context, args);
  43. };
  44. var callNow = immediate && !timeout;
  45. clearTimeout(timeout);
  46. timeout = setTimeout(later, wait);
  47. if (callNow) func.apply(context, args);
  48. };
  49. };
  50. const featuresBlock = document.querySelectorAll('.features-block');
  51. function checkSlide() {
  52. console.log('pass');
  53. featuresBlock.forEach(block => {
  54. // half way through the image
  55. const slideInAt = (window.scrollY + window.innerHeight) - block.offsetHeight / 2;
  56. console.log(block.offsetHeight / 2);
  57. // bottom of the image
  58. const isHalfShown = slideInAt > block.offsetTop;
  59. if (isHalfShown) {
  60. block.classList.add('active');
  61. }
  62. });
  63. }
  64. window.addEventListener('scroll', debounce(checkSlide));
  65. </script>
  66. </body>
  67. </html>