Move gulp tasks to separate files. Replace grid. Add autoprefixer.

pull/111/head
Glen Cheney 8 years ago
parent 6ea5491dca
commit 244f89aaba

@ -2,16 +2,20 @@
<p>You can add and remove elements from shuffle after it has been created. This also works for infinite scrolling.</p>
<h3>Add a collection</h3>
<pre rel="JavaScript"><code class="language-javascript">// Adds 2 &lt;div&gt;s to an existing Shuffle instance.
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">// Adds 2 &lt;div&gt;s to an existing Shuffle instance.
var $item1 = $('&lt;div class="gallery-item item1"&gt;')
var $item2 = $('&lt;div class="gallery-item item2"&gt;')
var $items = $item1.add($item2);
$('#my-shuffle').append($items);
$('#my-shuffle').shuffle('appended', $items);</code></pre>
</div>
<h3>Remove a collection</h3>
<pre rel="JavaScript"><code class="language-javascript">// Remove the 2 &lt;div&gt;s which were just added.
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">// Remove the 2 &lt;div&gt;s which were just added.
var $items = $('.gallery-item');
$('#my-shuffle').shuffle('remove', $items);</code></pre>
</div>
<p class="demo-link-container">Check out the <a href="{{ site.baseurl }}{% post_url 2013-06-19-adding-removing %}">demo</a>.</p>

