var $cards = $('#items .full-works');
var $card = $('#items .card');
var $cat = $('.cat-list .cat a');

function masonry() {
  var $grid = $cards.masonry({
    itemSelector: '.card',
    columnWidth: '.card',
    percentPosition: true,
    transitionDuration: '0.2s'
  });

  $grid.imagesLoaded().progress( function() {
    $grid.masonry();
  });
}

function isotype() {
  var $grid = $cards.isotope({
    itemSelector: '.card',
    layoutMode: 'fitRows'
  });

  $cat.on( 'click', function(e) {
    e.preventDefault();
    var filterValue = $( this ).attr('data-filter');
    filterValue = filterFns[ filterValue ] || filterValue;
    $grid.isotope({ filter: filterValue });
  });

}

function card(){
  var $item = $('.card')
  console.log($item);
}

function ajax() {
    var form = $('#ajax-test-form');
    form.submit(function(e) {
        // prevent form submission
        e.preventDefault();

        // submit the form via Ajax
        $.ajax({
            url: form.attr('action'),
            type: form.attr('method'),
            dataType: 'html',
            data: form.serialize(),
            success: function(result) {
                // Inject the result in the HTML
                $('#form-result').html(result);
            }
        });
    });
}

jQuery(document).ready(function($){
  masonry();
  // card();
  // ajax();
  // isotype();
});
