Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container-flex">

<div class="container">
  <div class="containerFiltre">
    
  <h2 class="TitleFilterActivity">Nos prochaines activités :</h2>
    
  <div class="FilterActivityContainer">  
    <ul class="FilterActivityList">
      <li class="FilterItem">Tout</li>
      <li class="FilterItem">Atelier</li>
      <li class="FilterItem">Formation</li>
      <li class="FilterItem">Conférence</li>
      <li class="FilterItem">Visite guidée</li>
    </ul>
 <form class="search search-container" action="//llamaswill.tumblr.com/search">
  <input 
         id="search-box" 
         type="text" 
         placeholder="Rechercher"
         class="search-box"    
         />
   
  <label for="search-box">
    <div><span class="glyphicon glyphicon-search search-icon"></span></div>
   </label>
  <input type="submit" id="search-submit" />
</form>
    </div>
  </div>
	
  <div id="ItemActivityContainer">
    <span class="list-count"></span>
		<ul id="ItemActivityList">
      <span class="list-count"></span>
      <li class="ItemActivity ShowActivity">
        <div class="test">
        <span class="ref activity">Atelier</span>
          <span class="ref date">1 janvier 2020</span>
          <h3>Créa-photo</h3>
        <div class="ContentActivity">
        <img src="https://www.guillenphoto.com/data/blog/presentation-rubrique/images/le-blog-photo-amar-guillen-photographe.jpg">
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi varius justo sed sollicitudin consequat. Praesent nec est et mauris facilisis sollicitudin. Cras id mauris ut velit venenatis tincidunt.</p>
        </div>
          </div>
        <div>
        <a href="#" class="ReadMore">en savoir plus</a><div>
      </li>
      
      <li class="ItemActivity ShowActivity">
        <div class="test">
        <span class="ref activity">Conférence</span>
          <span class="ref date">2 janvier 2020</span>
          <h3>Table ronde</h3>
        <div class="ContentActivity">
        <img src="https://www.guillenphoto.com/data/blog/presentation-rubrique/images/le-blog-photo-amar-guillen-photographe.jpg">
          <p>lorem</p>
        </div>
          </div>
        <div>
        <a href="#" class="ReadMore">en savoir plus</a><div>
      </li>
          
          <li class="ItemActivity ShowActivity">
        <div class="test">
        <span class="ref activity">Formation</span>
          <span class="ref date">3 janvier 2020</span>
          <h3>Reflex</h3>
        <div class="ContentActivity">
        <img src="https://www.guillenphoto.com/data/blog/presentation-rubrique/images/le-blog-photo-amar-guillen-photographe.jpg">
          <p>lorem</p>
        </div>
          </div>
        <div>
        <a href="#" class="ReadMore">en savoir plus</a><div>
      </li>
          
          <li class="ItemActivity ShowActivity">
        <div class="test">
        <span class="ref activity">Visite guidée</span>
          <span class="ref date">4 janvier 2020</span>
          <h3>Visite guidée des exposition temporaire</h3>
        <div class="ContentActivity">
        <img src="https://www.guillenphoto.com/data/blog/presentation-rubrique/images/le-blog-photo-amar-guillen-photographe.jpg">
          <p>lorem</p>
        </div>
          </div>
        <div>
        <a href="#" class="ReadMore">en savoir plus</a><div>
      </li>
          
          <li class="ItemActivity ShowActivity">
        <div class="test">
        <span class="ref activity">Visite guidée</span>
          <span class="ref date">5 janvier 2020</span>
          <h3>Visite guidée inoubliable</h3>
        <div class="ContentActivity">
        <img src="https://www.guillenphoto.com/data/blog/presentation-rubrique/images/le-blog-photo-amar-guillen-photographe.jpg">
          <p>lorem</p>
        </div>
          </div>
        <div>
        <a href="#" class="ReadMore">en savoir plus</a><div>
      </li>
          
          <li class="ItemActivity ShowActivity">
        <div class="test">
        <span class="ref activity">Formation</span>
          <span class="ref date">6 janvier 2020</span>
          <h3>Reflex</h3>
        <div class="ContentActivity">
        <img src="https://www.guillenphoto.com/data/blog/presentation-rubrique/images/le-blog-photo-amar-guillen-photographe.jpg">
          <p>lorem</p>
        </div>
          </div>
        <div>
        <a href="#" class="ReadMore">en savoir plus</a><div>
      </li>
      <span class="ResultActivity">Nous n'avons rien trouvé</span>
    </ul>
    
