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">
  
  <div class="row">
    <div class="col-xs-12 controls">
      <label>Filter:</label>
      <!-- FILTERS -->
      <button class="filter btn btn-default" data-filter="all">All</button>
      <button class="filter btn btn-default" data-filter=".category-1">People</button>
      <button class="filter btn btn-default" data-filter=".category-2">Nature</button>
      <button class="filter btn btn-default" data-filter=".category-3">animals</button>

      <label class="pad-left">Sort:</label>
      <!-- SORT CONTROLS -->
      <button class="sort btn btn-default" data-sort="myorder:asc">Ascending Order</button>
      <button class="sort btn btn-default" data-sort="myorder:desc">Descending Order</button>
    </div>
  </div>
  
  <div class="row">
    <div id="Container" class="col-xs-12 project-cards-container">
      <div class="mix category-1" data-myorder="1">
        <img data-src="http://lorempixel.com/400/240/people/1/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="2">
        <img data-src="http://lorempixel.com/400/240/people/2/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="3">
        <img data-src="http://lorempixel.com/400/240/nature/1/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="4">
        <img data-src="http://lorempixel.com/400/240/nature/2/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="5">
        <img data-src="http://lorempixel.com/400/240/people/3/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="6">
        <img data-src="http://lorempixel.com/400/240/people/4/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="7">
        <img data-src="http://lorempixel.com/400/240/nature/3/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="8">
        <img data-src="http://lorempixel.com/400/240/nature/4/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="9">
        <img data-src="http://lorempixel.com/400/240/people/5/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="10">
        <img data-src="http://lorempixel.com/400/240/people/6/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="11">
        <img data-src="http://lorempixel.com/400/240/nature/5/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="12">
        <img data-src="http://lorempixel.com/400/240/nature/6/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="13">
        <img data-src="http://lorempixel.com/400/240/people/7/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="14">
        <img data-src="http://lorempixel.com/400/240/people/8/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="15">
        <img data-src="http://lorempixel.com/400/240/nature/7/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="16">
        <img data-src="http://lorempixel.com/400/240/nature/8/" class="lazyload" />
      </div>
      <div class="mix category-2" data-myorder="17">
        <img data-src="http://lorempixel.com/400/240/nature/9/" class="lazyload" />
      </div>
      <div class="mix category-1" data-myorder="18">
        <img data-src="http://lorempixel.com/400/240/people/9/" class="lazyload" />
      </div>
      <div class="mix category-3" data-myorder="19">
        <img data-src="http://lorempixel.com/400/240/animals/1/" class="lazyload" />
      </div>
      <div class="mix category-3" data-myorder="20">
        <img data-src="http://lorempixel.com/400/240/animals/2/" class="lazyload" />
      </div>
      <div class="mix category-3" data-myorder="21">
        <img data-src="http://lorempixel.com/400/240/animals/3/" class="lazyload" />
      </div>
      
      <div class="mix category-3" data-myorder="22">
        <img data-src="http://lorempixel.com/400/240/animals/4/" class="lazyload" />
      </div>
      <div class="mix category-3" data-myorder="23">
        <img data-src="http://lorempixel.com/400/240/animals/5/" class="lazyload" />
      </div>
      <div class="mix category-3" data-myorder="24">
        <img data-src="http://lorempixel.com/400/240/animals/6/" class="lazyload" />
      </div>
      <div class="mix category-3" data-myorder="25">
        <img data-src="http://lorempixel.com/400/240/animals/7/" class="lazyload" />
      </div>
      <div class="mix category-3" data-myorder="26">
        <img data-src="http://lorempixel.com/400/240/animals/8/" class="lazyload" />
      </div>
      
      <div class="mix category-3" data-myorder="27">
        <img data-src="http://lorempixel.com/400/240/animals/9/" class="lazyload" />
      </div>
      <div class="gap"></div>
      <div class="gap"></div>
    </div>
  </div>
  
</div>
<!-- WIP based on https://codepen.io/patrickkunka/pen/gvHdi -->


              
            
!

CSS

              
                @import "lesshat";

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

body, button{
  font-family: 'Helvetica Neue', arial, sans-serif;
}

.controls{
  padding: 2%;
  background: #333;
  color: #eee;
}

label{
  font-weight: 300;
  margin: 0 .4em 0 0;
}

.pad-left {
  padding-left: 0.6em;
}

.btn {
  color: #000;
}

.lazyload {
  opacity: 0;
}

.lazyloading {
  opacity: 1;
  transition: 600ms opacity;
  background: #f7f7f7 url(https://afarkas.github.io/lazysizes/assets/imgs/loader.gif) no-repeat center;
  min-height: 60px;
}
/*
.lazyloaded {
  opacity: 1;
  transition: 10ms opacity;
}
*/

#Container .mix{
    display: none;
}

.project-cards-container {
  padding: 2% 2% 0;
  text-align: justify;
  font-size: 0.1px;
  background: #68b8c4;
  
  -webkit-backface-visibility: hidden;
  
  &:after {
    content: '';
    display: inline-block;
    width: 100%;
  }
    
  .mix,.gap {
    display: inline-block;
    width: 49%;
  }

  .mix {
    position: relative;
    text-align: left;
    background: #03899c;
    margin-bottom: 2%;
    display: none;
    
    .category-1 {
      border-top: 2px solid limegreen;
    }
    
    .category-2 {
      border-top: 2px solid yellow;
    }
    
    &:after {
      position: relative;
      z-index: 9;
      content: attr(data-myorder);
      color: white;
      font-size: 16px;
      display: inline-block;
      vertical-align: top;
      padding: 4% 6%;
      font-weight: 700;
    }

    &:before {
      content: '';
      display: inline-block;
      padding-top: 60%;
    }
    
    img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: block;
    }
  }
}


@media all and (min-width: 420px){
  .project-cards-container {
    .mix, .gap {
      width: 32%;
    }
  }
}

@media all and (min-width: 640px){
  .project-cards-container {
    .mix, .gap {
      width: 23.5%;
    }
  }
}

              
            
!

JS

              
                window.lazySizesConfig = window.lazySizesConfig || {};
//only for demo in production I would use normal expand option 
window.lazySizesConfig.expand = 9;
$(function(){
    $('#Container').mixItUp();  
});

// https://mixitup.kunkalabs.com/
              
            
!
999px

Console