-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathangular-transit.min.js
7 lines (6 loc) · 1.78 KB
/
angular-transit.min.js
1
2
3
4
5
6
7
/**
* angular-transit.js
* (c) 2013 Ben Lesh http://www.benlesh.com
* MIT Licensed
*/
!function(a,b){function c(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1)}var d=b.module("transit",[]),e=d.directive,f=b.forEach,g=b.isObject,h=b.extend;e("transit",function(){function b(a){return a?i[a]||a:"ease"}var d=0,e=function(a,b,c,d){return"cubic-bezier("+[a,b,c,d].join(",")+")"},i={"in":"ease-in",out:"ease-out",inOut:"ease-in-out",snap:e(0,1,.5,1),cubicOut:e(.215,.61,.355,1),cubicInOut:e(.645,.045,.355,1),circIn:e(.6,.04,.98,.335),circOut:e(.075,.82,.165,1),circInOut:e(.785,.135,.15,.86),expoIn:e(.95,.05,.795,.035),expoOut:e(.19,1,.22,1),expoInOut:e(1,0,0,1),quadIn:e(.55,.085,.68,.53),quadOut:e(.25,.46,.45,.94),quadInOut:e(.455,.03,.515,.955),quartIn:e(.895,.03,.685,.22),quartOut:e(.165,.84,.44,1),quartInOut:e(.77,0,.175,1),quintIn:e(.755,.05,.855,.06),quintOut:e(.23,1,.32,1),quintInOut:e(.86,0,.07,1),sineIn:e(.47,0,.745,.715),sineOut:e(.39,.575,.565,1),sineInOut:e(.445,.05,.55,.95),backIn:e(.6,-.28,.735,.045),backOut:e(.175,.885,.32,10.275),backInOut:e(.68,-.55,.265,10.55)};return function(e,i,j){var k,l=j.transit,m=e.$eval(l)||{},n=[];i.bind("transitionend",function(a){var b=k.cssProps,d=k.name,f=k.end;c(b,a.propertyName),0===b.length&&(e.$broadcast("transit:"+d+":end"),f&&e.$apply(f),n.length>0?(k=n.shift(),i.css(k.css)):k=null)}),f(m,function(c,j){var l=c.$name||"transit_"+d++,m=c.$end,o=c.$duration||"1s",p=b(c.$easing),q=c.$delay||"0s",r="",s={},t=[];a.console.log(p),f(c,function(a,b){if("$"!==b[0]){var c={duration:o,easing:p,delay:q};g(a)&&(h(c,a),a=a.value);var d=[b,c.duration,c.easing,c.delay].join(" ");r+=(r?", ":"")+d,s[b]=a,t.push(b)}}),s.transition=r,e.$watch(j,function(a){if(a){var b={name:l,css:s,end:m,cssProps:t};k?n.push(b):(k=b,i.css(s))}})})}})}(window,window.angular);