Browse Source

Merge branch 'master' into gh-pages

Conflicts:
	_includes/html-foot.html
	_includes/html-head.html
v1
David DeSandro 14 years ago
parent
commit
2b4206e01d
  1. 2
      _includes/add-buttons.js
  2. 73
      _includes/elements-demo-foot.html
  3. 22
      _includes/elements-demo-head.html
  4. 14
      _includes/filter-buttons.html
  5. 4
      _includes/footer.html
  6. 10
      _includes/html-foot.html
  7. 16
      _includes/html-head.html
  8. 21
      _includes/inf-scroll-page.html
  9. 20
      _includes/layout-change.js
  10. 23
      _includes/layout-options.html
  11. 31
      _includes/option-set-buttons.js
  12. 35
      _includes/sort-buttons.html
  13. 13
      _includes/sort-buttons.js
  14. 67
      _layouts/default.html
  15. 11
      _layouts/demo.html
  16. 36
      _layouts/doc.html
  17. 141
      _layouts/elements.html
  18. 17
      _layouts/index-page.html
  19. 31
      _layouts/inf-scroll-page.html
  20. 7
      _posts/demos/2010-01-01-index.yml
  21. 3
      _posts/demos/2010-12-12-basic.html
  22. 6
      _posts/demos/2010-12-13-elements-complete.html
  23. 7
      _posts/demos/2010-12-16-elements-partial.html
  24. 13
      _posts/demos/2010-12-29-layout-modes.html
  25. 28
      _posts/demos/2010-12-30-filtering.html
  26. 9
      _posts/demos/2010-12-30-sorting.html
  27. 7
      _posts/demos/2010-12-31-relayout.html
  28. 5
      _posts/demos/2011-01-02-adding-items.html
  29. 3
      _posts/demos/2011-01-02-infinite-scroll.html
  30. 3
      _posts/demos/2011-01-11-images.html
  31. 5
      _posts/demos/2011-03-29-combination-filters.html
  32. 61
      _posts/demos/2011-05-22-category-rows.html
  33. 190
      _posts/demos/2011-06-13-hash-history.html
  34. 5
      _posts/docs/2010-01-01-index.yml
  35. 16
      _posts/docs/2010-12-01-introduction.mdown
  36. 13
      _posts/docs/2010-12-03-options.mdown
  37. 3
      _posts/docs/2010-12-04-methods.mdown
  38. 3
      _posts/docs/2010-12-05-layout-modes.mdown
  39. 3
      _posts/docs/2010-12-06-filtering.mdown
  40. 3
      _posts/docs/2010-12-07-sorting.mdown
  41. 3
      _posts/docs/2010-12-09-animating.mdown
  42. 3
      _posts/docs/2010-12-10-adding-items.mdown
  43. 3
      _posts/docs/2011-05-25-extending-isotope.mdown
  44. 86
      _posts/docs/2011-06-16-hash-history-jquery-bbq.mdown
  45. 3
      _posts/docs/2011-12-11-help.mdown
  46. 5
      _posts/docs/2011-12-20-license.mdown
  47. 4
      _posts/pages/2011-01-01-2.html
  48. 4
      _posts/pages/2011-01-01-3.html
  49. 4
      _posts/pages/2011-01-01-4.html
  50. 4
      _posts/pages/2011-01-01-5.html
  51. 4
      _posts/pages/2011-01-01-6.html
  52. 14
      _posts/tests/2010-01-01-index.html
  53. 6
      _posts/tests/2010-01-01-index.yml
  54. 2
      _posts/tests/2011-03-27-destroy01.html
  55. 35
      _posts/tests/2011-03-27-flash01.html
  56. 2
      _posts/tests/2011-03-27-no-items01.html
  57. 6
      _posts/tests/2011-04-26-item-position-data01.html
  58. 66
      _posts/tests/2011-05-13-jquery-animation01.html
  59. 39
      _posts/tests/2011-05-18-centered-masonry.html
  60. 141
      _posts/tests/2011-05-24-elements-complete-test.html
  61. 27
      _posts/tests/2011-05-31-tiny-text.html
  62. 280
      css/style.css
  63. 192
      index.html
  64. 18
      js/jquery.ba-bbq.min.js

2
_includes/add-buttons.js

@ -1,3 +1,4 @@
$('#insert a').click(function(){
var $newEls = $( fakeElement.getGroup() );
$container.isotope( 'insert', $newEls );
@ -11,4 +12,3 @@
return false;
});

73
_includes/elements-demo-foot.html

@ -0,0 +1,73 @@
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
$(function(){
var $container = $('#container');
{% include random-sizes.js %}
$container.isotope({
itemSelector : '.element',
masonry : {
columnWidth : 120
},
masonryHorizontal : {
rowHeight: 120
},
cellsByRow : {
columnWidth : 240,
rowHeight : 240
},
cellsByColumn : {
columnWidth : 240,
rowHeight : 240
},
getSortData : {
symbol : function( $elem ) {
return $elem.attr('data-symbol');
},
category : function( $elem ) {
return $elem.attr('data-category');
},
number : function( $elem ) {
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();
}
}
});
{% include option-set-buttons.js %}
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include layout-change.js %}
{% include add-buttons.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
});
</script>

22
_includes/elements-demo-head.html

@ -0,0 +1,22 @@
<section id="copy">
<p>Isotope&rsquo;s capabilities are designed to be used together cohesively. You can do it all &mdash; filter, sort, change layout modes, add items &mdash; and Isotope will handle it with ease.</p>
</section>
<section id="options" class="clearfix">
{% include filter-buttons.html %}
{% include sort-buttons.html %}
{% include layout-options.html %}
<h3>Etc</h3>
<ul id="etc" class="clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
<li id="insert"><a href="#insert">Insert new elements</a></li>
<li id="append"><a href='#append'>Append new elements</a></li>
<!-- <li id="shuffle"><a href='#shuffle'>Shuffle</a></li> -->
</ul>
</section> <!-- #options -->

14
_includes/filter-buttons.html

@ -0,0 +1,14 @@
<h3>Filters</h3>
<ul id="filters" class="option-set clearfix" data-option-key="filter">
<li><a href="#filter" data-option-value="*" class="selected">show all</a></li>
<li><a href="#filter" data-option-value=".metal">metal</a></li>
<li><a href="#filter" data-option-value=".transition">transition</a></li>
<li><a href="#filter" data-option-value=".post-transition">post-transition</a></li>
<li><a href="#filter" data-option-value=".nonmetal">nonmetal</a></li>
<li><a href="#filter" data-option-value=".inner-transition">inner-transition</a></li>
<li><a href="#filter" data-option-value=".alkali, .alkaline-earth">alkali and alkaline-earth</a></li>
<li><a href="#filter" data-option-value=":not(.transition)">not transition</a></li>
<li><a href="#filter" data-option-value=".metal:not(.transition)">metal but not transition</a></li>
</ul>

4
_includes/footer.html

@ -1,4 +0,0 @@
<footer>
{{ site.name }} by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
</footer>

10
_includes/html-foot.html

@ -1,10 +0,0 @@
<!-- analytics -->
<script>
var _gaq=[['_setAccount','UA-592624-5'],['_trackPageview'],['_setDomainName', '.metafizzy.co']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>

16
_includes/html-head.html

@ -1,16 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{ page.title }} &middot; {{ site.name }} {% if page.category == 'docs' %}Docs{% elsif page.category == 'demos' %}Demo{% endif %}</title>
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" />
<!-- scripts at bottom of page -->
<script src="http://desandro.com/haveamint/?js"></script> <!-- analytics -->
</head>
<body class="{% if page.category == 'docs' %}doc{% elsif page.category == 'demos' %}demo{% endif %} {{ page.body_class }}">

21
_includes/inf-scroll-page.html

@ -0,0 +1,21 @@
<div id="container" class="variable-sizes">
{% assign page_position = page.page_position %}
{% for element in site.elements limit:20 offset:page.page_position %}
{% include element-partial.html %}
{% endfor %}
</div>
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){
var $container = $('#container');
$container.isotope({
itemSelector : '.element',
layoutMode : 'fitRows'
});
});
</script>

20
_includes/layout-change.js

@ -1,28 +1,24 @@
// change layout
var isHorizontal = false;
$('#layouts a').click(function(){
var mode = $(this).attr('href').slice(1);
wasHorizontal = isHorizontal;
isHorizontal = $(this).hasClass('horizontal');
function changeLayoutMode( $link, options ) {
var wasHorizontal = isHorizontal;
isHorizontal = $link.hasClass('horizontal');
if ( wasHorizontal !== isHorizontal ) {
// orientation change
// need to do some clean up for transitions and sizes
var style = isHorizontal ?
{ height: '80%', width: $container.width() } :
{ width: 'auto' };
// stop any animation on container height / width
$container.filter(':animated').stop();
// disable transition, apply revised style
$container.addClass('no-transition').css( style );
setTimeout(function(){
$container.removeClass('no-transition').isotope({ layoutMode : mode });
$container.removeClass('no-transition').isotope( options );
}, 100 )
} else {
// go ahead and apply new layout
$container.isotope({ layoutMode : mode });
$container.isotope( options );
}
return false;
});
}

23
_includes/layout-options.html

