$("img.lazy").lazyload({effect:"fadeIn"});document.querySelectorAll(".slider-container").forEach((e,a)=>{let s=e.querySelector(".slider-wrapper"),c=e.querySelectorAll(".slide").length,t=0,l=0,r=0;function o(){s.style.transform=`translateX(${-t*100}%)`}function i(){t=(t+1)%c,o()}function u(){t=(t-1+c)%c,o()}e.querySelector(".next").addEventListener("click",i),e.querySelector(".prev").addEventListener("click",u),e.addEventListener("touchstart",n=>{l=n.touches[0].clientX}),e.addEventListener("touchend",n=>{r=n.changedTouches[0].clientX,d()});function d(){l-r>50?i():r-l>50&&u()}});$(document).ready(function(){Reference=$(".carrousel li:first-child"),NbElement=$(".carrousel li").length,$(".carrousel").wrap('<div class="carrousel-conteneur"></div>').css("width",Reference.width()*NbElement),$(".carrousel-conteneur").width(Reference.width()).height(Reference.height()).css("overflow","hidden"),NbElement>1&&$(".carrousel-conteneur").after('<div class="carrousel-pagination"><button type="button" class="carrousel-prev">Précédent</button><button type="button" class="carrousel-next">Suivant</button></div>')});$(document).ready(function(){Cpt=0,$(" button.carrousel-next").click(function(){Cpt<NbElement-1&&(Cpt++,$(".carrousel").animate({marginLeft:-(Reference.width()*Cpt)}))}),$(" button.carrousel-prev").click(function(){Cpt>0&&(Cpt--,$(".carrousel").animate({marginLeft:-(Reference.width()*Cpt)}))})});$(function(){$("#btn_up").click(function(){$("html,body").animate({scrollTop:0},"slow")}),$(window).scroll(function(){$(window).scrollTop()<300?$("#btn_up").fadeOut():$("#btn_up").fadeIn()})});$(document).ready(function(){$(".code-trigger").click(function(){$(this).next().slideToggle()})});