@ -3,13 +3,16 @@
<p>By passing a function to shuffle, you can customize the filtering to your hearts content. Shuffle will iterate over each item 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"><code class="language-javascript">// Filters elements with a data-title attribute with less than 10 characters
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">// Filters elements with a data-title attribute with less than 10 characters
$('#grid').shuffle('shuffle', function($el, shuffle) {
return $el.data('title').length &lt; 10;
});</code></pre>
</div>
<h3>Searching</h3>
<pre rel="JavaScript"><code class="language-javascript">// Advanced filtering
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">// Advanced filtering
$('.js-shuffle-search').on('keyup change', function() {
var val = this.value.toLowerCase();
$grid.shuffle('shuffle', function($el, shuffle) {
@ -23,5 +26,6 @@ $('.js-shuffle-search').on('keyup change', function() {
return text.indexOf(val) !== -1;
});
});</code></pre>
</div>
<p class="demo-link-container">Check out the <a href="{{ site.baseurl }}{% post_url 2013-05-02-adaptive %}">compounded filters demo</a>.</p>

@ -1,5 +1,5 @@
<footer class="site-footer light-text-dark-box">
<div class="container-fluid">
<div class="container">
<p class="site-footer__credit">Photos and drawings by <a href="https://www.facebook.com/EightfoldStudios" target="_blank">Eightfold Studios</a>.</p>
</div>
</footer>

@ -1,6 +1,6 @@
<div class="row-fluid m-row js-demos demo-list">
<div class="row js-demos demo-list">
{% for post in site.demos %}
<div class="span3 m-span3 figure-wrap js-demo">
<div class="col-3@sm col-3@xs figure-wrap js-demo">
<a href="{{ site.baseurl }}/{{ post.slug }}">
<figure>
<div class="keep-ratio four-three">

@ -8,17 +8,21 @@
</ul>
<h3>Get notified when shuffle is done with setup</h3>
<pre rel="JavaScript"><code class="language-javascript">$grid.on('done.shuffle', function() {
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">$grid.on('done.shuffle', function() {
console.log('Finished initializing shuffle!');
});
// Initialize shuffle
$grid.shuffle( options );</code></pre>
</div>
<h3>Do something when an item is removed</h3>
<pre rel="JavaScript"><code class="language-javascript">$grid.on('removed.shuffle', function( evt, $collection, shuffle ) {
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">$grid.on('removed.shuffle', function( evt, $collection, shuffle ) {
console.log( this, evt, $collection, shuffle );
});</code></pre>
</div>
<p class="demo-link-container">Check out the <a href="#demo">demo</a> at the top of the page, or its <a href="/js/demos/homepage.js">JavaScript file.</a></p>

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{ page.title }}</title>

@ -2,20 +2,20 @@
<nav class="site-nav collapsed" id="nav" role="primary">
<div class="js-tray site-nav__tray light-text-dark-box">
<div class="container-fluid site-nav__tray-inner">
<div class="container site-nav__tray-inner">
<h3 class="site-nav__title">Shuffle.js</h3>
<div class="row-fluid">
<div class="span3">
<div class="row">
<div class="col-3@sm">
<a class="btn btn--primary" href="{{ site.baseurl }}/">Home</a>
</div>
<div class="span3">
<div class="col-3@sm">
<a class="btn btn--primary" href="https://github.com/Vestride/Shuffle">GitHub Repo</a>
</div>
<div class="span3">
<div class="col-3@sm">
<a class="btn btn--primary" href="https://twitter.com/Vestride">By @Vestride</a>
</div>
<div class="span3">
<div class="col-3@sm">
<a class="btn btn--primary" href="{{ site.baseurl }}/faq">FAQ</a>
</div>
</div>
@ -26,7 +26,7 @@
</div>
<div class="site-nav__band">
<div class="container-fluid">
<div class="container">
<button class="js-nav-toggle pull-right" data-close-label="Close Menu">Open Menu</button>
</div>
</div>

@ -1,7 +1,8 @@
<h2>Options<a href="#options"></a></h2>
<p>Settings you can change (these are the defaults).</p>
<pre rel="JavaScript"><code class="language-javascript">// Overrideable options
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">// Overrideable options
Shuffle.options = {
group: ALL_ITEMS, // Initial filter group.
speed: 250, // Transition/animation speed (milliseconds).
@ -19,5 +20,6 @@ Shuffle.options = {
sequentialFadeDelay: 150, // Delay between each item that fades in when adding items.
supported: CAN_TRANSITION_TRANSFORMS // Whether to use transforms or absolute positioning.
};</code></pre>
</div>
<p>No options <em>need</em> to be specified, but <code>itemSelector</code> should be used. Other common options to change are <code>speed</code>, <code>easing</code>, <code>gutterWidth</code>, and <code>columnWidth</code> (or <code>sizer</code>).</p>

@ -7,7 +7,7 @@
{% endif %}
{% if item.cols %}{% assign cols = item.cols %}{% else %}{% assign cols = 3 %}{% endif %}
{% assign description = item.description %}
<figure class="span{{ cols }} m-span3 picture-item{{ extras }}" data-groups='{{ groups }}' data-date-created="{{ item.date }}" data-title="{{ item.title }}">
<figure class="col-{{ cols }}@sm col-3@xs picture-item{{ extras }}" data-groups='{{ groups }}' data-date-created="{{ item.date }}" data-title="{{ item.title }}">
<div class="picture-item__inner">
<img src="{{ site.baseurl }}/img/{{ item.img }}" alt="" height="145" width="230" />
<div class="picture-item__details clearfix">

@ -3,15 +3,20 @@
<p>You can order the elements based off a function you supply. In the demo above, each item has a <code>data-date-created</code> and <code>data-title</code> attribute. When the select option menu changes, a sort object is passed to shuffle.</p>
<pre rel="HTML"><code class="language-markup">&lt;select class="sort-options"&gt;
<div class="code-block">
<pre rel="HTML"><code class="language-markup">&lt;select class="sort-options"&gt;
&lt;option value=""&gt;Default&lt;/option&gt;
&lt;option value="title"&gt;Title&lt;/option&gt;
&lt;option value="date-created"&gt;Date Created&lt;/option&gt;
&lt;/select&gt;</code></pre>
</div>
<pre rel="HTML"><code class="language-markup">&lt;figure class="picture-item" data-groups='[&quot;photography&quot;]' data-date-created="2010-09-14" data-title="Baseball"&gt;&hellip;&lt;/figure&gt;</code></pre>
<div class="code-block">
<pre rel="HTML"><code class="language-markup">&lt;figure class="picture-item" data-groups='[&quot;photography&quot;]' data-date-created="2010-09-14" data-title="Baseball"&gt;&hellip;&lt;/figure&gt;</code></pre>
</div>
<pre rel="JavaScript"><code class="language-javascript">// Sorting options
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">// Sorting options
$('.sort-options').on('change', function() {
var sort = this.value,
opts = {};
@ -35,6 +40,7 @@ $('.sort-options').on('change', function() {
// Filter elements
$grid.shuffle('sort', opts);
});</code></pre>
</div>
<p>The <code class="language-javascript">opts</code> parameter can contain two properties. <code class="language-javascript">reverse</code>, a boolean which will reverse the array. <code class="language-javascript">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>

@ -5,15 +5,16 @@
<p>In this example, shuffle is using the fluid grid from the <a href="http://twitter.github.io/bootstrap/">Twitter Bootstrap v2.3</a>. It's also making use of <a href="http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/"><abbr title="Block-Element-Modifier">BEM</abbr></a> class naming.</p>
<pre rel="HTML"><code class="language-markup">&lt;div id="grid" class="row-fluid"&gt;
&lt;figure class="span3 picture-item" data-groups='["photography"]'&gt;
<div class="code-block">
<pre rel="HTML"><code class="language-markup">&lt;div id="grid" class="row"&gt;
&lt;figure class="col-3@sm picture-item" data-groups='["photography"]'&gt;
&lt;img src="/img/baseball.png" height="145" width="230" /&gt;
&lt;div class="picture-item__details"&gt;
&lt;figcaption class="picture-item__title"&gt;Baseball&lt;/figcaption&gt;
&lt;p class="picture-item__tags"&gt;photography&lt;/p&gt;
&lt;/div&gt;
&lt;/figure&gt;
&lt;figure class="span6 picture-item" data-groups='["wallpaper","3d"]'&gt;
&lt;figure class="col-6@sm picture-item" data-groups='["wallpaper","3d"]'&gt;
&lt;img src="/img/tennis-ball.png" height="145" width="230" /&gt;
&lt;div class="picture-item__details"&gt;
&lt;figcaption class="picture-item__title"&gt;Tennis&lt;/figcaption&gt;
@ -21,14 +22,14 @@
&lt;/div&gt;
&lt;p class="picture-item__description"&gt;Some description here.&lt;/p&gt;
&lt;/figure&gt;
&lt;figure class="span3 picture-item" data-groups='["wallpaper","3d"]'&gt;
&lt;figure class="col-3@sm picture-item" data-groups='["wallpaper","3d"]'&gt;
&lt;img src="/img/imac.png" height="145" width="230" /&gt;
&lt;div class="picture-item__details"&gt;
&lt;figcaption class="picture-item__title"&gt;iMac&lt;/figcaption&gt;
&lt;p class="picture-item__tags"&gt;wallpaper, 3d&lt;/p&gt;
&lt;/div&gt;
&lt;/figure&gt;
&lt;figure class="span3 picture-item picture-item--h2" data-groups='["graphics"]'&gt;
&lt;figure class="col-3@sm picture-item picture-item--h2" data-groups='["graphics"]'&gt;
&lt;img src="/img/master-chief.png" height="145" width="230" /&gt;
&lt;div class="picture-item__details"&gt;
&lt;figcaption class="picture-item__title"&gt;Master Chief&lt;/figcaption&gt;
@ -37,6 +38,7 @@
&lt;p class="picture-item__description"&gt;Some description here.&lt;/p&gt;
&lt;/figure&gt;
&lt;/div&gt;</code></pre>
</div>
<h3 id="columns">How column widths work<a href="#how-column-widths-work"></a></h3>
<p>The <code>columnWidth</code> option is used to calculate the column width. You have several options:</p>
@ -49,7 +51,8 @@
<h3>A basic setup example</h3>
<p>If you want functional buttons, check out <a href="{{ site.baseurl }}/js/demos/homepage.js">the js file</a>.</p>
<pre rel="JavaScript"><code class="language-javascript">$(document).ready(function() {
<div class="code-block">
<pre rel="JavaScript"><code class="language-javascript">$(document).ready(function() {
var $grid = $('#grid'),
$sizer = $grid.find('.shuffle__sizer');
@ -58,3 +61,4 @@
sizer: $sizer
});
});</code></pre>
</div>

@ -1,9 +1,9 @@
{% include head.html %}
{% include nav.html %}
{% if page.includeHeader %}
<header class="container-fluid">
<div class="row-fluid">
<div class="span7">
<header class="container">
<div class="row">
<div class="col-7@sm">
<h1>Shuffle</h1>
<p>{{ site.defaultDescription }}</p>
<p>By <a href="https://twitter.com/Vestride" target="_blank">@Vestride</a></p>

@ -6,26 +6,26 @@ image: /demos/basic.jpg
bodyClass: basic
extraJS: [ "demos/homepage.js" ]
---
<div class="container-fluid">
<div class="row-fluid">
<div class="container">
<div class="row">
<h2>Masonry with a sizer</h2>
</div>
</div>
<div class="container-fluid">
<div id="grid" class="row-fluid m-row shuffle--container shuffle--fluid">
<div class="container">
<div id="grid" class="row shuffle--container shuffle--fluid">
{% for item in site.items %}
{% assign item = item %}
{% include picture-item.html %}
{% endfor %}
<div class="span3 m-span3 shuffle__sizer"></div>
<div class="col-3@sm col-3@xs shuffle__sizer"></div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="container">
<div class="row">
<h2>Shuffle.js</h2>
<p>{{ site.longDescription }}</p>
</div>

@ -9,7 +9,7 @@ extraCSS: [ "/css/gallery.css" ]
<section class="container">
<div class="row">
<h2 class="span12">Adaptive Layout with Compound Filters</h2>
<h2 class="col-12@sm">Adaptive Layout with Compound Filters</h2>
</div>
</section>
@ -17,7 +17,7 @@ extraCSS: [ "/css/gallery.css" ]
<div class="filter-options row">
<div class="span6">
<div class="col-6@sm">
<div class="filter-group filter--colors js-colors">
<h5 class="filter__label">Colors</h5>
<button class="btn btn--go" data-filter-value="green"><span class="visuallyhidden">Green</span></button>
@ -27,7 +27,7 @@ extraCSS: [ "/css/gallery.css" ]
</div>
</div>
<div class="span6">
<div class="col-6@sm">
<div class="filter-group filter--shapes js-shapes">
<h5 class="filter-group__label">Shapes</h5>
<span class="ib">
@ -49,7 +49,7 @@ extraCSS: [ "/css/gallery.css" ]
<div class="shape-up js-shuffle">
{% for shape in site.shapes %}
<div class="span3 shape shape--{{ shape.shape }} shape--{{ shape.color }}" data-shape="{{ shape.shape }}" data-color="{{ shape.color }}">
<div class="col-3@sm shape shape--{{ shape.shape }} shape--{{ shape.color }}" data-shape="{{ shape.shape }}" data-color="{{ shape.color }}">
<div class="keep-ratio">
<div class="shape__inner">
<div class="shape__space">

@ -7,7 +7,7 @@ extraJS: [ "imagesloaded.pkgd.js", "demos/images.js"]
prism: true
---
<div class="container-fluid">
<div class="container">
<h2>Images!</h2>
<p>You can encounter problems when shuffle item dimensions depend on images. <a href="{{ site.baseurl }}{% post_url 2013-06-29-image-problems %}">Like this demo</a>. There are three good solutions to this.</p>
<ol>
@ -51,22 +51,22 @@ prism: true
</style>
<div class="container-fluid shuffle-wrap">
<div class="container shuffle-wrap">
<img id="loader" class="loader" alt="Loading..." src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAzMDAgMzAwIgogICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KICA8cGF0aCBkPSJNIDE1MCwwCiAgICAgICAgICAgYSAxNTAsMTUwIDAgMCwxIDEwNi4wNjYsMjU2LjA2NgogICAgICAgICAgIGwgLTM1LjM1NSwtMzUuMzU1CiAgICAgICAgICAgYSAtMTAwLC0xMDAgMCAwLDAgLTcwLjcxMSwtMTcwLjcxMSB6IgogICAgICAgIGZpbGw9IiMzZDdmZTYiPgogICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiBhdHRyaWJ1dGVUeXBlPSJYTUwiCiAgICAgICAgICAgdHlwZT0icm90YXRlIiBmcm9tPSIwIDE1MCAxNTAiIHRvPSIzNjAgMTUwIDE1MCIKICAgICAgICAgICBiZWdpbj0iMHMiIGR1cj0iMXMiIGZpbGw9ImZyZWV6ZSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIC8+CiAgPC9wYXRoPgo8L3N2Zz4K" />
<div class="shuffle--images row-fluid">
<div class="shuffle--images row">
{% for item in site.items %}
<figure class="js-item img-item span3 m-span3">
<figure class="js-item img-item col-3@sm col-3@xs">
<img src="{{ site.baseurl }}/img/{{ item.img }}" alt="{{item.title}}"/>
<figcaption>{{ item.groups }}</figcaption>
</figure>
{% endfor %}
<div class="span3 m-span3" id="js-sizer"></div>
<div class="col-3@sm col-3@xs" id="js-sizer"></div>
</div>
</div>
<section>
<div class="container-fluid">
<div class="container">
<h2>Shuffle.js</h2>
<p>{{ site.longDescription }}</p>
</div>

@ -59,7 +59,7 @@ extraJS: [ "demos/adding-removing.js" ]
<section class="container">
<div class="row">
<h2 class="span12">Adding and Removing Items</h2>
<h2 class="col-12@sm">Adding and Removing Items</h2>
</div>
</section>
@ -100,7 +100,7 @@ extraJS: [ "demos/adding-removing.js" ]
<section class="container">
<div class="row">
<div class="span12">
<div class="col-12@sm">
<h2>Shuffle.js</h2>
<p>{{ site.longDescription }}</p>
</div>

@ -4,11 +4,11 @@ title: Mobile Grid Layout Test
description: Testing out the mobile grid for this site
---
<div class="container-fluid">
<div class="container">
<h2>Mobile Grid Demo</h2>
</div>
<style scoped>
<style>
article {
height: 30px;
@ -18,30 +18,30 @@ description: Testing out the mobile grid for this site
</style>
<div class="container-fluid">
<div class="row-fluid m-row">
<article class="span7 m-span3">
span7 | m-span3
<div class="container">
<div class="row">
<article class="col-7@sm col-3@xs">
col-7@sm | col-3@xs
</article>
<article class="span4 m-span1">
span4 | m-span1
<article class="col-4@sm col-1@xs">
col-4@sm | col-1@xs
</article>
<article class="span1 m-span2">
span1 | m-span2
<article class="col-1@sm col-2@xs">
col-1@sm | col-2@xs
</article>
</div>
<hr>
<div class="row-fluid m-row">
<article class="span6 m-span6"></article>
<div class="row">
<article class="col-6@sm col-6@xs"></article>
</div>
<hr>
<div class="row-fluid m-row">
<article class="span5 m-span3"></article>
<article class="span7 m-span3"></article>
<div class="row">
<article class="col-5@sm col-3@xs"></article>
<article class="col-7@sm col-3@xs"></article>
</div>
<hr>

@ -5,7 +5,7 @@ description: A demo of how NOT to use images with shuffle
extraJS: [ "demos/images-broken.js"]
---
<div class="container-fluid">
<div class="container">
<h2>This probably looks broken.</h2>
<p>Demo in which shuffle item dimensions are based on images without a fix. <a href="{{ site.baseurl }}{% post_url 2013-05-03-images %}">See here</a> for a solution.</p>
<p>Resize the window and it'll fix itself.</p>
@ -28,15 +28,15 @@ extraJS: [ "demos/images-broken.js"]
</style>
<div class="container-fluid">
<div class="shuffle--images row-fluid">
<div class="container">
<div class="shuffle--images row">
{% for item in site.items %}
<figure class="js-item img-item span3 m-span3">
<figure class="js-item img-item col-3@sm col-3@xs">
<img src="{{ site.baseurl }}/img/{{ item.img }}" alt="{{item.title}}"/>
<figcaption>{{ item.groups }}</figcaption>
</figure>
{% endfor %}
<div class="span3 m-span3" id="js-sizer"></div>
<div class="col-3@sm col-3@xs" id="js-sizer"></div>
</div>
</div>

@ -5,24 +5,24 @@ description: Frequently asked questions about Shuffle.js
image: /hero.png
extraJS: [ "faq.js" ]
---
<section class="container-fluid">
<div class="row-fluid">
<section class="container">
<div class="row">
<h2>FAQs</h2>
</div>
</section>
<section class="container-fluid search-section">
<div class="row-fluid">
<div class="span6">
<section class="container search-section">
<div class="row">
<div class="col-6@sm">
<input type="search" placeholder="Search..." class="faq-search" id="search" />
</div>
</div>
</section>
<section class="container-fluid">
<div class="row-fluid">
<section class="container">
<div class="row">
<article id="spaces" class="question js-question">
<div class="question__inner">
@ -97,7 +97,7 @@ extraJS: [ "faq.js" ]
</section>
<section class="container-fluid">
<div class="row-fluid">
<section class="container">
<div class="row">
</div>
</section>

@ -5,15 +5,15 @@ description: When elements enter the viewport, they transition in from zero opac
image: /demos/animated.jpg
extraJS: [ "viewport.js", "demos/animate-in.js" ]
---
<div class="container-fluid">
<div class="row-fluid">
<div class="container">
<div class="row">
<h2>Animated viewport entry</h2>
</div>
</div>
<div class="container-fluid">
<div id="grid" class="row-fluid m-row shuffle--container shuffle--fluid shuffle--animatein">
<div class="container">
<div id="grid" class="row shuffle--container shuffle--fluid shuffle--animatein">
{% for item in site.items %}
{% assign item = item %}
{% include picture-item.html %}
@ -26,13 +26,13 @@ extraJS: [ "viewport.js", "demos/animate-in.js" ]
{% assign item = item %}
{% include picture-item.html %}
{% endfor %}
<div class="span3 m-span3 shuffle__sizer"></div>
<div class="col-3@sm col-3@xs shuffle__sizer"></div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="container">
<div class="row">
<h2>Shuffle.js</h2>
<p>{{ site.longDescription }}</p>
<p>This demo was inspired by <a href="http://tympanus.net/codrops/">codrops</a>&rsquo; demo <a href="http://tympanus.net/codrops/2013/07/02/loading-effects-for-grid-items-with-css-animations/">Loading effects for grid items with css animations</a>.</p>

@ -49,7 +49,7 @@ extraJS: [ "demos/padding-grid.js" ]
}
</style>
<div class="container-fluid demo-description">
<div class="container demo-description">
<div class="row">
<div class="col-xs-12">
<h2>Bootstrap 3 Grid</h2>
@ -63,7 +63,7 @@ extraJS: [ "demos/padding-grid.js" ]
</div>
<div class="container-fluid">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-9">
<div class="row">
@ -106,7 +106,7 @@ extraJS: [ "demos/padding-grid.js" ]
</div>
<div class="container-fluid">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2>Shuffle.js</h2>

@ -10,7 +10,7 @@ jquery: false
pagejs: false
---
<div class="container-fluid">
<div class="container">
<h2>RequireJS!</h2>
<p>
Shuffle uses a UMD wrapper, so it is compatible with AMD loaders like <a href="http://requirejs.org">RequireJS</a>. The UMD wrapper also allows Shuffle to work with CommonJS modules. You can take a peek at the <a href="{{ site.baseurl }}/js/require-main.js">config file</a> used on this page.
@ -33,10 +33,10 @@ pagejs: false
}
</style>
<div class="container-fluid shuffle-wrap">
<div id="grid" class="shuffle--container row-fluid">
<div class="container shuffle-wrap">
<div id="grid" class="shuffle--container row">
{% for item in site.items %}
<figure class="js-item img-item span3 m-span3">
<figure class="js-item img-item col-3@sm col-3@xs">
<div class="keep-ratio four-three">
<div class="keep-ratio-inner">
<img src="{{ site.baseurl }}/img/{{ item.img }}" alt="{{item.title}}"/>
@ -45,13 +45,13 @@ pagejs: false
<figcaption>{{ item.groups }}</figcaption>
</figure>
{% endfor %}
<div class="span3 m-span3" id="js-sizer"></div>
<div class="col-3@sm col-3@xs" id="js-sizer"></div>
</div>
</div>
<section>
<div class="container-fluid">
<div class="container">
<h2>Shuffle.js</h2>
<p>{{ site.longDescription }}</p>
</div>

File diff suppressed because it is too large Load Diff

@ -37,17 +37,6 @@ nav > a {
margin: 5px 0;
}
.container-fluid {
width: 93%;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
.row.row--full {
margin-left: 0;
}
.breathable-list li {
line-height: 1.7;
}

@ -0,0 +1,159 @@
$grid-gutter-width: 16px;
$grid-columns: 12;
$grid-container: 'container';
$grid-row: 'row';
$grid-prefix: 'col';
$grid-sizes: (xs, sm, md, lg);
$grid-ratio-name: 'aspect';
$grid-ratio-inner-name: 'aspect__inner';
$grid-container-padding: (
xs: 3.5%,
sm: 7%
);
$grid-max-width--desktop: 1200px;
$grid-ratios: (
(16, 9),
(9, 16),
(4, 3),
(3, 4),
(3, 2),
(3, 1),
(2, 3),
(2, 1),
(1, 2),
(1, 1)
);
// 7% => 0.07
$_grid-padding-pct: map-get($grid-container-padding, "sm") / 100%;
// 0.07 => 0.14 => 0.86
$_grid-padding-value: 1 - $_grid-padding-pct * 2;
// Size of the window when the grid row has hit max-width.
$_viewport-at-max-grid-width: $grid-max-width--desktop / $_grid-padding-value;
$viewport-at-max-grid-width: round($_viewport-at-max-grid-width) + 0px;
$padding-at-max-grid-width: round($_viewport-at-max-grid-width * $_grid-padding-pct) + 0px;
@function get-column-selector($number, $breakpoint) {
@return ".#{$grid-prefix}-#{$number}\\@#{$breakpoint}";
}
@function get-grid-breakpoint-selectors($breakpoint) {
$selectors: ();
@for $i from 1 through $grid-columns {
$selectors: append($selectors, get-column-selector($i, $breakpoint), comma);
}
@return $selectors;
}
@function get-all-grid-breakpoint-selectors() {
$selectors: ();
@each $breakpoint in $grid-sizes {
$selectors: append($selectors, get-grid-breakpoint-selectors($breakpoint), comma);
}
@return $selectors;
}
@mixin make-grid-columns() {
$selectors: get-all-grid-breakpoint-selectors();
#{$selectors} {
position: relative;
box-sizing: border-box;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: ($grid-gutter-width / 2);
padding-right: ($grid-gutter-width / 2);
}
}
@mixin float-grid-columns($breakpoint) {
$selectors: get-grid-breakpoint-selectors($breakpoint);
#{$selectors} {
float: left;
}
}
@mixin grid-ratios($breakpoint: "") {
// If there is a grid breakpoint class here, prepend a @.
// e.g. "@sm" or "" when there isn't a class.
@if $breakpoint != "" {
$breakpoint: "\\@" + $breakpoint;
}
// Note @extend isn't used because it cannot be used within @media directives.
@each $list in $grid-ratios {
$top: nth($list, 1);
$bottom: nth($list, 2);
$name: "#{$top}x#{$bottom}";
.#{$grid-ratio-name}--#{$name}#{$breakpoint} {
padding-bottom: percentage($bottom / $top);
}
}
// A `none` class (eg `aspect--none@xs`) which removes the aspect ratio
.#{$grid-ratio-name}--none#{$breakpoint} {
@include no-aspect();
> .#{$grid-ratio-inner-name} {
position: static;
}
}
}
@mixin calc-grid-column($index, $columns, $breakpoint, $type) {
@if ($type == "width") and ($index > 0) {
.#{$grid-prefix}-#{$index}\@#{$breakpoint} {
width: percentage(($index / $columns));
}
}
@if ($type == "push") and ($index > 0) {
.#{$grid-prefix}-push-#{$index}\@#{$breakpoint} {
left: percentage(($index / $columns));
}
}
@if ($type == "push") and ($index == 0) {
.#{$grid-prefix}-push-0\@#{$breakpoint} {
left: auto;
}
}
@if ($type == "pull") and ($index > 0) {
.#{$grid-prefix}-pull-#{$index}\@#{$breakpoint} {
right: percentage(($index / $columns));
}
}
@if ($type == "pull") and ($index == 0) {
.#{$grid-prefix}-pull-0\@#{$breakpoint} {
right: auto;
}
}
@if ($type == "offset") {
.#{$grid-prefix}-offset-#{$index}\@#{$breakpoint} {
margin-left: percentage(($index / $columns));
}
}
}
@mixin loop-grid-columns($columns, $breakpoint, $type) {
@for $i from 0 through $columns {
@include calc-grid-column($i, $columns, $breakpoint, $type);
}
}
// Create grid for specific class
@mixin make-grid($breakpoint, $columns: $grid-columns) {
@include float-grid-columns($breakpoint);
@include grid-ratios($breakpoint);
@include loop-grid-columns($columns, $breakpoint, "width");
@include loop-grid-columns($columns, $breakpoint, "pull");
@include loop-grid-columns($columns, $breakpoint, "push");
@include loop-grid-columns($columns, $breakpoint, "offset");
}