</div>

</div>
  <div id="calendar">
    <div id="calendar_header">
      <i class="icon-chevron-left"></i>          
      <h1></h1>
      <i class="icon-chevron-right"></i>         
    </div>
    <div id="calendar_weekdays"></div>
    <div id="calendar_content"></div>
  </div>
</div>
              
            
!

CSS

              
                body{ font-size: 16px; font-family: helvetica; }

h3, h2{ margin: 0; }
.container-flex{ 
  display: flex; 

.container{
  padding: 2em;
  box-sizing: boder-box;
  width: 56%;
}
.containerFiltre{ 
  font-size: 16px;
  display: flex;
  align-items: flex-end; 
  margin-bottom: 50px;
  width: 100%; 
  .TitleFilterActivity{ 
    max-width: 181px; 
  }
 
  .FilterActivityContainer{ 
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    box-sizing: border-box;
    .FilterActivityList{ 
      margin: 0 20px 0 20px;
      padding: 0;
      width: 100%;
      display: flex;
      visibility: visible;
      opacity: 1;
      transition: .4s;
      box-sizing: border-box;
      padding: 0;
    justify-content: space-between; align-items: center;
      
    .FilterItem{ 
      list-style-type: none;
      cursor: pointer;
      margin: 0; opacity: .5; transition: .3s;
      &:hover{ opacity: 1; transition: .3s; }
      &.FilterItem-Actif{ opacity: 1; }
      }
    &.DisableFiltre{ 
      visibility: hidden;
      opacity: 0;
      transition: .4s;
        }
      }
    }
  }

[data-filter-item] {
	padding: 15px;
	background-color: #ccc;
	border: 1px solid #fff;
}

.search-container{ 
  margin: 0; 
  width: 40px;
  height: 40px;
label > div{
    position: relative; 
    cursor: pointer;
    .glyphicon{ 
        font-size: 16px;
        position: absolute; 
        top: 5px; left: 15px;
        z-index: 9; color: black; 
        }
  }
.search-box {
  position: absolute; 
  right: 0;
  font-size: inherit;
  transition: all .17s cubic-bezier(0.4, 0.8, .5, .5);
  width: inherit; 
  height: inherit;
  border-radius: 50px; 
  border: none;
  cursor: pointer;
  background: #e7e7e7;
  border: 1px solid #e7e7e7;
  display: block!important;
  &:focus {
    border: 1px solid #171717;
    transition: .3s;
    box-sizing: border-box;
    padding: 0 40px 0 20px;
    outline: none;
    width: 100%;
  }
  
  &:hover{
    border: 1px solid #171717;
    transition: .6s;
  }
  
  &:not(:focus){text-indent:-5000px;} }
#search-submit {position: relative; left: -5000px;}
  
}
  
  #calendar{
  position: fixed;
  right: 0; top: 0;
  margin-left: auto;
  margin-right: auto;
  width: 320px;
  font-family: 'Lato', sans-serif;
}
#calendar_weekdays div{
  display:inline-block;
  vertical-align:top;
}
#calendar_content, #calendar_weekdays, #calendar_header{
  position: relative;
  width: 320px;
  overflow: hidden;
  float: left;
  z-index: 10;
}
#calendar_weekdays div, #calendar_content div{
  width:20px;
  height: 20px;
  overflow: hidden;
  text-align: center;
  background-color: #FFFFFF;
  color: #787878;
}
  #calendar_weekdays div{ 
    color: #787878 !important; }
#calendar_content{
}
#calendar_content div{
  float: left;
}
  #calendar_content div{
    cursor: pointer;
    &:hover{
      background-color: blue;
      color: #fff; }
    &.DateActive{ 
      background-color: blue;
      color: #fff;
    }
    &.ActiveAvailable{ 
      background-color: red;
      color: green;
    }
}
#calendar_content div.blank{
  background-color: #E8E8E8;
}

