Adding bower_components to _site, they wont be gitignored
This commit is contained in:
parent
8038a31de7
commit
2824ba5aaf
274 changed files with 46334 additions and 3 deletions
104
_site/bower_components/imagefill.js/js/jquery-imagefill.js
vendored
Executable file
104
_site/bower_components/imagefill.js/js/jquery-imagefill.js
vendored
Executable file
|
|
@ -0,0 +1,104 @@
|
|||
/**
|
||||
* imagefill.js
|
||||
* Author & copyright (c) 2013: John Polacek
|
||||
* johnpolacek.com
|
||||
* https://twitter.com/johnpolacek
|
||||
*
|
||||
* Dual MIT & GPL license
|
||||
*
|
||||
* Project Page: http://johnpolacek.github.io/imagefill.js
|
||||
*
|
||||
* The jQuery plugin for making images fill their containers (and be centered)
|
||||
*
|
||||
* EXAMPLE
|
||||
* Given this html:
|
||||
* <div class="container"><img src="myawesomeimage" /></div>
|
||||
* $('.container').imagefill(); // image stretches to fill container
|
||||
*
|
||||
* REQUIRES:
|
||||
* imagesLoaded - https://github.com/desandro/imagesloaded
|
||||
*
|
||||
*/
|
||||
;(function($) {
|
||||
|
||||
$.fn.imagefill = function(options) {
|
||||
|
||||
var $container = this,
|
||||
$img = $container.find('img').addClass('loading').css({'position':'absolute'}),
|
||||
imageAspect = 1/1,
|
||||
containersH = 0,
|
||||
containersW = 0,
|
||||
defaults = {
|
||||
runOnce: false,
|
||||
throttle : 200 // 5fps
|
||||
},
|
||||
settings = $.extend({}, defaults, options);
|
||||
|
||||
// make sure container isn't position:static
|
||||
var containerPos = $container.css('position');
|
||||
$container.css({'overflow':'hidden','position':(containerPos === 'static') ? 'relative' : containerPos});
|
||||
|
||||
// set containerH, containerW
|
||||
$container.each(function() {
|
||||
containersH += $(this).outerHeight();
|
||||
containersW += $(this).outerWidth();
|
||||
});
|
||||
|
||||
// wait for image to load, then fit it inside the container
|
||||
$container.imagesLoaded().done(function(img) {
|
||||
imageAspect = $img.width() / $img.height();
|
||||
$img.removeClass('loading');
|
||||
fitImages();
|
||||
if (!settings.runOnce) {
|
||||
checkSizeChange();
|
||||
}
|
||||
});
|
||||
|
||||
function fitImages() {
|
||||
containersH = 0;
|
||||
containersW = 0;
|
||||
$container.each(function() {
|
||||
imageAspect = $(this).find('img').width() / $(this).find('img').height();
|
||||
var containerW = $(this).outerWidth(),
|
||||
containerH = $(this).outerHeight();
|
||||
containersH += $(this).outerHeight();
|
||||
containersW += $(this).outerWidth();
|
||||
|
||||
var containerAspect = containerW/containerH;
|
||||
if (containerAspect < imageAspect) {
|
||||
// taller
|
||||
$(this).find('img').css({
|
||||
width: 'auto',
|
||||
height: containerH,
|
||||
top:0,
|
||||
left:-(containerH*imageAspect-containerW)/2
|
||||
});
|
||||
} else {
|
||||
// wider
|
||||
$(this).find('img').css({
|
||||
width: containerW,
|
||||
height: 'auto',
|
||||
top:-(containerW/imageAspect-containerH)/2,
|
||||
left:0
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkSizeChange() {
|
||||
var checkW = 0,
|
||||
checkH = 0;
|
||||
$container.each(function() {
|
||||
checkH += $(this).outerHeight();
|
||||
checkW += $(this).outerWidth();
|
||||
});
|
||||
if (containersH !== checkH || containersW !== checkW) {
|
||||
fitImages();
|
||||
}
|
||||
setTimeout(checkSizeChange, settings.throttle);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
5
_site/bower_components/imagefill.js/js/vendor/html5shiv.js
vendored
Executable file
5
_site/bower_components/imagefill.js/js/vendor/html5shiv.js
vendored
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
|
||||
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
|
||||
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
|
||||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
|
||||
for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
|
||||
6
_site/bower_components/imagefill.js/js/vendor/jquery-1.10.1.min.js
vendored
Executable file
6
_site/bower_components/imagefill.js/js/vendor/jquery-1.10.1.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue