index.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. function slides() {
  2. var Home = document.querySelector('.hero .slide');
  3. if (Home != null) {
  4. var flkty = new Flickity( Home, {
  5. cellAlign: 'left',
  6. autoPlay: true,
  7. prevNextButtons: false,
  8. fade: true,
  9. });
  10. }
  11. var prive = document.querySelector('.prive .__slide');
  12. if (prive != null) {
  13. var flkty = new Flickity( prive, {
  14. // options
  15. cellAlign: 'left',
  16. autoPlay: true,
  17. })
  18. }
  19. var slide_tpsF = document.querySelectorAll('.tpsF .slide');
  20. if (slide_tpsF != null) {
  21. for (var i = 0; i < slide_tpsF.length; i++) {
  22. var flkty = new Flickity( slide_tpsF[i], {
  23. // options
  24. cellAlign: 'left',
  25. autoPlay: true,
  26. pageDots: false
  27. });
  28. }
  29. }
  30. var Partenaires = document.querySelector('.container_slide ul');
  31. if (Partenaires != null) {
  32. var flkty = new Flickity( Partenaires, {
  33. cellAlign: 'left',
  34. pageDots: false
  35. // groupCells: true,
  36. // carousel-cell: true,
  37. });
  38. }
  39. }
  40. function masonry() {
  41. var arrayEnga = document.querySelector('.tableau_engagements.row');
  42. if (arrayEnga != null) {
  43. var msnry = new Masonry(arrayEnga , {
  44. //columnWidth: '.engagement',
  45. columnWidth: '.engagement',
  46. itemSelector: '.engagement',
  47. gutter: '.gutter-sizer',
  48. percentPosition: true
  49. });
  50. }
  51. }
  52. function burger() {
  53. var hamburgers = document.querySelector(".hamburger");
  54. var nav = document.querySelector(".nav-main");
  55. hamburgers.addEventListener("click", function() {
  56. this.classList.toggle("is-active");
  57. nav.classList.toggle("is-active");
  58. });
  59. }
  60. function paralax() {
  61. var rellax = new Rellax('.paralax', {
  62. center:true
  63. });
  64. }
  65. function isotope() {
  66. var $grid = $('.grid').isotope({
  67. percentPosition: true,
  68. masonry: {
  69. columnWidth: '.item'
  70. },
  71. itemSelector: '.item',
  72. stagger: 30
  73. });
  74. $('.filter-button-group li').on( 'click', function(evt) {
  75. var filterValue = $(this).attr('data-filter');
  76. $grid.isotope({ filter: filterValue });
  77. });
  78. }
  79. function drag(){
  80. $( '.group_drag' ).draggable({
  81. containment: "html",
  82. scroll: false
  83. });
  84. }
  85. function click_nav() {
  86. $('#nav-main > ul > li:first-child > a').click(function(e) {
  87. e.preventDefault();
  88. })
  89. }
  90. $( document ).ready(function() {
  91. slides();
  92. masonry();
  93. burger();
  94. paralax();
  95. isotope();
  96. drag();
  97. click_nav();
  98. });