Gettin stylish

pull/56/head
Glen Cheney 11 years ago
parent 6f992ae755
commit 91535600de

@ -3,7 +3,7 @@ destination: ./_site
plugins: ./_plugins
layouts: ./_layouts
include: ['.htaccess']
exclude: ['./css/*']
exclude: ['./_scss/*.*']
permalink: /:title

@ -1,9 +1,14 @@
{% comment %} Ghetto conversion to JSON {% endcomment %}
{% capture groups %}["{{ item.groups | join: "," }}"]{% endcapture %}
<div class="item item--h2" data-groups='{{ groups }}' data-date-created="{{ item.date }}" data-title="{{ item.title }}">
{% if extras.length > 0 %}
{% capture extras %} picture-item--{{ item.extras | join: " picture-item--" }}{% endcapture %}
{% else %}
{% assign extras = "" %}
{% endif %}
<div class="span3 picture-item{{ extras }}" data-groups='{{ groups }}' data-date-created="{{ item.date }}" data-title="{{ item.title }}">
<img src="{{ item.img }}" alt="" height="145" width="230" />
<div class="item__details">
<span class="item__title">{{ item.title }}</span>
<div class="picture-item__details">
<span class="picture-item__title">{{ item.title }}</span>
<a href="#">Graphic Design</a>
{% if item.description %}<p>{{ item.description }}</p>{% endif %}
</div>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,64 @@
.btn-group {
@include clearfix();
.btn {
float: left;
border-radius: 0;
&:first-child {
border-radius: 6px 0 0 6px;
}
&:last-child {
border-radius: 0 6px 6px 0;
}
}
}
.btn,
button {
display: inline-block;
padding-top: .75em;
padding-bottom: .75em;
-webkit-appearance: none;
text-align: center;
color: white;
border-radius: .0625em;
border: 0;
background-color: $wetAsphalt;
transition: .2s ease-out;
&:hover {
background-color: lighten($wetAsphalt, 10);
box-shadow: 0 2px 0 0 darken($wetAsphalt, 5);
}
&.active,
&:active {
background-color: $midnightBlue;
box-shadow: inset 0 1px 2px rgba(0,0,0,.3);
}
&:active {
transition: none;
}
}
.btn--filter {
background-color: $carrot;
&:hover {
background-color: lighten($carrot, 5);
box-shadow: 0 2px 0 0 darken($carrot, 5);
}
&.active,
&:active {
background-color: $pumpkin;
}
}
.btn--sort {
}