@ -1,12 +1,13 @@
<h3>Layout modes</h3>
<ul id="layouts" class="option-set floated clearfix">
<li><a href="#masonry" class="selected">masonry</a></li>
<li><a href="#fitRows">fitRows</a></li>
<li><a href="#cellsByRow">cellsByRow</a></li>
<li><a href="#straightDown">straightDown</a></li>
<li><a href="#masonryHorizontal" class="horizontal">masonryHorizontal</a></li>
<li><a href="#fitColumns" class="horizontal">fitColumns</a></li>
<li><a href="#cellsByColumn" class="horizontal">cellsByColumn</a></li>
<li><a href="#straightAcross" class="horizontal">straightAcross</a></li>
</ul>
<h3>Layout modes</h3>
<ul id="layouts" class="option-set clearfix" data-option-key="layoutMode">
<li><a href="#masonry" data-option-value="masonry" class="selected">masonry</a></li>
<li><a href="#fitRows" data-option-value="fitRows">fitRows</a></li>
<li><a href="#cellsByRow" data-option-value="cellsByRow">cellsByRow</a></li>
<li><a href="#straightDown" data-option-value="straightDown">straightDown</a></li>
<li><a href="#masonryHorizontal" data-option-value="masonryHorizontal" class="horizontal">masonryHorizontal</a></li>
<li><a href="#fitColumns" data-option-value="fitColumns" class="horizontal">fitColumns</a></li>
<li><a href="#cellsByColumn" data-option-value="cellsByColumn" class="horizontal">cellsByColumn</a></li>
<li><a href="#straightAcross" data-option-value="straightAcross" class="horizontal">straightAcross</a></li>
</ul>

31
_includes/option-set-buttons.js

@ -0,0 +1,31 @@
var $optionSets = $('#options .option-set'),
$optionLinks = $optionSets.find('a');
$optionLinks.click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return false;
}
var $optionSet = $this.parents('.option-set');
$optionSet.find('.selected').removeClass('selected');
$this.addClass('selected');
// make option object dynamically, i.e. { filter: '.my-filter-class' }
var options = {},
key = $optionSet.attr('data-option-key'),
value = $this.attr('data-option-value');
// parse 'false' as false boolean
value = value === 'false' ? false : value;
options[ key ] = value;
if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
// changes in layout modes need extra logic
changeLayoutMode( $this, options )
} else {
// otherwise, apply new options
$container.isotope( options );
}
return false;
});

35
_includes/sort-buttons.html

@ -1,25 +1,18 @@
<h3>Sort</h3>
<ul id="sort" class="sort option-set">
<li>
<ul class="sort asc option-set floated clearfix">
<li><a href="#original-order" class="selected">original-order (asc)</a></li>
<li><a href="#name">name (asc)</a></li>
<li><a href="#symbol">symbol (asc)</a></li>
<li><a href="#number">number (asc)</a></li>
<li><a href="#weight">weight (asc)</a></li>
<li><a href="#category">category (asc)</a></li>
</ul>
</li>
<li>
<ul class="sort desc option-set floated clearfix">
<li><a href="#original-order">original-order (desc)</a></li>
<li><a href="#name">name (desc)</a></li>
<li><a href="#symbol">symbol (desc)</a></li>
<li><a href="#number">number (desc)</a></li>
<li><a href="#weight">weight (desc)</a></li>
<li><a href="#category">category (desc)</a></li>
</ul>
</li>
<ul id="sort" class="sort option-set clearfix" data-option-key="sortBy">
<li><a href="#sortBy=original-order" data-option-value="original-order" class="selected" data>original-order</a></li>
<li><a href="#sortBy=name" data-option-value="name">name</a></li>
<li><a href="#sortBy=symbol" data-option-value="symbol">symbol</a></li>
<li><a href="#sortBy=number" data-option-value="number">number</a></li>
<li><a href="#sortBy=weight" data-option-value="weight">weight</a></li>
<li><a href="#sortBy=category" data-option-value="category">category</a></li>
</ul>
<h3>Sort direction</h3>
<ul id="sort-direction" class="option-set clearfix" data-option-key="sortAscending">
<li><a href="#sortAscending=true" data-option-value="true" class="selected">sort ascending</a></li>
<li><a href="#sortAscending=false" data-option-value="false">sort descending</a></li>
</ul>

13
_includes/sort-buttons.js

@ -1,13 +0,0 @@
// sorting
$('#sort a').click(function(){
// get href attribute, minus the #
var $this = $(this),
sortName = $this.attr('href').slice(1),
asc = $this.parents('.sort').hasClass('asc');
$container.isotope({
sortBy : sortName,
sortAscending : asc
});
return false;
});

67
_layouts/default.html

@ -0,0 +1,67 @@
<!doctype html>
<html lang="en">
<head>
{% if page.category != 'homepage' %}{% assign root_path = '../' %}{% assign link_path = '..' %}{% else %}{% assign link_path = '.' %}{% endif %}
<meta charset="utf-8" />
<title>{{ page.title }}{% if page.category != 'homepage' %} &middot; {{ site.name }} {% if page.category == 'docs' %}Docs{% elsif page.category == 'demos' %}Demo{% endif %}{% endif %}</title>
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="{{ root_path }}css/style.css" />
<!-- scripts at bottom of page -->
</head>
<body class="{{ page.category }} {{ page.body_class }}">
<nav id="site-nav">
<h1><a href="{{ root_path }}index.html">{{ site.name }}</a></h1>
<h2>Docs</h2>
<ul>
{% for doc in site.categories.docs reversed %}
{% if page.title == doc.title and page.category == 'docs' %}
<li class="current"><a href="#content">{{ doc.title }}</a>
<ul class="toc">
{% for item in page.toc %}
<li><a href="#{{ item.anchor }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
</li>
{% else %}
<li><a href="{{ link_path }}{{ doc.url }}">{{ doc.title }}</a>
{% endif %}
{% endfor %}
</ul>
<h2>Demos</h2>
<ul>
{% for demo in site.categories.demos reversed %}
{% if page.title == demo.title and page.category == 'demos' %}
<li class="current"><a href="#content">{{ demo.title }}</a></li>
{% else %}
<li><a href="{{ link_path }}{{ demo.url }}">{{ demo.title }}</a>
{% endif %}
{% endfor %}
</ul>
</nav> <!-- #site-nav -->
<section id="content">
{% if page.category != 'homepage' %}
<h1>{{ page.title }}</h1>
{% endif %}
{{ content }}
<footer>
{{ site.name }} by <a href="http://desandro.com">David DeSandro</a> / <a href="http://metafizzy.co">Metafizzy</a>
</footer>
</section> <!-- #content -->
</body>
</html>

11
_layouts/demo.html

@ -1,11 +0,0 @@
{% include html-head.html %}
<p id="demo-nav"><a href="../index.html">{{ site.name }}</a> Demo</p>
<h1>{{ page.title }}</h1>
{{ content }}
{% include footer.html %}
{% include html-foot.html %}

36
_layouts/doc.html

@ -1,36 +0,0 @@
{% include html-head.html %}
<nav id="docs-nav">
<h1><a href="../index.html">{{ site.name }}</a> Docs</h1>
<ul>
{% for doc in site.categories.docs reversed %}
{% if page.title == doc.title %}
<li class="current"><a href="#content">{{ doc.title }}</a>
<ul class="toc">
{% for item in page.toc %}
<li><a href="#{{ item.anchor }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
</li>
{% else %}
{% if doc.layout != 'index-page' %}
<li><a href="..{{ doc.url }}">{{ doc.title }}</a>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</nav> <!-- #docs-nav -->
<section id="content">
<h1>{{ page.title }}</h1>
{{ content }}
{% include footer.html %}
</section> <!-- #content -->
{% include html-foot.html %}

141
_layouts/elements.html

@ -1,141 +0,0 @@
{% include html-head.html %}
<p id="demo-nav"><a href="../index.html">{{ site.name }}</a> Demo</p>
<h1>{{ page.title }}</h1>
<section id="copy">
<p>Isotope&rsquo;s capabilities are designed to be used together cohesively. You can do it all &mdash; filter, sort, change layout modes, add items &mdash; and Isotope will handle it with ease.</p>
</section>
<section id="options" class="clearfix">
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#show-all" class="selected">show all</a></li>
<li><a href="#metalloid">metalloid</a></li>
<li><a href="#metal">metal</a></li>
<li><a href="#alkali">alkali</a></li>
<li><a href="#alkaline-earth">alkaline-earth</a></li>
<li><a href="#inner-transition">inner-transition</a></li>
<li><a href="#lanthanoid">lanthanoid</a></li>
<li><a href="#actinoid">actinoid</a></li>
<li><a href="#transition">transition</a></li>
<li><a href="#post-transition">post-transition</a></li>
<li><a href="#nonmetal">nonmetal</a></li>
<li><a href="#other">other</a></li>
<li><a href="#halogen">halogen</a></li>
<li><a href="#noble-gas">noble-gas</a></li>
</ul>
{% include sort-buttons.html %}
{% include layout-options.html %}
<h3>Etc</h3>
<ul id="etc" class="floated clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
<li id="insert"><a href="#insert">Insert new elements</a></li>
<li id="append"><a href='#append'>Append new elements</a></li>
<!-- <li id="shuffle"><a href='#shuffle'>Shuffle</a></li> -->
</ul>
</section> <!-- #options -->
{{ content }}
{% include footer.html %}
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
$(function(){
var $container = $('#container');
{% include random-sizes.js %}
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
return false;
});
{% include sort-buttons.js %}
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include layout-change.js %}
{% include add-buttons.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element',
// layoutMode : 'fitRows',
masonry : {
columnWidth : 120
},
masonryHorizontal : {
rowHeight: 120
},
cellsByRow : {
columnWidth : 240,
rowHeight : 240
},
cellsByColumn : {
columnWidth : 240,
rowHeight : 240
},
animationEngine : $.browser.opera ? 'jquery' : 'best-available',
// animationEngine : 'jquery',
getSortData : {
symbol : function( $elem ) {
return $elem.attr('data-symbol');
},
category : function( $elem ) {
return $elem.attr('data-category');
},
number : function( $elem ) {
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();
}
}
});
});
</script>
{% include html-foot.html %}

