template.js.base.effect.min.js Maven / Gradle / Ivy
'use strict';(function(c){"function"===typeof define&&define.amd?define(["jquery","./version"],c):c(jQuery)})(function(c){c.effects={effect:{}};(function(c,h){function k(a,b,c){var d=w[b.type]||{};if(null==a)return c||!b.def?null:b.def;a=d.floor?~~a:parseFloat(a);return isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max6*c?a+(b-a)*c*6:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a}var d=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[2.55*a[1],
2.55*a[2],2.55*a[3],a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],f=c.Color=function(a,b,d,e){return new c.Color.fn.parse(a,
b,d,e)},g={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},w={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},l=f.support={},n=c("\x3cp\x3e")[0],u,m=c.each;n.style.cssText="background-color:rgba(1,1,1,.5)";l.rgba=-1c.inArray(null,s[e].slice(0,3))&&(s[e][3]=1,d.from&&(s._rgba=d.from(s[e])))}),this},is:function(a){var b=f(a),c=!0,d=this;m(g,function(a,e){var f,q=b[e.cache];q&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],m(e.props,function(a,b){if(null!=q[b.idx])return c=q[b.idx]===f[b.idx]}));return c});return c},_space:function(){var a=[],b=this;m(g,function(c,d){b[d.cache]&&a.push(c)});return a.pop()},transition:function(a,
b){var c=f(a),d=c._space(),e=g[d],h=0===this.alpha()?f("transparent"):this,r=h[e.cache]||e.to(h._rgba),l=r.slice(),c=c[e.cache];m(e.props,function(a,d){var e=d.idx,f=r[e],q=c[e],t=w[d.type]||{};null!==q&&(null===f?l[e]=q:(t.mod&&(q-f>t.mod/2?f+=t.mod:f-q>t.mod/2&&(f-=t.mod)),l[e]=k((q-f)*b+f,d)))});return this[d](l)},blend:function(a){if(1===this._rgba[3])return this;var b=this._rgba.slice(),d=b.pop(),e=f(a)._rgba;return f(c.map(b,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var a=
"rgba(",b=c.map(this._rgba,function(a,b){return null==a?2b&&(a=Math.round(100*a)+"%");return a});1===b[3]&&(b.pop(),a="hsl(");return a+b.join()+")"},toHexString:function(a){var b=this._rgba.slice(),d=b.pop();a&&b.push(~~(255*d));return"#"+c.map(b,function(a){a=(a||0).toString(16);return 1===a.length?"0"+a:a}).join("")},toString:function(){return 0===
this._rgba[3]?"transparent":this.toRgbaString()}});f.fn.parse.prototype=f.fn;g.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255;a=a[3];var e=Math.max(b,c,d),f=Math.min(b,c,d),h=e-f,g=e+f,m=.5*g,g=0===h?0:.5>=m?h/g:h/(2-g);return[Math.round(f===e?0:b===e?60*(c-d)/h+360:c===e?60*(d-b)/h+120:60*(b-c)/h+240)%360,g,m,null==a?1:a]};g.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var c=a[0]/
360,d=a[1],e=a[2];a=a[3];d=.5>=e?e*(1+d):e+d-e*d;e=2*e-d;return[Math.round(255*b(e,d,c+1/3)),Math.round(255*b(e,d,c)),Math.round(255*b(e,d,c-1/3)),a]};m(g,function(a,b){var e=b.props,g=b.cache,l=b.to,w=b.from;f.fn[a]=function(a){l&&!this[g]&&(this[g]=l(this._rgba));if(a===h)return this[g].slice();var b,d=c.type(a),q="array"===d||"object"===d?a:arguments,v=this[g].slice();m(e,function(a,b){var c=q["object"===d?a:b.idx];null==c&&(c=v[b.idx]);v[b.idx]=k(c,b)});return w?(b=f(w(v)),b[g]=v,b):f(v)};m(e,
function(b,e){f.fn[b]||(f.fn[b]=function(f){var g=c.type(f),h="alpha"===b?this._hsla?"hsla":"rgba":a,m=this[h](),l=m[e.idx];if("undefined"===g)return l;"function"===g&&(f=f.call(this,l),g=c.type(f));if(null==f&&e.empty)return this;"string"===g&&(g=d.exec(f))&&(f=l+parseFloat(g[2])*("+"===g[1]?1:-1));m[e.idx]=f;return this[h](m)})})});f.hook=function(b){b=b.split(" ");m(b,function(b,d){c.cssHooks[d]={set:function(b,e){var g,h="";if("transparent"!==e&&("string"!==c.type(e)||(g=a(e)))){e=f(g||e);if(!l.rgba&&
1!==e._rgba[3]){for(g="backgroundColor"===d?b.parentNode:b;(""===h||"transparent"===h)&&g&&g.style;)try{h=c.css(g,"backgroundColor"),g=g.parentNode}catch(m){}e=e.blend(h&&"transparent"!==h?h:"_default")}e=e.toRgbaString()}try{b.style[d]=e}catch(v){}}};c.fx.step[d]=function(a){a.colorInit||(a.start=f(a.elem,d),a.end=f(a.end),a.colorInit=!0);c.cssHooks[d].set(a.elem,a.start.transition(a.end,a.pos))}})};f.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor");
c.cssHooks.borderColor={expand:function(a){var b={};m(["Top","Right","Bottom","Left"],function(d,c){b["border"+c+"Color"]=a});return b}};u=c.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(c);(function(){function p(a){var b,d=a.ownerDocument.defaultView?
a.ownerDocument.defaultView.getComputedStyle(a,null):a.currentStyle,e={};if(d&&d.length&&d[0]&&d[d[0]])for(a=d.length;a--;)b=d[a],"string"===typeof d[b]&&(e[c.camelCase(b)]=d[b]);else for(b in d)"string"===typeof d[b]&&(e[b]=d[b]);return e}var h=["add","remove","toggle"],k={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};c.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(a,b){c.fx.step[b]=function(a){if("none"!==
a.end&&!a.setAttr||1===a.pos&&!a.setAttr)c.style(a.elem,b,a.end),a.setAttr=!0}});c.fn.addBack||(c.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))});c.effects.animateClass=function(a,b,d,e){var f=c.speed(b,d,e);return this.queue(function(){var b=c(this),d=b.attr("class")||"",e,n=f.children?b.find("*").addBack():b,n=n.map(function(){return{el:c(this),start:p(this)}});e=function(){c.each(h,function(d,c){if(a[c])b[c+"Class"](a[c])})};e();n=n.map(function(){this.end=
p(this.el[0]);var a=this.start,b=this.end,d={},e,f;for(e in b)f=b[e],a[e]===f||k[e]||!c.fx.step[e]&&isNaN(parseFloat(f))||(d[e]=f);this.diff=d;return this});b.attr("class",d);n=n.map(function(){var a=this,b=c.Deferred(),d=c.extend({},f,{queue:!1,complete:function(){b.resolve(a)}});this.el.animate(this.diff,d);return b.promise()});c.when.apply(c,n.get()).done(function(){e();c.each(arguments,function(){var a=this.el;c.each(this.diff,function(b){a.css(b,"")})});f.complete.call(b[0])})})};c.fn.extend({addClass:function(a){return function(b,
d,e,f){return d?c.effects.animateClass.call(this,{add:b},d,e,f):a.apply(this,arguments)}}(c.fn.addClass),removeClass:function(a){return function(b,d,e,f){return 1a?k(2*a)/2:1-k(-2*a+2)/2}})})();return c.effects});
© 2015 - 2024 Weber Informatics LLC | Privacy Policy