Rinser/html/js/zprogress.min.js

3 lines
1012 B
JavaScript
Raw Normal View History

2015-07-30 15:51:53 +00:00
!function(e){function t(){i||(e("body").append(d),i=e("#zprogress"),n=e("#zprogress_indicator"))}function s(){n.animate({translateX:100*r+"%"},200)}function o(){l&&clearTimeout(l),l=void 0}function a(){l=setTimeout(function(){e.zprogress.inc(.035*(f-r)*Math.random()),a()},350+400*Math.random())}var i,n,r,l,d="<style>#zprogress{position:fixed;top:0;left:0;width:100%;height:3px;opacity:0;pointer-events:none;-webkit-pointer-events:none;z-index:1000}#zprogress_indicator{width:100%;margin-left:-100%;height:100%;background:#1c88ff}</style><div id=zprogress><div id=zprogress_indicator></div></div>",h=12.5,p=h/100,f=1-p;e.zprogress={start:function(){t(),o(),r=p,i.animate({opacity:1}),n.animate({translateX:"0%"},0),setTimeout(function(){s(),a()},0)},inc:function(e){f>r&&(r+=e||.05),s()},set:function(e){t(),o(),r=e,s(),a()},done:function(){t(),o(),r=1,s(),setTimeout(function(){i.animate({opacity:0})},100)},color:function(e){t(),n.css({backgroundColor:e})}}}(Zepto);
//# sourceMappingURL=zprogress.min.js.map