17
_layouts/index-page.html

@ -1,17 +0,0 @@
{% include html-head.html %}
<p id="demo-nav"><a href="../index.html">{{ site.name }}</a></p>
<h1>{{ page.title }}</h1>
<ul id="index-list">
{% for post in site.categories[page.category] reversed %}
{% if post.layout != 'index-page' %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% include footer.html %}
{% include html-foot.html %}

31
_layouts/inf-scroll-page.html

@ -1,31 +0,0 @@
{% include html-head.html %}
<p id="demo-nav"><a href="../index.html">{{ site.name }}</a> Demo</p>
<h1>{{ page.title }}</h1>
<div id="container" class="variable-sizes">
{% assign page_position = page.page_position %}
{% for element in site.elements limit:20 offset:page_position %}
{% include element-partial.html %}
{% endfor %}
</div>
{% include footer.html %}
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){
var $container = $('#container');
$container.isotope({
itemSelector : '.element',
layoutMode : 'fitRows'
});
});
</script>
{% include html-foot.html %}

7
_posts/demos/2010-01-01-index.yml

@ -1,7 +0,0 @@
---
title: Demos
layout: index-page
category: demos
body_class: doc
---

3
_posts/demos/2010-12-12-basic.html

@ -1,8 +1,7 @@
---
title: Basic
layout: demo
layout: default
category: demos
related: a-intro
---
<section id="copy">

6
_posts/demos/2010-12-13-elements-complete.html

@ -1,10 +1,11 @@
---
title: Elements Complete
layout: elements
layout: default
category: demos
related: a-intro
---
{% include elements-demo-head.html %}
<div id="container" class="clickable clearfix">
{% for elem_number in site.random_order %}
{% assign element = site.elements[elem_number] %}
@ -12,3 +13,4 @@ related: a-intro
{% endfor %}
</div>
{% include elements-demo-foot.html %}

7
_posts/demos/2010-12-16-elements-partial.html

@ -1,10 +1,11 @@
---
title: Elements Partial
layout: elements
layout: default
category: demos
related: a-intro
---
{% include elements-demo-head.html %}
<div id="container" class="clickable clearfix">
{% for elem_number in site.best_of_order %}
{% assign element = site.elements[elem_number] %}
@ -12,4 +13,4 @@ related: a-intro
{% endfor %}
</div>
{% include elements-demo-foot.html %}

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

@ -1,8 +1,7 @@
---
title: Layout modes
layout: demo
layout: default
category: demos
related: layouts
---
<section id="copy">
@ -31,10 +30,6 @@ related: layouts
{% include random-sizes.js %}
{% include layout-change.js %}
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element',
masonry : {
@ -53,6 +48,12 @@ related: layouts
}
});
{% include layout-change.js %}
{% include option-set-buttons.js %}
});
</script>

28
_posts/demos/2010-12-30-filtering.html

@ -1,8 +1,7 @@
---
title: Filtering
layout: demo
layout: default
category: demos
related: filtering
---
<section id="copy">
@ -13,19 +12,7 @@ related: filtering
<section id="options" class="clearfix">
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#filter" data-filter="*" class="selected">show all</a></li>
<li><a href="#filter" data-filter=".metal">metal</a></li>
<li><a href="#filter" data-filter=".transition">transition</a></li>
<li><a href="#filter" data-filter=".post-transition">post-transition</a></li>
<li><a href="#filter" data-filter=".nonmetal">nonmetal</a></li>
<li><a href="#filter" data-filter=".inner-transition">inner-transition</a></li>
<li><a href="#filter" data-filter=".alkali, .alkaline-earth">alkali and alkaline-earth</a></li>
<li><a href="#filter" data-filter=":not(.transition)">not transition</a></li>
<li><a href="#filter" data-filter=".metal:not(.transition)">metal but not transition</a></li>
</ul>
{% include filter-buttons.html %}
</section> <!-- #options -->
@ -43,19 +30,12 @@ related: filtering
var $container = $('#container');
// filter buttons
$('#filters a').click(function(){
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
return false;
});
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element'
});
{% include option-set-buttons.js %}
});
</script>

9
_posts/demos/2010-12-30-sorting.html

@ -1,8 +1,7 @@
---
title: Sorting
layout: demo
layout: default
category: demos
related: sorting
---
<section id="copy">
@ -30,10 +29,6 @@ related: sorting
var $container = $('#container');
{% include sort-buttons.js %}
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element',
getSortData : {
@ -55,5 +50,7 @@ related: sorting
}
});
{% include option-set-buttons.js %}
});
</script>

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

@ -1,8 +1,7 @@
---
title: reLayout
layout: demo
layout: default
category: demos
related: methods
---
<section id="copy">
@ -11,7 +10,7 @@ related: methods
</section>
<section id="options">
<ul>
<ul class="clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
</ul>
</section>
@ -40,7 +39,7 @@ related: methods
});
// change size of clicked element
$container.find('.element').live('click', function(){
$container.find('.element').click(function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});

5
_posts/demos/2011-01-02-adding-items.html

@ -1,8 +1,7 @@
---
title: Adding items
layout: demo
layout: default
category: demos
related: methods
---
<section id="copy">
@ -13,7 +12,7 @@ related: methods
</section>
<section id="options">
<ul class="floated clearfix">
<ul class="clearfix">
<li id="insert"><a href="#insert">Insert new elements</a></li>
<li id="append"><a href='#append'>Append new elements</a></li>
<li id="prepend"><a href='#prepend'>Prepend</a></li>

3
_posts/demos/2011-01-02-infinite-scroll.html

@ -1,8 +1,7 @@
---
title: Infinite Scroll
layout: demo
layout: default
category: demos
related: layout
infinite_scroll: true
---

3
_posts/demos/2011-01-11-images.html

@ -1,8 +1,7 @@
---
title: Images
layout: demo
layout: default
category: demos
related: z-etc
photos:
- <a href="http://www.flickr.com/photos/nemoorange/5013039951/" title="Stanley by Dave DeSandro, on Flickr"><img src="http://farm5.static.flickr.com/4113/5013039951_3a47ccd509.jpg" alt="Stanley" /></a>
- <a href="http://www.flickr.com/photos/nemoorange/5013039885/" title="Officer by Dave DeSandro, on Flickr"><img src="http://farm5.static.flickr.com/4131/5013039885_0d16ac87bc.jpg" alt="Officer" /></a>

5
_posts/demos/2011-03-29-combination-filters.html

@ -1,8 +1,7 @@
---
title: Combination filters
layout: demo
layout: default
category: demos
related: filtering
schema:
- name: color
filters: [ red, blue, yellow ]
@ -23,7 +22,7 @@ schema:
{% for group in page.schema %}
<div class="option-combo {{ group.name }}">
<h4>{{ group.name }}</h4>
<ul class="filter option-set floated clearfix ">
<ul class="filter option-set clearfix ">
<li><a href="#filter-{{ group.name }}-any" data-filter="" data-group="{{ group.name }}" class="selected">any</a>
{% for filter in group.filters %}
<li><a href="#filter-{{ group.name }}-{{ filter }}" data-group="{{ group.name }}" data-filter=".{{ filter }}">{{ filter }}</a>

61
_posts/demos/2011-05-22-category-rows.html

@ -1,8 +1,7 @@
---
title: Category rows
layout: demo
layout: default
category: demos
related: layouts
---
<section id="copy">
@ -11,28 +10,11 @@ related: layouts
<section id="options" class="clearfix">
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#show-all" class="selected">show all</a></li>
<li><a href="#metalloid">metalloid</a></li>
<li><a href="#metal">metal</a></li>
<li><a href="#alkali">alkali</a></li>
<li><a href="#alkaline-earth">alkaline-earth</a></li>
<li><a href="#inner-transition">inner-transition</a></li>
<li><a href="#lanthanoid">lanthanoid</a></li>
<li><a href="#actinoid">actinoid</a></li>
<li><a href="#transition">transition</a></li>
<li><a href="#post-transition">post-transition</a></li>
<li><a href="#nonmetal">nonmetal</a></li>
<li><a href="#other">other</a></li>
<li><a href="#halogen">halogen</a></li>
<li><a href="#noble-gas">noble-gas</a></li>
</ul>
{% include filter-buttons.html %}
<h3>Etc</h3>
<ul id="etc" class="floated clearfix">
<ul id="etc" class="clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
<li id="insert"><a href="#insert">Insert new elements</a></li>
</ul>
@ -110,25 +92,7 @@ related: layouts
var $container = $('#container');
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
return false;
});
{% include add-buttons.js %}
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include option-buttons.js %}
{% include random-sizes.js %}
$container.isotope({
itemSelector : '.element',
@ -146,6 +110,23 @@ related: layouts
});
{% include option-set-buttons.js %}
{% include add-buttons.js %}
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
});
</script>

190
_posts/demos/2011-06-13-hash-history.html

