| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 | /* eslint-disable */
(function($) {
  // Preloader
  $(window).on("load", () => {
    if ($("#preloader")) {
      $("#preloader").fadeOut("slow", function() {
        $(this).remove();
      });
    }
  });
  // Back to top button
  $(window).scroll(function() {
    if ($(this).scrollTop() > 100) {
      $(".back-to-top").fadeIn("slow");
    } else {
      $(".back-to-top").fadeOut("slow");
    }
  });
  $(".back-to-top").click(() => {
    $("html, body").animate(
      {
        scrollTop: 0
      },
      1500,
      "easeInOutExpo"
    );
    return false;
  });
  const nav = $("nav");
  const navHeight = nav.outerHeight();
  /* --/ ScrollReveal /Easy scroll animations for web and mobile browsers /--*/
  window.sr = ScrollReveal();
  sr.reveal(".foo", {
    duration: 1000,
    delay: 15
  });
  // Smooth scroll for the menu and links with .scrollto classes
  $(".nav-menu a, #mobile-nav a, .scrollto").on("click", function() {
    if (
      location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") &&
      location.hostname == this.hostname
    ) {
      var target = $(this.hash);
      if (target.length) {
        var top_space = 0;
        if ($("#header").length) {
          top_space = $("#header").outerHeight();
          if (!$("#header").hasClass("header-fixed")) {
            top_space = top_space - 20;
          }
        }
        $("html, body").animate(
          {
            scrollTop: target.offset().top - top_space
          },
          1500,
          "easeInOutExpo"
        );
        if ($(this).parents(".nav-menu").length) {
          $(".nav-menu .menu-active").removeClass("menu-active");
          $(this)
            .closest("li")
            .addClass("menu-active");
        }
        if ($("body").hasClass("mobile-nav-active")) {
          $("body").removeClass("mobile-nav-active");
          $("#mobile-nav-toggle i").toggleClass("fa-times fa-bars");
          $("#mobile-body-overly").fadeOut();
        }
        return false;
      }
    }
  });
  // Mobile Navigation
  if ($("#nav-menu-container").length) {
    var $mobile_nav = $("#nav-menu-container")
      .clone()
      .prop({
        id: "mobile-nav"
      });
    $mobile_nav.find("> ul").attr({
      class: "",
      id: ""
    });
    $("body").append($mobile_nav);
    $("body").prepend(
      '<button type="button" id="mobile-nav-toggle"><i class="fa fa-bars"></i></button>'
    );
    $("body").append('<div id="mobile-body-overly"></div>');
    $("#mobile-nav")
      .find(".menu-has-children")
      .prepend('<i class="fa fa-chevron-down"></i>');
    $(document).on("click", ".menu-has-children i", function(e) {
      $(this)
        .next()
        .toggleClass("menu-item-active");
      $(this)
        .nextAll("ul")
        .eq(0)
        .slideToggle();
      $(this).toggleClass("fa-chevron-left fa-chevron-down");
    });
    $(document).on("click", "#mobile-nav-toggle", function(e) {
      $("body").toggleClass("mobile-nav-active");
      $("#mobile-nav-toggle i").toggleClass("fa-times fa-bars");
      $("#mobile-body-overly").toggle();
    });
    $(document).click(function(e) {
      var container = $("#mobile-nav, #mobile-nav-toggle");
      if (!container.is(e.target) && container.has(e.target).length === 0) {
        if ($("body").hasClass("mobile-nav-active")) {
          $("body").removeClass("mobile-nav-active");
          $("#mobile-nav-toggle i").toggleClass("fa-times fa-bars");
          $("#mobile-body-overly").fadeOut();
        }
      }
    });
  } else if ($("#mobile-nav, #mobile-nav-toggle").length) {
    $("#mobile-nav, #mobile-nav-toggle").hide();
  }
  /* --/ Carousel owl /--*/
  $("#carousel").owlCarousel({
    loop: true,
    margin: -1,
    items: 1,
    nav: true,
    navText: [
      '<i class="ion-ios-arrow-back" aria-hidden="true"></i>',
      '<i class="ion-ios-arrow-forward" aria-hidden="true"></i>'
    ],
    autoplay: true,
    autoplayTimeout: 3000,
    autoplayHoverPause: true
  });
  /* --/ Animate Carousel /--*/
  $(".intro-carousel").on("translate.owl.carousel", () => {
    $(".intro-content .intro-title")
      .removeClass("zoomIn animated")
      .hide();
    $(".intro-content .intro-price")
      .removeClass("fadeInUp animated")
      .hide();
    $(".intro-content .intro-title-top, .intro-content .spacial")
      .removeClass("fadeIn animated")
      .hide();
  });
  $(".intro-carousel").on("translated.owl.carousel", () => {
    $(".intro-content .intro-title")
      .addClass("zoomIn animated")
      .show();
    $(".intro-content .intro-price")
      .addClass("fadeInUp animated")
      .show();
    $(".intro-content .intro-title-top, .intro-content .spacial")
      .addClass("fadeIn animated")
      .show();
  });
  /* --/ Navbar Collapse /--*/
  $(".navbar-toggle-box-collapse").on("click", () => {
    $("body")
      .removeClass("box-collapse-closed")
      .addClass("box-collapse-open");
  });
  $(".close-box-collapse, .click-closed").on("click", () => {
    $("body")
      .removeClass("box-collapse-open")
      .addClass("box-collapse-closed");
    $(".menu-list ul").slideUp(700);
  });
  /* --/ Navbar Menu Reduce /--*/
  $(window).trigger("scroll");
  $(window).bind("scroll", () => {
    const pixels = 50;
    const top = 1200;
    if ($(window).scrollTop() > pixels) {
      $(".navbar-default").addClass("navbar-reduce");
      $(".navbar-default").removeClass("navbar-trans");
    } else {
      $(".navbar-default").addClass("navbar-trans");
      $(".navbar-default").removeClass("navbar-reduce");
    }
    if ($(window).scrollTop() > top) {
      $(".scrolltop-mf").fadeIn(1000, "easeInOutExpo");
    } else {
      $(".scrolltop-mf").fadeOut(1000, "easeInOutExpo");
    }
  });
  /* --/ Property owl /--*/
  $("#property-carousel").owlCarousel({
    loop: true,
    margin: 30,
    responsive: {
      0: {
        items: 1
      },
      769: {
        items: 2
      },
      992: {
        items: 3
      }
    }
  });
  /* --/ Property owl owl /--*/
  $("#property-single-carousel").owlCarousel({
    loop: true,
    margin: 0,
    nav: true,
    navText: [
      '<i class="ion-ios-arrow-back" aria-hidden="true"></i>',
      '<i class="ion-ios-arrow-forward" aria-hidden="true"></i>'
    ],
    responsive: {
      0: {
        items: 1
      }
    }
  });
  /* --/ News owl /--*/
  $("#new-carousel").owlCarousel({
    loop: true,
    margin: 30,
    responsive: {
      0: {
        items: 1
      },
      769: {
        items: 2
      },
      992: {
        items: 3
      }
    }
  });
  /* --/ Testimonials owl /--*/
  $("#testimonial-carousel").owlCarousel({
    margin: 0,
    autoplay: true,
    nav: true,
    animateOut: "fadeOut",
    animateIn: "fadeInUp",
    navText: [
      '<i class="ion-ios-arrow-back" aria-hidden="true"></i>',
      '<i class="ion-ios-arrow-forward" aria-hidden="true"></i>'
    ],
    autoplayTimeout: 4000,
    autoplayHoverPause: true,
    responsive: {
      0: {
        items: 1
      }
    }
  });
})(jQuery);
 |