Browse Source

docs : add `.width2 .height2` classes via Liquid; added modulus plugin;

pull/96/head
David DeSandro 14 years ago
parent
commit
f8df61619f
  1. 6
      _includes/element-partial.html
  2. 11
      _layouts/elements.html
  3. 7
      _plugins/modulus.rb
  4. 10
      _posts/demos/2010-12-29-layout-modes.html
  5. 10
      _posts/demos/2010-12-31-relayout.html
  6. 10
      _posts/tests/2011-04-26-item-position-data01.html
  7. 10
      _posts/tests/2011-05-13-jquery-animation01.html
  8. 11
      _posts/tests/2011-05-18-centered-masonry.html

6
_includes/element-partial.html

@ -1,5 +1,7 @@
{% capture a %}{{ element.number | modulus:7 | modulus:2 }}{% endcapture %}
<div class="element {% for cat in element.categories %}{{ cat }} {% endfor %} {% if page.infinite_scroll %} width2 height2 {% endif %}" data-symbol="{{ element.symbol }}" data-category="{{ element.categories[0] }}"> {% 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 %}
<div class="element {{ classnames }}" data-symbol="{{ element.symbol }}" data-category="{{ element.categories[0] }}">
<p class="number">{{ element.number }}</p> <p class="number">{{ element.number }}</p>
<h3 class="symbol">{{ element.symbol }}</h3> <h3 class="symbol">{{ element.symbol }}</h3>
<h2 class="name">{{ element.name }}</h2> <h2 class="name">{{ element.name }}</h2>

11
_layouts/elements.html

@ -95,17 +95,6 @@
$(function(){ $(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({ $container.isotope({
itemSelector : '.element', itemSelector : '.element',
// layoutMode : 'fitRows', // layoutMode : 'fitRows',

7
_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)

10
_posts/demos/2010-12-29-layout-modes.html

@ -34,16 +34,6 @@ related: layouts
$(function(){ $(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({ $container.isotope({
itemSelector : '.element', itemSelector : '.element',
masonry : { masonry : {

10
_posts/demos/2010-12-31-relayout.html

@ -45,16 +45,6 @@ related: methods
$(function(){ $(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({ $container.isotope({
itemSelector: '.element', itemSelector: '.element',
masonry : { masonry : {

10
_posts/tests/2011-04-26-item-position-data01.html

@ -52,16 +52,6 @@ category: tests
var $container = $('#container'); 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 %} {% include sort-buttons.js %}
// change size of clicked element // change size of clicked element

10
_posts/tests/2011-05-13-jquery-animation01.html

@ -61,16 +61,6 @@ category: tests
var $container = $('#container'); 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 %} {% include sort-buttons.js %}
$('#filters').find('a').click(function(){ $('#filters').find('a').click(function(){

11
_posts/tests/2011-05-18-centered-masonry.html

@ -162,17 +162,6 @@ category: tests
$(function(){ $(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({ $container.isotope({
itemSelector : '.element', itemSelector : '.element',
masonry : { masonry : {

Loading…
Cancel
Save