site.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. .bindPopup("<b>Hello world!</b><br />I am le campus.").openPopup();
  17. function onMapClick(e) {
  18. popup
  19. .setLatLng(e.latlng)
  20. .setContent("You clicked the map at " + e.latlng.toString())
  21. .openOn(mymap);
  22. }
  23. mymap.on('click', onMapClick);
  24. }
  25. }
  26. function filteritem() {
  27. var $card = $('.body-wrapper > .card');
  28. var $cat = $('.cat a');
  29. var $img = $('.body-wrapper .img');
  30. $(".filters .btn").click(function(e) {
  31. e.preventDefault();
  32. var filter = $(this).attr("data-filter");
  33. var self = $('.body-wrapper');
  34. self.masonryFilter({
  35. filter: function () {
  36. if (!filter) return true;
  37. return $(this).attr("data-filter") == filter;
  38. }
  39. });
  40. });
  41. var $grid = $('#archive .body-wrapper, #calendrier .body-wrapper').masonry({
  42. // columnWidth: 200,
  43. itemSelector: '.card',
  44. gutter: 10,
  45. transitionDuration: '0.2s'
  46. });
  47. // $( "a[hreflang|='en']" ).css( "border", "3px dotted green" );
  48. $grid.imagesLoaded().progress(function() {
  49. $grid.masonry();
  50. });
  51. }
  52. function slide() {
  53. $('.gal').bxSlider({
  54. infiniteLoop: true,
  55. preloadImages:'visible',
  56. pager:false,
  57. auto:true,
  58. });
  59. }
  60. function links() {
  61. var $a = $('li a[href="/organisez-vos-evenements"],li a[href="/qui-sommes-nous"] ');
  62. var $map = $('a#carte');
  63. $a.on('click', function(e) {
  64. e.preventDefault();
  65. })
  66. $map.on('click', function(e) {
  67. e.preventDefault();
  68. })
  69. }
  70. function clickbutton() {
  71. var $button = $('#ajax-test-form .radio');
  72. $button.on('click', function(){
  73. $(this).parent('.form-data').find('.check').removeClass('check');
  74. $(this).addClass('check');
  75. });
  76. }
  77. function clicksenddevis() {
  78. var $ok = $('.ok');
  79. var $send = $('#send-valide');
  80. $ok.on('click', function () {
  81. $(this).parent('#send-valide').remove();
  82. })
  83. }
  84. function addclass() {
  85. var $map = $('a#carte');
  86. $map.parents('.content_s').addClass('map')
  87. var $reco_click = $('#reco .title');
  88. var $reco_txt = $('#reco .txt');
  89. $reco_click.on('click', function() {
  90. $reco_txt.toggleClass('open');
  91. $(this).toggleClass('open');
  92. })
  93. }
  94. jQuery(document).ready(function(){
  95. addclass();
  96. clickbutton();
  97. links();
  98. slide();
  99. filteritem();
  100. map();
  101. });