index.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var Home = document.querySelector('.hero .slide');
  2. var flkty = new Flickity( Home, {
  3. // options
  4. cellAlign: 'left',
  5. autoPlay: true,
  6. prevNextButtons: false
  7. });
  8. var prive = document.querySelector('.prive .__slide');
  9. var flkty = new Flickity( prive, {
  10. // options
  11. cellAlign: 'left',
  12. autoPlay: true,
  13. })
  14. var slide_tpsF = document.querySelectorAll('.tpsF .slide');
  15. for (var i = 0; i < slide_tpsF.length; i++) {
  16. var flkty = new Flickity( slide_tpsF[i], {
  17. // options
  18. cellAlign: 'left',
  19. autoPlay: true,
  20. pageDots: false
  21. });
  22. }
  23. var Partenaires = document.querySelector('.container_slide .row');
  24. var flkty = new Flickity( Partenaires, {
  25. // options
  26. groupCells: true,
  27. pageDots: false
  28. });
  29. var msnry = new Masonry( '.tableau_engagements.row', {
  30. columnWidth: '.engagement',
  31. itemSelector: '.engagement',
  32. percentPosition: true
  33. });
  34. var hamburgers = document.querySelector(".hamburger");
  35. var nav = document.querySelector(".nav-main");
  36. hamburgers.addEventListener("click", function() {
  37. this.classList.toggle("is-active");
  38. nav.classList.toggle("is-active");
  39. });
  40. var elem = document.querySelector('.grid');
  41. var iso = new Isotope( elem, {
  42. itemSelector: '.item',
  43. layoutMode: 'fitRows'
  44. });
  45. var filtersElem = document.querySelector('.filter-button-group');
  46. filtersElem.addEventListener( 'click', function( event ) {
  47. var filterValue = event.target.getAttribute('data-filter');
  48. iso.arrange({ filter: filterValue });
  49. });