Update progressively to 1.1.5 release (#122)

This commit is contained in:
Elliot Jordan
2019-06-23 19:23:05 -07:00
committed by Michael Noronha
parent 55588aeba1
commit 5005ba9f31
2 changed files with 4 additions and 3 deletions

View File

@@ -1 +1 @@
.progressive{overflow:hidden;position:relative;background:#efefef}.progressive__img{width:100%;height:100%;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0)}.progressive--not-loaded{filter:blur(30px);-webkit-filter:blur(30px)}.progressive--is-loaded{filter:blur(20px);-webkit-filter:blur(20px);-webkit-animation:sharpen .5s both;animation:sharpen .5s both}@-webkit-keyframes sharpen{from{filter:blur(20px);-webkit-filter:blur(20px)}to{filter:blur(0);-webkit-filter:blur(0)}}@keyframes sharpen{from{filter:blur(20px);-webkit-filter:blur(20px)}to{filter:blur(0);-webkit-filter:blur(0)}}
.progressive{overflow:hidden;position:relative;background:#efefef}.progressive__img{width:100%;height:100%;transform:translateZ(0)}.progressive--not-loaded{filter:blur(30px)}.progressive--is-loaded{filter:blur(20px);animation:a .5s both}@keyframes a{0%{filter:blur(20px)}to{filter:blur(0)}}

View File

@@ -1,7 +1,8 @@
/*!
* progressively 1.0.0
* progressively 1.1.5
* https://github.com/thinker3197/progressively
* @license MIT licensed
*
* Copyright (C) 2016 Ashish
*/!function(a,b){"function"==typeof define&&define.amd?define(function(){return b(a)}):"object"==typeof exports?module.exports=b:a.progressively=b(a)}(this,function(a){"use strict";function b(a,b){var c={};for(var d in a)c[d]=b.hasOwnProperty(d)?b[d]:a[d];return c}function c(a){return null===a.offsetParent}function d(a,b){if(c(a))return!1;var d=a.getBoundingClientRect();return d.top>=0&&d.left>=0&&d.right<=(window.innerWidth||document.el.clientWidth)&&(d.bottom<=(window.innerHeight||document.el.clientHeight)||a.clientHeight>=window.innerHeight)}function e(a){setTimeout(function(){var b=new Image;b.onload=function(){a.classList.remove("progressive--not-loaded"),a.classList.add("progressive--is-loaded"),a.src=this.src,i(a)},b.src=a.dataset.progressive},g.delay)}function f(){h||(clearTimeout(h),h=setTimeout(function(){k.check(),k.render(),h=null},g.throttle))}var g,h,i,j,k={};return i=function(){},g={throttle:300,delay:100,onLoadComplete:function(){},onLoad:function(){}},k.init=function(c){c=c||{},g=b(g,c),i=g.onLoad||i,j=[].slice.call(document.querySelectorAll(".progressive__img")),k.render(),document.addEventListener?(a.addEventListener("scroll",f,!1),a.addEventListener("load",f,!1)):(a.attachEvent("onscroll",f),a.attachEvent("onload",f))},k.render=function(){for(var a,b=j.length-1;b>=0;--b)a=j[b],d(a)&&a.classList.contains("progressive--not-loaded")&&(e(a),j.splice(b,1));this.check()},k.check=function(){j.length||(g.onLoadComplete(),this.drop())},k.drop=function(){document.removeEventListener?a.removeEventListener("scroll",f):a.detachEvent("onscroll",f),clearTimeout(h)},k});
*/
!function(e,t){"function"==typeof define&&define.amd?define(function(){return t(e)}):"object"==typeof exports?module.exports=t:e.progressively=t(e)}(this,function(e){"use strict";function t(e,t){var n={};for(var o in e)n[o]=t.hasOwnProperty(o)?t[o]:e[o];return n}function n(e){var t=e.getBoundingClientRect(),n=t.top,o=t.height;e=e.parentNode;do{if(t=e.getBoundingClientRect(),!(n<=t.bottom))return!1;if(n+o<=t.top)return!1;e=e.parentNode}while(e!==document.body&&e!==document);return n<=document.documentElement.clientHeight}function o(e,t){setTimeout(function(){var n=new Image;n.onload=function(){e.classList.remove("progressive--not-loaded"),e.classList.add("progressive--is-loaded"),e.classList.contains("progressive__bg")?e.style["background-image"]='url("'+this.src+'")':e.src=this.src,a(e)},s()<t.smBreakpoint&&e.getAttribute("data-progressive-sm")&&(e.classList.add("progressive--loaded-sm"),n.src=e.getAttribute("data-progressive-sm")),e.classList.remove("progressive--loaded-sm"),n.src=e.getAttribute("data-progressive")},t.delay)}function s(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)}function r(){c||(clearTimeout(c),c=setTimeout(function(){u.check(),u.render(),c=null},i.throttle))}var i,c,a,d,l,u={};return a=function(){},i={throttle:300,delay:100,onLoadComplete:function(){},onLoad:function(){},smBreakpoint:600},u.init=function(n){n=n||{},i=t(i,n),a=i.onLoad||a,d=[].slice.call(document.querySelectorAll(".progressive__img, .progressive__bg")),l=[],u.render(),document.addEventListener?(e.addEventListener("scroll",r,!1),e.addEventListener("resize",r,!1),e.addEventListener("load",r,!1)):(e.attachEvent("onscroll",r),e.attachEvent("onresize",r),e.attachEvent("onload",r))},u.render=function(){for(var e,t=d.length-1;t>=0;--t)e=d[t],n(e)&&(e.classList.contains("progressive--not-loaded")||e.classList.contains("progressive--loaded-sm"))&&(o(e,i),e.classList.contains("progressive--loaded-sm")&&l.push(e),d.splice(t,1));if(s()>=i.smBreakpoint)for(var r=l.length-1;r>=0;--r)e=l[r],n(e)&&(e.classList.contains("progressive--not-loaded")||e.classList.contains("progressive--loaded-sm"))&&(o(e,i),l.splice(t,1));this.check()},u.check=function(){d.length||l.length||(i.onLoadComplete(),this.drop())},u.drop=function(){document.removeEventListener?(e.removeEventListener("scroll",r),e.removeEventListener("resize",r)):(e.detachEvent("onscroll",r),e.detachEvent("onresize",r)),clearTimeout(c)},u});