#calendar_content div.today{
  color: #fff;
  background-color: #171717 !important;
 
  
}
#calendar_header{
  width: 100%;
  height: 20px;
  text-align: center;
  background-color: #fff !important;
  //padding: 2px 0;
}
  
#calendar_header h1{
  font-size: 1em;
  color: #171717;
  float:left;
  width:70%;
}
i[class^=icon-chevron]{
  color: inherit;
  float: left;
  width:15%;
  border-radius: 50%;
  }
}


#ItemActivityContainer{ 
  width: 100%;
  position: relative; 
  #ItemActivityList{ 
    margin: 0; padding: 0;
    .ItemActivity{
      justify-content: space-between;
      border-top: 2px solid #e7e7e7; 
      box-sizing: border-box;
      border-radius: 4px;
      padding: 40px 0 40px 0; 
      list-style-type: none;
      //position: relative;
      margin: 0 0 20px 0;
      //display: flex;
      //justify-content: space-between;
    &.ShowActivity{ display: flex; }
    &.hidden { display: none; }
      //div{
      div{
        &:nth-child(1){ margin: 0 10px 0 0; }
        &:nth-child(2){ width: 131px; }
      }
    .ref{ 
      font-size: 14px;
      font-weight: bold;
      box-sizing: border-box;
      padding: .5em 1em .5em 1em; 
      border-radius: 50px;
      &:nth-child(1){
        display: none;
      }
      &:nth-child(2){
        background-color: #171717; 
        color: #fff;
      }
    }
      
   }
    h3{ display: inline;
      margin: 0 0 0 10px; }
    }
  .ContentActivity{
    display: flex;
    margin: 40px 0 0 0;
  img{ width: auto; max-height: 150px; }
    p{ margin: 0 0 0 20px; }
  }
  //}
  //div{ 
    .ReadMore{ 
      //position: absolute; 
      top: 40px; right: 0; 
      text-decoration: none;
      padding: 1em; background: #e7e7e7; color: inherit; 
      &:hover{ background: #191919; color: #e7e7e7; transition: .3s; }
    
    //}
  }
}
.ResultActivity{
  display: none; 
  opacity: .5;
  font-weight: bold;
  &.showResult{
    display: block;
  }
}
              
            
!

JS

              
                // Calendar 
$(function(){function c(){p();var e=h();var r=0;var u=false;l.empty();while(!u){if(s[r]==e[0].weekday){u=true}else{l.append('<div class="blank"></div>');r++}}for(var c=0;c<42-r;c++){if(c>=e.length){l.append('<div class="blank"></div>')}else{var v=e[c].day;var m=g(new Date(t,n-1,v))?'<div class="today">':"<div>";l.append(m+""+v+"</div>")}}var y=o[n-1];a.css("background-color",y).find("h1").text(i[n-1]+" "+t);f.find("div").css("color",y);l.find(".today").css("background-color",y);d()}function h(){var e=[];for(var r=1;r<v(t,n)+1;r++){e.push({day:r,weekday:s[m(t,n,r)]})}return e}function p(){f.empty();for(var e=0;e<7;e++){f.append("<div>"+s[e].substring(0,3)+"</div>")}}function d(){var t;var n=$("#calendar").css("width",e+"px");n.find(t="#calendar_weekdays, #calendar_content").css("width",e+"px").find("div").css({width:e/7+"px",height:e/8+"px","line-height":e/9+"px"});n.find("#calendar_header").css({height:e*(1/10)+"px"}).find('i[class^="icon-chevron"]').css("line-height",e*(1/10)+"px")}function v(e,t){return(new Date(e,t,0)).getDate()}function m(e,t,n){return(new Date(e,t-1,n)).getDay()}function g(e){return y(new Date)==y(e)}function y(e){return e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate()}function b(){var e=new Date;t=e.getFullYear();n=e.getMonth()+1}var e=480;var t=2013;var n=9;var r=[];var i=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"];var s=["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"];var o=["#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7","#e7e7e7"];var u=$("#calendar");var a=u.find("#calendar_header");var f=u.find("#calendar_weekdays");var l=u.find("#calendar_content");b();c();a.find('i[class^="icon-chevron"]').on("click",function(){var e=$(this);var r=function(e){n=e=="next"?n+1:n-1;if(n<1){n=12;t--}else if(n>12){n=1;t++}c()};if(e.attr("class").indexOf("left")!=-1){r("previous")}else{r("next")}})})


/* --------------------------------------- */

 var jobCount = $('#ItemActivityList li').length; 
    $('.list-count').text(' Trouvé '+jobCount);

$("#search-box").keyup(function () {
    $(this).addClass('hidden');

    var searchTerm = $("#search-box").val();
    //var listItem = $('#list').children('.item-activity'); 
    var searchSplit = searchTerm.replace(/ /g, "'):containsi('")
      //extends :contains to be case insensitive
  $.extend($.expr[':'], {
  'containsi': function(elem, i, match, array)
  {
    return (elem.textContent || elem.innerText || '').toLowerCase()
    .indexOf((match[3] || "").toLowerCase()) >= 0;
  }
});
    
    $("#ItemActivityList .ItemActivity .test h3").not(":containsi('" + searchSplit + "')").each(function(e)   {
      $(this).parent(".test").parent(".ItemActivity").removeClass('ShowActivity').addClass('hidden'); 
    });
    
    $("#ItemActivityList .ItemActivity .test h3:containsi('" + searchSplit + "')").each(function(e) {
      $(this).parent(".test").parent(".ItemActivity").removeClass('hidden').addClass('ShowActivity');
    });
    
    var jobCount = $('#ItemActivityList li').length; 
    $('.list-count').text(' Trouvé '+jobCount);
  
    if(jobCount == '0') {
      $('.ResultActivity').addClass('showResult');
    }
    else {
      $('.ResultActivity').removeClass('showResult');
    }
  });
 
/*------------------------------*/
// Remplacer texte au focus
var itemText = $(".TitleFilterActivity").text();
var changeText = "Vous recherchez";
$( ".search-box" ).focus(function() {
 $(".TitleFilterActivity").text(changeText);
 $('.FilterActivityContainer > FilterActivityList').addClass("DisableFiltre");
});
$( ".search-box" ).focusout(function() {
  $(".TitleFilterActivity").text(itemText);
  $('.FilterActivity > ul').removeClass("DisableFiltre");
});

/*------------------------------*/
//Filtrer par text / text d'activité === texte lien filtre
$(function() {
		var TextLink = "";
		$(".FilterItem").click(function(){
      $(".FilterItem").removeClass("FilterItem-Actif");
      $("#calendar_content > div").removeClass("DateActive");
      $(".ResultActivity").removeClass("showResult");
      $(this).addClass("FilterItem-Actif");
			TextLink = $(this).text().toLowerCase().replace(/é|è|ê/g,"e");  
   $("#ItemActivityList .ItemActivity").each(function() {
    if (TextLink == "tout" ) {
      $("#ItemActivityList .ItemActivity").removeClass('hidden');
    } else if ($(this).children(".test").children(".activity").text().toLowerCase().replace(/é|è|ê/g,"e") == TextLink) {
      $(this).removeClass('hidden');
    } else {
      $(this).addClass('hidden');
    }
  }), false;
		});
	});

/*------------------------------*/
// FILTRER PAR DATE - CALENDRIER
$(function() {
  $("#calendar").on("click", "#calendar_content > div", function(){
  //$("#calendar_content > div").click(function(){ 
    $(".FilterItem").removeClass("FilterItem-Actif");
    $("#calendar_content > div").removeClass("DateActive");
    $(".ResultActivity").addClass("showResult");
    $(this).addClass("DateActive");
    var day = $(this).text().toLowerCase().replace(/é|è|ê/g,"e");  
    var month = $("#calendar_header > h1").text().toLowerCase().replace(/é|è|ê/g,"e");
    var BaseDate = day + ' ' + month ;
    var dateActivity = $(".date").text().toLowerCase().replace(/é|è|ê/g,"e");
    
       $(".date").each(function() {
        if (BaseDate == $(this).text().toLowerCase().replace(/é|è|ê/g,"e")) 
        {
        $(this).parent(".test").parent("li").removeClass('hidden');
        $(".ResultActivity").removeClass("showResult");  
         } 
         else
         {
         $(this).parent(".test").parent("li").addClass('hidden');
         }
      }), false;
    
		});
	});
/*-------------------------------------------------*/


              
            
!
999px

Console