-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwodry.min.js
4 lines (3 loc) · 4.32 KB
/
wodry.min.js
1
2
3
4
/* Sergey Golovin 2014 golovim@gmail.com */
(function(){var a,b={}.hasOwnProperty;a=jQuery,a.fn.extend({wodry:function(c){var d,e,f,g,h;return null==c&&(c={}),e=a.extend({},c),null==e.separator&&(e.separator="|"),null==e.delay&&(e.delay=2e3),null==e.animationDuration&&(e.animationDuration=500),null==e.animation&&(e.animation="rotateY"),null==e.callback&&(e.callback=function(){}),null==e.shift&&(e.shift={}),null==(f=e.shift).x&&(f.x=0),null==(g=e.shift).y&&(g.y=0),null==(h=e.shift).z&&(h.z=0),null==e.styles&&(e.styles=[]),d={rotateY:{front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotateY(180deg)",action:{transform:" rotateY(180deg)",transition:" "+e.animationDuration+"ms"}},rotateX:{front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotateX(180deg)",action:{transform:" rotateX(180deg)",transition:" "+e.animationDuration+"ms"}},rotateAll:{isCoplex:!0,front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotateX(180deg) rotateY(180deg)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotateX(180deg) rotateY(180deg)",action:{transform:" rotateX(180deg) rotateY(180deg)",transition:" "+e.animationDuration+"ms"}},scaleX:{isCoplex:!0,front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) scaleX(0.1)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) scaleX(0.1)",action:{transform:" scaleX(10)",transition:" "+e.animationDuration+"ms"}},scaleY:{isCoplex:!0,front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) scaleY(0.1)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) scaleY(0.1)",action:{transform:" scaleY(10)",transition:" "+e.animationDuration+"ms"}},scaleAll:{isCoplex:!0,front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) scaleY(0.1) slaleX(0.1)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) scaleY(0.1) scaleX(0.1)",action:{transform:" scaleY(10) scaleX(10)",transition:" "+e.animationDuration+"ms"}},anticlockwise:{isCoplex:!0,front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotate3d(100,40,-80,180deg)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotate3d(100,40,-80,180deg)",action:{transform:" rotate3d(100,40,-80,180deg)",transition:" "+e.animationDuration+"ms"}},clockwise:{isCoplex:!0,front_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotate3d(40,100,80,180deg)",back_transform:"translate3d("+e.shift.x+"px,"+e.shift.y+"px,"+e.shift.z+"px) rotate3d(40,100,80,180deg)",action:{transform:" rotate3d(40,100,80,180deg)",transition:" "+e.animationDuration+"ms"}}},this.each(function(){var c,f,g,h,i,j,k,l,m;return i=a(this),f=[],a.each(i.text().split(e.separator),function(a,b){return f.push(b)}),m=0,e.styles.length>0?i.html("<span class='"+e.styles[0]+"'>"+f[0]+"</span>"):i.text(f[0]),k=function(){return m=(m+1)%e.styles.length},j="front-face",g="back-face",l=function(a,c){var d,e,f,g,h,i,j,k,l,m,n;for(i={},g={},l=0,m=a.length;m>l;l++)h=a[l],d=a.indexOf(h),g[h]=c[d];if(a.length===c.length){for(h in g)b.call(g,h)&&(j=g[h],n=["-webkit-"+h,"-moz-"+h,"-o-"+h],k=n[0],e=n[1],f=n[2],i[k]=j,i[e]=j,i[f]=j,i[h]=j);return i}},c=function(b,c,d,e){return c.html(""),a("<span class='"+j+"'>"+d+"</span>").appendTo(c),a("."+c.context.className+" .front-face").css(l(["transform"],[b.front_transform])),a("<span class='"+g+"'>"+e+"</span>").appendTo(c),a("."+c.context.className+" .back-face").css(l(["transform"],[b.back_transform])),c.wrapInner("<span class='wodry-flipping' />").find(".wodry-flipping").hide().show().css(l(["transform","transition"],[b.action.transform,b.action.transition])),b.isCoplex?setTimeout(function(){return a("."+c.context.className+" .front-face").remove()},1):void 0},h=function(){var b,h;return e.styles.length>0&&(j="front-face "+e.styles[m],g="back-face "+e.styles[k()]),i.find(".back-face").length>0&&i.html(i.find(".back-face").html()),h=i.text(),b=a.inArray(h,f),b+1===f.length&&(b=-1),c(d[e.animation],i,h,f[b+1])},setInterval(function(){return h(),e.callback()},e.delay+e.animationDuration)})}})}).call(this);
//# sourceMappingURL=wodry.min.map