(function ($) {
  "use strict";
  // Blog Slider
  const slides = document.querySelectorAll(
    ".nexum-blog-slider .wp-block-post"
  );
  slides.forEach((element) => {
    if (!element.classList.contains("swiper-slide")) {
      element.classList.add("swiper-slide");
    }
  });
  let nexumSlider2 = new Swiper(".nexum-blog-slider", {
    spaceBetween: 0,
    slidesPerView: 1,
    speed: 300,
    loop: true,
    effect: "slide",
    autoplay: {
      delay: 5000,
      disableOnInteraction: false,
    },
    pagination: {
      el: ".nexum-slider-pagination",
      clickable: true,
    },
    navigation: {
      nextEl: ".nexum-blog-slider .swiper-button-next",
      prevEl: ".nexum-blog-slider .swiper-button-prev",
      clickable: true,
    },
  });
  // Breaking news slider
  let nexumHeader = new Swiper(".nexum-header-slider", {
    spaceBetween: 0,
    slidesPerView: 2,
    loop: true,
    speed: 500,
    effect: "slide",

    autoplay: {
      delay: 3000,
      disableOnInteraction: false,
      pauseOnMouseEnter: true,
    },
  });
  $(".nexum-swiper-holder").find(".wp-block-post").addClass("swiper-slide");
})(jQuery);
