site.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. function map() {
  2. var $carte = $('#carte');
  3. if ( $carte.length ) {
  4. var mymap = L.map('carte').setView([44.7365818, 4.9776488], 13);
  5. var greenIcon = L.icon({
  6. iconUrl: '/user/themes/lecampus/images/mappoint.svg',
  7. iconSize: [38, 95], // size of the icon
  8. iconAnchor: [22, 94], // point of the icon which will correspond to marker's location
  9. popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
  10. });
  11. L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
  12. maxZoom: 18,
  13. id: 'mapbox.streets'
  14. }).addTo(mymap);
  15. L.marker([44.7365818, 4.9776488], {icon: greenIcon}).addTo(mymap);
  16. function onMapClick(e) {
  17. popup
  18. .setLatLng(e.latlng)
  19. .setContent("You clicked the map at " + e.latlng.toString())
  20. .openOn(mymap);
  21. }
  22. mymap.on('click', onMapClick);
  23. }
  24. }
  25. function filteritem() {
  26. var $card = $('.body-wrapper > .card');
  27. var $cat = $('.cat a');
  28. var $img = $('.body-wrapper .img');
  29. $(".filters .btn").click(function(e) {
  30. e.preventDefault();
  31. var filter = $(this).attr("data-filter");
  32. var self = $('.body-wrapper');
  33. self.masonryFilter({
  34. filter: function () {
  35. if (!filter) return true;
  36. return $(this).attr("data-filter") == filter;
  37. }
  38. });
  39. });
  40. var $grid = $('#archive .body-wrapper, #calendrier .body-wrapper').masonry({
  41. // columnWidth: 200,
  42. itemSelector: '.card',
  43. gutter: 10,
  44. transitionDuration: '0.2s'
  45. });
  46. // $( "a[hreflang|='en']" ).css( "border", "3px dotted green" );
  47. $grid.imagesLoaded().progress(function() {
  48. $grid.masonry();
  49. });
  50. }
  51. function slide() {
  52. $('.gal').bxSlider({
  53. responsive: true,
  54. infiniteLoop: true,
  55. preloadImages:'visible',
  56. pager:false,
  57. auto:true,
  58. });
  59. $('.gal-salles').bxSlider({
  60. responsive: true,
  61. pager:true,
  62. preloadImages:'visible',
  63. });
  64. }
  65. function links() {
  66. var $a = $('li a[href="/organisez-vos-evenements"],li a[href="/qui-sommes-nous"] ');
  67. var $map = $('a#carte');
  68. $a.on('click', function(e) {
  69. e.preventDefault();
  70. })
  71. $map.on('click', function(e) {
  72. e.preventDefault();
  73. })
  74. }
  75. function clickbutton() {
  76. var $button = $('#ajax-test-form .radio label');
  77. $button.on('click', function(){
  78. $(this).parents('.form-data').find('.check').removeClass('check');
  79. $(this).parent('.radio').addClass('check');
  80. });
  81. }
  82. function clicksenddevis() {
  83. var $ok = $('.ok');
  84. var $send = $('#send-valide');
  85. $ok.on('click', function () {
  86. $(this).parent('#send-valide').remove();
  87. })
  88. }
  89. function addclass() {
  90. var $map = $('a#carte');
  91. $map.parents('.content_s').addClass('map')
  92. var $reco_click = $('#reco .title');
  93. var $reco_txt = $('#reco .txt');
  94. $reco_click.on('click', function() {
  95. $reco_txt.toggleClass('open');
  96. $(this).toggleClass('open');
  97. })
  98. }
  99. function mapsalles() {
  100. var $salles = $('.fond svg path');
  101. var $content = $('.content .content_salle');
  102. arrayid = [];
  103. $salles.on('click', function() {
  104. var idsalle = this.id;
  105. arrayid.push(idsalle);
  106. $salles.css("fill", "white");
  107. $(this).css("fill", "#0093a3");
  108. $('.content .content_salle').css("display", "none");
  109. $('.content .content_salle#'+arrayid).css("display", "block");
  110. arrayid.length = 0;
  111. });
  112. };
  113. function burger() {
  114. $('.navTrigger').click(function(){
  115. $(this).toggleClass('active');
  116. $('.dropmenu').toggleClass('active');
  117. });
  118. }
  119. jQuery(document).ready(function(){
  120. addclass();
  121. clickbutton();
  122. links();
  123. slide();
  124. filteritem();
  125. map();
  126. mapsalles();
  127. burger();
  128. });