@ -0,0 +1,190 @@
---
title: Hash history
layout: default
category: demos
---
<section id="copy">
<p><a href="http://benalman.com/projects/jquery-bbq-plugin/">jQuery BBQ</a> by Ben Alman allows you to use hash history to save Isotope options. Try clicking a couple options then hitting the back button, or copying the URL and pasting it into a new window.</p>
</section>
<section id="options" class="clearfix">
<h3>Filters</h3>
<ul class="option-set clearfix">
<li><a href="#filter=*" class="selected">show all</a></li>
<li><a href="#filter=.metal">metal</a></li>
<li><a href="#filter=.transition">transition</a></li>
<li><a href="#filter=.post-transition">post-transition</a></li>
<li><a href="#filter=.nonmetal">nonmetal</a></li>
<li><a href="#filter=.inner-transition">inner-transition</a></li>
<li><a href="#filter=.alkali%2C+.alkaline-earth">alkali and alkaline-earth</a></li>
<li><a href="#filter=%3Anot(.transition)">not transition</a></li>
<li><a href="#filter=.metal%3Anot(.transition)">metal but not transition</a></li>
</ul>
<h3>Sort</h3>
<ul class="option-set clearfix">
<li><a href="#sortBy=original-order" class="selected">original-order</a></li>
<li><a href="#sortBy=name">name</a></li>
<li><a href="#sortBy=symbol">symbol</a></li>
<li><a href="#sortBy=number">number</a></li>
<li><a href="#sortBy=weight">weight</a></li>
<li><a href="#sortBy=category">category</a></li>
</ul>
<h3>Sort direction</h3>
<ul class="option-set clearfix">
<li><a href="#sortAscending=true" class="selected">sort ascending</a></li>
<li><a href="#sortAscending=false">sort descending</a></li>
</ul>
<h3>Layout modes</h3>
<ul class="option-set clearfix">
<li><a href="#layoutMode=masonry" class="selected">masonry</a></li>
<li><a href="#layoutMode=fitRows">fitRows</a></li>
<li><a href="#layoutMode=cellsByRow">cellsByRow</a></li>
<li><a href="#layoutMode=straightDown">straightDown</a></li>
</ul>
</section> <!-- #options -->
<div id="container" class="variable-sizes clearfix">
{% for elem_number in site.random_order | limit:60 %}
{% assign element = site.elements[elem_number] %}
{% include element-partial.html %}
{% endfor %}
</div> <!-- #container -->
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/jquery.ba-bbq.min.js"></script>
<script>
$(function(){
var $container = $('#container'),
// object that will keep track of options
isotopeOptions = {},
// defaults, used if not explicitly set in hash
defaultOptions = {
filter: '*',
sortBy: 'original-order',
sortAscending: true,
layoutMode: 'masonry'
};
// 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');
}
});
var setupOptions = $.extend( defaultOptions, {
itemSelector : '.element',
masonry : {
columnWidth : 120
},
cellsByRow : {
columnWidth : 240,
rowHeight : 240
},
getSortData : {
symbol : function( $elem ) {
return $elem.attr('data-symbol');
},
category : function( $elem ) {
return $elem.attr('data-category');
},
number : function( $elem ) {
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();
}
}
});
// set up Isotope
$container.isotope( setupOptions );
var $optionSets = $('#options').find('.option-set'),
isOptionLinkClicked = false;
// switches selected class on buttons
function changeSelectedLink( $elem ) {
// remove selected class on previous item
$elem.parents('.option-set').find('.selected').removeClass('selected');
// set selected class on new item
$elem.addClass('selected');
}
$optionSets.find('a').click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return;
}
changeSelectedLink( $this );
// get href attr, remove leading #
var href = $this.attr('href').replace( /^#/, '' ),
// convert href into object
// i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' }
option = $.deparam( href, true );
// apply new option to previous
$.extend( isotopeOptions, option );
// set hash, triggers hashchange on window
$.bbq.pushState( isotopeOptions );
isOptionLinkClicked = true;
return false;
});
$(window).bind( 'hashchange', function( event ){
// get options object from hash
var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {},
// apply defaults where no option was specified
options = $.extend( {}, defaultOptions, hashOptions );
// apply options from hash
$container.isotope( options );
// save options
isotopeOptions = hashOptions;
// if option link was not clicked
// then we'll need to update selected links
if ( !isOptionLinkClicked ) {
// iterate over options
var hrefObj, hrefValue, $selectedLink;
for ( var key in options ) {
hrefObj = {};
hrefObj[ key ] = options[ key ];
// convert object into parameter string
// i.e. { filter: '.inner-transition' } -> 'filter=.inner-transition'
hrefValue = $.param( hrefObj );
// get matching link
$selectedLink = $optionSets.find('a[href="#' + hrefValue + '"]');
changeSelectedLink( $selectedLink );
}
}
isOptionLinkClicked = false;
})
// trigger hashchange to capture any hash data on init
.trigger('hashchange');
});
</script>

5
_posts/docs/2010-01-01-index.yml

@ -1,5 +0,0 @@
---
title: Docs
layout: index-page
category: docs
---

16
_posts/docs/2010-12-01-introduction.mdown

