/* 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( '' ); $("body").append('
'); $("#mobile-nav") .find(".menu-has-children") .prepend(''); $(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: [ '', '' ], 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: [ '', '' ], 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: [ '', '' ], autoplayTimeout: 4000, autoplayHoverPause: true, responsive: { 0: { items: 1 } } }); })(jQuery);