diff --git a/dist/jquery.slotmachine.js b/dist/jquery.slotmachine.js index 932fb1c..dff01b3 100644 --- a/dist/jquery.slotmachine.js +++ b/dist/jquery.slotmachine.js @@ -1,4 +1,4 @@ -/*! SlotMachine - v1.0.2 - 2014-07-09 +/*! SlotMachine - v2.0.1 - 2014-07-09 * https://github.com/josex2r/jQuery-SlotMachine * Copyright (c) 2014 Jose Luis Represa; Licensed MIT */ ;(function($, window, document, undefined){ diff --git a/dist/jquery.slotmachine.min.js b/dist/jquery.slotmachine.min.js index 62a2fc7..fac98c1 100644 --- a/dist/jquery.slotmachine.min.js +++ b/dist/jquery.slotmachine.min.js @@ -1,4 +1,4 @@ -/*! SlotMachine - v1.0.2 - 2014-07-09 +/*! SlotMachine - v2.0.1 - 2014-07-09 * https://github.com/josex2r/jQuery-SlotMachine * Copyright (c) 2014 Jose Luis Represa; Licensed MIT */ !function(a,b,c,d){function e(c,e){function f(b){for(var c=0,d=0;b>d;d++)c+=a(A.get(d)).outerHeight();return-c+u}function i(){return Math.abs(Math.round(parseInt(t.css("margin-top").replace(/px/,""),10)/A.first().height()))-1}function j(a){var b,c=a||!1;do b=Math.floor(Math.random()*A.length);while(c&&b===F.index&&b>=0);return{index:b,el:A.get(b)}}function k(){var a;if(null!==y.settings.randomize&&"function"==typeof y.settings.randomize){var b=y.settings.randomize(F.index);(0>b||b>=A.length)&&(b=0),a={index:b,el:A.get(b)}}else a=j();return a}function l(){var a=F.index-1<0?A.length-1:F.index-1;return{index:a,el:A.get(a)}}function m(){var a=F.index+10){switch(a){case 1:case 2:n("slow",!0);break;case 3:case 4:n("medium",!0),b/=1.5;break;default:n("fast",!0),b/=2}t.animate({marginTop:v},b,"linear",function(){C===!1&&(t.css("margin-top",0),p(a-1))})}else q()}function q(a){if(t.clearQueue().stop(!0,!1),n("slow",!0),E=!0,!r())return"function"==typeof D&&D(!1,!1),n("stop",!1),o(),void(E=!1);var b=j();"function"==typeof a?b=a():null!==y.settings.randomize&&"function"==typeof y.settings.randomize?b=k():y.settings.auto&&(b=m()),F.index=i(),F.el=A.get(F.index);var c=f(b.index),d=3*y.settings.delay;b.index>F.index?0===F.index&&b.index===A.length-1&&t.css("margin-top",f(A.length)):F.index===A.length-1&&0===b.index&&t.css("margin-top",0),F=b,t.animate({marginTop:c},d,"easeOutBounce",function(){n("stop"),E=!1,"function"==typeof D&&(D(z,F),D=null)}),setTimeout(function(){n("false",!1)},d/2)}function r(){if(y.settings.stopHidden===!1)return!1;var c=z.offset().top>a(b).scrollTop()+a(b).height(),d=a(b).scrollTop()>z.height()+z.offset().top;return!c&&!d}function s(){C===!1&&(B=setTimeout(function(){D=s,C=!1,p(5)},y.settings.auto))}this.element=c,this.settings=a.extend({},h,e),this._defaults=h,this._name=g;var t,u,v,w,x,y=this,z=a(c),A=z.children(),B=null,C=!1,D=null,E=!1,F={index:this.settings.active,el:A.get(this.settings.active)};return z.css("overflow","hidden"),A.wrapAll("
"),t=z.find(".slotMachineContainer"),v=-t.height(),w=A.last().clone(),x=A.first().clone(),t.prepend(w),t.append(x),u=-w.outerHeight(),t.css("margin-top",f(y.settings.active)),y.settings.auto!==!1&&(y.settings.auto===!0?p():s()),{auto:s,shuffle:function(a,b){C=!1,D=b,p("number"==typeof a?a:a!==d?5:d)},stop:function(a){y.settings.auto!==!1&&null!==B&&clearTimeout(B),"number"==typeof a&&a>0?(t.clearQueue().stop(!0,!1),C=!1,p(a)):(C=!0,q())},prev:function(){q(l)},next:function(){q(m)},active:function(){return F},isRunning:function(){return E}}}function f(b,c){var d;return a.data(b,"plugin_"+g)?d=a.data(b,"plugin_"+g):(d=new e(b,c),a.data(b,"plugin_"+g,d)),d}var g="slotMachine",h={active:0,delay:200,auto:!1,randomize:null,stopHidden:!0};a(c).ready(function(){a("filter#slotMachineBlurSVG").length<=0&&a("body").append(''),a("filter#slotMachineBlurSVG").length<=0&&a("body").append(''),a("filter#slotMachineBlurSVG").length<=0&&a("body").append(''),a("mask#slotMachineFadeSVG").length<=0&&a("body").append(''),a("body").append("")}),"function"!=typeof a.easing.easeOutBounce&&a.extend(a.easing,{easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?7.5625*d*b*b+c:2/2.75>b?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:2.5/2.75>b?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}}),a.fn[g]=function(b){return 1===this.length?f(this,b):this.each(function(){a.data(this,"plugin_"+g)||f(this,b)})}}(jQuery,window,document); \ No newline at end of file diff --git a/package.json b/package.json index 4323476..78d87c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jquery-slotmachine", - "version": "2.0.0-ignored", + "version": "2.0.1-ignored", "engines": { "node": ">= 0.8.0" }, diff --git a/slotmachine.jquery.json b/slotmachine.jquery.json index e0871d7..95a3ffe 100644 --- a/slotmachine.jquery.json +++ b/slotmachine.jquery.json @@ -11,7 +11,7 @@ "winning", "machine" ], - "version": "2.0.0", + "version": "2.0.1", "download": "https://github.com/josex2r/jQuery-SlotMachine", "homepage": "https://github.com/josex2r/jQuery-SlotMachine", "demo": "http://josex2r.github.io/jQuery-SlotMachine/",