@ -0,0 +1,718 @@
/*------------------------------------*\
$CSSWIZARDRY-GRIDS
\*------------------------------------*/
/**
* CONTENTS
* INTRODUCTION.........How the grid system works.
* VARIABLES............Your settings.
* MIXINS...............Library mixins.
* GRID SETUP...........Build the grid structure.
* WIDTHS...............Build our responsive widths around our breakpoints.
* PUSH.................Push classes.
* PULL.................Pull classes.
*/
/*------------------------------------*\
$INTRODUCTION
\*------------------------------------*/
/**
* csswizardry grids provides you with widths to suit a number of breakpoints
* designed around devices of a size you specify. Out of the box, csswizardry
* grids caters to the following types of device:
*
* palm -- palm-based devices, like phones and small tablets
* lap -- lap-based devices, like iPads or laptops
* portable -- all of the above
* desk -- stationary devices, like desktop computers
* regular -- any/all types of device
*
* These namespaces are then used in the library to give you the ability to
* manipulate your layouts based around them, for example:
*
<div class="grid__item one-whole lap--one-half desk--one-third">
*
* This would give you a grid item which is 100% width unless it is on a lap
* device, at which point it become 50% wide, or it is on a desktop device, at
* which point it becomes 33.333% width.
*
* csswizardry grids also has push and pull classes which allow you to nudge
* grid items left and right by a defined amount. These follow the same naming
* convention as above, but are prepended by either `push--` or `pull--`, for
* example:
*
`class="grid__item one-half push--one-half"`
*
* This would give you a grid item which is 50% width and pushed over to the
* right by 50%.
*
* All classes in csswizardry grids follow this patten, so you should fairly
* quickly be able to piece together any combinations you can imagine, for
* example:
*
`class="grid__item one-whole lap--one-half desk--one-third push--desk--one-third"`
*
`class="grid__item one-quarter palm--one-half push--palm--one-half"`
*
`class="grid__item palm--one-third desk--five-twelfths"`
*/
/*------------------------------------*\
$VARIABLES
\*------------------------------------*/
/**
* If you are building a non-responsive site but would still like to use
* csswizardry-grids, set this to false:
*/
$responsive: true!default;
/**
* Is this build mobile first? Setting to true means that all grids will be
* 100% width if you do not apply a more specific class to them.
*/
$mobile-first: true!default;
/**
* Set the spacing between your grid items.
*/
$gutter: 24px!default;
/**
* Would you like Sass silent classes, or regular CSS classes?
*/
$use-silent-classes: false!default;
/**
* Would you like push and pull classes enabled?
*/
$push: false!default;
$pull: false!default;
/**
* Using `inline-block` means that the grid items need their whitespace removing
* in order for them to work correctly. Set the following to true if you are
* going to achieve this by manually removing/commenting out any whitespace in
* your HTML yourself.
*
* Setting this to false invokes a hack which cannot always be guaranteed,
* please see the following for more detail:
*
* github.com/csswizardry/csswizardry-grids/commit/744d4b23c9d2b77d605b5991e54a397df72e0688
* github.com/csswizardry/inuit.css/issues/170#issuecomment-14859371
*/
$use-markup-fix: true!default;
/**
* Define your breakpoints. The first value is the prefix that shall be used for
* your classes (e.g. `.palm--one-half`), the second value is the media query
* that the breakpoint fires at.
*/
$breakpoints: (
'palm' '(max-width: 480px)',
'lap' '(min-width: 481px) and (max-width: 1023px)',
'portable' '(max-width: 1023px)',
'desk' '(min-width: 1024px)'
)!default;
/**
* Define which namespaced breakpoints you would like to generate for each of
* widths, push and pull. This is handy if you only need pull on, say, desk, or
* you only need a new width breakpoint at mobile sizes. It allows you to only
* compile as much CSS as you need. All are turned on by default, but you can
* add and remove breakpoints at will.
*
* Push and pull shall only be used if `$push` and/or `$pull` and `$responsive`
* have been set to true.
*/
$breakpoint-has-widths: ('palm', 'lap', 'portable', 'desk')!default;
$breakpoint-has-push: ('palm', 'lap', 'portable', 'desk')!default;
$breakpoint-has-pull: ('palm', 'lap', 'portable', 'desk')!default;
/**
* You do not need to edit anything from this line onward; csswizardry-grids is
* good to go. Happy griddin!
*/
$class-type: unquote(".");
@if $use-silent-classes == true{
$class-type: unquote("%");
}
/*------------------------------------*\
$MIXINS
\*------------------------------------*/
/**
* These mixins are for the library to use only, you should not need to modify
* them at all.
*
* Enclose a block of code with a media query as named in `$breakpoints`.
*/
@mixin grid-media-query($media-query){
$breakpoint-found: false;
@each $breakpoint in $breakpoints{
$name: nth($breakpoint, 1);
$declaration: nth($breakpoint, 2);
@if $media-query == $name and $declaration{
$breakpoint-found: true;
@media only screen and #{$declaration}{
@content;
}
}
}
@if $breakpoint-found == false{
@warn "Breakpoint #{$media-query} does not exist"
}
}
/**
* Drop relative positioning into silent classes which cant take advantage of
* the `[class*="push--"]` and `[class*="pull--"]` selectors.
*/
@mixin silent-relative(){
@if $use-silent-classes == true{
position:relative;
}
}
/*------------------------------------*\
$GRID SETUP
\*------------------------------------*/
/**
* 1. Allow the grid system to be used on lists.
* 2. Remove any margins and paddings that might affect the grid system.
* 3. Apply a negative `margin-left` to negate the columns gutters.
*/
#{$class-type}grid{
list-style:none; /* [1] */
margin:0; /* [2] */
padding:0; /* [2] */
margin-left:-$gutter; /* [3] */
@if $use-markup-fix != true{
letter-spacing:-0.31em;
}
}
@if $use-markup-fix != true{
/* Opera hack */
.opera:-o-prefocus,
#{$class-type}grid{
word-spacing:-0.43em;
}
}
/**
* 1. Cause columns to stack side-by-side.
* 2. Space columns apart.
* 3. Align columns to the tops of each other.
* 4. Full-width unless told to behave otherwise.
* 5. Required to combine fluid widths and fixed gutters.
*/
#{$class-type}grid__item{
display:inline-block; /* [1] */
padding-left:$gutter; /* [2] */
vertical-align:top; /* [3] */
@if $mobile-first == true{
width:100%; /* [4] */
}
-webkit-box-sizing:border-box; /* [5] */
-moz-box-sizing:border-box; /* [5] */
box-sizing:border-box; /* [5] */
@if $use-markup-fix != true{
letter-spacing:normal;
word-spacing:normal;
}
}
/**
* Reversed grids allow you to structure your source in the opposite order to
* how your rendered layout will appear. Extends `.grid`.
*/
#{$class-type}grid--rev{
direction:rtl;
text-align:left;
> #{$class-type}grid__item{
direction:ltr;
text-align:left;
}
}
/**
* Gutterless grids have all the properties of regular grids, minus any spacing.
* Extends `.grid`.
*/
#{$class-type}grid--full{
margin-left:0;
> #{$class-type}grid__item{
padding-left:0;
}
}
/**
* Align the entire grid to the right. Extends `.grid`.
*/
#{$class-type}grid--right{
text-align:right;
> #{$class-type}grid__item{
text-align:left;
}
}
/**
* Centered grids align grid items centrally without needing to use push or pull
* classes. Extends `.grid`.
*/
#{$class-type}grid--center{
text-align:center;
> #{$class-type}grid__item{
text-align:left;
}
}
/**
* Align grid cells vertically (`.grid--middle` or `.grid--bottom`). Extends
* `.grid`.
*/
#{$class-type}grid--middle{
> #{$class-type}grid__item{
vertical-align:middle;
}
}
#{$class-type}grid--bottom{
> #{$class-type}grid__item{
vertical-align:bottom;
}
}
/**
* Create grids with narrower gutters. Extends `.grid`.
*/
#{$class-type}grid--narrow{
margin-left:-($gutter / 2);
> #{$class-type}grid__item{
padding-left:$gutter / 2;
}
}
/**
* Create grids with wider gutters. Extends `.grid`.
*/
#{$class-type}grid--wide{
margin-left:-($gutter * 2);
> #{$class-type}grid__item{
padding-left:$gutter * 2;
}
}
/*------------------------------------*\
$WIDTHS
\*------------------------------------*/
/**
* Create our width classes, prefixed by the specified namespace.
*/
@mixin device-type($namespace:""){
/**
* Whole
*/
#{$class-type}#{$namespace}one-whole { width:100%; }
/**
* Halves
*/
#{$class-type}#{$namespace}one-half { width:50%; }
/**
* Thirds
*/
#{$class-type}#{$namespace}one-third { width:33.333%; }
#{$class-type}#{$namespace}two-thirds { width:66.666%; }
/**
* Quarters
*/
#{$class-type}#{$namespace}one-quarter { width:25%; }
#{$class-type}#{$namespace}two-quarters { @extend #{$class-type}#{$namespace}one-half; }
#{$class-type}#{$namespace}three-quarters { width:75%; }
/**
* Fifths
*/
#{$class-type}#{$namespace}one-fifth { width:20%; }
#{$class-type}#{$namespace}two-fifths { width:40%; }
#{$class-type}#{$namespace}three-fifths { width:60%; }
#{$class-type}#{$namespace}four-fifths { width:80%; }
/**
* Sixths
*/
#{$class-type}#{$namespace}one-sixth { width:16.666%; }
#{$class-type}#{$namespace}two-sixths { @extend #{$class-type}#{$namespace}one-third; }
#{$class-type}#{$namespace}three-sixths { @extend #{$class-type}#{$namespace}one-half; }
#{$class-type}#{$namespace}four-sixths { @extend #{$class-type}#{$namespace}two-thirds; }
#{$class-type}#{$namespace}five-sixths { width:83.333%; }
/**
* Eighths
*/
#{$class-type}#{$namespace}one-eighth { width:12.5%; }
#{$class-type}#{$namespace}two-eighths { @extend #{$class-type}#{$namespace}one-quarter; }
#{$class-type}#{$namespace}three-eighths { width:37.5%; }
#{$class-type}#{$namespace}four-eighths { @extend #{$class-type}#{$namespace}one-half; }
#{$class-type}#{$namespace}five-eighths { width:62.5%; }
#{$class-type}#{$namespace}six-eighths { @extend #{$class-type}#{$namespace}three-quarters; }
#{$class-type}#{$namespace}seven-eighths { width:87.5%; }
/**
* Tenths
*/
#{$class-type}#{$namespace}one-tenth { width:10%; }
#{$class-type}#{$namespace}two-tenths { @extend #{$class-type}#{$namespace}one-fifth; }
#{$class-type}#{$namespace}three-tenths { width:30%; }
#{$class-type}#{$namespace}four-tenths { @extend #{$class-type}#{$namespace}two-fifths; }
#{$class-type}#{$namespace}five-tenths { @extend #{$class-type}#{$namespace}one-half; }
#{$class-type}#{$namespace}six-tenths { @extend #{$class-type}#{$namespace}three-fifths; }
#{$class-type}#{$namespace}seven-tenths { width:70%; }
#{$class-type}#{$namespace}eight-tenths { @extend #{$class-type}#{$namespace}four-fifths; }
#{$class-type}#{$namespace}nine-tenths { width:90%; }
/**
* Twelfths
*/
#{$class-type}#{$namespace}one-twelfth { width:8.333%; }
#{$class-type}#{$namespace}two-twelfths { @extend #{$class-type}#{$namespace}one-sixth; }
#{$class-type}#{$namespace}three-twelfths { @extend #{$class-type}#{$namespace}one-quarter; }
#{$class-type}#{$namespace}four-twelfths { @extend #{$class-type}#{$namespace}one-third; }
#{$class-type}#{$namespace}five-twelfths { width:41.666% }
#{$class-type}#{$namespace}six-twelfths { @extend #{$class-type}#{$namespace}one-half; }
#{$class-type}#{$namespace}seven-twelfths { width:58.333%; }
#{$class-type}#{$namespace}eight-twelfths { @extend #{$class-type}#{$namespace}two-thirds; }
#{$class-type}#{$namespace}nine-twelfths { @extend #{$class-type}#{$namespace}three-quarters; }
#{$class-type}#{$namespace}ten-twelfths { @extend #{$class-type}#{$namespace}five-sixths; }
#{$class-type}#{$namespace}eleven-twelfths { width:91.666%; }
}
/**
* Our regular, non-responsive width classes.
*/
@include device-type();
/**
* Our responsive classes, if we have enabled them.
*/
@if $responsive == true{
@each $name in $breakpoint-has-widths {
@include grid-media-query($name) {
@include device-type('#{$name}--');
}
}
}
/*------------------------------------*\
$PUSH
\*------------------------------------*/
/**
* Push classes, to move grid items over to the right by certain amounts.
*/
@mixin push-setup($namespace: ""){
/**
* Whole
*/
#{$class-type}push--#{$namespace}one-whole { left:100%; @include silent-relative(); }
/**
* Halves
*/
#{$class-type}push--#{$namespace}one-half { left:50%; @include silent-relative(); }
/**
* Thirds
*/
#{$class-type}push--#{$namespace}one-third { left:33.333%; @include silent-relative(); }
#{$class-type}push--#{$namespace}two-thirds { left:66.666%; @include silent-relative(); }
/**
* Quarters
*/
#{$class-type}push--#{$namespace}one-quarter { left:25%; @include silent-relative(); }
#{$class-type}push--#{$namespace}two-quarters { @extend #{$class-type}push--#{$namespace}one-half; }
#{$class-type}push--#{$namespace}three-quarters { left:75%; @include silent-relative(); }
/**
* Fifths
*/
#{$class-type}push--#{$namespace}one-fifth { left:20%; @include silent-relative(); }
#{$class-type}push--#{$namespace}two-fifths { left:40%; @include silent-relative(); }
#{$class-type}push--#{$namespace}three-fifths { left:60%; @include silent-relative(); }
#{$class-type}push--#{$namespace}four-fifths { left:80%; @include silent-relative(); }
/**
* Sixths
*/
#{$class-type}push--#{$namespace}one-sixth { left:16.666%; @include silent-relative(); }
#{$class-type}push--#{$namespace}two-sixths { @extend #{$class-type}push--#{$namespace}one-third; }
#{$class-type}push--#{$namespace}three-sixths { @extend #{$class-type}push--#{$namespace}one-half; }
#{$class-type}push--#{$namespace}four-sixths { @extend #{$class-type}push--#{$namespace}two-thirds; }
#{$class-type}push--#{$namespace}five-sixths { left:83.333%; @include silent-relative(); }
/**
* Eighths
*/
#{$class-type}push--#{$namespace}one-eighth { left:12.5%; @include silent-relative(); }
#{$class-type}push--#{$namespace}two-eighths { @extend #{$class-type}push--#{$namespace}one-quarter; }
#{$class-type}push--#{$namespace}three-eighths { left:37.5%; @include silent-relative(); }
#{$class-type}push--#{$namespace}four-eighths { @extend #{$class-type}push--#{$namespace}one-half; }
#{$class-type}push--#{$namespace}five-eighths { left:62.5%; @include silent-relative(); }
#{$class-type}push--#{$namespace}six-eighths { @extend #{$class-type}push--#{$namespace}three-quarters; }
#{$class-type}push--#{$namespace}seven-eighths { left:87.5%; @include silent-relative(); }
/**
* Tenths
*/
#{$class-type}push--#{$namespace}one-tenth { left:10%; @include silent-relative(); }
#{$class-type}push--#{$namespace}two-tenths { @extend #{$class-type}push--#{$namespace}one-fifth; }
#{$class-type}push--#{$namespace}three-tenths { left:30%; @include silent-relative(); }
#{$class-type}push--#{$namespace}four-tenths { @extend #{$class-type}push--#{$namespace}two-fifths; }
#{$class-type}push--#{$namespace}five-tenths { @extend #{$class-type}push--#{$namespace}one-half; }
#{$class-type}push--#{$namespace}six-tenths { @extend #{$class-type}push--#{$namespace}three-fifths; }
#{$class-type}push--#{$namespace}seven-tenths { left:70%; @include silent-relative(); }
#{$class-type}push--#{$namespace}eight-tenths { @extend #{$class-type}push--#{$namespace}four-fifths; }
#{$class-type}push--#{$namespace}nine-tenths { left:90%; @include silent-relative(); }
/**
* Twelfths
*/
#{$class-type}push--#{$namespace}one-twelfth { left:8.333%; @include silent-relative(); }
#{$class-type}push--#{$namespace}two-twelfths { @extend #{$class-type}push--#{$namespace}one-sixth; }
#{$class-type}push--#{$namespace}three-twelfths { @extend #{$class-type}push--#{$namespace}one-quarter; }
#{$class-type}push--#{$namespace}four-twelfths { @extend #{$class-type}push--#{$namespace}one-third; }
#{$class-type}push--#{$namespace}five-twelfths { left:41.666%; @include silent-relative(); }
#{$class-type}push--#{$namespace}six-twelfths { @extend #{$class-type}push--#{$namespace}one-half; }
#{$class-type}push--#{$namespace}seven-twelfths { left:58.333%; @include silent-relative(); }
#{$class-type}push--#{$namespace}eight-twelfths { @extend #{$class-type}push--#{$namespace}two-thirds; }
#{$class-type}push--#{$namespace}nine-twelfths { @extend #{$class-type}push--#{$namespace}three-quarters; }
#{$class-type}push--#{$namespace}ten-twelfths { @extend #{$class-type}push--#{$namespace}five-sixths; }
#{$class-type}push--#{$namespace}eleven-twelfths { left:91.666%; @include silent-relative(); }
}
@if $push == true {
/**
* Not a particularly great selector, but the DRYest way to do things.
*/
[class*="push--"]{ position:relative; }
@include push-setup();
@if $responsive == true{
@each $name in $breakpoint-has-push {
@include grid-media-query($name) {
@include push-setup('#{$name}--');
}
}
}
}
/*------------------------------------*\
$PULL
\*------------------------------------*/
/**
* Pull classes, to move grid items back to the left by certain amounts.
*/
@mixin pull-setup($namespace: ""){
/**
* Whole
*/
#{$class-type}pull--#{$namespace}one-whole { right:100%; @include silent-relative(); }
/**
* Halves
*/
#{$class-type}pull--#{$namespace}one-half { right:50%; @include silent-relative(); }
/**
* Thirds
*/
#{$class-type}pull--#{$namespace}one-third { right:33.333%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}two-thirds { right:66.666%; @include silent-relative(); }
/**
* Quarters
*/
#{$class-type}pull--#{$namespace}one-quarter { right:25%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}two-quarters { @extend #{$class-type}pull--#{$namespace}one-half; }
#{$class-type}pull--#{$namespace}three-quarters { right:75%; @include silent-relative(); }
/**
* Fifths
*/
#{$class-type}pull--#{$namespace}one-fifth { right:20%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}two-fifths { right:40%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}three-fifths { right:60%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}four-fifths { right:80%; @include silent-relative(); }
/**
* Sixths
*/
#{$class-type}pull--#{$namespace}one-sixth { right:16.666%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}two-sixths { @extend #{$class-type}pull--#{$namespace}one-third; }
#{$class-type}pull--#{$namespace}three-sixths { @extend #{$class-type}pull--#{$namespace}one-half; }
#{$class-type}pull--#{$namespace}four-sixths { @extend #{$class-type}pull--#{$namespace}two-thirds; }
#{$class-type}pull--#{$namespace}five-sixths { right:83.333%; @include silent-relative(); }
/**
* Eighths
*/
#{$class-type}pull--#{$namespace}one-eighth { right:12.5%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}two-eighths { @extend #{$class-type}pull--#{$namespace}one-quarter; }
#{$class-type}pull--#{$namespace}three-eighths { right:37.5%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}four-eighths { @extend #{$class-type}pull--#{$namespace}one-half; }
#{$class-type}pull--#{$namespace}five-eighths { right:62.5%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}six-eighths { @extend #{$class-type}pull--#{$namespace}three-quarters; }
#{$class-type}pull--#{$namespace}seven-eighths { right:87.5%; @include silent-relative(); }
/**
* Tenths
*/
#{$class-type}pull--#{$namespace}one-tenth { right:10%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}two-tenths { @extend #{$class-type}pull--#{$namespace}one-fifth; }
#{$class-type}pull--#{$namespace}three-tenths { right:30%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}four-tenths { @extend #{$class-type}pull--#{$namespace}two-fifths; }
#{$class-type}pull--#{$namespace}five-tenths { @extend #{$class-type}pull--#{$namespace}one-half; }
#{$class-type}pull--#{$namespace}six-tenths { @extend #{$class-type}pull--#{$namespace}three-fifths; }
#{$class-type}pull--#{$namespace}seven-tenths { right:70%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}eight-tenths { @extend #{$class-type}pull--#{$namespace}four-fifths; }
#{$class-type}pull--#{$namespace}nine-tenths { right:90%; @include silent-relative(); }
/**
* Twelfths
*/
#{$class-type}pull--#{$namespace}one-twelfth { right:8.333%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}two-twelfths { @extend #{$class-type}pull--#{$namespace}one-sixth; }
#{$class-type}pull--#{$namespace}three-twelfths { @extend #{$class-type}pull--#{$namespace}one-quarter; }
#{$class-type}pull--#{$namespace}four-twelfths { @extend #{$class-type}pull--#{$namespace}one-third; }
#{$class-type}pull--#{$namespace}five-twelfths { right:41.666%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}six-twelfths { @extend #{$class-type}pull--#{$namespace}one-half; }
#{$class-type}pull--#{$namespace}seven-twelfths { right:58.333%; @include silent-relative(); }
#{$class-type}pull--#{$namespace}eight-twelfths { @extend #{$class-type}pull--#{$namespace}two-thirds; }
#{$class-type}pull--#{$namespace}nine-twelfths { @extend #{$class-type}pull--#{$namespace}three-quarters; }
#{$class-type}pull--#{$namespace}ten-twelfths { @extend #{$class-type}pull--#{$namespace}five-sixths; }
#{$class-type}pull--#{$namespace}eleven-twelfths { right:91.666%; @include silent-relative(); }
}
@if $pull == true{
/**
* Not a particularly great selector, but the DRYest way to do things.
*/
[class*="pull--"]{ position:relative; }
@include pull-setup();
@if $responsive == true{
@each $name in $breakpoint-has-pull {
@include grid-media-query($name) {
@include pull-setup('#{$name}--');
}
}
}
}

