text: /* Description: Custom JS file */
  
  
   /**
     * Easy selector helper function
     */
    const select = (el, all = false) => {
      el = el.trim()
      if (all) {
        return [...document.querySelectorAll(el)]
      } else {
        return document.querySelector(el)
      }
    }
  
    /**
     * Easy event listener function
     */
    const on = (type, el, listener, all = false) => {
      if (all) {
        select(el, all).forEach(e => e.addEventListener(type, listener))
      } else {
        select(el, all).addEventListener(type, listener)
      }
    }
  
  
  
  /* Navigation*/
  // Collapse the navbar by adding the top-nav-collapse class
  window.onscroll = function () {
  	scrollFunction();
  	scrollFunctionBTT(); // back to top button
  };
  
  window.onload = function () {
  	document.getElementById("preloader").classList.add('fadeOut');
  
  	scrollFunction();
  };
  
  
  
  function scrollFunction() {
  	if (document.documentElement.scrollTop > 30) {
  		document.getElementById("navbarExample").classList.add("top-nav-collapse");
  	} else if ( document.documentElement.scrollTop < 30 ) {
  		document.getElementById("navbarExample").classList.remove("top-nav-collapse");
  	}
  }
  
  // Navbar on mobile
  let elements = document.querySelectorAll(".nav-link:not(.dropdown-toggle)");
  
  for (let i = 0; i < elements.length; i++) {
  	elements[i].addEventListener("click", () => {
  		document.querySelector(".offcanvas-collapse").classList.toggle("open");
  	});
  }
  
  document.querySelector(".navbar-toggler").addEventListener("click", () => {
    	document.querySelector(".offcanvas-collapse").classList.toggle("open");
  });
  
  // Hover on desktop
  function toggleDropdown(e) {
  	const _d = e.target.closest(".dropdown");
  	let _m = document.querySelector(".dropdown-menu", _d);
  
  	setTimeout(
  		function () {
  		const shouldOpen = _d.matches(":hover");
  		_m.classList.toggle("show", shouldOpen);
  		_d.classList.toggle("show", shouldOpen);
  
  		_d.setAttribute("aria-expanded", shouldOpen);
  		},
  		e.type === "mouseleave" ? 300 : 0
  	);
  }
  
  // On hover
  const dropdownCheck = document.querySelector('.dropdown');
  
  if (dropdownCheck !== null) { 
  	document.querySelector(".dropdown").addEventListener("mouseleave", toggleDropdown);
  	document.querySelector(".dropdown").addEventListener("mouseover", toggleDropdown);
  
  	// On click
  	document.querySelector(".dropdown").addEventListener("click", (e) => {
  		const _d = e.target.closest(".dropdown");
  		let _m = document.querySelector(".dropdown-menu", _d);
  		if (_d.classList.contains("show")) {
  			_m.classList.remove("show");
  			_d.classList.remove("show");
  		} else {
  			_m.classList.add("show");
  			_d.classList.add("show");
  		}
  	});
  }
    
  
  /* Card Slider - Swiper */
  var cardSlider = new Swiper('.card-slider', {
  	autoplay: {
  		delay: 5000,
  		disableOnInteraction: false
  	},
  	loop: true,
  	navigation: {
  		nextEl: '.swiper-button-next',
  		prevEl: '.swiper-button-prev'
  	},
  	slidesPerView: 2,
  	spaceBetween: 70,
  	breakpoints: {
  		// when window is <= 991px
  		991: {
  			slidesPerView: 1
  		}
  	}
  });
  
  
  
  
  /* Back To Top Button */
  // Get the button
  myButton = document.getElementById("myBtn");
  
  // When the user scrolls down 20px from the top of the document, show the button
  function scrollFunctionBTT() {
  	if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
  		myButton.style.display = "block";
  	} else {
  		myButton.style.display = "none";
  	}
  }
  
  // When the user clicks on the button, scroll to the top of the document
  function topFunction() {
  	document.body.scrollTop = 0; // for Safari
  	document.documentElement.scrollTop = 0; // for Chrome, Firefox, IE and Opera
  }
  
  /* portfolio */
  
  window.addEventListener('load', () => {
      let portfolioContainer = select('.portfolio-container');
      if (portfolioContainer) {
        let portfolioIsotope = new Isotope(portfolioContainer, {
          itemSelector: '.portfolio-item',
          layoutMode: 'fitRows'
        });
  
        let portfolioFilters = select('#portfolio-flters li', true);
  
        on('click', '#portfolio-flters li', function(e) {
          e.preventDefault();
          portfolioFilters.forEach(function(el) {
            el.classList.remove('filter-active');
          });
          this.classList.add('filter-active');
  
          portfolioIsotope.arrange({
            filter: this.getAttribute('data-filter')
          });
          aos_init();
        }, true);
      }
  
    });
  
    /**
     * Initiate portfolio lightbox 
     */
    const portfolioLightbox = GLightbox({
      selector: '.portfokio-lightbox'
    });
  
    /**
     * Portfolio details slider
     */
    new Swiper('.portfolio-details-slider', {
      speed: 400,
      autoplay: {
        delay: 5000,
        disableOnInteraction: false
      },
      pagination: {
        el: '.swiper-pagination',
        type: 'bullets',
        clickable: true
      }
    });
  