$(function() { "use strict"; //===== Prealoder if ($('.preloader').length) { $('.preloader').fadeOut(); } //formulaire recrutement $("#submitAnnonce").click(function(){ $('.sw-invalid').removeClass('sw-invalid'); var dataform = new FormData(); dataform.append('annonce', $('#annonce').val()); dataform.append('nom', $('#nom').val()); dataform.append('email', $('#adr').val()); dataform.append('telephone', $('#telephone').val()); dataform.append('message', $('#message').val()); dataform.append('email2', $('#email').val()); dataform.append('rgpd', ($('#rgpd').is(':checked')) ? 1 : 0 ); dataform.append('lettre', $('#lettre').prop('files')[0]); dataform.append('cv', $('#cv').prop('files')[0]); $.ajax({ type: "POST", url: "ajaxRecrutement.php", data: dataform, cache: false, contentType: false, processData: false }) .done(function(data) { if (data.error) { if (data.errorCode == 1) { $(".messageErreur").html( "Tous les champs suivis d'une astérisque sont obligatoires." ); } if (data.errorCode == 2) { $(".messageErreur").html( "Vous devez saisir un email valide." ); } if (data.errorCode == 3) { $(".messageErreur").html( "Afin que nous puissions vous recontacter, vous devez cochez la case affichée en rouge." ); } if (data.errorCode == 4) { $(".messageErreur").html("La taille maximale de votre fichier doit être inférieure à 1Mb."); } if (data.errorCode == 5) { $(".messageErreur").html("Seuls les formats de fichiers suivants sont autorisés : .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .jpg," + " .jpeg, .png, .gif, .bmp, .rtf .odt."); } $.each(data.errorFields, function (index, value) { $("#" + value).addClass('sw-invalid'); }); } else { $(".sw-contact-form").html('

Votre demande a bien été prise en compte.

'); // window.location='success.php'; } }) .fail(function() { alert( "Une erreur est survenue lors votre demande de contact." ); }) .always(function() { }); return false; }); //formulaire contact $("#submitContact").click(function(){ $('.sw-invalid').removeClass('sw-invalid'); $.ajax({ type: "POST", url: "ajaxContact.php", data: { nom: $('#nom').val(), email: $('#adr').val(), telephone: $('#telephone').val(), message: $('#message').val(), email2: $('#email').val(), rgpd: ($('#rgpd').is(':checked')) ? 1 : 0, } }) .done(function(data) { if (data.error) { if (data.errorCode == 1) { alert( "Tous les champs suivis d'une astérisque sont obligatoires." ); } if (data.errorCode == 2) { alert( "Vous devez saisir un email valide." ); } if (data.errorCode == 3) { alert( "Afin que nous puissions vous recontacter, vous devez cochez la case affichée en rouge." ); } $.each(data.errorFields, function (index, value) { $("#" + value).addClass('sw-invalid'); }); } else { $(".sw-contact-form").html('

Votre demande a bien été prise en compte.

'); // window.location='success.php'; } }) .fail(function() { alert( "Une erreur est survenue lors votre demande de contact." ); }) .always(function() { }); return false; }); //===== Sticky $(window).on('scroll', function(event) { var scroll = $(window).scrollTop(); if (scroll < 155) { $(".main-header").removeClass("sticky"); } else{ $(".main-header").addClass("sticky"); } }); /*---canvas menu activation---*/ $('.canvas_open').on('click', function(){ $('.offcanvas_menu_wrapper,.off_canvars_overlay').addClass('active') }); $('.canvas_close,.off_canvars_overlay').on('click', function(){ $('.offcanvas_menu_wrapper,.off_canvars_overlay').removeClass('active') }); /*---Off Canvas Menu---*/ var $offcanvasNav = $('.offcanvas_main_menu'), $offcanvasNavSubMenu = $offcanvasNav.find('.sub-menu'); $offcanvasNavSubMenu.parent().prepend(''); $offcanvasNavSubMenu.slideUp(); $offcanvasNav.on('click', 'li a, li .menu-expand', function(e) { var $this = $(this); if ( ($this.parent().attr('class').match(/\b(menu-item-has-children|has-children|has-sub-menu)\b/)) && ($this.attr('href') === '#' || $this.hasClass('menu-expand')) ) { e.preventDefault(); if ($this.siblings('ul:visible').length){ $this.siblings('ul').slideUp('slow'); }else { $this.closest('li').siblings('li').find('ul:visible').slideUp('slow'); $this.siblings('ul').slideDown('slow'); } } if( $this.is('a') || $this.is('span') || $this.attr('clas').match(/\b(menu-expand)\b/) ){ $this.parent().toggleClass('menu-open'); }else if( $this.is('li') && $this.attr('class').match(/\b('menu-item-has-children')\b/) ){ $this.toggleClass('menu-open'); } }); //===== faq accrodion if ($('.accrodion-grp').length) { var accrodionGrp = $('.accrodion-grp'); accrodionGrp.each(function () { var accrodionName = $(this).data('grp-name'); var Self = $(this); var accordion = Self.find('.accrodion'); Self.addClass(accrodionName); Self.find('.accrodion .accrodion-content').hide(); Self.find('.accrodion.active').find('.accrodion-content').show(); accordion.each(function () { $(this).find('.accrodion-title').on('click', function () { if ($(this).parent().parent().hasClass('active') === false) { $('.accrodion-grp.' + accrodionName).find('.accrodion').removeClass('active'); $('.accrodion-grp.' + accrodionName).find('.accrodion').find('.accrodion-content').slideUp(); $(this).parent().parent().addClass('active'); $(this).parent().parent().find('.accrodion-content').slideDown(); }; }); }); }); }; // fun facts Active $('.find-space-area').on('click', '.find-space-item', function() { $('.find-space-item.active').removeClass('active'); $(this).addClass('active'); }); // fun facts Active $('.fun-facts-area').on('mouseover', '.fun-facts-item', function() { $('.fun-facts-item.active').removeClass('active'); $(this).addClass('active'); }); // news Active $('.news-area').on('mouseover', '.news-item', function() { $('.news-item.active').removeClass('active'); $(this).addClass('active'); }); // news Active $('.services-box-area').on('mouseover', '.single-services', function() { $('.single-services.active').removeClass('active'); $(this).addClass('active'); }); //===== banner animation slick slider function mainSlider() { var BasicSlider = $('.banner-slide'); var BasicSlider2 = $('.banner-slide-3'); BasicSlider.on('init', function (e, slick) { var $firstAnimatingElements = $('.banner-area:first-child').find('[data-animation]'); doAnimations($firstAnimatingElements); }); BasicSlider2.on('init', function (e, slick) { var $firstAnimatingElements = $('.banner-3-area:first-child').find('[data-animation]'); doAnimations($firstAnimatingElements); }); BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) { var $animatingElements = $('.banner-area[data-slick-index="' + nextSlide + '"]').find('[data-animation]'); doAnimations($animatingElements); }); BasicSlider2.on('beforeChange', function (e, slick, currentSlide, nextSlide) { var $animatingElements = $('.banner-3-area[data-slick-index="' + nextSlide + '"]').find('[data-animation]'); doAnimations($animatingElements); }); BasicSlider.slick({ autoplay: true, autoplaySpeed: 10000, dots: false, fade: true, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 768, settings: { arrows: false } } ] }); BasicSlider2.slick({ autoplay: true, autoplaySpeed: 10000, dots: false, fade: true, arrows: false, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 768, settings: { 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(); //===== feedback slide slick slider $('.gallery-active').slick({ dots: false, infinite: true, autoplay: true, autoplaySpeed: 2000, arrows: false, speed: 1000, slidesToShow: 4, slidesToScroll: 1, responsive: [ { breakpoint: 1600, settings: { slidesToShow: 4, } },{ breakpoint: 1200, settings: { slidesToShow: 3, } }, { breakpoint: 992, settings: { slidesToShow: 3, } }, { breakpoint: 768, settings: { slidesToShow: 2, dots: false, } }, { breakpoint: 576, settings: { slidesToShow: 1, dots: false, } } ] }); //===== testimonial slide slick slider $('.testimonial-active').slick({ dots: false, infinite: true, autoplay: true, autoplaySpeed: 2000, arrows: false, speed: 1000, slidesToShow: 3, slidesToScroll: 1, centerMode: true, centerPadding: '0px', responsive: [ { breakpoint: 1600, settings: { slidesToShow: 3, } },{ breakpoint: 1200, settings: { slidesToShow: 2, } }, { breakpoint: 992, settings: { slidesToShow: 2, } }, { breakpoint: 768, settings: { slidesToShow: 1, dots: false, } }, { breakpoint: 576, settings: { slidesToShow: 1, dots: false, } } ] }); $('.services').slick({ dots: false, infinite: true, autoplay: true, autoplaySpeed: 2000, arrows: true, prevArrow:"
Prev
", nextArrow:"
Next
", speed: 1000, slidesToShow: 4, slidesToScroll: 1, centerMode: true, centerPadding: '0px', responsive: [ { breakpoint: 1600, settings: { slidesToShow: 3, } },{ breakpoint: 1200, settings: { slidesToShow: 2, } }, { breakpoint: 992, settings: { slidesToShow: 2, } }, { breakpoint: 768, settings: { slidesToShow: 1, dots: false, } }, { breakpoint: 576, settings: { slidesToShow: 1, dots: false, } } ] }); //===== barnd slide slick slider $('.barnd-active').slick({ dots: false, infinite: true, autoplay: true, autoplaySpeed: 2000, arrows: false, speed: 1000, slidesToShow: 5, slidesToScroll: 1, responsive: [ { breakpoint: 1600, settings: { slidesToShow: 5, } },{ breakpoint: 1200, settings: { slidesToShow: 4, } }, { breakpoint: 992, settings: { slidesToShow: 3, } }, { breakpoint: 768, settings: { slidesToShow: 3, dots: false, } }, { breakpoint: 576, settings: { slidesToShow: 2, dots: false, } } ] }); //====== Magnific Popup $('.video-popup').magnificPopup({ type: 'iframe' // other options }); //===== Magnific Popup $('.image-popup').magnificPopup({ type: 'image', gallery:{ enabled:true } }); //===== niceSelect js $('select').niceSelect(); if ($('.wow').length) { var wow = new WOW({ boxClass: 'wow', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 150, // distance to the element when triggering the animation (default is 0) mobile: true, // trigger animations on mobile devices (default is true) live: true // act on asynchronously loaded content (default is true) }); wow.init(); } if ($('.counter').length) { $('.counter').counterUp({ delay: 10, time: 3000 }); } //===== Back to top // Scroll Event $(window).on('scroll', function () { var scrolled = $(window).scrollTop(); if (scrolled > 300) $('.go-top').addClass('active'); if (scrolled < 300) $('.go-top').removeClass('active'); }); // Click Event $('.go-top').on('click', function () { $("html, body").animate({ scrollTop: "0" }, 200); }); //===== });