@ -0,0 +1,53 @@
/*
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* `contenteditable` attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.clearfix:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
/*
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.clearfix {
*zoom: 1;
}
.pull-left {
float: left;
}
.pull-right {
float: right;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

@ -0,0 +1,82 @@
body {
font-family: 'Ubuntu', sans-serif;
}
/* lets have some constraints shall we */
.container-fluid {
max-width: 93%;
margin-left: auto;
margin-right: auto;
}
.row.row--full {
margin-left: 0;
}
// Links
a {
&,
&:visited {
color: $river;
}
&:hover {
text-decoration: none;
}
&:active {
color: $emerald;
}
}
h1 {
margin: 20px 0;
font-weight: 300;
font-size: 4em;
line-height: 1;
color: $emerald;
}
h2 {
position: relative;
color: $wetAsphalt;
font-size: 2.5em;
// border-bottom: 2px solid $emerald;
margin-bottom: 18px;
&:after {
content: '';
position: absolute;
bottom: 4px;
left: 0;
z-index: -1;
width: 100%;
height: 2px;
background-color: $emerald;
}
}
nav > a {
display: block;
margin: 5px 0;
}
// Filters
.filter__label {
margin: 0 0 3px;
}

@ -0,0 +1,396 @@
/*! normalize.css v2.1.2 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
/**
* Correct `inline-block` display not defined in IE 8/9.
*/
audio,
canvas,
video {
display: inline-block;
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address styling not present in IE 8/9.
*/
[hidden] {
display: none;
}
/* ==========================================================================
Base
========================================================================== */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
/**
* Address `outline` inconsistency between Chrome and other browsers.
*/
a:focus {
outline: thin dotted;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* ==========================================================================
Typography
========================================================================== */
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari 5, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9, Safari 5, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Correct font family set oddly in Safari 5 and Chrome.
*/
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
/**
* Improve readability of pre-formatted text in all browsers.
*/
pre {
white-space: pre-wrap;
}
/**
* Set consistent quote types.
*/
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* ==========================================================================
Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9.
*/
img {
border: 0;
}
/**
* Correct overflow displayed oddly in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
/* ==========================================================================
Figures
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari 5.
*/
figure {
margin: 0;
}
/* ==========================================================================
Forms
========================================================================== */
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Correct font family not being inherited in all browsers.
* 2. Correct font size not being inherited in all browsers.
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
*/
button,
input,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 2 */
margin: 0; /* 3 */
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
button,
input {
line-height: normal;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
* Correct `select` style inheritance in Firefox 4+ and Opera.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* 1. Address box sizing set to `content-box` in IE 8/9.
* 2. Remove excess padding in IE 8/9.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari 5 and Chrome
* on OS X.
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* 1. Remove default vertical scrollbar in IE 8/9.
* 2. Improve readability and alignment in all browsers.
*/
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
/* ==========================================================================
Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}

@ -0,0 +1,63 @@
/*
Some colors from Flat UI
Firm/Turquiose: #1ABC9C;
Success/Emerald: #2ECC71;
Info/River: #3498DB;
Amethyst: #9B59B6;
Night/Wet Asphalt: #34495E;
Bright/Sunflower: #F1C40F;
Bright/Organge: #F39C12;
Carrot: #E67E22;
Alizarin: #E74C3C;
Clouds: #ECF0F1;
Concrete: #95A5A6;
*/
$turqoise: #1ABC9C;
$greenSea: #16A085;
$emerald: #2ECC71;
$nephritis: #27AE60;
$river: #3498DB;
$belizeHole: #2980B9;
$amethyst: #9B59B6;
$wisteria: #8E44AD;
$wetAsphalt: #34495E;
$midnightBlue: #2C3E50;
$sunflower: #F1C40F;
$orange: #F39C12;
$carrot: #E67E22;
$pumpkin: #D35400;
$alizarin: #E74C3C;
$pomegranate: #C0392B;
$clouds: #ECF0F1;
$silver: #BDC3C7;
$concrete: #95A5A6;
$asbestos: #7F8C8D;
@mixin clearfix() {
&:before,
&:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
& {
*zoom: 1;
}
}

@ -0,0 +1,207 @@
*,
::before,
::after {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body { background: #EEE; color: #333; }
body::before {
content: 'Default - 940px';
position: fixed;
z-index: 5;
top: 0;
left: 0;
width: 100%;
height: 25px;
background-color: hsla(110, 50%, 60%, .6);
-webkit-transition: background .2s ease;
-o-transition: background .2s ease;
transition: background .2s ease;
}
@media (min-width: 1200px) {
body::before {
content: 'Large Desktop - 1200px+';
background-color: hsla(10, 50%, 60%, .6);
}
}
@media (min-width: 768px) and (max-width: 979px) {
body::before {
content: 'Portrait tablet to landscape and desktop - > 768px && < 979px';
background-color: hsla(50, 50%, 60%, .6);
}
}
@media (max-width: 767px) {
body::before {
content: 'Phones to Tablets - < 767px';
background-color: hsla(210, 50%, 60%, .6);
}
}
@media (max-width: 480px) {
body::before {
content: 'Phones - < 480px';
background-color: hsla(300, 50%, 60%, .6);
}
}
/*Hero image*/
.hero {
position: relative;
overflow: hidden;
}
.hero img {
display: block;
width: 100%;
}
.hero-text {
color: #fff;
}
/* Gallery */
.product {
margin: 20px 0 0;
height: 200px;
overflow: hidden;
}
.product.w2 {
/*width: ;*/
}
.product.link {
padding: 70px 20px 0;
background-color: hsl(110, 50%, 60%);
}
.product.h2 {
height: 420px;
}
@media (min-width: 1200px) {
.product {
margin-top: 30px;
}
.product.h2 {
height: 430px;
}
}
@media (min-width: 768px) and (max-width: 979px) {
/*.product {
margin-top: 20px;
}
.product.h2 {
height: 420px;
}*/
}
@media (max-width: 767px) {
.product {
margin-top: 10px;
}
.product.h2 {
height: 410px;
}
}
/* Show what the data-* attributes are */
.product:before {
content: attr(data-groups);
position: absolute;
top: 0;
left: 0;
color: white;
text-shadow: -1px 0 0 black, 0 -1px 0 black, 1px 0 0 black, 0 1px 0 black;
font-family: Menlo;
}
/* Show what the data-* attributes are */
.product:after {
content: attr(data-megapixels) 'MP :: $' attr(data-price);
position: absolute;
top: 40px;
left: 0;
color: white;
text-shadow: -1px 0 0 black, 0 -1px 0 black, 1px 0 0 black, 0 1px 0 black;
font-family: Menlo;
}
.product-content {
padding: 10px;
}
.product-img {
text-align: center;
}
.product-meta-name {
text-transform: uppercase;
font-family: sans-serif;
font-size: 12px;
}
/* Helpers */
.box {
background: #444;
color: #f2f2f2;
box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.full {
position: absolute;
top: 0;
left: 0;
z-index: 5;
width: 100%;
height: 100%;
}
.ghost-center-wrap:before {
content: '';
display: inline-block;
vertical-align: middle;
width: 0;
height: 100%;
}
.ghost-center {
display: inline-block;
vertical-align: middle;
margin: 0;
}
/* filters */
.filter-options {
margin: 20px 0;
}
@media (max-width: 767px) {
.product {
display: table;
}
.product-img {
display: table-cell;
width: 33.33%;
vertical-align: middle;
}
.product-content {
display: table-cell;
width: 66.66%;
}
}

@ -0,0 +1,30 @@
/*=============================================*\
Some styles to show off masonry layout
\*=============================================*/
$pictureGutter: 24px;
.picture-item {
height: 210px;
margin-top: $pictureGutter;
overflow: hidden;
&.picture-item--h2 {
height: 420px;
}
.picture-item__details {
}
.picture-item__title {
}
}
// .item.w2 {
// width: 480px;
// }
.item.w2.h2 img {
width: 100%;
height: auto;
}

@ -0,0 +1,9 @@
@import "variables";
@import "normalize.scss";
// @import "csswizardry-grids";
@import "bootstrap.scss";
@import "main.scss";
@import "buttons.scss";
@import "helpers.scss";

@ -2,10 +2,11 @@
::before,
::after {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
box-sizing: border-box; }
body { background: #EEE; color: #333; }
body {
background: #EEE;
color: #333; }
body::before {
content: 'Default - 940px';
@ -15,86 +16,61 @@ body::before {
left: 0;
width: 100%;
height: 25px;
background-color: hsla(110, 50%, 60%, .6);
background-color: rgba(119, 204, 102, 0.6);
-webkit-transition: background .2s ease;
-o-transition: background .2s ease;
transition: background .2s ease;
}
-o-transition: background .2s ease;
transition: background .2s ease; }
@media (min-width: 1200px) {
body::before {
content: 'Large Desktop - 1200px+';
background-color: hsla(10, 50%, 60%, .6);
}
}
background-color: rgba(204, 119, 102, 0.6); } }
@media (min-width: 768px) and (max-width: 979px) {
body::before {
content: 'Portrait tablet to landscape and desktop - > 768px && < 979px';
background-color: hsla(50, 50%, 60%, .6);
}
}
background-color: rgba(204, 187, 102, 0.6); } }
@media (max-width: 767px) {
body::before {
content: 'Phones to Tablets - < 767px';
background-color: hsla(210, 50%, 60%, .6);
}
}
background-color: rgba(102, 153, 204, 0.6); } }
@media (max-width: 480px) {
body::before {
content: 'Phones - < 480px';
background-color: hsla(300, 50%, 60%, .6);
}
}
background-color: rgba(204, 102, 204, 0.6); } }
/*Hero image*/
.hero {
position: relative;
overflow: hidden;
}
overflow: hidden; }
.hero img {
display: block;
width: 100%;
}
width: 100%; }
.hero-text {
color: #fff;
}
color: #fff; }
/* Gallery */
.product {
margin: 20px 0 0;
height: 200px;
overflow: hidden;
}
overflow: hidden; }
.product.w2 {
/*width: ;*/
}
/*width: ;*/ }
.product.link {
padding: 70px 20px 0;
background-color: hsl(110, 50%, 60%);
}
background-color: #77cc66; }
.product.h2 {
height: 420px;
}
height: 420px; }
@media (min-width: 1200px) {
.product {
margin-top: 30px;
}
margin-top: 30px; }
.product.h2 {
height: 430px;
}
}
height: 430px; } }
@media (min-width: 768px) and (max-width: 979px) {
/*.product {
margin-top: 20px;
@ -102,19 +78,13 @@ body::before {
.product.h2 {
height: 420px;
}*/
}
}*/ }
@media (max-width: 767px) {
.product {
margin-top: 10px;
}
margin-top: 10px; }
.product.h2 {
height: 410px;
}
}
height: 410px; } }
/* Show what the data-* attributes are */
.product:before {
content: attr(data-groups);
@ -123,40 +93,34 @@ body::before {
left: 0;
color: white;
text-shadow: -1px 0 0 black, 0 -1px 0 black, 1px 0 0 black, 0 1px 0 black;
font-family: Menlo;
}
font-family: Menlo; }
/* Show what the data-* attributes are */
.product:after {
content: attr(data-megapixels) 'MP :: $' attr(data-price);
content: attr(data-megapixels) "MP :: $" attr(data-price);
position: absolute;
top: 40px;
left: 0;
color: white;
text-shadow: -1px 0 0 black, 0 -1px 0 black, 1px 0 0 black, 0 1px 0 black;
font-family: Menlo;
}
font-family: Menlo; }
.product-content {
padding: 10px;
}
padding: 10px; }
.product-img {
text-align: center;
}
text-align: center; }
.product-meta-name {
text-transform: uppercase;
font-family: sans-serif;
font-size: 12px;
}
font-size: 12px; }
/* Helpers */
.box {
background: #444;
color: #f2f2f2;
box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.full {
position: absolute;
@ -164,44 +128,33 @@ body::before {
left: 0;
z-index: 5;
width: 100%;
height: 100%;
}
height: 100%; }
.ghost-center-wrap:before {
content: '';
display: inline-block;
vertical-align: middle;
width: 0;
height: 100%;
}
height: 100%; }
.ghost-center {
display: inline-block;
vertical-align: middle;
margin: 0;
}
margin: 0; }
/* filters */
.filter-options {
margin: 20px 0;
}
margin: 20px 0; }
@media (max-width: 767px) {
.product {
display: table;
}
display: table; }
.product-img {
display: table-cell;
width: 33.33%;
vertical-align: middle;
}
vertical-align: middle; }
.product-content {
display: table-cell;
width: 66.66%;
}
}
width: 66.66%; } }

