Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. jQuery(function ($) {
  2. "use strict";
  3. /* ========================================================================= */
  4. /* Page Preloader
  5. /* ========================================================================= */
  6. $(window).on('load', function () {
  7. $('.preloader').fadeOut(100);
  8. });
  9. // lazy load initialize
  10. const observer = lozad(); // lazy loads elements with default selector as ".lozad"
  11. observer.observe();
  12. /* ========================================================================= */
  13. /* Magnific popup
  14. /* ========================================================================= */
  15. $('.image-popup').magnificPopup({
  16. type: 'image',
  17. removalDelay: 160, //delay removal by X to allow out-animation
  18. callbacks: {
  19. beforeOpen: function () {
  20. // just a hack that adds mfp-anim class to markup
  21. this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
  22. this.st.mainClass = this.st.el.attr('data-effect');
  23. }
  24. },
  25. closeOnContentClick: true,
  26. midClick: true,
  27. fixedContentPos: false,
  28. fixedBgPos: true
  29. });
  30. /* ========================================================================= */
  31. /* Portfolio Filtering Hook
  32. /* ========================================================================= */
  33. function filter(){
  34. var containerEl = document.querySelector('.shuffle-wrapper');
  35. if (containerEl) {
  36. var Shuffle = window.Shuffle;
  37. var myShuffle = new Shuffle(document.querySelector('.shuffle-wrapper'), {
  38. itemSelector: '.shuffle-item',
  39. buffer: 1
  40. });
  41. jQuery('input[name="shuffle-filter"]').on('change', function (evt) {
  42. var input = evt.currentTarget;
  43. if (input.checked) {
  44. myShuffle.filter(input.value);
  45. }
  46. });
  47. }}
  48. $(window).on('scroll', function () {
  49. filter();
  50. });
  51. /* ========================================================================= */
  52. /* Testimonial Carousel
  53. /* ========================================================================= */
  54. $("#testimonials").slick({
  55. infinite: true,
  56. arrows: false,
  57. autoplay: true,
  58. autoplaySpeed: 4000
  59. });
  60. /* ========================================================================= */
  61. /* Animated section
  62. /* ========================================================================= */
  63. var wow = new WOW({
  64. offset: 100, // distance to the element when triggering the animation (default is 0)
  65. mobile: false // trigger animations on mobile devices (default is true)
  66. });
  67. var scrolled = false;
  68. $(window).on('scroll', function () {
  69. if (!scrolled) {
  70. scrolled = true;
  71. wow.init();
  72. }
  73. })
  74. /* ========================================================================= */
  75. /* animation scroll js
  76. /* ========================================================================= */
  77. var html_body = $('html, body');
  78. $('nav a, .page-scroll').on('click', function () { //use page-scroll class in any HTML tag for scrolling
  79. if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
  80. var target = $(this.hash);
  81. target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
  82. if (target.length) {
  83. html_body.animate({
  84. scrollTop: target.offset().top - 70
  85. }, 1500, 'easeInOutExpo');
  86. return false;
  87. }
  88. }
  89. });
  90. // easeInOutExpo Declaration
  91. jQuery.extend(jQuery.easing, {
  92. easeInOutExpo: function (x, t, b, c, d) {
  93. if (t === 0) {
  94. return b;
  95. }
  96. if (t === d) {
  97. return b + c;
  98. }
  99. if ((t /= d / 2) < 1) {
  100. return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
  101. }
  102. return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
  103. }
  104. });
  105. /* ========================================================================= */
  106. /* counter up
  107. /* ========================================================================= */
  108. function counter() {
  109. var oTop;
  110. if ($('.count').length !== 0) {
  111. oTop = $('.count').offset().top - window.innerHeight;
  112. }
  113. if ($(window).scrollTop() > oTop) {
  114. $('.count').each(function () {
  115. var $this = $(this),
  116. countTo = $this.attr('data-count');
  117. $({
  118. countNum: $this.text()
  119. }).animate({
  120. countNum: countTo
  121. }, {
  122. duration: 1000,
  123. easing: 'swing',
  124. step: function () {
  125. $this.text(Math.floor(this.countNum));
  126. },
  127. complete: function () {
  128. $this.text(this.countNum);
  129. }
  130. });
  131. });
  132. }
  133. }
  134. $(window).on('scroll', function () {
  135. counter();
  136. });
  137. });