@ -2,8 +2,7 @@
title: Introduction
category: docs
layout: doc
related: a-intro
layout: default
toc:
- { title: Features, anchor: features }
- { title: Licensing, anchor: licensing }
@ -28,7 +27,7 @@ toc:
## Licensing
<p id="commercial">
<strong>Commercial use of Isotope requires purchase of one-time license fee per developer seat.</strong> Commercial use includes any application that makes you money &mdash; portfolio sites, premium templates, etc. Commercial licenses may be purchased at <a href="http://metafizzy.co">metafizzy.co</a>.
<strong>Commercial use of Isotope requires purchase of one-time license fee per developer seat.</strong> Commercial use includes any application that makes you money &mdash; portfolio sites, premium templates, etc. Commercial licenses may be purchased at <a href="http://metafizzy.co/#isotope-license">metafizzy.co</a>.
</p>
Use in non-commercial and personal applications is free.
@ -70,7 +69,7 @@ There are a number of [options](options.html) you can specify. Within the optio
## Code repository
This project lives on GitHub at [github.com/desandro/isotope](http://github.com/desandro/isotope). There you can grab the latest code and download this entire project.
This project lives on GitHub at [github.com/desandro/isotope](http://github.com/desandro/isotope). There you can grab the latest code and follow development.
## A word about moderation {: #moderation}
@ -78,12 +77,13 @@ Isotope enables a wealth of functionality. But just because you can take advanta
## Acknowledgments
+ [**Faruk AteĹź**](http://farukat.es) for [Modernizr](http://www.modernizr.com/) (partially used within Isotope)
+ [**Louis-Rémi Babé**](http://twitter.com/Louis_Remi) for [jQuery smartresize](https://github.com/louisremi/jquery-smartresize) (used within Isotope) and for [jQuery transform](https://github.com/louisremi/jquery.transform.js) which clued me in to using jQuery 1.4.3's CSS hooks
+ [**"Cowboy" Ben Alman**](http://benalman.com/) for [jQuery BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (included with docs)
+ [**Louis-Rémi Babé**](http://twitter.com/Louis_Remi) for [jQuery smartresize](https://github.com/louisremi/jquery-smartresize) (used within Isotope) and for [jQuery transform](https://github.com/louisremi/jquery.transform.js) which clued me in to using jQuery 1.4.3's CSS hooks
+ [**Jacek Galanciak**](http://razorjack.net/) for [jQuery Quicksand](http://razorjack.net/quicksand/), an early kernel of inspiration
+ [**Ralph Holzmann**](http://twitter.com/#!/ralphholzmann) for re-writing the [jQuery Plugins/Authoring tutorial](http://docs.jquery.com/Plugins/Authoring) and opened my eyes to [Plugin Methods](http://docs.jquery.com/Plugins/Authoring#Plugin_Methods) pattern
+ [**Eric Hynds**](http://www.erichynds.com/) for his article [Using $.widget.bridge Outside of the Widget Factory](http://www.erichynds.com/jquery/using-jquery-ui-widget-factory-bridge/) which provided the architecture for Isotope
+ [**Paul Irish**](http://paul-irish.com) for [Infinite Scroll](http://infinite-scroll.com) (included with docs), the [imagesLoaded plugin](http://gist.github.com/268257) (included with Isotope), [Debounced resize() plugin](http://paulirish.com/demo/resize) (provided base for smartresize), and of course [Modernizr](http://www.modernizr.com/)
+ The [**jQuery UI Team**](http://jqueryui.com/about) for [$.widget.bridge](https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L62-107) (used within Isotope)
+ [**Paul Irish**](http://paul-irish.com) for [Infinite Scroll](http://infinite-scroll.com) (included with docs), the [imagesLoaded plugin](http://gist.github.com/268257) (included with Isotope), and [Debounced resize() plugin](http://paulirish.com/demo/resize) (provided base for smartresize)
+ The [**jQuery UI Team**](http://jqueryui.com/about) for [$.widget.bridge](https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L113-155) (partially used within Isotope)
+ The Modernizr team for [Modernizr](http://www.modernizr.com/) (partially used within Isotope)
+ [**Juriy Zaytsev aka "kangax"**](http://perfectionkills.com) for [getStyleProperty](http://perfectionkills.com/feature-testing-css-properties/) (used within Isotope)

13
_posts/docs/2010-12-03-options.mdown

@ -2,9 +2,8 @@
title: Options
category: docs
layout: doc
layout: default
body_class: option-def
related: a-intro
toc:
- { title: animationEngine, anchor: animationengine }
- { title: animationOptions, anchor: animationoptions }
@ -58,7 +57,7 @@ Determines the jQuery method to apply styles, `.css()` or `.animate()`. Useful f
<dd class="default"><code>{ queue: <span class="kc">false</span>, duration: <span class="mi">800</span> }</code></dd>
</dl>
When jQuery is the animation engine, these options will be used in <code>.animate()</code>. See the [jQuery API for animate options](http://api.jquery.com/animate/#animate-properties-options) for details.
When jQuery is the animation engine (see above), these options will be used in <code>.animate()</code>. See the [jQuery API for animate options](http://api.jquery.com/animate/#animate-properties-options) for details.
### Example
@ -97,7 +96,11 @@ Setting a filter with show item elements that match the selector, and hide eleme
### Values {#filter-values}
+ `'*'` Shows all item elements
<ul>
<li><code><span class="s1">'*'</span></code> or <code><span class="s1">''</span></code> (an empty string): Shows all item elements</li>
</ul>
## getSortData
@ -280,7 +283,7 @@ If you do disable transforms, but still want to use [CSS transitions](animating.
### Disabling hiddenStyle scale
If you are using filtering, it's also a good idea to disable the scale transform with the [`hiddenStyle` option](#hiddenstyle)
If you are using filtering, it's also a good idea to disable the scale transform with the [`hiddenStyle` option](#hiddenstyle).
{% highlight javascript %}

3
_posts/docs/2010-12-04-methods.mdown

@ -2,8 +2,7 @@
title: Methods
category: docs
layout: doc
related: methods
layout: default
toc:
- { title: addItems, anchor: additems }
- { title: appended, anchor: appended }

3
_posts/docs/2010-12-05-layout-modes.mdown

@ -2,9 +2,8 @@
title: Layout modes
category: docs
layout: doc
layout: default
body_class: option-def
related: layout
toc:
- { title: cellsByColumn, anchor: cellsbycolumn }
- { title: cellsByRow, anchor: cellsbyrow }

3
_posts/docs/2010-12-06-filtering.mdown

@ -2,8 +2,7 @@
title: Filtering
category: docs
layout: doc
related: filtering
layout: default
toc:
- { title: Markup, anchor: markup }
- { title: jQuery script, anchor: jquery_script }

3
_posts/docs/2010-12-07-sorting.mdown

@ -2,8 +2,7 @@
title: Sorting
category: docs
layout: doc
related: sorting
layout: default
toc:
- { title: Markup, anchor: markup }
- { title: getSortData option, anchor: getsortdata_option }

3
_posts/docs/2010-12-09-animating.mdown

@ -2,8 +2,7 @@
title: Animating
category: docs
layout: doc
related: animating
layout: default
toc:
- { title: animationEngine option, anchor: animationengine_option }
- { title: CSS transitions, anchor: css_transitions }

3
_posts/docs/2010-12-10-adding-items.mdown

@ -2,8 +2,7 @@
title: Adding items
category: docs
layout: doc
related: methods
layout: default
toc:
- { title: addItems method, anchor: additems_method }
- { title: insert method, anchor: insert_method }

3
_posts/docs/2011-05-25-extending-isotope.mdown

@ -2,8 +2,7 @@
title: Extending Isotope
category: docs
layout: doc
related: z-etc
layout: default
toc:
- { title: Custom layout modes, anchor: custom_layout_modes }

86
_posts/docs/2011-06-16-hash-history-jquery-bbq.mdown

@ -0,0 +1,86 @@
---
title: Hash history with jQuery BBQ
category: docs
layout: default
toc:
- { title: Markup, anchor: markup }
- { title: jQuery script, anchor: jquery_script }
---
As cool as Isotope is, the only thing that could make it even cooler would be adding bookmark-able URL hashes. Ben Alman's [jQuery BBQ](http://benalman.com/projects/jquery-bbq-plugin/) allows us to do just that.
> jQuery BBQ leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history.
[**See Demo: Hash history**](../demos/hash-history.html)
BBQ is a marvelous plugin that provides for a lot more functionality. The [hash history demo](../demos/hash-history.html) uses multiple options (`sortBy`, `sortAscending`, and `layoutMode` in addition to `filter`), the ability to use back-button history, and properly highlights selected links.
Given BBQ's tremendous capabilities, the code can grow to be a bit complex. Be sure to read through [BBQ's docs](http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html) and take look at [its examples](http://benalman.com/code/projects/jquery-bbq/examples/) before you dive in and code up your own solution.
## Markup
Instead of setting the option values and keys with `data` attributes, we can add the option in the `href` for each link.
{% highlight html %}
<ul class="option-set">
<li><a href="#filter=*" class="selected">show all</a></li>
<li><a href="#filter=.metal">metal</a></li>
<li><a href="#filter=.transition">transition</a></li>
<li><a href="#filter=.alkali%2C+.alkaline-earth">alkali and alkaline-earth</a></li>
<li><a href="#filter=%3Anot(.transition)">not transition</a></li>
<li><a href="#filter=.metal%3Anot(.transition)">metal but not transition</a></li>
</ul>
{% endhighlight %}
The `href` value is a serialized string, suitable for a URL. These values can be created with [jQuery.param()](http://api.jquery.com/jQuery.param/).
{% highlight javascript %}
$.param({ filter: '.metal' })
// >> "filter=.metal"
$.param({ filter: '.alkali, alkaline-earth' })
// >> "filter=.alkali%2C+alkaline-earth"
$.param({ filter: ':not(.transition)' })
// >> "#filter=%3Anot(.transition)"
{% endhighlight %}
## jQuery script
These serialized `href` values can be converted into their proper jQuery object form when clicked using [jQuery.deparam()](http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html#jQuery.deparam) from jQuery BBQ.
{% highlight javascript %}
$('.option-set a').click(function(){
// get href attr, remove leading #
var href = $(this).attr('href').replace( /^#/, '' ),
// convert href into object
// i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' }
option = $.deparam( href, true );
// set hash, triggers hashchange on window
$.bbq.pushState( option );
return false;
});
{% endhighlight %}
Calling [$.bbq.pushState()](http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html#jQuery.bbq.pushState) will trigger the `hashchange` event. At that point, we can parse the hash from the URL and use it to trigger the proper change in the Isotope instance.
{% highlight javascript %}
$(window).bind( 'hashchange', function( event ){
// get options object from hash
var hashOptions = $.deparam.fragment();
// apply options from hash
$container.isotope( hashOptions );
})
// trigger hashchange to capture any hash data on init
.trigger('hashchange');
{% endhighlight %}
Now any filter buttons that are clicked will update the URL hash, so these options can be bookmarked.

3
_posts/docs/2011-12-11-help.mdown

@ -2,8 +2,7 @@
title: Help
category: docs
layout: doc
related: z-etc
layout: default
toc:
- { title: Reporting bugs and issues, anchor: reporting_bugs_and_issues }
- { title: Support license, anchor: support_license }

5
_posts/docs/2011-12-20-license.mdown

@ -2,8 +2,7 @@
title: License
category: docs
layout: doc
related: z-etc
layout: default
toc:
- { title: Isotope Commercial License Agreement, anchor: isotope_commercial_license_agreement }
@ -11,7 +10,7 @@ toc:
Isotope may be used in non-commercial and personal applications for free.
For commercial applications, you may license Isotope with the purchase of a one-time fee per developer seat (how many of you will be developing with Isotope) . Once purchased, you may use Isotope in all your future commercial applications. Commercial licenses may be purchased at [metafizzy.co](http://metafizzy.co).
For commercial applications, you may license Isotope with the purchase of a one-time fee per developer seat (how many of you will be developing with Isotope) . Once purchased, you may use Isotope in all your future commercial applications. [Commercial licenses may be purchased at metafizzy.co](http://metafizzy.co/#isotope-license).
Copyright &copy; 2011 David DeSandro / Metafizzy LLC

4
_posts/pages/2011-01-01-2.yml → _posts/pages/2011-01-01-2.html

@ -1,7 +1,9 @@
---
title: Infinite Scroll Page 2
category: pages
layout: inf-scroll-page
layout: default
page_position: 20
infinite_scroll: true
---
{% include inf-scroll-page.html %}

4
_posts/pages/2011-01-01-3.yml → _posts/pages/2011-01-01-3.html

@ -1,7 +1,9 @@
---
title: Infinite Scroll Page 3
category: pages
layout: inf-scroll-page
layout: default
page_position: 40
infinite_scroll: true
---
{% include inf-scroll-page.html %}

4
_posts/pages/2011-01-01-4.yml → _posts/pages/2011-01-01-4.html

@ -1,7 +1,9 @@
---
title: Infinite Scroll Page 4
category: pages
layout: inf-scroll-page
layout: default
page_position: 60
infinite_scroll: true
---
{% include inf-scroll-page.html %}

4
_posts/pages/2011-01-01-5.yml → _posts/pages/2011-01-01-5.html

@ -1,7 +1,9 @@
---
title: Infinite Scroll Page 5
category: pages
layout: inf-scroll-page
layout: default
page_position: 80
infinite_scroll: true
---
{% include inf-scroll-page.html %}

4
_posts/pages/2011-01-01-6.yml → _posts/pages/2011-01-01-6.html

@ -1,7 +1,9 @@
---
title: Infinite Scroll Page 6
category: pages
layout: inf-scroll-page
layout: default
page_position: 100
infinite_scroll: true
---
{% include inf-scroll-page.html %}

14
_posts/tests/2010-01-01-index.html

@ -0,0 +1,14 @@
---
title: Tests Index
layout: default
category: tests
body_class: doc
---
<ul>
{% for post in site.categories[page.category] reversed %}
{% if post.layout != 'index-page' %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>

6
_posts/tests/2010-01-01-index.yml

@ -1,6 +0,0 @@
---
title: Tests
layout: index-page
category: tests
body_class: doc
---

2
_posts/tests/2011-03-27-destroy01.html

@ -1,6 +1,6 @@
---
title: destroy01
layout: demo
layout: default
category: tests
---

35
_posts/tests/2011-03-27-flash01.html

@ -1,6 +1,6 @@
---
title: flash01
layout: demo
layout: default
category: tests
---
@ -29,13 +29,12 @@ category: tests
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#filter" data-filter="*" class="selected">show all</a></li>
<li><a href="#filter-link" data-filter=".link">link</a></li>
<li><a href="#filter-audio" data-filter=".audio">audio</a></li>
<li><a href="#filter-video" data-filter=".video">video</a></li>
<li><a href="#filter-photo" data-filter=".photo">photo</a></li>
<ul id="filters" class="option-set clearfix" data-option-key="filter">
<li><a href="#filter-show-all" data-option-value="*" class="selected">show all</a></li>
<li><a href="#filter-link" data-option-value=".link">link</a></li>
<li><a href="#filter-audio" data-option-value=".audio">audio</a></li>
<li><a href="#filter-video" data-option-value=".video">video</a></li>
<li><a href="#filter-photo" data-option-value=".photo">photo</a></li>
</ul>
</section> <!-- #options -->
@ -113,24 +112,6 @@ category: tests
var $container = $('#container');
$('#filters a').click(function(){
var filterName = $(this).attr('data-filter');
$container.isotope({ filter : filterName });
return false;
});
// switches selected class on buttons
$('#options').find('.option-set a').click(function(){
var $this = $(this);
// don't proceed if already selected
if ( !$this.hasClass('selected') ) {
$this.parents('.option-set').find('.selected').removeClass('selected');
$this.addClass('selected');
}
});
$container.imagesLoaded(function(){
$container.isotope({
transformsEnabled: false,
@ -141,5 +122,7 @@ category: tests
});
});
{% include option-set-buttons.js %}
});
</script>

2
_posts/tests/2011-03-27-no-items01.html

@ -1,6 +1,6 @@
---
title: no items01
layout: demo
layout: default
category: tests
---

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

@ -1,6 +1,6 @@
---
title: item position data01
layout: demo
layout: default
category: tests
---
@ -14,7 +14,7 @@ category: tests
<h3>Etc</h3>
<ul id="etc" class="floated clearfix">
<ul id="etc" class="clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
</ul>
@ -36,7 +36,7 @@ category: tests
{% include random-sizes.js %}
{% include sort-buttons.js %}
{% include option-set-buttons.js %}
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){

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

@ -1,6 +1,6 @@
---
title: jquery animation01
layout: demo
layout: default
category: tests
---
@ -19,30 +19,14 @@ category: tests
<section id="options" class="clearfix">
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#show-all" class="selected">show all</a></li>
<li><a href="#metalloid">metalloid</a></li>
<li><a href="#metal">metal</a></li>
<li><a href="#alkali">alkali</a></li>
<li><a href="#alkaline-earth">alkaline-earth</a></li>
<li><a href="#inner-transition">inner-transition</a></li>
<li><a href="#lanthanoid">lanthanoid</a></li>
<li><a href="#actinoid">actinoid</a></li>
<li><a href="#transition">transition</a></li>
<li><a href="#post-transition">post-transition</a></li>
<li><a href="#nonmetal">nonmetal</a></li>
<li><a href="#other">other</a></li>
<li><a href="#halogen">halogen</a></li>
<li><a href="#noble-gas">noble-gas</a></li>
</ul>
{% include filter-buttons.html %}
{% include sort-buttons.html %}
<h3>Etc</h3>
<ul id="etc" class="floated clearfix">
<ul id="etc" class="clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
</ul>
@ -63,32 +47,6 @@ category: tests
{% include random-sizes.js %}
{% include sort-buttons.js %}
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
return false;
});
{% include option-buttons.js %}
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
$container.isotope({
itemSelector: '.element',
transformsEnabled: false,
@ -115,5 +73,21 @@ category: tests
}
});
{% include option-set-buttons.js %}
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
});
</script>

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

@ -1,6 +1,6 @@
---
title: centered masonry
layout: demo
layout: default
category: tests
---
@ -16,30 +16,13 @@ category: tests
<section id="options" class="clearfix">
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#show-all" class="selected">show all</a></li>
<li><a href="#metalloid">metalloid</a></li>
<li><a href="#metal">metal</a></li>
<li><a href="#alkali">alkali</a></li>
<li><a href="#alkaline-earth">alkaline-earth</a></li>
<li><a href="#inner-transition">inner-transition</a></li>
<li><a href="#lanthanoid">lanthanoid</a></li>
<li><a href="#actinoid">actinoid</a></li>
<li><a href="#transition">transition</a></li>
<li><a href="#post-transition">post-transition</a></li>
<li><a href="#nonmetal">nonmetal</a></li>
<li><a href="#other">other</a></li>
<li><a href="#halogen">halogen</a></li>
<li><a href="#noble-gas">noble-gas</a></li>
</ul>
{% include filter-buttons.html %}
{% include sort-buttons.html %}
<h3>Etc</h3>
<ul id="etc" class="floated clearfix">
<ul id="etc" class="clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
<li id="insert"><a href="#insert">Insert new elements</a></li>
@ -124,6 +107,7 @@ category: tests
var $container = $('#container');
{% include random-sizes.js %}
$container.isotope({
itemSelector : '.element',
@ -150,18 +134,7 @@ category: tests
}
});
{% include random-sizes.js %}
{% include sort-buttons.js %}
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
return false;
});
{% include option-set-buttons.js %}
// change size of clicked element
$container.find('.element').live('click', function(){
@ -184,7 +157,7 @@ category: tests
return false;
});
{% include option-buttons.js %}
});

141
_posts/tests/2011-05-24-elements-complete-test.html

@ -1,6 +1,6 @@
---
title: elements complete test
layout: demo
layout: default
category: tests
---
@ -10,24 +10,7 @@ category: tests
<section id="options" class="clearfix">
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#show-all" class="selected">show all</a></li>
<li><a href="#metalloid">metalloid</a></li>
<li><a href="#metal">metal</a></li>
<li><a href="#alkali">alkali</a></li>
<li><a href="#alkaline-earth">alkaline-earth</a></li>
<li><a href="#inner-transition">inner-transition</a></li>
<li><a href="#lanthanoid">lanthanoid</a></li>
<li><a href="#actinoid">actinoid</a></li>
<li><a href="#transition">transition</a></li>
<li><a href="#post-transition">post-transition</a></li>
<li><a href="#nonmetal">nonmetal</a></li>
<li><a href="#other">other</a></li>
<li><a href="#halogen">halogen</a></li>
<li><a href="#noble-gas">noble-gas</a></li>
</ul>
{% include filter-buttons.html %}
{% include sort-buttons.html %}
@ -35,7 +18,7 @@ category: tests
<h3>Etc</h3>
<ul id="etc" class="floated clearfix">
<ul id="etc" class="clearfix">
<li id="toggle-sizes"><a href="#toggle-sizes">Toggle variable sizes</a></li>
<li id="insert"><a href="#insert">Insert new elements</a></li>
@ -57,62 +40,11 @@ category: tests
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
$(function(){
var $container = $('#container');
$('#filters').find('a').click(function(){
console.time('filter');
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
console.timeEnd('filter');
return false;
});
// sorting
$('#sort a').click(function(){
console.time('sort');
// get href attribute, minus the #
var $this = $(this),
sortName = $this.attr('href').slice(1),
asc = $this.parents('.sort').hasClass('asc');
$container.isotope({
sortBy : sortName,
sortAscending : asc
});
console.timeEnd('sort');
return false;
});
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include layout-change.js %}
{% include add-buttons.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
{% include option-buttons.js %}
var $container = $('#container');
$(function(){
{% include random-sizes.js %}
console.time('init');
$container.isotope({
@ -155,6 +87,67 @@ category: tests
console.timeEnd('init');
var $optionSets = $('#options .option-set'),
$optionLinks = $optionSets.find('a');
$optionLinks.click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return false;
}
var $optionSet = $this.parents('.option-set');
$optionSet.find('.selected').removeClass('selected');
$this.addClass('selected');
// make option object dynamically, i.e. { filter: '.my-filter-class' }
var options = {},
key = $optionSet.attr('data-option-key'),
value = $this.attr('data-option-value');
// parse 'false' as false boolean
value = value === 'false' ? false : value;
options[ key ] = value;
console.time( key );
if ( key === 'layoutMode' && changeLayoutMode ) {
// changes in layout modes need extra logic
changeLayoutMode( $this, options )
} else {
// otherwise, apply new options
$container.isotope( options );
}
console.timeEnd( key );
return false;
});
{% include layout-change.js %}
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include add-buttons.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
{% include option-buttons.js %}
});
</script>

27
_posts/tests/2011-05-31-tiny-text.html

@ -1,6 +1,6 @@
---
title: Tiny text
layout: demo
layout: default
category: tests
lorem: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
---
@ -28,10 +28,10 @@ lorem: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
<h3>Filters</h3>
<ul id="filters" class="option-set floated clearfix">
<li><a href="#show-all" class="selected">show all</a></li>
<li><a href="#red">red</a></li>
<li><a href="#blue">blue</a></li>
<ul id="filters" class="option-set clearfix" data-option-key="filter">
<li><a href="#show-all" data-option-value="*" class="selected">show all</a></li>
<li><a href="#red" data-option-value=".red">red</a></li>
<li><a href="#blue" data-option-value=".blue">blue</a></li>
</ul>
</section> <!-- #options -->
@ -56,30 +56,15 @@ lorem: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
$(function(){
var $container = $('#container');
$container.isotope({
});
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
return false;
});
{% include option-buttons.js %}
{% include option-set-buttons.js %}
});
</script>

280
css/style.css

@ -88,7 +88,8 @@ h1, h2, h3, p, ul, ol, pre, dl {
margin-bottom: 1.0em;
}
h1, h2, #super-list, .element, .tagline, #index-list {
h1, h2, #super-list, .element, .tagline, #index-list,
.super-list .link {
font-family: 'Helvetica Neue', Arial, sans-serif;
}
@ -130,6 +131,13 @@ a img { border: none; }
em { font-style: italic; }
strong { font-weight: bold; }
blockquote {
padding-left: 1.0em;
margin-left: 1.0em;
border-left: 1px solid #333;
font-style: italic;
}
/**** Isotope styles ****/
/* required for containers to inherit vertical size from window */
@ -266,19 +274,19 @@ body {
margin-left: 1.5em;
}
#options .floated li {
#options li {
float: left;
margin-bottom: 0.2em;
}
#options li a {
display: inline-block;
display: block;
padding: 0.4em 0.5em;
background-color: #DDD;
color: #222;
font-weight: bold;
margin-bottom: 0.2em;
text-shadow: 0 1px hsla( 0, 0%, 100%, 0.5 );
background-image: -moz-linear-gradient(-90deg,
background-image: -moz-linear-gradient( -90deg,
hsla( 0, 0%, 100%, 0.5 ) ,
hsla( 0, 0%, 100%, 0.0 )
);
@ -286,6 +294,10 @@ body {
from( hsla( 0, 0%, 100%, 0.5 ) ),
to( hsla( 0, 0%, 100%, 0.0 ) )
);
background-image: -o-linear-gradient( -90deg,
hsla( 0, 0%, 100%, 0.5 ) ,
hsla( 0, 0%, 100%, 0.0 )
);
}
#options li a:hover {
@ -300,21 +312,21 @@ body {
box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
}
#options .floated li a {
#options li a {
border-left: 1px solid hsla( 0, 0%, 100%, 0.3 );
border-right: 1px solid hsla( 0, 0%, 0%, 0.2 );
}
#options .floated li:first-child a {
#options li:first-child a {
border-radius: 7px 0 0 7px;
border-left: none;
}
#options .floated li:last-child a {
#options li:last-child a {
border-radius: 0 7px 7px 0;
}
#options .option-set li a.selected {
#options li a.selected {
background-color: #13F;
text-shadow: none;
color: white;
@ -395,93 +407,77 @@ body {
width: 100%;
}
#content {
margin-left: 210px;
}
.demos #content {
height: 100%;
}
/**** Docs ****/
body.doc {
.docs #content {
max-width: 640px;
}
.doc a:hover {
.docs #content a:hover {
border-bottom: 1px dotted;
}
/**** Doc page nav ****/
body.doc {
margin-left: 220px;
}
.doc nav {
width: 210px;
position: fixed;
#site-nav {
width: 200px;
position: absolute;
left: 10px;
top: 0px;
padding-top: 20px;
height: 100%;
overflow: auto;
}
.doc nav h1 {
margin-top: 0;
}
@media screen and (max-width: 768px) {
body.doc {
margin-left: 0px;
}
.doc nav {
width: auto;
position: relative;
left: auto;
top: auto;
padding-top: 0px;
height: auto;
margin-bottom: 20px;
}
font-size: 12px;
}
/**** Doc page nav ****/
#docs-nav h1,
#demo-nav {
font-size: 19px;
#site-nav h1 {
font-size: 24px;
margin-bottom: 0.5em;
margin-top: 0;
font-weight: bold;
font-family: 'Helvetica Neue', Arial, sans-serif;
}
#docs-nav h1 a,
#demo-nav a { color: #4FB; }
#docs-nav h1 a:hover,
#demo-nav a:hover { color: #4BF; }
#demo-nav {
padding-bottom: 0.5em;
border-bottom: 1px solid #333;
#site-nav h2 {
font-size: 17px;
font-weight: normal;
margin: 0 0 0.3em;
border-top: none;
}
#docs-nav ul {
#site-nav h1 a { color: #4FB; }
#site-nav h1 a:hover { color: #4BF; }
#site-nav ul {
list-style: none;
margin: 0;
margin: 0 0 1.0em;
font-weight: bold;
}
#docs-nav ul a {
#site-nav ul ul { margin-bottom: 0; }
#site-nav ul a {
display: block;
border: none;
padding: 1px 5px;
}
#docs-nav ul .current a {
#site-nav ul .current a {
background: hsla( 0, 0%, 0%, 0.3 );
color: #1BF;
}
#docs-nav ul a:hover,
#docs-nav ul .current a:hover { color: white; }
#site-nav ul a:hover,
#site-nav ul .current a:hover { color: white; }
#docs-nav ul .current .toc a {
#site-nav ul .current .toc a {
font-size: 12px;
padding-left: 1.2em;
font-weight: normal;
@ -489,18 +485,19 @@ body.doc {
/**** Doc content ****/
.doc h2 {
.docs #content h2 {
border-top: 1px solid #333;
padding-top: 0.8em;
margin-bottom: 0.8em;
}
.doc h2:target {
.docs #content h2:target {
padding: 10px;
background: white;
color: #222;
}
.doc h3 {
.docs #content h3 {
color: #FEC;
background: hsla( 0, 0%, 75%, 0.05 );
padding: 2px 0.5em;
@ -508,7 +505,7 @@ body.doc {
font-size: 1.15em;
}
.doc h4 {
.docs #content h4 {
margin-bottom: 0.5em;
font-size: 14px;
}
@ -531,11 +528,11 @@ pre, code {
font-family: 'Monaco', monospace, sans-serif;
}
.doc #content code {
#content code {
font-size: 12px;
}
.doc #content pre {
#content pre {
line-height: 1.6em;
}
@ -569,27 +566,27 @@ h3#options {
/* Tagline */
.doc .tagline {
.docs .tagline {
font-size: 22px;
font-weight: 300;
}
/* as-is from MIT */
.doc .as-is {
.docs .as-is {
font-size: 95%;
}
/* Commercial license blurb */
.doc #commercial {
.docs #commercial {
background: white;
padding: 10px;
font-size: 14px;
color: #1F1F1D;
}
.doc #commercial a { font-weight: bold;}
.docs #commercial a { font-weight: bold;}
/**** Pygments ****/
@ -620,52 +617,11 @@ code .nd { color: #9FAD7E; } /* CSS pseudo selector */
/**** Super list ****/
#super-list {
list-style: none;
margin: 0;
padding: 0;
margin-bottom: 40px;
}
#super-list li {
display: inline-block;
float: left;
font-size: 28px;
line-height: 1.2em;
margin: 2px;
font-weight: 300;
}
#super-list li.feature { background: #111; }
#super-list li span,
#super-list li a {
display: block;
padding: 0.2em 0.5em;
}
#super-list li a {
color: #222;
}
#super-list li.doc a { background: #3CF; }
#super-list li.demo a { background: #FC3; }
#super-list li.link a { background: #E58; color: white; }
#super-list li a:hover {
background: white;
}
#super-list li.link a:hover { color: #222; }
#super-list.masonry li {
width: 216px;
}
#super-list.masonry li.feature,
#super-list.masonry li.link {
width: 436px;
}
/**** Sites using Isotope ****/
#sites h2 {
display: none;
padding: 0.4em;
line-height: 32px;
margin-bottom: 0.4em;
@ -695,44 +651,97 @@ code .nd { color: #9FAD7E; } /* CSS pseudo selector */
margin: 0;
}
#sites li {
.super-list .example {
list-style: none;
float: left;
width: 290px;
width: 230px;
margin: 5px;
}
#sites li a,
#sites li b,
#sites li img {
.super-list .example a,
.super-list .example b,
.super-list .example img {
display: block;
}
#sites li a {
width: 270px;
padding: 10px;
.super-list .example img { width: 100%; }
.super-list .example a {
background: #1F1E1D;
}
#sites li a:hover {
background: #333;
.super-list .example a:hover {
background: white;
color: #111;
}
#sites li b {
.super-list .example b {
font-weight: bold;
line-height: 1.3em;
margin-bottom: 0.6em;
padding: 3px;
padding-top: 8px;
}
.super-list .link {
float: left;
position: relative;
font-size: 24px;
line-height: 1.2em;
font-weight: 300;
margin: 5px;
}
/**** Index pages ****/
.super-list .link {
width: 230px;
height: 110px;
}
#index-list {
font-weight: 300;
font-size: 28px;
line-height: 1.4em;
list-style: none;
margin-left: 0;
.super-list .link a {
display: block;
padding: 10px;
padding-left: 65px;
height: 90px;
background: #1F1E1D;
color: #FE5;
-webkit-border-radius: 14px;
-moz-border-radius: 14px;
border-radius: 14px;
}
.super-list .link a:before {
content: 'âž”';
font-size: 70px;
position: absolute;
top: 30px;
left: 5px;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
.super-list .link.away a:before {
top: 25px;
left: 0px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.super-list .link a:hover {
background: #E58;
color: white;
}
.super-list .feature .name {
bottom: auto;
top: 140px;
left: 18px;
font-size: 20px;
}
/**** Infinite Scroll ****/
@ -754,10 +763,7 @@ code .nd { color: #9FAD7E; } /* CSS pseudo selector */
/* >> The Magnificent CLEARFIX: Updated to prevent margin-collapsing on child elements << j.mp/bestclearfix */
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; visibility: hidden; }
/* The Magnificent Clearfix: nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
/* fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
.clearfix { zoom: 1; }

192
index.html

@ -1,128 +1,120 @@
---
title: Index
layout: nil
title: Isotope
layout: default
category: homepage
features:
- name: An exquisite jQuery plugin for magical&nbsp;layouts
symbol: Iso
number: 1
category: alkali
- name: Dynamic, intelligent layouts
symbol: Dyn
number: 31
category: actinoid
- name: Re&ndash;order items with&nbsp;sorting
symbol: Srt
number: 27
category: lanthanoid
- name: Powerful methods, simple&nbsp;syntax
symbol: Pow
number: 61
category: metalloid
- name: Reveal &amp; hide items with&nbsp;filtering
symbol: Flt
number: 11
category: alkaline-earth
- name: Captivating animations
symbol: Ani
number: 41
category: transition
- name: Progressively enhanced for CSS3 transforms &amp;&nbsp;transitions
symbol: Pro
number: 71
category: halogen
- name: Sort items by just about&nbsp;anything
symbol: Any
number: 51
category: post-transition
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{ site.name }}</title>
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
</head>
<body>
<h1>{{ site.name }}</h1>
<section id="options" class="clearfix">
<div class="option-combo">
<h2>Filter:</h2>
<ul id="filter" class="option-set floated clearfix">
<li><a href="#show-all" data-filter="*" class="selected">show all</a></li>
<li><a href="#features" data-filter=".feature">features</a></li>
<li><a href="#docs" data-filter=".doc">docs</a></li>
<li><a href="#demos" data-filter=".demo">demos</a></li>
<ul id="filter" class="option-set clearfix" data-option-key="filter">
<li><a href="#show-all" data-option-value="*" class="selected">show all</a></li>
<li><a href="#elements" data-option-value=".element:not(.feature)">elements</a></li>
<li><a href="#features" data-option-value=".feature">features</a></li>
<li><a href="#examples" data-option-value=".example">examples</a></li>
</ul>
</div>
<div class="option-combo">
<h2>Sort:</h2>
<ul id="sort" class="option-set floated clearfix">
<li><a href="#type" data-sort="original-order" class="selected">original order</a></li>
<li><a href="#related" data-sort="related">related</a></li>
<li><a href="#width" data-sort="width">width</a></li>
<ul id="sort" class="option-set clearfix" data-option-key="sortBy">
<li><a href="#mixed" data-option-value="number" class="selected">mixed</a></li>
<li><a href="#original" data-option-value="original-order">original</a></li>
<li><a href="#alphabetical" data-option-value="alphabetical">alphabetical</a></li>
</ul>
</div>
<div class="option-combo">
<h2>Layout: </h2>
<ul id="layouts" class="option-set floated clearfix">
<li><a href="#fitRows" class="selected">fitRows</a></li>
<li><a href="#straightDown">straightDown</a></li>
<li><a href="#masonry">masonry</a></li>
<ul id="layouts" class="option-set clearfix" data-option-key="layoutMode">
<li><a href="#masonry" data-option-value="masonry" class="selected">masonry</a></li>
<li><a href="#fitRows" data-option-value="fitRows">fitRows</a></li>
<li><a href="#straightDown" data-option-value="straightDown">straightDown</a></li>
</ul>
</div>
</section>
<ul id="super-list" class="fitRows clearfix">
<li class="feature" data-category="feature" data-related="etc"><span>An exquisite jQuery plugin for magical layouts</span></li>
<li class="feature" data-category="feature" data-related="filtering"><span>Reveal &amp; hide items with filtering</span></li>
<li class="feature" data-category="feature" data-related="sorting"><span>Re&ndash;order items with sorting</span></li>
<li class="feature" data-category="feature" data-related="layout"><span>Dynamic, intelligent layouts</span></li>
<li class="feature" data-category="feature" data-related="animating"><span>Captivating animations</span></li>
<li class="feature" data-category="feature" data-related="sorting"><span>Sort items by just about anything</span></li>
<li class="feature" data-category="feature" data-related="methods"><span>Powerful methods, simple syntax</span></li>
<li class="feature" data-category="feature" data-related="animating"><span>Progressively enhanced for CSS3 transforms &amp; transitions</span></li>
{% for doc in site.categories.docs reversed %}
{% if doc.layout != 'index-page' %}
<li class="doc" data-category="doc" data-related="{{ doc.related }}"><a href=".{{ doc.url }}">Docs: {{ doc.title }}</a></li>
{% endif %}
<div id="container" class="super-list variable-sizes clearfix">
{% for elem_number in site.random_order limit:30 %}
{% assign element = site.elements[elem_number] %}
{% include element-partial.html %}
{% endfor %}
{% for demo in site.categories.demos reversed %}
{% if demo.layout != 'index-page' %}
<li class="demo" data-category="demo" data-related="{{ demo.related }}"><a href=".{{ demo.url }}">Demo: {{ demo.title }}</a></li>
{% endif %}
{% for feature in page.features %}
<div class="element feature {{ feature.category }} width2 height2">
<p class="number">{{ feature.number }}</p>
<h3 class="symbol">{{ feature.symbol }}</h3>
<h2 class="name">{{ feature.name }}</h2>
</div>
{% endfor %}
<li class="link" data-related="z-etc"><a href="jquery.isotope.min.js">Download jquery.isotope.min.js</a></li>
<li class="link" data-related="z-etc"><a href="http://meta.metafizzy.co/files/isotope-site.zip">Download this project</a></li>
<li class="link" data-related="z-etc"><a href="http://github.com/desandro/isotope">Isotope on GitHub</a></li>
</ul>
<div class="link" data-number="5"><a href="jquery.isotope.min.js">Down&#8203;load jquery&#8203;.isotope&#8203;.min.js</a></div>
<div class="link" data-number="13"><a href="http://meta.metafizzy.co/files/isotope-site.zip">Down&#8203;load this project</a></div>
<div class="link away" data-number="35"><a href="http://github.com/desandro/isotope">Isotope on GitHub</a></div>
</div>
<div id="sites"></div>
{% include footer.html %}
<script src="{{ site.jquery_js }}"></script>
<script src="{{ site.isotope_js }}"></script>
<script>
$list = $('#super-list');
$('#filter a').click(function(){
var filterName = $(this).attr('data-filter');
$list.isotope({ filter : filterName });
return false;
});
$('#sort a').click(function(){
var sortName = $(this).attr('data-sort');
$list.isotope({ sortBy : sortName });
return false;
});
var currentLayout = 'fitRows';
$('#layouts a').click(function(){
var layoutName = $(this).attr('href').slice(1);
$list.removeClass( currentLayout ).addClass( layoutName );
currentLayout = layoutName;
$list.isotope({ layoutMode : layoutName });
return false;
});
{% include option-buttons.js %}
$(function(){
$list.isotope({
layoutMode : 'fitRows',
masonry : {
columnWidth: 220
var $container = $('#container');
$container.isotope({
masonry: {
columnWidth: 120
},
getSortData : {
related : function( $elem ) {
return $elem.attr('data-related');
sortBy: 'number',
getSortData: {
number: function( $elem ) {
var number = $elem.hasClass('element') ?
$elem.find('.number').text() :
$elem.attr('data-number');
return parseInt( number, 10 );
},
width : function( $elem ) {
return $elem.width();
alphabetical: function( $elem ) {
var name = $elem.find('.name'),
itemText = name.length ? name : $elem;
return itemText.text();
}
}
});
{% include option-set-buttons.js %}
// Sites using Isotope markup
var $sites = $('#sites'),
$sitesTitle = $('<h2 class="loading"><img src="http://i.imgur.com/qkKy8.gif" />Loading sites using Isotope</h2>'),
@ -161,17 +153,29 @@ layout: nil
for ( var i=0, len = images.length; i < len; i++ ) {
image = images[i];
item = '<li><a href="' + image.url + '">'
+ '<b>' + image.name + '</b>'
+ '<img src="' + image.file.src.replace('/m.', '/s.') + '" />'
+ '<b>' + image.name + '</b>'
+ '</a></li>';
items.push( item );
}
var $items = $( items.join('') );
var $items = $( items.join('') )
.addClass('example');
// set random number for each item
$items.each(function(){
$(this).attr('data-number', ~~( Math.random() * 100 + 15 ));
});
$items.imagesLoaded(function(){
$sitesTitle.removeClass('loading').text('Sites using Isotope');
$sitesList.isotope( 'insert', $items );
$container.append( $items );
$items.each(function(){
var $this = $(this),
itemHeight = Math.ceil( $this.height() / 120 ) * 120 - 10;
$this.height( itemHeight );
});
$container.isotope( 'insert', $items );
});
});
@ -179,5 +183,3 @@ layout: nil
});
</script>
{% include html-foot.html %}

18
js/jquery.ba-bbq.min.js vendored

@ -0,0 +1,18 @@
/*
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
* http://benalman.com/projects/jquery-bbq-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
/*
* jQuery hashchange event - v1.2 - 2/11/2010
* http://benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
Loading…
Cancel
Save