You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
5.0 KiB

  1. (function ($)
  2. { "use strict"
  3. /* 1. Proloder */
  4. $(window).on('load', function () {
  5. $('#preloader-active').delay(450).fadeOut('slow');
  6. $('body').delay(450).css({
  7. 'overflow': 'visible'
  8. });
  9. });
  10. /* 2. sticky And Scroll UP */
  11. $(window).on('scroll', function () {
  12. var scroll = $(window).scrollTop();
  13. if (scroll < 400) {
  14. $(".header-sticky").removeClass("sticky-bar");
  15. $('#back-top').fadeOut(500);
  16. } else {
  17. $(".header-sticky").addClass("sticky-bar");
  18. $('#back-top').fadeIn(500);
  19. }
  20. });
  21. // Scroll Up
  22. $('#back-top a').on("click", function () {
  23. $('body,html').animate({
  24. scrollTop: 0
  25. }, 800);
  26. return false;
  27. });
  28. /* 3. slick Nav */
  29. // mobile_menu
  30. var menu = $('ul#navigation');
  31. if(menu.length){
  32. menu.slicknav({
  33. prependTo: ".mobile_menu",
  34. closedSymbol: '+',
  35. openedSymbol:'-'
  36. });
  37. };
  38. /* 4. MainSlider-1 */
  39. // h1-hero-active
  40. function mainSlider() {
  41. var BasicSlider = $('.slider-active');
  42. BasicSlider.on('init', function (e, slick) {
  43. var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');
  44. doAnimations($firstAnimatingElements);
  45. });
  46. BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {
  47. var $animatingElements = $('.single-slider[data-slick-index="' + nextSlide + '"]').find('[data-animation]');
  48. doAnimations($animatingElements);
  49. });
  50. BasicSlider.slick({
  51. autoplay: false,
  52. autoplaySpeed: 4000,
  53. dots: false,
  54. fade: true,
  55. arrows: true,
  56. prevArrow: '<button type="button" class="slick-prev"><i class="ti-angle-left"></i></button>',
  57. nextArrow: '<button type="button" class="slick-next"><i class="ti-angle-right"></i></button>',
  58. responsive: [{
  59. breakpoint: 1024,
  60. settings: {
  61. slidesToShow: 1,
  62. slidesToScroll: 1,
  63. infinite: true,
  64. }
  65. },
  66. {
  67. breakpoint: 991,
  68. settings: {
  69. slidesToShow: 1,
  70. slidesToScroll: 1,
  71. arrows: true
  72. }
  73. },
  74. {
  75. breakpoint: 767,
  76. settings: {
  77. slidesToShow: 1,
  78. slidesToScroll: 1,
  79. arrows: true
  80. }
  81. }
  82. ]
  83. });
  84. function doAnimations(elements) {
  85. var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
  86. elements.each(function () {
  87. var $this = $(this);
  88. var $animationDelay = $this.data('delay');
  89. var $animationType = 'animated ' + $this.data('animation');
  90. $this.css({
  91. 'animation-delay': $animationDelay,
  92. '-webkit-animation-delay': $animationDelay
  93. });
  94. $this.addClass($animationType).one(animationEndEvents, function () {
  95. $this.removeClass($animationType);
  96. });
  97. });
  98. }
  99. }
  100. mainSlider();
  101. /* 5. Testimonial Active*/
  102. var testimonial = $('.h1-testimonial-active');
  103. if(testimonial.length){
  104. testimonial.slick({
  105. dots: false,
  106. infinite: true,
  107. speed: 1000,
  108. autoplay:false,
  109. arrows: false,
  110. prevArrow: '<button type="button" class="slick-prev"><i class="ti-angle-left"></i></button>',
  111. nextArrow: '<button type="button" class="slick-next"><i class="ti-angle-right"></i></button>',
  112. slidesToShow: 1,
  113. slidesToScroll: 1,
  114. responsive: [
  115. {
  116. breakpoint: 1024,
  117. settings: {
  118. slidesToShow: 1,
  119. slidesToScroll: 1,
  120. infinite: true,
  121. dots: false,
  122. arrow:true
  123. }
  124. },
  125. {
  126. breakpoint: 600,
  127. settings: {
  128. slidesToShow: 1,
  129. slidesToScroll: 1,
  130. dots: false,
  131. arrow:false
  132. }
  133. },
  134. {
  135. breakpoint: 480,
  136. settings: {
  137. slidesToShow: 1,
  138. slidesToScroll: 1,
  139. dots: false,
  140. arrow:false
  141. }
  142. }
  143. ]
  144. });
  145. }
  146. /* 6. Nice Selectorp */
  147. var nice_Select = $('select');
  148. if(nice_Select.length){
  149. nice_Select.niceSelect();
  150. }
  151. /* 7. data-background */
  152. $("[data-background]").each(function () {
  153. $(this).css("background-image", "url(" + $(this).attr("data-background") + ")")
  154. });
  155. /* 10. WOW active */
  156. new WOW().init();
  157. // 11. ---- Mailchimp js --------//
  158. function mailChimp() {
  159. $('#mc_embed_signup').find('form').ajaxChimp();
  160. }
  161. mailChimp();
  162. // 12 Pop Up Img
  163. var popUp = $('.single_gallery_part, .img-pop-up');
  164. if(popUp.length){
  165. popUp.magnificPopup({
  166. type: 'image',
  167. gallery:{
  168. enabled:true
  169. }
  170. });
  171. }
  172. })(jQuery);