(function ($) { "use strict"; // meanmenu $('#mobile-menu').meanmenu({ meanMenuContainer: '.mobile-menu', meanScreenWidth: "992" }); // One Page Nav var top_offset = $('.header-area').height() - 10; $('.main-menu nav ul').onePageNav({ currentClass: 'active', scrollOffset: top_offset, }); $(window).on('scroll', function () { var scroll = $(window).scrollTop(); if (scroll < 245) { $(".header-sticky").removeClass("sticky"); } else { $(".header-sticky").addClass("sticky"); } }); // data - background $("[data-background]").each(function () { $(this).css("background-image", "url(" + $(this).attr("data-background") + ")") }) $("[data-bg-color]").each(function () { $(this).css("background", $(this).attr("data-bg-color")) }) /* Search -------------------------------------------------------*/ var $searchWrap = $('.search-wrap'); var $navSearch = $('.nav-search'); var $searchClose = $('#search-close'); $('.search-trigger').on('click', function (e) { e.preventDefault(); $searchWrap.animate({ opacity: 'toggle' }, 500); $navSearch.add($searchClose).addClass("open"); }); $('.search-close').on('click', function (e) { e.preventDefault(); $searchWrap.animate({ opacity: 'toggle' }, 500); $navSearch.add($searchClose).removeClass("open"); }); function closeSearch() { $searchWrap.fadeOut(200); $navSearch.add($searchClose).removeClass("open"); } $(document.body).on('click', function (e) { closeSearch(); }); $(".search-trigger, .main-search-input").on('click', function (e) { e.stopPropagation(); }); // mainSlider function mainSlider() { var BasicSlider = $('.slider-active'); BasicSlider.on('init', function (e, slick) { var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]'); doAnimations($firstAnimatingElements); }); BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) { var $animatingElements = $('.single-slider[data-slick-index="' + nextSlide + '"]').find('[data-animation]'); doAnimations($animatingElements); }); BasicSlider.slick({ autoplay: false, autoplaySpeed: 10000, dots: false, fade: true, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1024, settings: { slidesToShow: 1, slidesToScroll: 1, infinite: true, } }, { breakpoint: 991, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false } } ] }); function doAnimations(elements) { var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; elements.each(function () { var $this = $(this); var $animationDelay = $this.data('delay'); var $animationType = 'animated ' + $this.data('animation'); $this.css({ 'animation-delay': $animationDelay, '-webkit-animation-delay': $animationDelay }); $this.addClass($animationType).one(animationEndEvents, function () { $this.removeClass($animationType); }); }); } } mainSlider(); // owlCarousel $('.test-active').owlCarousel({ loop: true, margin: 30, items: 1, navText: ['', ''], nav: false, dots: false, responsive: { 0: { items: 1, margin: 0 }, 767: { items: 2 }, 992: { items: 2 }, 1200: { items: 3 } } }); /* owlCarousel $('#carousel-actus-footer').owlCarousel({ loop:true, margin:0, items:1, navText:['',''], nav:false, dots:false, responsive:{ 0:{ items:1, margin: 0 }, 767:{ items:1 }, 992:{ items:1 }, 1200:{ items:1 } } }); */ // ------------------------------- Partner Slider var pSlider = $(".brand-active"); if (pSlider.length) { pSlider.owlCarousel({ loop: true, nav: false, dots: false, autoplay: true, autoplayTimeout: 4000, smartSpeed: 1200, navText: ['', ''], autoplayHoverPause: true, lazyLoad: true, responsive: { 0: { items: 2 }, 768: { items: 3 }, 992: { items: 4 }, 1200: { items: 5 } }, }) } // owlCarousel $('.groupesully').owlCarousel({ loop: true, margin: 30, items: 1, navText: ['', ''], nav: false, dots: false, responsive: { 0: { items: 2 }, 767: { items: 4 }, 992: { items: 5 }, 1200: { items: 5 } } }); // blog - active $('.postbox__gallery').slick({ dots: false, arrows: true, infinite: true, speed: 300, prevArrow: '', nextArrow: '', slidesToShow: 1, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 1, slidesToScroll: 1, infinite: true, } }, { breakpoint: 991, settings: { slidesToShow: 1, slidesToScroll: 1 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); // team - active $('.team-active').slick({ dots: false, autoplay: true, autoplaySpeed: 2000, arrows: true, infinite: true, speed: 300, prevArrow: '', nextArrow: '', slidesToShow: 3, slidesToScroll: 1, responsive: [ { breakpoint: 1200, settings: { slidesToShow: 2, slidesToScroll: 1, infinite: true, } }, { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 767, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 550, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); // team - active $('.testimonials-activation').slick({ dots: false, autoplay: true, autoplaySpeed: 2000, arrows: true, infinite: true, speed: 300, prevArrow: '', nextArrow: '', slidesToShow: 2, slidesToScroll: 1, responsive: [ { breakpoint: 1200, settings: { slidesToShow: 2, slidesToScroll: 1, infinite: true, } }, { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 767, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 550, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); // blog - active $('.service-active').slick({ dots: false, arrows: false, infinite: true, speed: 300, prevArrow: '', nextArrow: '', slidesToShow: 3, slidesToScroll: 1, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 2, slidesToScroll: 1, infinite: true, arrows: false, } }, { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false, } } ] }); // blog - active $('.h4gallery-active').slick({ dots: true, arrows: true, infinite: true, speed: 300, prevArrow: '', nextArrow: '', slidesToShow: 2, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 2, slidesToScroll: 1, infinite: true, } }, { breakpoint: 991, settings: { slidesToShow: 1, slidesToScroll: 1 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false, } } ] }); /* magnificPopup img view */ $('.popup-image').magnificPopup({ type: 'image', gallery: { enabled: true } }); /* magnificPopup video view */ $('.popup-video').magnificPopup({ type: 'iframe' }); // isotop $('.blog-masonry').imagesLoaded(function () { // init Isotope var $grid = $('.blog-masonry').isotope({ itemSelector: '.grid-item', percentPosition: true, masonry: { // use outer width of grid-sizer for columnWidth columnWidth: '.grid-item', } }); }); // isotop $('.row-portfolio').imagesLoaded(function () { // init Isotope var $grid = $('.row-portfolio').isotope({ itemSelector: '.grid-item', percentPosition: true, masonry: { // use outer width of grid-sizer for columnWidth columnWidth: '.grid-sizer' } }); // filter items on button click $('.portfolio-filter').on('click', 'button', function () { var filterValue = $(this).attr('data-filter'); $grid.isotope({ filter: filterValue }); }); }); //for menu active class $('.portfolio-filter button').on('click', function (event) { $(this).siblings('.active').removeClass('active'); $(this).addClass('active'); event.preventDefault(); }); // isotop $('.gallery-portfolio').imagesLoaded(function () { // init Isotope var $grid = $('.gallery-portfolio').isotope({ itemSelector: '.grid-gallery', percentPosition: true, }); // filter items on button click $('.gallery-filter').on('click', 'button', function () { var filterValue = $(this).attr('data-filter'); $grid.isotope({ filter: filterValue }); }); //for menu active class $('.gallery-filter button').on('click', function (event) { $(this).siblings('.active').removeClass('active'); $(this).addClass('active'); event.preventDefault(); }); }); // counterUP $('.counter').counterUp({ delay: 10, time: 1000 }); // testimonials-active $('.testimonials-activation').slick({ dots: false, arrows: false, infinite: false, speed: 300, slidesToShow: 2, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 1, slidesToScroll: 1, infinite: true, dots: false } }, { breakpoint: 600, settings: { slidesToShow: 1, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); // team-active $('.team-activation').slick({ dots: true, infinite: false, speed: 300, arrows: false, slidesToShow: 6, slidesToScroll: 1, responsive: [ { breakpoint: 1200, settings: { slidesToShow: 4, slidesToScroll: 1, infinite: true, dots: true } }, { breakpoint: 600, settings: { slidesToShow: 1, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 2, slidesToScroll: 1 } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); // scrollToTop $.scrollUp({ scrollName: 'scrollUp', // Element ID topDistance: '300', // Distance from top before showing element (px) topSpeed: 300, // Speed back to top (ms) animation: 'fade', // Fade, slide, none animationInSpeed: 200, // Animation in speed (ms) animationOutSpeed: 200, // Animation out speed (ms) scrollText: '', // Text for element activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' }); // nice-slector $(document).ready(function () { $('select').niceSelect(); }); // WOW active new WOW().init(); /*------------------------- showlogin toggle function --------------------------*/ $('#showlogin').on('click', function () { $('#checkout-login').slideToggle(900); }); /*------------------------- showcoupon toggle function --------------------------*/ $('#showcoupon').on('click', function () { $('#checkout_coupon').slideToggle(900); }); /*------------------------- Create an account toggle function --------------------------*/ $('#cbox').on('click', function () { $('#cbox_info').slideToggle(900); }); /*------------------------- Create an account toggle function --------------------------*/ $('#ship-box').on('click', function () { $('#ship-box-info').slideToggle(1000); }); // map function basicmap() { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 11, scrollwheel: false, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(40.6700, -73.9400), // New York // This is where you would paste any style found on Snazzy Maps. styles: [{ "stylers": [{ "hue": "#dd0d0d" }] }, { "featureType": "road", "elementType": "labels", "stylers": [{ "visibility": "off" }] }, { "featureType": "road", "elementType": "geometry", "stylers": [{ "lightness": 100 }, { "visibility": "simplified" }] }] }; // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the var mapElement = document.getElementById('contact-map'); // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it var marker = new google.maps.Marker({ position: new google.maps.LatLng(40.6700, -73.9400), map: map, title: 'Cryptox' }); } if ($('#contact-map').length != 0) { google.maps.event.addDomListener(window, 'load', basicmap); } })(jQuery);