// Preloader js $(window).on('load', function () { $('.preloader').fadeOut(100); }); (function ($) { 'use strict'; // navigation $(window).scroll(function () { if ($('.navigation').offset().top > 1) { $('.navigation').addClass('nav-bg'); } else { $('.navigation').removeClass('nav-bg'); } }); // video modal popup var $videoSrc; $('.video-modal').click(function () { $videoSrc = $(this).data("src"); }); $('#videoModal').on('shown.bs.modal', function (e) { $("#video").attr('src', $videoSrc + "?autoplay=1&modestbranding=1&showinfo=0"); }) $('#videoModal').on('hide.bs.modal', function (e) { $("#video").attr('src', $videoSrc); }) $('#videoModal2').on('shown.bs.modal', function (e) { $("#video2").attr('src', $videoSrc + "?autoplay=1&modestbranding=1&showinfo=0"); }) $('#videoModal2').on('hide.bs.modal', function (e) { $("#video2").attr('src', $videoSrc); }) // testimonial slider $('.testimonial-slider').slick({ dots: false, infinite: true, speed: 300, slidesToShow: 3, slidesToScroll: 1, arrows: true, prevArrow: '', nextArrow: '', autoplay: true, responsive: [{ breakpoint: 1024, settings: { slidesToShow: 3 } }, { breakpoint: 600, settings: { slidesToShow: 2 } }, { breakpoint: 401, settings: { slidesToShow: 1 } } ] }); // product Slider $('.product-slider').slick({ autoplay: false, infinite: true, arrows: false, dots: true, customPaging: function (slider, i) { var image = $(slider.$slides[i]).data('image'); return 'product-img'; } }); // Accordions $('.collapse').on('shown.bs.collapse', function () { $(this).parent().find('.ti-plus').removeClass('ti-plus').addClass('ti-minus'); }).on('hidden.bs.collapse', function () { $(this).parent().find('.ti-minus').removeClass('ti-minus').addClass('ti-plus'); }); // Contact Form $( document ).ready(function() { var $contactForm = $('#contact-form'); $contactForm.submit(function(e) { e.preventDefault(); $.ajax({ url: 'https://mailbear.delmar.bzh/api/v1/form/En7Bq5f4izuYs2zsnYHzmomNXbLzJE6V', method: 'POST', data: $(this).serialize(), dataType: 'json', beforeSend: function() { $contactForm.find('.overlay div').html('
  Envoi...
'); $contactForm.find('.overlay').fadeIn(); }, success: function(data) { $contactForm.find('.alert--loading').hide(); $contactForm.find('.overlay div').html('
  Message envoyé !
'); $contactForm.find('.overlay').fadeIn(); }, error: function(err) { $contactForm.find('.alert--loading').hide(); $contactForm.find('.overlay div').html('
  Ooops, c\'est tout pêté !!!
'); $contactForm.find('.overlay').fadeIn(); } }); }); $contactForm.find('.overlay').click(function(e) { $(this).fadeOut(); }); }); })(jQuery);