"use strict";

$(document).ready(function () {
  // WOW.js Init
  new WOW({
    boxClass: 'wow',
    animateClass: 'animated',
    offset: 200,
    mobile: false,
    live: false
  }).init(); // Add/remove 'nav-scroll' class to header on scroll

  window.onscroll = function () {
    var header = document.querySelector('header');

    if (header) {
      if (window.scrollY > 50) {
        header.classList.add('nav-scroll');
      } else {
        header.classList.remove('nav-scroll');
      }
    }
  }; // Scroll to top button


  $('.to-top').click(function () {
    $('html, body').animate({
      scrollTop: 0
    }, 1000);
    return false;
  }); // ------------- swiper services -------------//

  var services_slider = new Swiper('.services_slider .swiper-container', {
    slidesPerView: 2,
    spaceBetween: 0,
    speed: 1000,
    pagination: {
      el: '.swiper-pagination',
      clickable: true
    },
    navigation: {
      nextEl: '.services_slider .swiper-button-next',
      prevEl: '.services_slider .swiper-button-prev'
    },
    mousewheel: false,
    keyboard: true,
    autoplay: {
      delay: 2000
    },
    loop: false,
    breakpoints: {
      0: {
        slidesPerView: 1
      },
      480: {
        slidesPerView: 1
      },
      787: {
        slidesPerView: 1
      },
      991: {
        slidesPerView: 2
      },
      1200: {
        slidesPerView: 2
      }
    }
  });
  document.querySelectorAll(".accordion-button").forEach(function (button) {
    var text = button.textContent.trim();
    var words = text.split(" ");

    if (words.length > 1) {
      var first = words.shift();
      button.innerHTML = "<span class=\"first-word\">".concat(first, "</span> ").concat(words.join(" "));
    }
  });
});