From ebbe4a3ec2d75386e94a9b4bd424f0c2bfaee015 Mon Sep 17 00:00:00 2001 From: briankelleher Date: Tue, 22 Mar 2016 15:11:36 -0400 Subject: [PATCH] fix templates, javascript dependencies for work page, need to concat styles --- www/wp-content/themes/ation2016/functions.php | 5 +++- www/wp-content/themes/ation2016/gulpfile.js | 1 - .../themes/ation2016/src/scripts/main.js | 24 +++++++++++++++++++ .../themes/ation2016/static/scripts/main.js | 24 +++++++++++++++++++ .../ation2016/static/scripts/main.min.js | 4 ++-- 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/www/wp-content/themes/ation2016/functions.php b/www/wp-content/themes/ation2016/functions.php index df02ef3..afe4aa1 100755 --- a/www/wp-content/themes/ation2016/functions.php +++ b/www/wp-content/themes/ation2016/functions.php @@ -61,7 +61,10 @@ function add_to_twig( $twig ) { function loadScripts() { wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/static/vendor/bootstrap.min.css' ); wp_enqueue_style( 'main', get_template_directory_uri() . '/static/styles/site.min.css' ); - wp_enqueue_script( 'main', get_template_directory_uri() . '/static/scripts/main.min.js', array('jquery'), '1.0.0', true ); + wp_enqueue_script( 'imagesloaded', get_template_directory_uri() . '/static/scripts/imagesLoaded.min.js', array('jquery'), '1.0.0', true ); + wp_enqueue_script( 'isotope', get_template_directory_uri() . '/static/scripts/isotope.min.js', array('jquery', 'imagesloaded'), '1.0.0', true ); + wp_enqueue_script( 'cells-by-row', get_template_directory_uri() . '/static/scripts/cells-by-row.min.js', array('jquery', 'isotope'), '1.0.0', true ); + wp_enqueue_script( 'main', get_template_directory_uri() . '/static/scripts/main.min.js', array('jquery','isotope','cells-by-row', 'imagesloaded'), '1.0.0', true ); } } diff --git a/www/wp-content/themes/ation2016/gulpfile.js b/www/wp-content/themes/ation2016/gulpfile.js index 64d6ddb..b8d2600 100644 --- a/www/wp-content/themes/ation2016/gulpfile.js +++ b/www/wp-content/themes/ation2016/gulpfile.js @@ -44,7 +44,6 @@ gulp.task('scripts', function(){ }})) .pipe(jshint()) .pipe(jshint.reporter('default')) - .pipe(concat('main.js')) .pipe(gulp.dest('static/scripts/')) .pipe(rename({suffix: '.min'})) .pipe(uglify()) diff --git a/www/wp-content/themes/ation2016/src/scripts/main.js b/www/wp-content/themes/ation2016/src/scripts/main.js index f54becd..d15b4c7 100644 --- a/www/wp-content/themes/ation2016/src/scripts/main.js +++ b/www/wp-content/themes/ation2016/src/scripts/main.js @@ -9,4 +9,28 @@ jQuery( document ).ready( function( $ ) { } }); + // Block grid + var $blocks = $('.blocks'); + + // Initialize isotope options + $blocks.isotope({ percentPosition: true, itemSelector: '.block', columnWidth: '.block' }); + + // Redo layout once each image is loaded + $blocks.imagesLoaded().progress( function() { + $blocks.isotope('layout'); + }); + + // Filter grid items based on their work category, on the click of a filter + $('.work-bar a').click( function(e) { + e.preventDefault(); + var filter = $(this).data('filter'); + $blocks.isotope({ + filter: filter, + percentPosition: true, + itemSelector: '.block', + columnWidth: '.block', + }); + console.log('Filtered by', filter); + }); + }); \ No newline at end of file diff --git a/www/wp-content/themes/ation2016/static/scripts/main.js b/www/wp-content/themes/ation2016/static/scripts/main.js index f54becd..d15b4c7 100644 --- a/www/wp-content/themes/ation2016/static/scripts/main.js +++ b/www/wp-content/themes/ation2016/static/scripts/main.js @@ -9,4 +9,28 @@ jQuery( document ).ready( function( $ ) { } }); + // Block grid + var $blocks = $('.blocks'); + + // Initialize isotope options + $blocks.isotope({ percentPosition: true, itemSelector: '.block', columnWidth: '.block' }); + + // Redo layout once each image is loaded + $blocks.imagesLoaded().progress( function() { + $blocks.isotope('layout'); + }); + + // Filter grid items based on their work category, on the click of a filter + $('.work-bar a').click( function(e) { + e.preventDefault(); + var filter = $(this).data('filter'); + $blocks.isotope({ + filter: filter, + percentPosition: true, + itemSelector: '.block', + columnWidth: '.block', + }); + console.log('Filtered by', filter); + }); + }); \ No newline at end of file diff --git a/www/wp-content/themes/ation2016/static/scripts/main.min.js b/www/wp-content/themes/ation2016/static/scripts/main.min.js index ac4bfe4..b4d086d 100644 --- a/www/wp-content/themes/ation2016/static/scripts/main.min.js +++ b/www/wp-content/themes/ation2016/static/scripts/main.min.js @@ -1,2 +1,2 @@ -jQuery(document).ready(function(e){e(window).scroll(function(){e(this).scrollTop()>1?e("header").addClass("sticky"):e("header").removeClass("sticky")})}); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1haW4uanMiXSwibmFtZXMiOlsialF1ZXJ5IiwiZG9jdW1lbnQiLCJyZWFkeSIsIiQiLCJ3aW5kb3ciLCJzY3JvbGwiLCJ0aGlzIiwic2Nyb2xsVG9wIiwiYWRkQ2xhc3MiLCJyZW1vdmVDbGFzcyJdLCJtYXBwaW5ncyI6IkFBQUFBLE9BQUFDLFVBQUFDLE1BQUEsU0FBQUMsR0FHQUEsRUFBQUMsUUFBQUMsT0FBQSxXQUNBRixFQUFBRyxNQUFBQyxZQUFBLEVBQ0FKLEVBQUEsVUFBQUssU0FBQSxVQUVBTCxFQUFBLFVBQUFNLFlBQUEiLCJmaWxlIjoibWFpbi5taW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyJqUXVlcnkoIGRvY3VtZW50ICkucmVhZHkoIGZ1bmN0aW9uKCAkICkge1xuXG4gICAgLy8gQXBwbGllcyBzdGlja3kgY2xhc3MgdG8gaGVhZGVyIHdoZW4gc2Nyb2xsaW5nIHBhc3QgZmlyc3QgcGl4ZWxcbiAgICAkKHdpbmRvdykuc2Nyb2xsKCBmdW5jdGlvbigpIHtcbiAgICAgICAgaWYgKCAkKHRoaXMpLnNjcm9sbFRvcCgpID4gMSApIHtcbiAgICAgICAgICAgICQoJ2hlYWRlcicpLmFkZENsYXNzKFwic3RpY2t5XCIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgJCgnaGVhZGVyJykucmVtb3ZlQ2xhc3MoXCJzdGlja3lcIik7XG4gICAgICAgIH1cbiAgICB9KTtcblxufSk7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 +jQuery(document).ready(function(o){o(window).scroll(function(){o(this).scrollTop()>1?o("header").addClass("sticky"):o("header").removeClass("sticky")});var e=o(".blocks");e.isotope({percentPosition:!0,itemSelector:".block",columnWidth:".block"}),e.imagesLoaded().progress(function(){e.isotope("layout")}),o(".work-bar a").click(function(t){t.preventDefault();var i=o(this).data("filter");e.isotope({filter:i,percentPosition:!0,itemSelector:".block",columnWidth:".block"}),console.log("Filtered by",i)})}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1haW4ubWluLmpzIl0sIm5hbWVzIjpbImpRdWVyeSIsImRvY3VtZW50IiwicmVhZHkiLCIkIiwid2luZG93Iiwic2Nyb2xsIiwidGhpcyIsInNjcm9sbFRvcCIsImFkZENsYXNzIiwicmVtb3ZlQ2xhc3MiLCIkYmxvY2tzIiwiaXNvdG9wZSIsInBlcmNlbnRQb3NpdGlvbiIsIml0ZW1TZWxlY3RvciIsImNvbHVtbldpZHRoIiwiaW1hZ2VzTG9hZGVkIiwicHJvZ3Jlc3MiLCJjbGljayIsImUiLCJwcmV2ZW50RGVmYXVsdCIsImZpbHRlciIsImRhdGEiLCJjb25zb2xlIiwibG9nIl0sIm1hcHBpbmdzIjoiQUFBQUEsT0FBUUMsVUFBV0MsTUFBTyxTQUFVQyxHQUdoQ0EsRUFBRUMsUUFBUUMsT0FBUSxXQUNURixFQUFFRyxNQUFNQyxZQUFjLEVBQ3ZCSixFQUFFLFVBQVVLLFNBQVMsVUFFckJMLEVBQUUsVUFBVU0sWUFBWSxXQUtoQyxJQUFJQyxHQUFVUCxFQUFFLFVBR2hCTyxHQUFRQyxTQUFVQyxpQkFBaUIsRUFBTUMsYUFBYyxTQUFVQyxZQUFhLFdBRzlFSixFQUFRSyxlQUFlQyxTQUFVLFdBQzdCTixFQUFRQyxRQUFRLFlBSXBCUixFQUFFLGVBQWVjLE1BQU8sU0FBU0MsR0FDN0JBLEVB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