You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
2.4 KiB

  1. (function(e,t,n,i){e.animationSettings=function(t,n,a,o){return t=n===i?t:"object"==typeof n?e.extend({},t,n):"function"==typeof a?e.extend({},t,{duration:n,complete:a}):"object"==typeof a?e.extend(!0,{},t,{duration:n},a):e.extend({},t,{duration:n,easing:a,complete:o})},e.fn.popIn=function(t,n,i){var a=e.animationSettings(e.fn.popIn.settings,t,n,i),o=e(this),s=o.size(),c=0,r=function(){0==o.filter(":animated").size(),c++,e(this).css("transform","").removeClass(a.className.init),e.proxy(a.eachComplete,this)(),c==s&&e.proxy(a.complete,o)()},l=function(t){e(this).delay(a.delay*t).animate({opacity:a.endOpacity,transform:"scale("+a.endScale+")"},a.duration,a.easing,r)};return a.isLegacyBrowser?o.show():o.addClass(a.className.init).show().css({opacity:a.startOpacity,transform:"scale("+a.startScale+")"}).each(l),e(this)},e.fn.popOut=function(t,n,i){var a=e.animationSettings(e.fn.popIn.settings,t,n,i),o={complete:function(){e(this).hide(),e.proxy(a.complete,this)()},startOpacity:a.endOpacity,endOpacity:0,startScale:a.endScale,endScale:a.startScale},s=e.extend(!0,{},a,o);e(this).popIn(s)},e.fn.popIn.settings={isLegacyBrowser:!1,className:{init:"init"},duration:450,easing:"easeOutExpo",delay:100,startOpacity:0,endOpacity:1,startScale:.7,endScale:1,eachComplete:function(){},complete:function(){}},e.fn.kenBurns=function(t,n,a){var o=e.animationSettings(e.fn.kenBurns.settings,t,n,a),s={randomPosition:function(e,t,n){var n=n!==i?n:t,a=Math.random()*(e+n-(e-t))+(e-t);return parseInt(a,10)},animate:function(){var t={},n={};t=o.useStartPosition?{x:parseInt(e(this).css("background-position-x"),10),y:parseInt(e(this).css("background-position-y"),10)}:{x:s.randomPosition(50,o.xRange),y:s.randomPosition(50,o.yRange)},n.x=t.x>50?s.randomPosition(t.x,o.xMaxTravelDistance,-o.xMinTravelDistance):s.randomPosition(t.x,-o.xMinTravelDistance,o.xMaxTravelDistance),n.y=t.y>50?s.randomPosition(t.y,o.yMaxTravelDistance,-o.yMinTravelDistance):s.randomPosition(t.y,-o.yMinTravelDistance,o.yMaxTravelDistance),e(this).css({backgroundPosition:t.x+"%",backgroundPositionY:t.y+"%"}).stop().animate({backgroundPosition:n.x+"%",backgroundPositionY:n.y+"%"},o.duration,o.easing,o.complete)}};return o.isLegacyBrowser||e(this).each(s.animate),e(this)},e.fn.kenBurns.settings={isLegacyBrowser:!1,duration:1e4,easing:"linear",useStartPosition:!1,xRange:40,yRange:20,xMinTravelDistance:30,xMaxTravelDistance:60,yMinTravelDistance:20,yMaxTravelDistance:40,scale:.1,complete:function(){}}})(jQuery,window,document);