From 42cac49330ff111bdbc13c46a177badcb84b5915 Mon Sep 17 00:00:00 2001 From: Brandon Raitt Date: Sun, 25 Oct 2015 23:44:18 -0400 Subject: [PATCH] Compress JS for fix for issue #11. --- jquery.foggy.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.foggy.min.js b/jquery.foggy.min.js index e9ed4c9..c1f678c 100644 --- a/jquery.foggy.min.js +++ b/jquery.foggy.min.js @@ -4,4 +4,4 @@ // Homepage: http://nbartlomiej.github.com/foggy // Author: nbartlomiej@gmail.com -!function(t){t.fn.foggy=function(e){var i,n={opacity:.8,blurRadius:2,quality:16,cssFilterSupport:!0},s={opacity:1,blurRadius:0};i=0==e?t.extend(n,s):t.extend(n,e);var r=function(t,e,i,n){this.content=t,this.position=e,this.offset=i,this.opacity=n};r.prototype.render=function(e){t("
",{html:this.content,"class":"foggy-pass-"+this.position}).css({position:this.position,opacity:this.opacity,top:this.offset[0],left:this.offset[1]}).appendTo(e)};var o=function(t){this.radius=t};o.prototype.includes=function(t,e){return Math.pow(t,2)+Math.pow(e,2)<=Math.pow(this.radius,2)?!0:!1},o.prototype.points=function(){for(var t=[],e=-this.radius;e<=this.radius;e++)for(var i=-this.radius;i<=this.radius;i++)this.includes(e,i)&&t.push([e,i]);return t};var a=function(t,e){this.element=t,this.settings=e};a.prototype.calculateOffsets=function(e,i){var n,s=t.grep(new o(e).points(),function(t){return 0!=t[0]||0!=t[1]});if(s.length<=i)n=s;else{for(var r=s.length-i,a=[],u=0;r>u;u++)a.push(Math.round(u*(s.length/r)));n=t.grep(s,function(e,i){return t.inArray(i,a)>=0?!1:!0})}return n},a.prototype.getContent=function(){var e=t(this.element).find(".foggy-pass-relative")[0];return e?t(e).html():t(this.element).html()},a.prototype.render=function(){var e=this.getContent();t(this.element).empty();var i=t("
").css({position:"relative"}),n=this.calculateOffsets(2*this.settings.blurRadius,this.settings.quality),s=1.2*this.settings.opacity/(n.length+1);new r(e,"relative",[0,0],s).render(i),t(n).each(function(t,n){new r(e,"absolute",n,s).render(i)}),i.appendTo(this.element),0===this.settings.blurRadius&&(e=this.getContent(),t(this.element).empty().append(e))};var u=function(t,e){this.element=t,this.settings=e};return u.prototype.render=function(){var e=((""+i.opacity).slice(2,4),this.settings.blurRadius);t(this.element).css({"-webkit-filter":1>e?"none":"blur("+e+"px)","-moz-filter":1>e?"none":"blur("+e+"px)",filter:1>e?"none":"blur("+e+"px)",opacity:i.opacity})},this.each(function(t,e){i.cssFilterSupport&&"-webkit-filter"in document.body.style?new u(e,i).render():navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.indexOf("Trident")>0||navigator.userAgent.indexOf("Edge")>0?new a(e,i).render():i.cssFilterSupport&&"filter"in document.body.style?new u(e,i).render():new a(e,i).render()})}}(jQuery); +!function(t){t.fn.foggy=function(e){var i,n={opacity:.8,blurRadius:2,quality:16,cssFilterSupport:!0,duration:0},r={opacity:1,blurRadius:0};i=0==e?t.extend(n,r):t.extend(n,e);var s=function(t,e,i,n){this.content=t,this.position=e,this.offset=i,this.opacity=n};s.prototype.render=function(e){t("
",{html:this.content,"class":"foggy-pass foggy-pass-"+this.position}).css({position:this.position,top:this.offset[0],left:this.offset[1],opacity:0!==i.duration?0:this.opacity}).appendTo(e).animate({opacity:this.opacity},i.duration)};var o=function(t){this.radius=t};o.prototype.includes=function(t,e){return Math.pow(t,2)+Math.pow(e,2)<=Math.pow(this.radius,2)?!0:!1},o.prototype.points=function(){for(var t=[],e=-this.radius;e<=this.radius;e++)for(var i=-this.radius;i<=this.radius;i++)this.includes(e,i)&&t.push([e,i]);return t};var a=function(t,e){this.element=t,this.settings=e};a.prototype.calculateOffsets=function(e,i){var n,r=t.grep(new o(e).points(),function(t){return 0!=t[0]||0!=t[1]});if(r.length<=i)n=r;else{for(var s=r.length-i,a=[],u=0;s>u;u++)a.push(Math.round(u*(r.length/s)));n=t.grep(r,function(e,i){return t.inArray(i,a)>=0?!1:!0})}return n},a.prototype.getContent=function(){var e=t(this.element).find(".foggy-pass-relative")[0];return e?t(e).html():t(this.element).html()},a.prototype.render=function(){var e=this.getContent();t(this.element).empty();var n=t("
").css({position:"relative"}),r=this.calculateOffsets(2*this.settings.blurRadius,this.settings.quality),o=1.2*this.settings.opacity/(r.length+1);if(new s(e,"relative",[0,0],o).render(n),t(r).each(function(t,i){new s(e,"absolute",i,o).render(n)}),n.appendTo(this.element),0===this.settings.blurRadius){e=this.getContent();var a=t(this.element);a.find(".foggy-positon-absolute").animate({opacity:0},i.duration),a.empty().append(e)}};var u=function(t,e){this.element=t,this.settings=e};return u.prototype.render=function(){var e=((""+i.opacity).slice(2,4),this.settings.blurRadius),n=t(this.element);if(0===i.duration)n.css({"-webkit-filter":0===e?"none":"blur("+e+"px)","-moz-filter":0===e?"none":"blur("+e+"px)",filter:0===e?"none":"blur("+e+"px)",opacity:i.opacity});else{if(n.animate({opacity:i.opacity},i.duration),0!==e){n.attr("data-start-blur",e);var r=0}else var r=n.data("start-blur");t({blurRadius:r}).animate({blurRadius:e},{duration:i.duration,step:function(){var t=this.blurRadius;n.css({"-webkit-filter":0===t?"none":"blur("+t+"px)","-moz-filter":0===t?"none":"blur("+t+"px)",filter:0===t?"none":"blur("+t+"px)"})}})}},this.each(function(t,e){i.cssFilterSupport&&"-webkit-filter"in document.body.style?new u(e,i).render():navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.indexOf("Trident")>0||navigator.userAgent.indexOf("Edge")>0?new a(e,i).render():i.cssFilterSupport&&"filter"in document.body.style?new u(e,i).render():new a(e,i).render()})}}(jQuery);