@ -0,0 +1,126 @@
@import "grid-framework";
// .container
.#{$grid-container} {
padding-left: map-get($grid-container-padding, "xs");
padding-right: map-get($grid-container-padding, "xs");
@include clearfix();
}
// .row
.#{$grid-row} {
margin-left: auto;
margin-right: auto;
@include clearfix();
.#{$grid-row} {
margin-left: $grid-gutter-width / -2;
margin-right: $grid-gutter-width / -2;
}
&--centered {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
}
// .aspect--16x9 etc.
@include grid-ratios();
// .aspect > div or .aspect__inner
.#{$grid-ratio-name} > div,
.#{$grid-ratio-inner-name} {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
// Create basic styles for every grid class.
@include make-grid-columns();
// Only the extra small grid takes effect at all times. Mobile first!
@include make-grid(xs, 6);
@include breakpoint(sm) {
@include make-grid(sm);
// Add more padding to the container class.
.#{$grid-container} {
padding-left: map-get($grid-container-padding, "sm");
padding-right: map-get($grid-container-padding, "sm");
}
.#{$grid-row} {
max-width: $grid-max-width--desktop;
}
}
@media screen and (min-width: $viewport-at-max-grid-width) {
.#{$grid-container} {
}
.#{$grid-row} {
}
}
.code-block {
position: relative;
overflow: visible;
margin-left: calc(-3.5vw - #{($grid-gutter-width / 2)});
margin-right: calc(-3.5vw - #{($grid-gutter-width / 2)});
pre {
position: relative;
z-index: 1;
padding-left: calc(3.5vw + #{($grid-gutter-width / 2)});
padding-right: calc(3.5vw + #{($grid-gutter-width / 2)});
}
}
@include breakpoint(sm) {
.code-block {
margin-left: calc(-7vw - #{($grid-gutter-width / 2)});
margin-right: calc(-7vw - #{($grid-gutter-width / 2)});
pre {
position: relative;
z-index: 1;
padding-left: calc(7vw + #{($grid-gutter-width / 2)});
padding-right: calc(7vw + #{($grid-gutter-width / 2)});
}
}
}
// @include breakpoint(md) {
//
// .code-block {
// margin-left: calc(-3.5vw - #{($grid-gutter-width / 2)});
// margin-right: calc(-3.5vw - #{($grid-gutter-width / 2)});
//
// pre {
// position: relative;
// z-index: 1;
// padding-left: calc(3.5vw + #{($grid-gutter-width / 2)});
// padding-right: calc(3.5vw + #{($grid-gutter-width / 2)});
// }
// }
// }
@media (min-width: $viewport-at-max-grid-width) {
.code-block {
margin-left: calc(((100vw - #{$grid-max-width--desktop}) / -2) - #{$grid-gutter-width / 2});
margin-right: calc(((100vw - #{$grid-max-width--desktop}) / -2) - #{$grid-gutter-width / 2});
pre {
padding-left: calc(((100vw - #{$grid-max-width--desktop}) / 2) + #{$grid-gutter-width / 2});
padding-right: calc(((100vw - #{$grid-max-width--desktop}) / 2) + #{$grid-gutter-width / 2});
}
}
}

@ -0,0 +1,61 @@
// @param {string} bp Breakpoint value. One of `xs, sm, md, lg`.
// @param {boolean} isMaxWidth By default, the media queries are mobile first,
// so they use `min-width: __px`. By passing `true`, the mixin will subtract
// one pixel from the breakpoint value and make it `max-width: __px`.
// @param {boolean} isScreenOnly Whether to hide this media query from print styles.
//
// Note: For print media, we want the default styles and the xs breakpoint to take effect.
@mixin breakpoint($bp, $isMaxWidth: false, $isScreenOnly: true) {
$media-query: get-breakpoint-query($bp, $isMaxWidth);
@if $isScreenOnly {
$media-query: "screen and #{$media-query}";
}
@media #{$media-query} {
@content;
}
}
@mixin clearfix() {
&::after {
content: " ";
display: table;
clear: both;
}
}
@mixin keep-aspect() {
position: relative;
width: 100%;
height: 0;
overflow: hidden;
padding-bottom: 100%;
}
@mixin aspect($width, $height) {
padding-bottom: percentage($height / $width);
}
@mixin no-aspect() {
height: auto;
padding-bottom: 0;
overflow: visible;
}
@function get-breakpoint-query($bp, $isMaxWidth: false) {
$breakpoint: map-get($breakpoints, $bp);
$media: if($isMaxWidth, 'max-width', 'min-width');
@if $isMaxWidth {
$breakpoint: $breakpoint - 1px;
}
@if map-has-key($breakpoints, $bp) {
@return "(#{$media}: #{$breakpoint})";
} @else {
@warn "#{$bp} not recognized. Valid breakpoints: #{map-keys($breakpoints)}";
@return "screen";
}
}

@ -1,24 +0,0 @@
$columns: 6;
$gutterWidth: 2; // 2% gutter width
$columnWidth: (100 - ( $gutterWidth * ( $columns - 1 ))) / $columns;
@media ( max-width: 47.9375em ) {
.m-row {
[class*="m-span"] {
float: left;
margin-left: $gutterWidth + 0%;
&:first-child {
margin-left: 0;
}
}
@for $i from 1 through 6 {
.m-span#{$i} {
width: ($i * $columnWidth) + (($i - 1) * $gutterWidth) + 0%;
}
}
}
}

@ -20,7 +20,8 @@
}
.site-nav__tray-inner {
padding: 30px 0;
padding-top: 30px;
padding-bottom: 30px;
}
&.collapsed .site-nav__tray {
@ -60,7 +61,7 @@
text-align: right;
}
@media screen and (max-width: 47.9375em) {
@include breakpoint(sm, true) {
.site-nav .btn {
margin-bottom: 5px;

@ -66,7 +66,7 @@ h4 {
font-size: 1.25em;
}
@media ( max-width: 47.9375em ) {
@include breakpoint(sm, true) {
h1 {
font-size: 8vw;
margin: 3vw 0;
@ -97,8 +97,6 @@ h3:hover > a {
text-indent: -999em;
}
.unstyled {
list-style-type: none;
padding: 0;
@ -120,3 +118,20 @@ h3:hover > a {
}
}
}
:not(pre) > code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
color: get-color(black);
background-color: rgba(0,0,0,0.04);
border-radius: 3px;
&::before,
&::after {
letter-spacing: -0.2em;
content: "\00a0";
}
}

@ -1,3 +1,11 @@
$breakpoints: (
xs: 0px,
sm: 768px,
md: 1024px,
lg: 1392px,
xl: 1680px
);
// Colors from Flat UI
$turqoise: #1ABC9C;
@ -40,13 +48,3 @@ $gray30: #5D6D77;
$gray40: $concrete;
$gray50: $asbestos;
$white: #FFF;
@mixin clearfix() {
&::after {
content: " ";
display: table;
clear: both;
}
}

@ -1,4 +1,5 @@
@import "variables";
@import "mixins";
/*=============================================*\
Some styles to show off masonry layout
@ -18,8 +19,8 @@ $itemHeight: 220px;
height: ($itemHeight * 2) + $pictureGutter; /* 2x the height + 1 gutter */
}
// Ehh, i should really use something other than span6 to target this...
&.span6:not(.picture-item--h2) {
// Ehh, i should really use something other than col-6@sm to target this...
&.col-6\@sm:not(.picture-item--h2) {
.picture-item__details {
position: absolute;
@ -38,9 +39,10 @@ $itemHeight: 220px;
}
.picture-item__inner {
background: $clouds;
position: relative;
height: 100%;
overflow: hidden;
background: $clouds;
}
img {
@ -66,21 +68,14 @@ $itemHeight: 220px;
.picture-item__tags {
margin: 0;
}
.picture-item__title {
}
}
// Autoprefixer misses a parenthesis.
/* autoprefixer: off */
@supports (filter: blur(1px)) or (-webkit-filter: blur(1px)) {
.picture-item.span6:not(.picture-item--h2) {
@supports (filter: blur(1px)) {
.picture-item.col-6\@sm:not(.picture-item--h2) {
.picture-item__blur {
/* autoprefixer: on */
position: absolute;
z-index: 1;
top: calc(50px - #{$itemHeight}); // Caption is 50px tall.
@ -140,7 +135,7 @@ $itemHeight: 220px;
@media ( max-width: 47.9375em ) {
@include breakpoint(sm, true) {
.picture-item {
height: auto;
@ -162,8 +157,8 @@ $itemHeight: 220px;
}
}
.filter > .row-fluid,
.filter > .row-fluid > div {
.filter > .row,
.filter > .row > div {
margin: 10px 0;
}

@ -1,9 +1,9 @@
@import "variables";
@import "mixins";
@import "normalize";
@import "type";
@import "bootstrap";
@import "mobile-grid";
@import "global";
@import "type";
@import "grid";
@import "site-nav";
@import "demo-list";
@import "faq";

@ -32,11 +32,11 @@
"node_modules",
"bower_components",
"Gruntfile.js",
"gulp",
"gulpfile.js",
"favicon.png",
"index.html",
"package.json",
"robots.txt",
"todo.md",
"test",
"tests",
"webpack.config.js",

@ -55,7 +55,8 @@
border-radius: 50%; }
.shape--diamond .shape__space {
transform: rotate(45deg) scale(0.70711); }
-webkit-transform: rotate(45deg) scale(0.70711);
transform: rotate(45deg) scale(0.70711); }
.shape--triangle .shape__space {
padding-top: 14.5px;
@ -121,6 +122,7 @@ body::before {
width: 100%;
height: 25px;
background-color: rgba(119, 204, 102, 0.6);
-webkit-transition: background .2s ease;
transition: background .2s ease; }
@media (min-width: 1200px) {

@ -9,7 +9,7 @@
.picture-item.picture-item--h2 {
height: 464px;
/* 2x the height + 1 gutter */ }
.picture-item.span6:not(.picture-item--h2) .picture-item__details {
.picture-item.col-6\@sm:not(.picture-item--h2) .picture-item__details {
position: absolute;
bottom: 0;
left: 0;
@ -18,12 +18,13 @@
background-color: rgba(0, 0, 0, 0.6);
color: white;
overflow: hidden; }
.picture-item.span6:not(.picture-item--h2) .picture-item__description {
.picture-item.col-6\@sm:not(.picture-item--h2) .picture-item__description {
display: none; }
.picture-item .picture-item__inner {
background: #ECF0F1;
position: relative;
height: 100%;
overflow: hidden; }
overflow: hidden;
background: #ECF0F1; }
.picture-item img {
display: block;
width: 100%;
@ -40,20 +41,19 @@
.picture-item .picture-item__tags {
margin: 0; }
/* autoprefixer: off */
@supports (filter: blur(1px)) or (-webkit-filter: blur(1px)) {
.picture-item.span6:not(.picture-item--h2) .picture-item__blur {
/* autoprefixer: on */
@supports ((-webkit-filter: blur(1px)) or (filter: blur(1px))) {
.picture-item.col-6\@sm:not(.picture-item--h2) .picture-item__blur {
position: absolute;
z-index: 1;
top: calc(50px - 220px);
left: 0;
display: block;
filter: blur(7px); }
.picture-item.span6:not(.picture-item--h2) .picture-item__details {
-webkit-filter: blur(7px);
filter: blur(7px); }
.picture-item.col-6\@sm:not(.picture-item--h2) .picture-item__details {
background: none; }
.picture-item.span6:not(.picture-item--h2) .picture-item__tags,
.picture-item.span6:not(.picture-item--h2) .picture-item__title {
.picture-item.col-6\@sm:not(.picture-item--h2) .picture-item__tags,
.picture-item.col-6\@sm:not(.picture-item--h2) .picture-item__title {
position: relative;
z-index: 2; } }
@ -77,16 +77,19 @@
.shuffle--animatein .picture-item__inner {
opacity: 0;
transform: translate(0, 220px); }
-webkit-transform: translate(0, 220px);
transform: translate(0, 220px); }
.shuffle--animatein .picture-item__inner--transition {
-webkit-transition: all .6s ease;
transition: all .6s ease; }
.shuffle--animatein .picture-item.in .picture-item__inner {
opacity: 1;
transform: translate(0, 0); }
-webkit-transform: translate(0, 0);
transform: translate(0, 0); }
@media (max-width: 47.9375em) {
@media screen and (max-width: 767px) {
.picture-item {
height: auto;
margin-top: 20px; }
@ -99,8 +102,8 @@
.picture-item .picture-item__description {
padding-right: .875em;
padding-bottom: 1.25em; }
.filter > .row-fluid,
.filter > .row-fluid > div {
.filter > .row,
.filter > .row > div {
margin: 10px 0; }
.m-nofloat {
float: none; } }

File diff suppressed because it is too large Load Diff

2
dist/shuffle.js vendored

@ -414,6 +414,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Set the initial css for each item
* @param {Array.<ShuffleItem>} [items] Optionally specifiy at set to initialize.
* @private
*/
}, {
@ -428,6 +429,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Remove element reference and styles.
* @private
*/
}, {

@ -0,0 +1,4 @@
module.exports = {
watch: false,
};

@ -0,0 +1,31 @@
'use strict';
const gutil = require('gulp-util');
const webpack = require('webpack');
const config = require('../config');
module.exports = function compile(done) {
let main = Object.assign({}, require('../../webpack.config.js'));
let min = Object.assign({}, require('../../webpack.config.min.js'));
let compiler = webpack([main, min]);
let isDone = false;
function callback(err, stats) {
if (err) {
throw new Error(err);
}
gutil.log(stats.toString({ colors: true }));
if (!isDone) {
isDone = true;
done();
}
}
if (config.watch) {
compiler.watch({}, callback);
} else {
compiler.run(callback);
}
};

@ -0,0 +1,17 @@
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
module.exports = function css() {
return gulp.src([
'./_scss/gallery.scss',
'./_scss/shuffle-styles.scss',
'./_scss/style.scss',
])
.pipe(sass())
.pipe(postcss([autoprefixer()]))
.pipe(gulp.dest('./css/'));
};

@ -0,0 +1,11 @@
'use strict';
const gulp = require('gulp');
const shell = require('gulp-shell');
module.exports = function jekyll() {
let cmd = 'jekyll serve --watch --config _config.yml,_config_dev.yml';
return gulp.src('_config.yml', { read: false })
.pipe(shell([cmd]));
};

@ -0,0 +1,11 @@
'use strict';
const gulp = require('gulp');
const config = require('../config');
const cssTask = require('./css');
module.exports = function setWatching(done) {
config.watch = true;
gulp.watch('_scss/*.scss', cssTask);
done();
};

@ -1,75 +1,11 @@
'use strict';
const gulp = require('gulp');
const gutil = require('gulp-util');
const webpack = require('webpack');
const shell = require('gulp-shell');
const sass = require('gulp-sass');
let config = {
watch: false,
};
function compile(done) {
let main = Object.assign({}, require('./webpack.config.js'));
let min = Object.assign({}, require('./webpack.config.min.js'));
let compiler = webpack([main, min]);
let isDone = false;
function callback(err, stats) {
if (err) {
throw new Error(err);
}
gutil.log(stats.toString({ colors: true }));
if (!isDone) {
isDone = true;
done();
}
}
if (config.watch) {
compiler.watch({}, callback);
} else {
compiler.run(callback);
}
}
function jekyll() {
let cmd = 'jekyll serve --watch --config _config.yml,_config_dev.yml';
return gulp.src('_config.yml', { read: false })
.pipe(shell([cmd]));
}
function setWatching(done) {
config.watch = true;
gulp.watch('_scss/*.scss', css);
done();
}
function css() {
return gulp.src([
'./_scss/gallery.scss',
'./_scss/shuffle-styles.scss',
'./_scss/style.scss',
])
.pipe(sass())
.pipe(gulp.dest('./css/'));
}
// function test() {
// return gulp.src('test/specs.js')
// .pipe(jasmine());
// }
// gulp.task(test);
gulp.task('scripts', compile);
gulp.task('set-watching', setWatching);
gulp.task(css);
gulp.task(jekyll);
gulp.task('scripts', require('./gulp/tasks/compile'));
gulp.task('set-watching', require('./gulp/tasks/set-watching'));
gulp.task('css', require('./gulp/tasks/css'));
gulp.task('jekyll', require('./gulp/tasks/jekyll'));
gulp.task('watch', gulp.series(
'set-watching',

@ -7,16 +7,20 @@ includeHeader: true
prism: true
---
<section id="install">
<div class="container-fluid">
<h2>Install<a href="#install"></a></h2>
<div class="row-fluid">
<div class="span12">
<pre><code class="language">npm install shufflejs --save</code></pre>
<div class="container">
<div class="row">
<div class="col-12@sm">
<h2>Install<a href="#install"></a></h2>
</div>
<div class="col-12@sm">
<div class="code-block">
<pre><code class="language">npm install shufflejs --save</code></pre>
</div>
<p>Shuffle is also available on bower as <code>shufflejs</code>.</p>
</div>
</div>
<div class="row-fluid">
<nav class="span6" role="secondary">
<div class="row">
<nav class="col-6@sm" role="secondary">
<a href="https://github.com/Vestride/Shuffle">View the GitHub repository</a>
<a href="https://github.com/Vestride/Shuffle/releases">See the latest releases</a>
</nav>
@ -26,17 +30,23 @@ prism: true
<section id="demo">
<div class="container-fluid">
<h2>Example<a href="#demo"></a></h2>
<div class="container">
<div class="row">
<div class="col-12@sm">
<h2>Example<a href="#demo"></a></h2>
</div>
</div>
</div>
<div class="container-fluid filter">
<div class="container filter">
<div class="row-fluid">
<input class="filter__search js-shuffle-search" type="search" placeholder="Search..." />
<div class="row">
<div class="col-12@sm">
<input class="filter__search js-shuffle-search" type="search" placeholder="Search..." />
</div>
</div>
<div class="row-fluid">
<div class="span9">
<div class="row">
<div class="col-9@sm">
<p class="filter__label">Filter:</p>
<div class="filter-options btn-group">
<button class="btn btn--warning" data-group="wallpaper">Wallpapers</button>
@ -45,7 +55,7 @@ prism: true
<button class="btn btn--warning" data-group="3d">3D Renders</button>
</div>
</div>
<div class="span3">
<div class="col-3@sm">
<div class="m-nofloat pull-right">
<p class="filter__label">Sort:</p>
<select class="sort-options">
@ -59,119 +69,175 @@ prism: true
</div>
<div class="container-fluid">
<div id="grid" class="row-fluid m-row shuffle--container shuffle--fluid">
<div class="container">
<div id="grid" class="row shuffle--container shuffle--fluid">
{% for item in site.items %}
{% assign item = item %}
{% include picture-item.html %}
{% endfor %}
<div class="span3 m-span3 shuffle__sizer"></div>
<div class="col-3@sm col-3@xs shuffle__sizer"></div>
</div>
</div>
</section>
<section id="demos">
<div class="container-fluid">
<h2>Demos<a href="#demos"></a></h2>
<div class="container">
<div class="row">
<div class="col-12@sm">
<h2>Demos<a href="#demos"></a></h2>
</div>
</div>
{% include demo-list.html %}
</div>
</section>
<section id="features">
<div class="container-fluid">
{% include features.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include features.html %}
</div>
</div>
</div>
</section>
<section id="options">
<div class="container-fluid">
{% include options.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include options.html %}
</div>
</div>
</div>
</section>
<section id="usage">
<div class="container-fluid">
{% include usage.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include usage.html %}
</div>
</div>
</div>
</section>
<section id="events">
<div class="container-fluid">
{% include events.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include events.html %}
</div>
</div>
</div>
</section>
<section id="sorting">
<div class="container-fluid">
{% include sorting.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include sorting.html %}
</div>
</div>
</div>
</section>
<section id="advanced-filters">
<div class="container-fluid">
{% include advanced-filters.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include advanced-filters.html %}
</div>
</div>
</div>
</section>
<section id="adding-removing">
<div class="container-fluid">
{% include adding-removing.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include adding-removing.html %}
</div>
</div>
</div>
</section>
<section id="public-methods">
<div class="container-fluid">
{% include public-methods.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include public-methods.html %}
</div>
</div>
</div>
</section>
<section id="extra-features">
<div class="container-fluid">
<h2>Extra Features<a href="#extra-features"></a></h2>
<div class="container">
<div class="row">
<div class="col-12@sm">
<h2>Extra Features<a href="#extra-features"></a></h2>
<p>Shuffle likely will not grow much farther than the current feature set. If you need something with drag and drop, filling in gaps, more layout modes, etc., I suggest looking into <a target="_blank" href="http://packery.metafizzy.co/">packery</a> or <a target="_blank" href="http://isotope.metafizzy.co/">isotope</a>.</p>
<p>Shuffle likely will not grow much farther than the current feature set. If you need something with drag and drop, filling in gaps, more layout modes, etc., I suggest looking into <a target="_blank" href="http://packery.metafizzy.co/">packery</a> or <a target="_blank" href="http://isotope.metafizzy.co/">isotope</a>.</p>
</div>
</div>
</div>
</section>
<section id="dependencies">
<div class="container-fluid">
<h2>Dependencies<a href="#dependencies"></a></h2>
<div class="container">
<div class="row">
<div class="col-12@sm">
<h2>Dependencies<a href="#dependencies"></a></h2>
</div>
</div>
</div>
</section>
<section id="browsers">
<div class="container-fluid">
<h2>Supported Browsers<a href="#browsers"></a></h2>
<ul>
<li>Chrome</li>
<li>Firefox</li>
<li>IE 11+</li>
<li>Safari</li>
</ul>
<p>Many other browsers will likely work as well and support for others may be added with polyfills for ES5 features. If you require broader browser support, use the most recent <code>v3</code> of Shuffle.</p>
<div class="container">
<div class="row">
<div class="col-12@sm">
<h2>Supported Browsers<a href="#browsers"></a></h2>
<ul>
<li>Chrome</li>
<li>Firefox</li>
<li>IE 11+</li>
<li>Safari</li>
</ul>
<p>Many other browsers will likely work as well and support for others may be added with polyfills for ES5 features. If you require broader browser support, use the most recent <code>v3</code> of Shuffle.</p>
</div>
</div>
</div>
</section>
<section id="be-social">
<div class="container-fluid">
<h2>Be Social<a href="#be-social"></a></h2>
<div class="text-center">
<iframe src="http://ghbtns.com/github-btn.html?user=Vestride&repo=Shuffle&type=watch&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true" seamless></iframe>
<div class="container">
<div class="row">
<div class="col-12@sm">
<h2>Be Social<a href="#be-social"></a></h2>
<div class="text-center">
<iframe src="http://ghbtns.com/github-btn.html?user=Vestride&repo=Shuffle&type=watch&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true" seamless></iframe>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://vestride.github.io/Shuffle/" data-via="Vestride" data-size="large">Tweet</a>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://vestride.github.io/Shuffle/" data-via="Vestride" data-size="large">Tweet</a>
<div class="g-plusone" data-href="http://vestride.github.io/Shuffle/" data-size="standard" data-annotation="bubble"></div>
<div class="g-plusone" data-href="http://vestride.github.io/Shuffle/" data-size="standard" data-annotation="bubble"></div>
</div>
</div>
</div>
</div>
</section>
<section id="changelog">
<div class="container-fluid">
{% include changelog.html %}
<div class="container">
<div class="row">
<div class="col-12@sm">
{% include changelog.html %}
</div>
</div>
</div>
</section>

@ -49,12 +49,14 @@
"xtend": "^4.0.1"
},
"devDependencies": {
"autoprefixer": "^6.3.4",
"babel-core": "^6.5.2",
"babel-jest": "^6.0.1",
"babel-loader": "^6.2.2",
"babel-preset-es2015": "^6.5.0",
"babel-register": "^6.5.2",
"gulp": "gulpjs/gulp.git#4.0",
"gulp-postcss": "^6.1.0",
"gulp-sass": "^2.2.0",
"gulp-shell": "^0.5.2",
"gulp-util": "^3.0.7",

@ -293,6 +293,7 @@ class Shuffle {
/**
* Set the initial css for each item
* @param {Array.<ShuffleItem>} [items] Optionally specifiy at set to initialize.
* @private
*/
_initItems(items = this.items) {
items.forEach((item) => {
@ -302,6 +303,7 @@ class Shuffle {
/**
* Remove element reference and styles.
* @private
*/
_disposeItems(items = this.items) {
items.forEach((item) => {
@ -441,7 +443,8 @@ class Shuffle {
var calculatedColumns = (containerWidth + gutter) / columnWidth;
// Widths given from getStyles are not precise enough...
if (Math.abs(Math.round(calculatedColumns) - calculatedColumns) < this.options.columnThreshold) {
if (Math.abs(Math.round(calculatedColumns) - calculatedColumns) <
this.options.columnThreshold) {
// e.g. calculatedColumns = 11.998876
calculatedColumns = Math.round(calculatedColumns);
}
@ -714,7 +717,7 @@ class Shuffle {
let y = item.point.y;
if (this.options.useTransforms) {
styles.transform = `translate(${ x }px, ${ y }px) scale(${ item.scale })`;
styles.transform = `translate(${x}px, ${y}px) scale(${item.scale})`;
} else {
styles.left = x + 'px';
styles.top = y + 'px';
@ -785,9 +788,7 @@ class Shuffle {
this._styleImmediately(immediates);
let promises = transitions.map((obj) => {
return this._transition(obj);
});
let promises = transitions.map(obj => this._transition(obj));
if (transitions.length > 0 && this.options.speed > 0) {
// Set flag that shuffle is currently in motion.

Loading…
Cancel
Save