Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. /* animation scroll js
  62. /* ========================================================================= */
  63. var html_body = $('html, body');
  64. $('nav a, .page-scroll').on('click', function () { //use page-scroll class in any HTML tag for scrolling
  65. if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
  66. var target = $(this.hash);
  67. target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
  68. if (target.length) {
  69. html_body.animate({
  70. scrollTop: target.offset().top - 50
  71. }, 1500, 'easeInOutExpo');
  72. return false;
  73. }
  74. }
  75. });
  76. // easeInOutExpo Declaration
  77. jQuery.extend(jQuery.easing, {
  78. easeInOutExpo: function (x, t, b, c, d) {
  79. if (t === 0) {
  80. return b;
  81. }
  82. if (t === d) {
  83. return b + c;
  84. }
  85. if ((t /= d / 2) < 1) {
  86. return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
  87. }
  88. return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
  89. }
  90. });
  91. /* ========================================================================= */
  92. /* counter up
  93. /* ========================================================================= */
  94. function counter() {
  95. var oTop;
  96. if ($('.count').length !== 0) {
  97. oTop = $('.count').offset().top - window.innerHeight;
  98. }
  99. if ($(window).scrollTop() > oTop) {
  100. $('.count').each(function () {
  101. var $this = $(this),
  102. countTo = $this.attr('data-count');
  103. $({
  104. countNum: $this.text()
  105. }).animate({
  106. countNum: countTo
  107. }, {
  108. duration: 1000,
  109. easing: 'swing',
  110. step: function () {
  111. $this.text(Math.floor(this.countNum));
  112. },
  113. complete: function () {
  114. $this.text(this.countNum);
  115. }
  116. });
  117. });
  118. }
  119. }
  120. $(window).on('scroll', function () {
  121. counter();
  122. });
  123. });