diff --git a/_includes/element-partial.html b/_includes/element-partial.html index 2d1d733..561a302 100644 --- a/_includes/element-partial.html +++ b/_includes/element-partial.html @@ -1,5 +1,7 @@ - -
+ {% capture a %}{{ element.number | modulus:7 | modulus:2 }}{% endcapture %} + {% capture b %}{{ element.number | modulus:3 }}{% endcapture %} + {% capture classnames %}{% for cat in element.categories %}{{ cat }} {% endfor %} {% if page.infinite_scroll %} width2 height2 {% else %} {% if a == '1' %} width2 {% endif %} {% if b == '0' %} height2 {% endif %} {% endif %} {% endcapture %} +

{{ element.number }}

{{ element.symbol }}

{{ element.name }}

diff --git a/_layouts/elements.html b/_layouts/elements.html index c009a63..69aba03 100644 --- a/_layouts/elements.html +++ b/_layouts/elements.html @@ -95,17 +95,6 @@ $(function(){ - // hacky way of adding random size classes - $container.find('.element').each(function(){ - if ( Math.random() > 0.6 ) { - $(this).addClass('width2'); - } - if ( Math.random() > 0.6 ) { - $(this).addClass('height2'); - } - }); - - $container.isotope({ itemSelector : '.element', // layoutMode : 'fitRows', diff --git a/_plugins/modulus.rb b/_plugins/modulus.rb new file mode 100644 index 0000000..0b98c97 --- /dev/null +++ b/_plugins/modulus.rb @@ -0,0 +1,7 @@ +module MathFilter + def modulus(input, operand) + to_number(input) % to_number(operand) + end +end + +Liquid::Template.register_filter(MathFilter) \ No newline at end of file diff --git a/_posts/demos/2010-12-29-layout-modes.html b/_posts/demos/2010-12-29-layout-modes.html index 4cf40b1..e6580f3 100644 --- a/_posts/demos/2010-12-29-layout-modes.html +++ b/_posts/demos/2010-12-29-layout-modes.html @@ -34,16 +34,6 @@ related: layouts $(function(){ - // hacky way of adding random size classes - $container.find('.element').each(function(){ - if ( Math.random() > 0.6 ) { - $(this).addClass('width2'); - } - if ( Math.random() > 0.6 ) { - $(this).addClass('height2'); - } - }); - $container.isotope({ itemSelector : '.element', masonry : { diff --git a/_posts/demos/2010-12-31-relayout.html b/_posts/demos/2010-12-31-relayout.html index 833c120..b903eac 100644 --- a/_posts/demos/2010-12-31-relayout.html +++ b/_posts/demos/2010-12-31-relayout.html @@ -45,16 +45,6 @@ related: methods $(function(){ - // hacky way of adding random size classes - $container.find('.element').each(function(){ - if ( Math.random() > 0.6 ) { - $(this).addClass('width2'); - } - if ( Math.random() > 0.6 ) { - $(this).addClass('height2'); - } - }); - $container.isotope({ itemSelector: '.element', masonry : { diff --git a/_posts/tests/2011-04-26-item-position-data01.html b/_posts/tests/2011-04-26-item-position-data01.html index 5c89636..d9a6a3a 100644 --- a/_posts/tests/2011-04-26-item-position-data01.html +++ b/_posts/tests/2011-04-26-item-position-data01.html @@ -52,16 +52,6 @@ category: tests var $container = $('#container'); - // hacky way of adding random size classes - $container.find('.element').each(function(){ - if ( Math.random() > 0.6 ) { - $(this).addClass('width2'); - } - if ( Math.random() > 0.6 ) { - $(this).addClass('height2'); - } - }); - {% include sort-buttons.js %} // change size of clicked element diff --git a/_posts/tests/2011-05-13-jquery-animation01.html b/_posts/tests/2011-05-13-jquery-animation01.html index cab3fcd..4fb2a66 100644 --- a/_posts/tests/2011-05-13-jquery-animation01.html +++ b/_posts/tests/2011-05-13-jquery-animation01.html @@ -61,16 +61,6 @@ category: tests var $container = $('#container'); - // hacky way of adding random size classes - $container.find('.element').each(function(){ - if ( Math.random() > 0.6 ) { - $(this).addClass('width2'); - } - if ( Math.random() > 0.6 ) { - $(this).addClass('height2'); - } - }); - {% include sort-buttons.js %} $('#filters').find('a').click(function(){ diff --git a/_posts/tests/2011-05-18-centered-masonry.html b/_posts/tests/2011-05-18-centered-masonry.html index ea3054a..931a184 100644 --- a/_posts/tests/2011-05-18-centered-masonry.html +++ b/_posts/tests/2011-05-18-centered-masonry.html @@ -162,17 +162,6 @@ category: tests $(function(){ - // hacky way of adding random size classes - $container.find('.element').each(function(){ - if ( Math.random() > 0.6 ) { - $(this).addClass('width2'); - } - if ( Math.random() > 0.6 ) { - $(this).addClass('height2'); - } - }); - - $container.isotope({ itemSelector : '.element', masonry : {