let $ = jQuery;
$(document).ready(function () {
  if ($("body").outerHeight() < $(window).height()) {
    $("footer").css({
      "margin-top": $(window).height() - $("body").outerHeight(),
    });
  }


  $("body").on('click', function(){
    let target = $(this).find(".grid-filter li.activeFilter a").html()
    $(".filter-title").text(target)
    console.log(target)
  })

  $(".portfolio-item").css({
    height: ($(".portfolio-item").width() / 2) * 1.4,
  });

  if ($("div").hasClass("eH-Area")) {
    $(".eH-Area").each(function () {
      $(this).find(".eH").matchHeight();
      $(this).find(".eH2").matchHeight();
    });
  }

  if ($(window).width() > 991) {
    $(".values-section").css({
      "padding-top": ($(".banner-cards .banner-cards-area").outerHeight() / 2) + 100,
      // "padding-bottom": ($(".banner-cards .banner-cards-area").outerHeight() / 2),
    });
  }


});

window.addEventListener("load", function () {
  if ($("div").hasClass("swiper-parent")) {
    new Swiper(".swiper-parent", {
      slidesPerView: 1,
      pagination: {
        clickable: false,
      },
      grabCursor: true,
      navigation: {
        prevEl: ".slider-arrow-left",
        nextEl: ".slider-arrow-right",
      },
      breakpoints: {
        768: {
          slidesPerView: 2,
        },
        992: {
          slidesPerView: 3,
        },
      },
    });
  }
});


$(window).ready(function(){
  $(".loader-area").fadeOut()
  setTimeout(function() {
    $("#slider").addClass("loaded");
  }, 800);
})