+
diff --git a/_scss/_grid.scss b/_scss/_grid.scss
index e9f796e..6f5a21e 100644
--- a/_scss/_grid.scss
+++ b/_scss/_grid.scss
@@ -25,6 +25,11 @@
}
}
+// .aspect
+.#{$grid-ratio-name} {
+ @include keep-aspect();
+}
+
// .aspect--16x9 etc.
@include grid-ratios();
diff --git a/_scss/_helpers.scss b/_scss/_helpers.scss
index 6999d51..42e377e 100644
--- a/_scss/_helpers.scss
+++ b/_scss/_helpers.scss
@@ -4,27 +4,6 @@
display: inline-block;
}
-.aspect,
-.keep-ratio {
- position: relative;
- width: 100%;
- height: 0;
- overflow: hidden;
- padding-bottom: 100%;
-
- &.four-three {
- padding-bottom: 75%;
- }
-}
-
-.aspect--4x3 {
- padding-bottom: 75%;
-}
-
-.aspect--16x9 {
- padding-bottom: 56.25%;
-}
-
// Hide from both screenreaders and browsers.
.hidden {
display: none !important;
@@ -58,6 +37,9 @@
float: right;
}
+.full-width { width: 100%; }
+.full-height { height: 100%; }
+
.hide-text {
font: 0/0 a;
color: transparent;
diff --git a/_scss/gallery.scss b/_scss/gallery.scss
index d008ba1..11e4534 100644
--- a/_scss/gallery.scss
+++ b/_scss/gallery.scss
@@ -105,7 +105,7 @@
// IE8 filter alpha wasn't working with the positioning stuff
.lt-ie9 .shape {
- .keep-ratio {
+ .aspect {
position: static;
width: 100%;
height: 250px;
diff --git a/css/gallery.css b/css/gallery.css
index cf24cc1..b3f1b54 100644
--- a/css/gallery.css
+++ b/css/gallery.css
@@ -65,7 +65,7 @@
border-width: 0 110px 191px 110px;
background-color: transparent; }
-.lt-ie9 .shape .keep-ratio {
+.lt-ie9 .shape .aspect {
position: static;
width: 100%;
height: 250px;
diff --git a/css/prism.css b/css/prism.css
index 93ab4ae..57ba41d 100644
--- a/css/prism.css
+++ b/css/prism.css
@@ -1,4 +1,4 @@
-/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+scss */
+/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+scss&plugins=line-highlight+file-highlight */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
@@ -136,3 +136,51 @@ pre[class*="language-"] {
.token.entity {
cursor: help;
}
+
+pre[data-line] {
+ position: relative;
+ padding: 1em 0 1em 3em;
+}
+
+.line-highlight {
+ position: absolute;
+ left: 0;
+ right: 0;
+ padding: inherit 0;
+ margin-top: 1em; /* Same as .prism’s padding-top */
+
+ background: hsla(24, 20%, 50%,.08);
+ background: -moz-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+ background: -webkit-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+ background: -o-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+ background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+
+ pointer-events: none;
+
+ line-height: inherit;
+ white-space: pre;
+}
+
+ .line-highlight:before,
+ .line-highlight[data-end]:after {
+ content: attr(data-start);
+ position: absolute;
+ top: .4em;
+ left: .6em;
+ min-width: 1em;
+ padding: 0 .5em;
+ background-color: hsla(24, 20%, 50%,.4);
+ color: hsl(24, 20%, 95%);
+ font: bold 65%/1.5 sans-serif;
+ text-align: center;
+ vertical-align: .3em;
+ border-radius: 999px;
+ text-shadow: none;
+ box-shadow: 0 1px white;
+ }
+
+ .line-highlight[data-end]:after {
+ content: attr(data-end);
+ top: auto;
+ bottom: .4em;
+ }
diff --git a/css/style.css b/css/style.css
index 3ca6fa5..c7a9ef3 100644
--- a/css/style.css
+++ b/css/style.css
@@ -538,6 +538,13 @@ h3:hover > a {
-ms-flex-pack: center;
justify-content: center; }
+.aspect {
+ position: relative;
+ width: 100%;
+ height: 0;
+ overflow: hidden;
+ padding-bottom: 100%; }
+
.aspect--16x9 {
padding-bottom: 56.25%; }
@@ -1171,23 +1178,6 @@ button {
.ib {
display: inline-block; }
-.aspect,
-.keep-ratio {
- position: relative;
- width: 100%;
- height: 0;
- overflow: hidden;
- padding-bottom: 100%; }
- .aspect.four-three,
- .keep-ratio.four-three {
- padding-bottom: 75%; }
-
-.aspect--4x3 {
- padding-bottom: 75%; }
-
-.aspect--16x9 {
- padding-bottom: 56.25%; }
-
.hidden {
display: none !important;
visibility: hidden; }
@@ -1214,6 +1204,12 @@ button {
.pull-right {
float: right; }
+.full-width {
+ width: 100%; }
+
+.full-height {
+ height: 100%; }
+
.hide-text {
font: 0/0 a;
color: transparent;
diff --git a/js/demos/images.js b/js/demos/images.js
index a551345..a47f0eb 100644
--- a/js/demos/images.js
+++ b/js/demos/images.js
@@ -1,54 +1,6 @@
+var Shuffle = window.shuffle;
-// For this demo, shuffle won't be initialized until
-// all the images have finished loading.
-
-// Another approach would be to initialize shuffle on document
-// ready and as imagesLoaded reports back progress, call shuffle.layout()
-
-// imagesLoaded: https://github.com/desandro/imagesloaded
-
-var ImageDemo = (function( $, imagesLoaded ) {
-
- var $shuffle = $('.shuffle--images'),
- $imgs = $shuffle.find('img'),
- $loader = $('#loader'),
- sizer = document.getElementById('js-sizer'),
- imgLoad,
-
- init = function() {
-
- // Create a new imagesLoaded instance
- imgLoad = new imagesLoaded( $imgs.get() );
-
- // Listen for when all images are done
- // will be executed even if some images fail
- imgLoad.on( 'always', onAllImagesFinished );
- },
-
- onAllImagesFinished = function( instance ) {
-
- if ( window.console && window.console.log ) {
- console.log( instance );
- }
-
- // Hide loader
- $loader.addClass('hidden');
-
- // Adds visibility: visible;
- $shuffle.addClass('images-loaded');
-
- // Initialize shuffle
- $shuffle.shuffle({
- sizer: sizer,
- itemSelector: '.js-item'
- });
- };
-
- return {
- init: init
- };
-}( jQuery, window.imagesLoaded ));
-
-$(document).ready(function() {
- ImageDemo.init();
+window.myShuffle = new Shuffle(document.querySelector('.my-grid-with-images'), {
+ itemSelector: '.js-item',
+ sizer: '.shuffle__sizer',
});
diff --git a/js/prism.js b/js/prism.js
index bc726b1..0037318 100644
--- a/js/prism.js
+++ b/js/prism.js
@@ -1,8 +1,9 @@
-/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+scss&plugins=file-highlight */
+/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+scss&plugins=line-highlight+file-highlight */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(m instanceof a)){u.lastIndex=0;var y=u.exec(m),v=1;if(!y&&h&&p!=r.length-1){var b=r[p+1].matchedStr||r[p+1],k=m+b;if(p
=m.length)continue;var _=y.index+y[0].length,P=m.length+b.length;if(v=3,P>=_){if(r[p+1].greedy)continue;v=2,k=k.slice(0,P)}m=k}if(y){g&&(f=y[1].length);var w=y.index+f,y=y[0].slice(f),_=w+y.length,S=m.slice(0,w),O=m.slice(_),j=[p,v];S&&j.push(S);var A=new a(i,c?n.tokenize(y,c):y,d,y,h);j.push(A),O&&j.push(O),Array.prototype.splice.apply(r,j)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.matchedStr=a||null,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==l.type&&(l.attributes.spellcheck="true"),e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o="";for(var s in l.attributes)o+=(o?" ":"")+s+'="'+(l.attributes[s]||"")+'"';return"<"+l.tag+' class="'+l.classes.join(" ")+'" '+o+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",n.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
Prism.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(