@ -1,13 +1,13 @@
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
text-shadow: 0px 1px rgba(0,0,0,0.3);
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
direction: ltr;
text-align: left;
@ -24,6 +24,13 @@ pre[class*="language-"] {
hyphens: none;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
@ -33,7 +40,7 @@ pre[class*="language-"] {
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
background: #f5f2f0;
}
/* Inline code */
@ -46,63 +53,49 @@ pre[class*="language-"] {
.token.prolog,
.token.doctype,
.token.cdata {
color: #75715E;
color: slategray;
}
.token.punctuation {
color: #f8f8f2;
color: #999;
}
.namespace {
opacity: .7;
}
.token.tag {
color: #f92672;
}
.token.property {
color: #66d9ef;
font-style: italic;
}
.token.property,
.token.tag,
.token.boolean,
.token.number{
color: #ae81ff;
.token.number {
color: #905;
}
.token.selector,
.token.attr-name {
color: #a6e22e;
}
.token.attr-name,
.token.string {
color: #e6db74;
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #f8f8f2;
color: #a67f59;
background: hsla(0,0%,100%,.5);
}
.token.atrule,
.token.attr-value {
color: #e6db74;
}
.token.operator {
color: #f92672;
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.keyword{
color: #66d9ef;
}
.token.regex,
.token.important {
color: #fd971f;
color: #e90;
}
.token.important {
@ -111,4 +104,4 @@ pre[class*="language-"] {
.token.entity {
cursor: help;
}
}

@ -1,23 +1,13 @@
/*=============================================*\
Some styles to show off masonry layout
\*=============================================*/
.item {
width: 230px;
height: 200px;
overflow: hidden;
margin-top: 20px;
margin-right: 20px;
}
.item.w2 {
width: 480px;
}
.picture-item {
height: 210px;
margin-top: 24px;
overflow: hidden; }
.picture-item.picture-item--h2 {
height: 420px; }
.item.w2.h2 img {
width: 100%;
height: auto;
}
.item.h2 {
height: 420px;
}
width: 100%;
height: auto; }

File diff suppressed because it is too large Load Diff

@ -4,173 +4,192 @@ title: jQuery Shuffle Plugin
bodyClass: home
extraJS: [ "homepage.js" ]
---
<div>
<header>
<h1 class="special">Shuffle</h1>
<p>Categorize, sort, and filter a responsive grid of items</p>
</header>
<section class="downloads">
<h2>Downloads</h2>
<a href="js/jquery.shuffle.js">jquery.shuffle.js</a>
<a href="js/jquery.shuffle.min.js">jquery.shuffle.min.js</a>
</section>
<section>
<h2>Example</h2>
<div class="filter clearfix">
<p class="lfloat label">Filter:</p>
<ul class="filter-options control-group lfloat">
<li data-group="all" class="active">Most Recent</li>
<li data-group="wallpaper">Wallpapers</li>
<li data-group="graphics">Graphic Design</li>
<li data-group="photography">Photography</li>
<li data-group="3d">3D Renders</li>
</ul>
<p class="lfloat label">Sort:</p>
<ul class="sort-options control-group lfloat">
<li data-sort class="active">Default</li>
<li data-sort="title">Title</li>
<li data-sort="date-created">Date Created</li>
</ul>
<input class="search label" type="search" placeholder="Search..." />
</div>
<div id="grid" class="container">
{% for item in site.items %}
{% assign item = item %}
{% include picture-item.html %}
{% endfor %}
<!-- <div class="item" data-groups='["photography"]' data-date-created="2010-09-14" data-title="Baseball">
<img src="img/baseball.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Baseball</span>
<a href="img/originals/baseball.jpg">Photography</a>
</div>
</div>
<div class="item w2" data-groups='["wallpaper", "3d"]' data-date-created="2011-08-14" data-title="Tennis">
<p class="rfloat">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.</p>
<img src="img/tennis-ball.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Tennis</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item" data-groups='["3d", "wallpaper"]' data-date-created="2009-05-27" data-title="iMac">
<img src="img/imac.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">iMac</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item h2" data-groups='["graphics"]' data-date-created="2012-05-14" data-title="Master Chief">
<img src="img/master-chief.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Master Chief</span>
<a href="#">Graphic Design</a>
<p>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.</p>
</div>
</div>
<div class="item" data-groups='["3d", "wallpaper"]' data-date-created="2012-09-14" data-title="Eightfold">
<img src="img/es-blue.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Eightfold</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item w2" data-groups='["photography"]' data-date-created="2012-03-14" data-title="Pumpkin">
<p class="rfloat">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.</p>
<img src="img/pumpkin.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Pumpkin</span>
<a href="#">Photography</a>
</div>
</div>
<div class="item w2 h2" data-groups='["3d", "wallpaper"]' data-date-created="2012-09-14" data-title="Vestride">
<img src="img/vestride-red.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Vestride</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item h2" data-groups='["graphics"]' data-date-created="2012-01-12" data-title="Newegg">
<img src="img/newegg.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Newegg</span>
<a href="#">Motion Graphics</a>
<p>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.</p>
</div>
</div>
<div class="item" data-groups='["wallpaper"]' data-date-created="2012-01-14" data-title="Arc">
<img src="img/eightfoldarc.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Arc</span>
<a href="#">Wallpaper</a>
</div>
</div>
<div class="item" data-groups='["photography"]' data-date-created="2011-01-14" data-title="Ground">
<img src="img/ground.png" alt="" height="145" width="230"/>
<div class="item-details">
<span class="title">Ground</span>
<a href="img/originals/baseball.jpg">Photography</a>
</div>
</div>
<div class="item w2" data-groups='["wallpaper"]' data-date-created="2011-12-14" data-title="Grass">
<p class="rfloat">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.</p>
<img src="img/grassy-hills.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Grass</span>
<a href="#">Wallpaper</a>
</div>
</div>
<div class="item" data-groups='["3d", "wallpaper"]' data-date-created="2012-04-14" data-title="Vestride">
<img src="img/vestride-classy.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Vestride</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div> -->
</div>
</section>
<section>
<h2>Other Examples</h2>
<ul>
<li><a href="{% post_url demos/2013-05-01-basic %}">Basic masonry layout</a></li>
<li><a href="{% post_url demos/2013-05-03-minimal %}">The minimal markup with filters</a></li>
<li><a href="{% post_url demos/2013-05-02-adaptive %}">Twitter bootstrap adaptive masonry with compounded filters</a></li>
</ul>
</section>
<section>
<h2>Features</h2>
<ul>
<li>Uses CSS Transitions!</li>
<li>Responsive (try resizing the window!)</li>
<li>Filter items by groups</li>
<li>Items can have multiple groups and be different sizes</li>
<li>Sort items</li>
<li>Advanced filtering method (like searching)</li>
</ul>
</section>
<section>
<h2>Options</h2>
<div>
<p>Settings you can change (these are the defaults)</p>
<pre rel="JavaScript">
<header class="container-fluid">
<div class="row-fluid">
<div class="span7">
<h1>Shuffle</h1>
<p>Categorize, sort, and filter a responsive grid of items</p>
</div>
</div>
</header>
<section>
<div class="container-fluid">
<h2>Downloads</h2>
<nav role="secondary">
<a href="js/jquery.shuffle.js">jquery.shuffle.js</a>
<a href="js/jquery.shuffle.min.js">jquery.shuffle.min.js</a>
</nav>
</div>
</section>
<section>
<div class="container-fluid">
<h2>Example</h2>
</div>
<div class="container-fluid filter">
<div class="row-fluid">
<p class="filter__label">Filter:</p>
<div class="filter-options btn-group">
<button class="btn btn--filter" data-group="wallpaper">Wallpapers</button>
<button class="btn btn--filter" data-group="graphics">Graphic Design</button>
<button class="btn btn--filter" data-group="photography">Photography</button>
<button class="btn btn--filter" data-group="3d">3D Renders</button>
</div>
</div>
<div class="row-fluid">
<p class="filter__label">Sort:</p>
<div class="sort-options btn-group">
<button class="btn btn--sort" data-sort class="active">Default</button>
<button class="btn btn--sort" data-sort="title">Title</button>
<button class="btn btn--sort" data-sort="date-created">Date Created</button>
</div>
<input class="search label" type="search" placeholder="Search..." />
</div>
</div>
<div id="grid" class="container-fluid">
{% for item in site.items %}
{% assign item = item %}
{% include picture-item.html %}
{% endfor %}
<!-- <div class="item" data-groups='["photography"]' data-date-created="2010-09-14" data-title="Baseball">
<img src="img/baseball.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Baseball</span>
<a href="img/originals/baseball.jpg">Photography</a>
</div>
</div>
<div class="item w2" data-groups='["wallpaper", "3d"]' data-date-created="2011-08-14" data-title="Tennis">
<p class="rfloat">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.</p>
<img src="img/tennis-ball.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Tennis</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item" data-groups='["3d", "wallpaper"]' data-date-created="2009-05-27" data-title="iMac">
<img src="img/imac.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">iMac</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item h2" data-groups='["graphics"]' data-date-created="2012-05-14" data-title="Master Chief">
<img src="img/master-chief.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Master Chief</span>
<a href="#">Graphic Design</a>
<p>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.</p>
</div>
</div>
<div class="item" data-groups='["3d", "wallpaper"]' data-date-created="2012-09-14" data-title="Eightfold">
<img src="img/es-blue.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Eightfold</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item w2" data-groups='["photography"]' data-date-created="2012-03-14" data-title="Pumpkin">
<p class="rfloat">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.</p>
<img src="img/pumpkin.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Pumpkin</span>
<a href="#">Photography</a>
</div>
</div>
<div class="item w2 h2" data-groups='["3d", "wallpaper"]' data-date-created="2012-09-14" data-title="Vestride">
<img src="img/vestride-red.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Vestride</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div>
<div class="item h2" data-groups='["graphics"]' data-date-created="2012-01-12" data-title="Newegg">
<img src="img/newegg.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Newegg</span>
<a href="#">Motion Graphics</a>
<p>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.</p>
</div>
</div>
<div class="item" data-groups='["wallpaper"]' data-date-created="2012-01-14" data-title="Arc">
<img src="img/eightfoldarc.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Arc</span>
<a href="#">Wallpaper</a>
</div>
</div>
<div class="item" data-groups='["photography"]' data-date-created="2011-01-14" data-title="Ground">
<img src="img/ground.png" alt="" height="145" width="230"/>
<div class="item-details">
<span class="title">Ground</span>
<a href="img/originals/baseball.jpg">Photography</a>
</div>
</div>
<div class="item w2" data-groups='["wallpaper"]' data-date-created="2011-12-14" data-title="Grass">
<p class="rfloat">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.</p>
<img src="img/grassy-hills.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Grass</span>
<a href="#">Wallpaper</a>
</div>
</div>
<div class="item" data-groups='["3d", "wallpaper"]' data-date-created="2012-04-14" data-title="Vestride">
<img src="img/vestride-classy.png" alt="" height="145" width="230" />
<div class="item-details">
<span class="title">Vestride</span>
<a href="#">3D Render, Wallpaper</a>
</div>
</div> -->
</div>
</section>
<section>
<div class="container-fluid">
<h2>Other Examples</h2>
<nav role="primary">
<a href="{% post_url demos/2013-05-01-basic %}">Basic masonry layout</a>
<a href="{% post_url demos/2013-05-03-minimal %}">The minimal markup with filters</a>
<a href="{% post_url demos/2013-05-02-adaptive %}">Twitter bootstrap adaptive masonry with compounded filters</a>
</nav>
</div>
</section>
<section>
<div class="container-fluid">
<h2>Features</h2>
<ul>
<li>Uses CSS Transitions!</li>
<li>Responsive (try resizing the window!)</li>
<li>Filter items by groups</li>
<li>Items can have multiple groups and be different sizes</li>
<li>Sort items</li>
<li>Advanced filtering method (like searching)</li>
</ul>
</div>
</section>
<section>
<div class="container-fluid">
<h2>Options</h2>
<div>
<p>Settings you can change (these are the defaults)</p>
<pre rel="JavaScript">
<code class="language-javascript">
// Overrideable options
$.fn.shuffle.options = {
@ -181,18 +200,21 @@ $.fn.shuffle.options = {
columnWidth : 0 // can be a function or number or calculated by plugin
};
</code>
</pre>
</pre>
<p>The easing function is one of <code>'default'</code>, <code>'linear'</code>, <code>'ease-in'</code>, <code>'ease-out'</code>, <code>'ease-in-out'</code>, or <code>'cubic-bezier'</code>.</p>
</div>
<p>The easing function is one of <code>'default'</code>, <code>'linear'</code>, <code>'ease-in'</code>, <code>'ease-out'</code>, <code>'ease-in-out'</code>, or <code>'cubic-bezier'</code>.</p>
</div>
</div>
</section>
<section>
<h2>Usage</h2>
<section>
<div class="container-fluid">
<h2>Usage</h2>
<div>
<h3>The HTML Structure</h3>
<p>The only real important thing here is the <code class="language-markup token attr-name">data-groups</code> attribute. It has to be a <a href="http://jsonlint.com/">valid JSON</a> array of strings.</p>
<pre rel="HTML">
<div>
<h3>The HTML Structure</h3>
<p>The only real important thing here is the <code class="language-markup token attr-name">data-groups</code> attribute. It has to be a <a href="http://jsonlint.com/">valid JSON</a> array of strings.</p>
<pre rel="HTML">
<code class="language-markup">
&lt;div id="grid"&gt;
&lt;div class="item" data-groups='["photography"]' data-date-created="2010-09-14" data-title="Baseball"&gt;
@ -221,14 +243,14 @@ $.fn.shuffle.options = {
&lt;/div&gt;
&lt;/div&gt;
</code>
</pre>
</pre>
<h3>How column widths work</h3>
<p>The <code>columnWidth</code> option is used to calculate the column width. This option <strong>can be a function</strong> for responsive layouts. If it's not a function, it uses jQuery's <code class="language-javascript">outerWidth(true)</code> to calculate the column width (this includes margins). If the <code>columnWidth</code> option isn't specified, the width will be the width of the first item.</p>
<h3>How column widths work</h3>
<p>The <code>columnWidth</code> option is used to calculate the column width. This option <strong>can be a function</strong> for responsive layouts. If it's not a function, it uses jQuery's <code class="language-javascript">outerWidth(true)</code> to calculate the column width (this includes margins). If the <code>columnWidth</code> option isn't specified, the width will be the width of the first item.</p>
<h3>A basic setup example</h3>
<p>Sets up the button clicks and runs shuffle</p>
<pre rel="jQuery">
<h3>A basic setup example</h3>
<p>Sets up the button clicks and runs shuffle</p>
<pre rel="jQuery">
<code class="language-javascript">
$(document).ready(function(){
@ -249,30 +271,32 @@ $(document).ready(function(){
$('#grid').shuffle();
});
</code>
</pre>
</pre>
<h3>Events</h3>
<p>These events will be triggered at their respective times: <code>'shrink.shuffle'</code>, <code>'shrunk.shuffle'</code>, <code>'filter.shuffle'</code>, <code>'filtered.shuffle'</code>, and <code>'sorted.shuffle'</code>.</p>
</div>
</section>
<h3>Events</h3>
<p>These events will be triggered at their respective times: <code>'shrink.shuffle'</code>, <code>'shrunk.shuffle'</code>, <code>'filter.shuffle'</code>, <code>'filtered.shuffle'</code>, and <code>'sorted.shuffle'</code>.</p>
</div>
</div>
</section>
<section>
<h2>Sorting</h2>
<section>
<div class="container-fluid">
<h2>Sorting</h2>
<p>You can order the elements based off a function you supply. In the example above, each item has a <code>data-date-created</code> and <code>data-title</code> attribute. The filter buttons have a <code>data-sort</code> attribute with the value of the item&rsquo;s attribute. Then, with some JavaScript, we can get the correct attribute and provide a function to sort by.</p>
<p>You can order the elements based off a function you supply. In the example above, each item has a <code>data-date-created</code> and <code>data-title</code> attribute. The filter buttons have a <code>data-sort</code> attribute with the value of the item&rsquo;s attribute. Then, with some JavaScript, we can get the correct attribute and provide a function to sort by.</p>
<pre rel="HTML">
<pre rel="HTML">
<code class="language-markup">
&lt;li data-sort="title"&gt;Title&lt;/li&gt;
</code>
</pre>
</pre>
<pre rel="HTML">
<pre rel="HTML">
<code class="language-markup">
&lt;div class="item" data-title="Baseball"&gt;&hellip;&lt;/div&gt;
</code>
</pre>
<pre rel="JavaScript">
</pre>
<pre rel="JavaScript">
<code class="language-javascript">
// Sorting options
$('.sort-options li').on('click', function() {
@ -305,29 +329,31 @@ $('.sort-options li').on('click', function() {
$grid.shuffle('sort', opts);
});
</code>
</pre>
</pre>
<p>The <code>opts</code> parameter can contain two properties. <code>reverse</code>, a boolean which will reverse the array. <code>by</code> is a function that is passed the element wrapped in jQuery. In the case above, we&rsquo;re returning the value of the data-date-created or data-title attributes.</p>
<p>Calling sort with an empty object will reset the elements to DOM order.</p>
</section>
<p>The <code>opts</code> parameter can contain two properties. <code>reverse</code>, a boolean which will reverse the array. <code>by</code> is a function that is passed the element wrapped in jQuery. In the case above, we&rsquo;re returning the value of the data-date-created or data-title attributes.</p>
<p>Calling sort with an empty object will reset the elements to DOM order.</p>
</div>
</section>
<section>
<h2>Advanced Filtering</h2>
<section>
<div class="container-fluid">
<h2>Advanced Filtering</h2>
<p>By passing a function to shuffle, you can customize the filtering to your hearts content. Shuffle will iterate over each item in the container and give your function the element wrapped in jQuery and the shuffle instance. Return <code>true</code> to keep the element or <code>false</code> to hide it.</p>
<p>By passing a function to shuffle, you can customize the filtering to your hearts content. Shuffle will iterate over each item in the container and give your function the element wrapped in jQuery and the shuffle instance. Return <code>true</code> to keep the element or <code>false</code> to hide it.</p>
<h3>Example</h3>
<pre rel="JavaScript">
<h3>Example</h3>
<pre rel="JavaScript">
<code class="language-javascript">
// Filters elements with a data-title attribute with less than 10 characters
$('#grid').shuffle(function($el, shuffle) {
return $el.data('title').length &lt; 10;
});
</code>
</pre>
</pre>
<h3>Searching</h3>
<pre rel="JavaScript">
<h3>Searching</h3>
<pre rel="JavaScript">
<code class="language-javascript">
// Advanced filtering
$('.filter .search').on('keyup change', function() {
@ -347,54 +373,62 @@ $('.filter .search').on('keyup change', function() {
</code>
</pre>
<p>For another example of advanced filters, check out the <a href="responsive.html">compounded filters demo</a>.</p>
</section>
<p>For another example of advanced filters, check out the <a href="responsive.html">compounded filters demo</a>.</p>
</div>
</section>
<section>
<h2>Dependencies</h2>
<section>
<div class="container-fluid">
<h2>Dependencies</h2>
<ul>
<li><a target="_blank" href="http://jquery.com">jQuery</a></li>
<li><a target="_blank" href="http://modernizr.com">Modernizr</a>
<ul>
<li><a target="_blank" href="http://jquery.com">jQuery</a></li>
<li><a target="_blank" href="http://modernizr.com">Modernizr</a>
<ul>
<li>A custom Modernizr build has been included with the plugin.</li>
<li>If you already have Modernizr on your site, you may delete it.</li>
<li>If you don't know what Modernizr is, leave it!</li>
</ul>
</li>
<li>A custom Modernizr build has been included with the plugin.</li>
<li>If you already have Modernizr on your site, you may delete it.</li>
<li>If you don't know what Modernizr is, leave it!</li>
</ul>
</section>
<section>
<h2>Supported Browsers</h2>
<ul>
<li>Chrome</li>
<li>Firefox</li>
<li>IE 7+</li>
<li>Opera</li>
<li>Safari</li>
</ul>
<p>
Browsers that don't support CSS transitions and transforms <strong>*cough*</strong> IE &lt;= 9 <strong>*cough*</strong> will see a less cool, javascript based version of the effect.
</p>
</section>
<section>
<h2>Links</h2>
<ul>
<li><a href="https://github.com/Vestride/Shuffle">GitHub Repo</a></li>
<li><a href="http://isotope.metafizzy.co/">Inspired by Isotope</a></li>
<li><a href="http://glencheney.com">Me</a></li>
</ul>
</section>
<section>
<h2>Changes</h2>
{% include changelog.html %}
</section>
</div>
</li>
</ul>
</div>
</section>
<section>
<div class="container-fluid">
<h2>Supported Browsers</h2>
<ul>
<li>Chrome</li>
<li>Firefox</li>
<li>IE 7+</li>
<li>Opera</li>
<li>Safari</li>
</ul>
<p>
Browsers that don't support CSS transitions and transforms <strong>*cough*</strong> IE &lt;= 9 <strong>*cough*</strong> will see a less cool, javascript based version of the effect.
</p>
</div>
</section>
<section>
<div class="container-fluid">
<h2>Links</h2>
<ul>
<li><a href="https://github.com/Vestride/Shuffle">GitHub Repo</a></li>
<li><a href="http://isotope.metafizzy.co/">Inspired by Isotope</a></li>
<li><a href="http://glencheney.com">Me</a></li>
</ul>
</div>
</section>
<section>
<div class="container-fluid">
<h2>Changes</h2>
{% include changelog.html %}
</div>
</section>

@ -1,75 +1,105 @@
$(document).ready(function() {
var DEMO = (function($, window) {
'use strict';
var $grid = $('#grid'),
$filterOptions = $('.filter-options'),
init = function() {
setupFilters();
setupSorting();
setupSearching();
// instantiate the plugin
$('#grid').shuffle();
// Destroy it! o_O
// $('#grid').shuffle('destroy');
// You can subscribe to custom events: shrink, shrunk, filter, filtered, and sorted
$('#grid').on('shrink.shuffle shrunk.shuffle filter.shuffle filtered.shuffle sorted.shuffle layout.shuffle', function(evt, shuffle) {
if ( window.console ) {
console.log(evt.type, shuffle, this);
}
});
},
// Set up button clicks
setupFilters = function() {
var $btns = $filterOptions.children();
$btns.on('click', function() {
var $this = $(this),
isActive = $this.hasClass( 'active' ),
group = isActive ? 'all' : $this.data('group');
// Hide current label, show current label in title
if ( !isActive ) {
$('.filter-options .active').removeClass('active');
}
$this.toggleClass('active');
// Filter elements
$grid.shuffle( group );
});
$btns = null;
},
// Set up button clicks
$('.filter-options li').on('click', function() {
var $this = $(this),
$grid = $('#grid');
// Hide current label, show current label in title
$('.filter-options .active').removeClass('active');
$this.addClass('active');
// Filter elements
$grid.shuffle($this.data('group'));
});
// Sorting options
$('.sort-options li').on('click', function() {
var $this = $(this),
$grid = $('#grid'),
sort = $this.data('sort'),
opts = {};
// Hide current label, show current label in title
$('.sort-options .active').removeClass('active');
$this.addClass('active');
// We're given the element wrapped in jQuery
if (sort === 'date-created') {
opts = {
by: function($el) {
return $el.data('date-created');
}
}
} else if (sort === 'title') {
opts = {
by: function($el) {
return $el.data('title').toLowerCase();
}
};
}
// Filter elements
$grid.shuffle('sort', opts);
});
// Advanced filtering
$('.filter .search').on('keyup change', function() {
var val = this.value.toLowerCase();
$('#grid').shuffle(function($el, shuffle) {
// Only search elements in the current group
if (shuffle.group !== 'all' && $.inArray(shuffle.group, $el.data('groups')) === -1) {
return false;
}
var text = $.trim($el.text()).toLowerCase();
return text.indexOf(val) != -1;
});
});
// instantiate the plugin
$('#grid').shuffle();
// Destroy it! o_O
// $('#grid').shuffle('destroy');
// You can subscribe to custom events: shrink, shrunk, filter, filtered, and sorted
$('#grid').on('shrink.shuffle shrunk.shuffle filter.shuffle filtered.shuffle sorted.shuffle layout.shuffle', function(evt, shuffle) {
if ( window.console ) {
console.log(evt.type, shuffle, this);
}
});
});
setupSorting = function() {
// Sorting options
$('.sort-options button').on('click', function() {
var $this = $(this),
sort = $this.data('sort'),
opts = {};
// Hide current label, show current label in title
$('.sort-options .active').removeClass('active');
$this.addClass('active');
// We're given the element wrapped in jQuery
if (sort === 'date-created') {
opts = {
by: function($el) {
return $el.data('date-created');
}
}
} else if (sort === 'title') {
opts = {
by: function($el) {
return $el.data('title').toLowerCase();
}
};
}
// Filter elements
$grid.shuffle('sort', opts);
});
},
setupSearching = function() {
// Advanced filtering
$('.filter .search').on('keyup change', function() {
var val = this.value.toLowerCase();
$grid.shuffle(function($el, shuffle) {
// Only search elements in the current group
if (shuffle.group !== 'all' && $.inArray(shuffle.group, $el.data('groups')) === -1) {
return false;
}
var text = $.trim($el.text()).toLowerCase();
return text.indexOf(val) != -1;
});
});
};
return {
init: init
};
}(jQuery, window));
$(document).ready(function() {
DEMO.init();
});

@ -1,453 +1,11 @@
/***********************************************
Begin prism-core.js
***********************************************/
/**
* Prism: Lightweight, robust, elegant syntax highlighting
* MIT license http://www.opensource.org/licenses/mit-license.php/
* @author Lea Verou http://lea.verou.me
*/
(function(){
// Private helper vars
var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i;
var _ = self.Prism = {
languages: {
insertBefore: function (inside, before, insert, root) {
root = root || _.languages;
var grammar = root[inside];
var ret = {};
for (var token in grammar) {
if (grammar.hasOwnProperty(token)) {
if (token == before) {
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
ret[newToken] = insert[newToken];
}
}
}
ret[token] = grammar[token];
}
}
return root[inside] = ret;
},
DFS: function(o, callback) {
for (var i in o) {
callback.call(o, i, o[i]);
if (Object.prototype.toString.call(o) === '[object Object]') {
_.languages.DFS(o[i], callback);
}
}
}
},
highlightAll: function(async, callback) {
var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code, code');
for (var i=0, element; element = elements[i++];) {
_.highlightElement(element, async === true, callback);
}
},
highlightElement: function(element, async, callback) {
// Find language
var language, grammar, parent = element;
while (parent && !lang.test(parent.className)) {
parent = parent.parentNode;
}
if (parent) {
language = (parent.className.match(lang) || [,''])[1];
grammar = _.languages[language];
}
if(!language){
language = 'generic'
grammar = _.languages[language];
}
if (!grammar) {
return;
}
// Set language on the element, if not present
element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
// Set language on the parent, for styling
parent = element.parentNode;
if (/pre/i.test(parent.nodeName)) {
parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
}
var code = element.textContent.trim();
if(!code) {
return;
}
code = code.replace(/&/g, '&amp;').replace(/</g, '&lt;')
.replace(/>/g, '&gt;').replace(/\u00a0/g, ' ');
//console.time(code.slice(0,50));
var env = {
element: element,
language: language,
grammar: grammar,
code: code
};
_.hooks.run('before-highlight', env);
if (async && self.Worker) {
var worker = new Worker(_.filename);
worker.onmessage = function(evt) {
env.highlightedCode = Token.stringify(JSON.parse(evt.data));
env.element.innerHTML = env.highlightedCode;
callback && callback.call(env.element);
//console.timeEnd(code.slice(0,50));
_.hooks.run('after-highlight', env);
};
worker.postMessage(JSON.stringify({
language: env.language,
code: env.code
}));
}
else {
env.highlightedCode = _.highlight(env.code, env.grammar)
env.element.innerHTML = env.highlightedCode;
callback && callback.call(element);
_.hooks.run('after-highlight', env);
//console.timeEnd(code.slice(0,50));
}
},
highlight: function (text, grammar) {
return Token.stringify(_.tokenize(text, grammar));
},
tokenize: function(text, grammar) {
var Token = _.Token;
var strarr = [text];
var rest = grammar.rest;
if (rest) {
for (var token in rest) {
grammar[token] = rest[token];
}
delete grammar.rest;
}
tokenloop: for (var token in grammar) {
if(!grammar.hasOwnProperty(token) || !grammar[token]) {
continue;
}
var pattern = grammar[token],
inside = pattern.inside,
lookbehind = !!pattern.lookbehind || 0;
pattern = pattern.pattern || pattern;
for (var i=0; i<strarr.length; i++) { // Dont cache length as it changes during the loop
var str = strarr[i];
if (strarr.length > text.length) {
// Something went terribly wrong, ABORT, ABORT!
break tokenloop;
}
if (str instanceof Token) {
continue;
}
pattern.lastIndex = 0;
var match = pattern.exec(str);
if (match) {
if(lookbehind) {
lookbehind = match[1].length;
}
var from = match.index - 1 + lookbehind,
match = match[0].slice(lookbehind),
len = match.length,
to = from + len,
before = str.slice(0, from + 1),
after = str.slice(to + 1);
var args = [i, 1];
if (before) {
args.push(before);
}
var wrapped = new Token(token, inside? _.tokenize(match, inside) : match);
args.push(wrapped);
if (after) {
args.push(after);
}
Array.prototype.splice.apply(strarr, args);
}
}
}
return strarr;
},
hooks: {
all: {},
add: function (name, callback) {
var hooks = _.hooks.all;
hooks[name] = hooks[name] || [];
hooks[name].push(callback);
},
run: function (name, env) {
var callbacks = _.hooks.all[name];
if (!callbacks || !callbacks.length) {
return;
}
for (var i=0, callback; callback = callbacks[i++];) {
callback(env);
}
}
}
};
var Token = _.Token = function(type, content) {
this.type = type;
this.content = content;
};
Token.stringify = function(o) {
if (typeof o == 'string') {
return o;
}
if (Object.prototype.toString.call(o) == '[object Array]') {
for (var i=0; i<o.length; i++) {
o[i] = Token.stringify(o[i]);
}
return o.join('');
}
var env = {
type: o.type,
content: Token.stringify(o.content),
tag: 'span',
classes: ['token', o.type],
attributes: {}
};
if (env.type == 'comment') {
env.attributes['spellcheck'] = 'true';
}
_.hooks.run('wrap', env);
var attributes = '';
for (var name in env.attributes) {
attributes += name + '="' + (env.attributes[name] || '') + '"';
}
return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>';
};
if (!self.document) {
// In worker
self.addEventListener('message', function(evt) {
var message = JSON.parse(evt.data),
lang = message.language,
code = message.code;
self.postMessage(JSON.stringify(_.tokenize(code, _.languages[lang])));
self.close();
}, false);
return;
}
// Get current script and highlight
var script = document.getElementsByTagName('script');
script = script[script.length - 1];
if (script) {
_.filename = script.src;
if (document.addEventListener && !script.hasAttribute('data-manual')) {
document.addEventListener('DOMContentLoaded', _.highlightAll);
}
}
})();
/***********************************************
Begin prism-markup.js
***********************************************/
Prism.languages.markup = {
'comment': /&lt;!--[\w\W]*?--(&gt;|&gt;)/g,
'prolog': /&lt;\?.+?\?&gt;/,
'doctype': /&lt;!DOCTYPE.+?&gt;/,
'cdata': /&lt;!\[CDATA\[[\w\W]+?]]&gt;/i,
'tag': {
pattern: /&lt;\/?[\w:-]+\s*[\w\W]*?&gt;/gi,
inside: {
'tag': {
pattern: /^&lt;\/?[\w:-]+/i,
inside: {
'punctuation': /^&lt;\/?/,
'namespace': /^[\w-]+?:/
}
},
'attr-value': {
pattern: /=(('|")[\w\W]*?(\2)|[^\s>]+)/gi,
inside: {
'punctuation': /=/g
}
},
'punctuation': /\/?&gt;/g,
'attr-name': {
pattern: /[\w:-]+/g,
inside: {
'namespace': /^[\w-]+?:/
}
}
}
},
'entity': /&amp;#?[\da-z]{1,8};/gi
};
// Plugin to make entity title show the real entity, idea by Roman Komarov
Prism.hooks.add('wrap', function(env) {
if (env.type === 'entity') {
env.attributes['title'] = env.content.replace(/&amp;/, '&');
}
});
/***********************************************
Begin prism-css.js
***********************************************/
Prism.languages.css = {
'comment': /\/\*[\w\W]*?\*\//g,
'atrule': /@[\w-]+?(\s+.+)?(?=\s*{|\s*;)/gi,
'url': /url\((["']?).*?\1\)/gi,
'selector': /[^\{\}\s][^\{\}]*(?=\s*\{)/g,
'property': /(\b|\B)[a-z-]+(?=\s*:)/ig,
'string': /("|')(\\?.)*?\1/g,
'important': /\B!important\b/gi,
'ignore': /&(lt|gt|amp);/gi,
'punctuation': /[\{\};:]/g
};
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
'style': {
pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,
inside: {
'tag': {
pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,
inside: Prism.languages.markup.tag.inside
},
rest: Prism.languages.css
}
}
});
}
/***********************************************
Begin prism-javascript.js
***********************************************/
Prism.languages.javascript = {
'comment': {
pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,
lookbehind: true
},
'string': /("|')(\\?.)*?\1/g,
'regex': {
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,
lookbehind: true
},
'keyword': /\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,
'boolean': /\b(true|false)\b/g,
'number': /\b-?(0x)?\d*\.?\d+\b/g,
'operator': /[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g,
'ignore': /&(lt|gt|amp);/gi,
'punctuation': /[{}[\];(),.:]/g
};
if (Prism.languages.markup) {
Prism.languages.insertBefore('markup', 'tag', {
'script': {
pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,
inside: {
'tag': {
pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,
inside: Prism.languages.markup.tag.inside
},
rest: Prism.languages.javascript
}
}
});
}
/***********************************************
Begin prism-generic.js
***********************************************/
Prism.languages.generic = {
'comment': {
pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,
lookbehind: true
},
'preprocessor': /(#.*?$)/g,
'string': /("|')(\\?.)*?\1/g,
'entity': /(\b[a-z_]\w*\b(?=\s*\([^\)]*\)))(\b[a-z_]\w+\b\s+(?=\b[a-z_]\w+\b))/,
'keyword': /\b(enddeclare|endforeach|endswitch|continue|endwhile|foreach|finally|default|elseif|endfor|return|switch|assert|break|catch|endif|throw|while|then|case|else|goto|each|and|for|try|use|xor|and|not|end|as|do|if|or|in|is|to|function|interface|namespace|function|unsigned|boolean|integer|package|double|string|signed|object|class|array|float|short|false|char|long|void|long|byte|bool|null|true|enum|var|int)\b/g,
'boolean': /\b(true|false)\b/g,
'number': /\b-?(0x)?\d*\.?\d+\b/g,
'operator': /[-+]{1,2}|!|=?(\<|&lt;){1,3}|=?(\>|&gt;){1,3};?|={1,3}|(\&amp;|\&){1,2}|\|?\||\?|\*|\/|(\!|\^|\*|\&|\%|\|)=/g,
'punctuation': /[{}[\];(),.:]/g,
'modifier': /(protected|abstract|property|private|global|public|static|native|const|final)\b/g,
};
*/(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind||0;a=a.pattern||a;for(var c=0;c<s.length;c++){var h=s[c];if(s.length>e.length)break e;if(h instanceof i)continue;a.lastIndex=0;var p=a.exec(h);if(p){l&&(l=p[1].length);var d=p.index-1+l,p=p[0].slice(l),v=p.length,m=d+v,g=h.slice(0,d+1),y=h.slice(m+1),b=[c,1];g&&b.push(g);var w=new i(u,f?t.tokenize(p,f):p);b.push(w);y&&b.push(y);Array.prototype.splice.apply(s,b)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
Prism.languages.markup={comment:/&lt;!--[\w\W]*?--(&gt;|&gt;)/g,prolog:/&lt;\?.+?\?&gt;/,doctype:/&lt;!DOCTYPE.+?&gt;/,cdata:/&lt;!\[CDATA\[[\w\W]+?]]&gt;/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?&gt;/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|&gt;|"/g}},punctuation:/\/?&gt;/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:/@[\w-]+?(\s+[^;{]+)?(?=\s*{|\s*;)/gi,url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\}]*(?=\s*\{)/g,property:/(\b|\B)[a-z-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:class|interface|extends|implements|trait|instanceof|new)\s+)[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});
;

Loading…
Cancel
Save