Robo Extract Template

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /**
  2. * Template Name: BizLand - v1.2.0
  3. * Template URL: https://bootstrapmade.com/bizland-bootstrap-business-template/
  4. * Author: BootstrapMade.com
  5. * License: https://bootstrapmade.com/license/
  6. */
  7. !(function($) {
  8. "use strict";
  9. // Preloader
  10. $(window).on('load', function() {
  11. if ($('#preloader').length) {
  12. $('#preloader').delay(100).fadeOut('slow', function() {
  13. $(this).remove();
  14. });
  15. }
  16. });
  17. // Smooth scroll for the navigation menu and links with .scrollto classes
  18. var scrolltoOffset = $('#header').outerHeight() - 21;
  19. if (window.matchMedia("(max-width: 991px)").matches) {
  20. scrolltoOffset += 20;
  21. }
  22. $(document).on('click', '.nav-menu a, .mobile-nav a, .scrollto', function(e) {
  23. if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
  24. var target = $(this.hash);
  25. if (target.length) {
  26. e.preventDefault();
  27. var scrollto = target.offset().top - scrolltoOffset;
  28. if ($(this).attr("href") == '#header') {
  29. scrollto = 0;
  30. }
  31. $('html, body').animate({
  32. scrollTop: scrollto
  33. }, 1500, 'easeInOutExpo');
  34. if ($(this).parents('.nav-menu, .mobile-nav').length) {
  35. $('.nav-menu .active, .mobile-nav .active').removeClass('active');
  36. $(this).closest('li').addClass('active');
  37. }
  38. if ($('body').hasClass('mobile-nav-active')) {
  39. $('body').removeClass('mobile-nav-active');
  40. $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close');
  41. $('.mobile-nav-overly').fadeOut();
  42. }
  43. return false;
  44. }
  45. }
  46. });
  47. // Activate smooth scroll on page load with hash links in the url
  48. $(document).ready(function() {
  49. if (window.location.hash) {
  50. var initial_nav = window.location.hash;
  51. if ($(initial_nav).length) {
  52. var scrollto = $(initial_nav).offset().top - scrolltoOffset;
  53. $('html, body').animate({
  54. scrollTop: scrollto
  55. }, 1500, 'easeInOutExpo');
  56. }
  57. }
  58. });
  59. // Navigation active state on scroll
  60. var nav_sections = $('section');
  61. var main_nav = $('.nav-menu, .mobile-nav');
  62. $(window).on('scroll', function() {
  63. var cur_pos = $(this).scrollTop() + 200;
  64. nav_sections.each(function() {
  65. var top = $(this).offset().top,
  66. bottom = top + $(this).outerHeight();
  67. if (cur_pos >= top && cur_pos <= bottom) {
  68. if (cur_pos <= bottom) {
  69. main_nav.find('li').removeClass('active');
  70. }
  71. main_nav.find('a[href="#' + $(this).attr('id') + '"]').parent('li').addClass('active');
  72. }
  73. if (cur_pos < 300) {
  74. $(".nav-menu ul:first li:first, .mobile-menu ul:first li:first").addClass('active');
  75. }
  76. });
  77. });
  78. // Mobile Navigation
  79. if ($('.nav-menu').length) {
  80. var $mobile_nav = $('.nav-menu').clone().prop({
  81. class: 'mobile-nav d-lg-none'
  82. });
  83. $('body').append($mobile_nav);
  84. $('body').prepend('<button type="button" class="mobile-nav-toggle d-lg-none"><i class="icofont-navigation-menu"></i></button>');
  85. $('body').append('<div class="mobile-nav-overly"></div>');
  86. $(document).on('click', '.mobile-nav-toggle', function(e) {
  87. $('body').toggleClass('mobile-nav-active');
  88. $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close');
  89. $('.mobile-nav-overly').toggle();
  90. });
  91. $(document).on('click', '.mobile-nav .drop-down > a', function(e) {
  92. e.preventDefault();
  93. $(this).next().slideToggle(300);
  94. $(this).parent().toggleClass('active');
  95. });
  96. $(document).click(function(e) {
  97. var container = $(".mobile-nav, .mobile-nav-toggle");
  98. if (!container.is(e.target) && container.has(e.target).length === 0) {
  99. if ($('body').hasClass('mobile-nav-active')) {
  100. $('body').removeClass('mobile-nav-active');
  101. $('.mobile-nav-toggle i').toggleClass('icofont-navigation-menu icofont-close');
  102. $('.mobile-nav-overly').fadeOut();
  103. }
  104. }
  105. });
  106. } else if ($(".mobile-nav, .mobile-nav-toggle").length) {
  107. $(".mobile-nav, .mobile-nav-toggle").hide();
  108. }
  109. // Toggle .header-scrolled class to #header when page is scrolled
  110. $(window).scroll(function() {
  111. if ($(this).scrollTop() > 100) {
  112. $('#header').addClass('header-scrolled');
  113. $('#topbar').addClass('topbar-scrolled');
  114. } else {
  115. $('#header').removeClass('header-scrolled');
  116. $('#topbar').removeClass('topbar-scrolled');
  117. }
  118. });
  119. if ($(window).scrollTop() > 100) {
  120. $('#header').addClass('header-scrolled');
  121. $('#topbar').addClass('topbar-scrolled');
  122. }
  123. // Back to top button
  124. $(window).scroll(function() {
  125. if ($(this).scrollTop() > 100) {
  126. $('.back-to-top').fadeIn('slow');
  127. } else {
  128. $('.back-to-top').fadeOut('slow');
  129. }
  130. });
  131. $('.back-to-top').click(function() {
  132. $('html, body').animate({
  133. scrollTop: 0
  134. }, 1500, 'easeInOutExpo');
  135. return false;
  136. });
  137. // Skills section
  138. $('.skills-content').waypoint(function() {
  139. $('.progress .progress-bar').each(function() {
  140. $(this).css("width", $(this).attr("aria-valuenow") + '%');
  141. });
  142. }, {
  143. offset: '80%'
  144. });
  145. // jQuery counterUp
  146. $('[data-toggle="counter-up"]').counterUp({
  147. delay: 10,
  148. time: 1000
  149. });
  150. // Testimonials carousel (uses the Owl Carousel library)
  151. $(".testimonials-carousel").owlCarousel({
  152. autoplay: true,
  153. dots: true,
  154. loop: true,
  155. items: 1
  156. });
  157. // Porfolio isotope and filter
  158. $(window).on('load', function() {
  159. var portfolioIsotope = $('.portfolio-container').isotope({
  160. itemSelector: '.portfolio-item'
  161. });
  162. $('#portfolio-flters li').on('click', function() {
  163. $("#portfolio-flters li").removeClass('filter-active');
  164. $(this).addClass('filter-active');
  165. portfolioIsotope.isotope({
  166. filter: $(this).data('filter')
  167. });
  168. aos_init();
  169. });
  170. // Initiate venobox (lightbox feature used in portofilo)
  171. $(document).ready(function() {
  172. $('.venobox').venobox();
  173. });
  174. });
  175. // Portfolio details carousel
  176. $(".portfolio-details-carousel").owlCarousel({
  177. autoplay: true,
  178. dots: true,
  179. loop: true,
  180. items: 1
  181. });
  182. // Init AOS
  183. function aos_init() {
  184. AOS.init({
  185. duration: 1000,
  186. once: true
  187. });
  188. }
  189. $(window).on('load', function() {
  190. aos_init();
  191. });
  192. })(jQuery);