gsap.registerPlugin(ScrollTrigger);
// import LocomotiveScroll from "https://cdn.skypack.dev/locomotive-scroll";
const locoScroll = new LocomotiveScroll({
  el: document.querySelector(".smooth-scroll"),
  smooth: true,
  multiplier: 1.5,
  // for tablet smooth
  tablet: { smooth: true },

  // for mobile
  smartphone: { smooth: true ,
    multiplier: 1,}
});
locoScroll.on("scroll", ScrollTrigger.update);

ScrollTrigger.scrollerProxy(".smooth-scroll", {
  scrollTop(value) {
    return arguments.length
      ? locoScroll.scrollTo(value, 0, 0)
      : locoScroll.scroll.instance.scroll.y;
  },
  getBoundingClientRect() {
    return {
      top: 0,
      left: 0,
      width: window.innerWidth,
      height: window.innerHeight
    };
  }

  // follwoing line is not required to work pinning on touch screen

  /* pinType: document.querySelector(".smooth-scroll").style.transform
    ? "transform"
    : "fixed"*/
});

ScrollTrigger.addEventListener("refresh", () => locoScroll.update());
ScrollTrigger.refresh();

$(".preloader").fadeTo(5000,1).fadeOut(1000);

$('.menu_btn').click(function () { 
  $(this).toggleClass('active');
  $('header nav').toggleClass('active');
});

if ($(window).width() < 769) {
  $('.dropdown_1 a').click(function () { 
    $('header nav ul li.dropdown_1 ul.dropdown_menu').slideToggle();
  });
}