template.js.base.effect-size.min.js Maven / Gradle / Ivy
'use strict';(function(c){"function"===typeof define&&define.amd?define(["jquery","../version","../effect"],c):c(jQuery)})(function(c){return c.effects.define("size",function(f,w){var g,l,h,m,k,r,b=c(this),t=["fontSize"],n=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],p=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];r=f.mode;var u="effect"!==r,q=f.scale||"both";k=f.origin||["middle","center"];var v=b.css("position"),s=b.position(),e=c.effects.scaledDimensions(b),
a=f.from||e,d=f.to||c.effects.scaledDimensions(b,0);c.effects.createPlaceholder(b);"show"===r&&(r=a,a=d,d=r);h=a.height/e.height;m=a.width/e.width;g=d.height/e.height;l=d.width/e.width;if("box"===q||"both"===q)h!==g&&(a=c.effects.setTransition(b,n,h,a),d=c.effects.setTransition(b,n,g,d)),m!==l&&(a=c.effects.setTransition(b,p,m,a),d=c.effects.setTransition(b,p,l,d));"content"!==q&&"both"!==q||h===g||(a=c.effects.setTransition(b,t,h,a),d=c.effects.setTransition(b,t,g,d));k&&(k=c.effects.getBaseline(k,
e),a.top=(e.outerHeight-a.outerHeight)*k.y+s.top,a.left=(e.outerWidth-a.outerWidth)*k.x+s.left,d.top=(e.outerHeight-d.outerHeight)*k.y+s.top,d.left=(e.outerWidth-d.outerWidth)*k.x+s.left);b.css(a);if("content"===q||"both"===q)n=n.concat(["marginTop","marginBottom"]).concat(t),p=p.concat(["marginLeft","marginRight"]),b.find("*[width]").each(function(){var b=c(this),a=c.effects.scaledDimensions(b),d={height:a.height*h,width:a.width*m,outerHeight:a.outerHeight*h,outerWidth:a.outerWidth*m},a={height:a.height*
g,width:a.width*l,outerHeight:a.height*g,outerWidth:a.width*l};h!==g&&(d=c.effects.setTransition(b,n,h,d),a=c.effects.setTransition(b,n,g,a));m!==l&&(d=c.effects.setTransition(b,p,m,d),a=c.effects.setTransition(b,p,l,a));u&&c.effects.saveStyle(b);b.css(d);b.animate(a,f.duration,f.easing,function(){u&&c.effects.restoreStyle(b)})});b.animate(d,{queue:!1,duration:f.duration,easing:f.easing,complete:function(){var e=b.offset();0===d.opacity&&b.css("opacity",a.opacity);u||(b.css("position","static"===
v?"relative":v).offset(e),c.effects.saveStyle(b));w()}})})});
© 2015 - 2024 Weber Informatics LLC | Privacy Policy