From 8a337a3736d039d802e2aa0d52b21fa88c3b4dfc Mon Sep 17 00:00:00 2001 From: Jan Paepke Date: Sun, 2 Mar 2014 13:23:29 +0100 Subject: [PATCH] Fixed a bug concerning the box-sizing model --- ScrollMagic.jquery.json | 2 +- bower.json | 2 +- docs/ScrollScene.html | 28 +++++++++++++-------------- docs/classes.list.html | 14 +++++++------- docs/index.html | 2 +- docs/jquery.scrollmagic.debug.js.html | 2 +- docs/jquery.scrollmagic.js.html | 7 +++++-- js/jquery.scrollmagic.debug.js | 2 +- js/jquery.scrollmagic.js | 7 +++++-- js/jquery.scrollmagic.min.js | 4 ++-- 10 files changed, 38 insertions(+), 32 deletions(-) diff --git a/ScrollMagic.jquery.json b/ScrollMagic.jquery.json index 968d4cde..cb152b73 100644 --- a/ScrollMagic.jquery.json +++ b/ScrollMagic.jquery.json @@ -1,6 +1,6 @@ { "name": "ScrollMagic", - "version": "1.0.0", + "version": "1.0.1", "title": "ScrollMagic", "author": { "name": "Jan Paepke", diff --git a/bower.json b/bower.json index 16594a41..8cb20cd0 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "ScrollMagic", "description": "The jQuery plugin for magical scroll interactions.", - "version": "1.0.0", + "version": "1.0.1", "homepage": "http://janpaepke.github.io/ScrollMagic/", "author": { "name": "Jan Paepke", diff --git a/docs/ScrollScene.html b/docs/ScrollScene.html index 4d5ff0fc..636e965f 100644 --- a/docs/ScrollScene.html +++ b/docs/ScrollScene.html @@ -1120,7 +1120,7 @@
Parameters:
Source:
@@ -1279,7 +1279,7 @@
Parameters:
Source:
@@ -1799,7 +1799,7 @@
Parameters:
Source:
@@ -2131,7 +2131,7 @@
Parameters:
Source:
@@ -2492,7 +2492,7 @@

removeSource:
@@ -2651,7 +2651,7 @@
Parameters:
Source:
@@ -3722,7 +3722,7 @@
Parameters:
Source:
@@ -4670,7 +4670,7 @@
Properties
Source:
@@ -4939,7 +4939,7 @@
Properties
Source:
@@ -5208,7 +5208,7 @@
Properties
Source:
@@ -5477,7 +5477,7 @@
Properties
Source:
@@ -5745,7 +5745,7 @@
Properties
Source:
@@ -6014,7 +6014,7 @@
Properties
Source:
@@ -6282,7 +6282,7 @@
Properties
Source:
diff --git a/docs/classes.list.html b/docs/classes.list.html index dc546ecf..cc0ca6ca 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -385,7 +385,7 @@
Properties
Source:
@@ -654,7 +654,7 @@
Properties
Source:
@@ -923,7 +923,7 @@
Properties
Source:
@@ -1192,7 +1192,7 @@
Properties
Source:
@@ -1460,7 +1460,7 @@
Properties
Source:
@@ -1729,7 +1729,7 @@
Properties
Source:
@@ -1997,7 +1997,7 @@
Properties
Source:
diff --git a/docs/index.html b/docs/index.html index 926cef8d..187d6144 100644 --- a/docs/index.html +++ b/docs/index.html @@ -214,7 +214,7 @@

Version:
-
  • 1.0.0
+
  • 1.0.1
diff --git a/docs/jquery.scrollmagic.debug.js.html b/docs/jquery.scrollmagic.debug.js.html index ce9f06c5..faa9ddf6 100644 --- a/docs/jquery.scrollmagic.debug.js.html +++ b/docs/jquery.scrollmagic.debug.js.html @@ -101,7 +101,7 @@

Source: jquery.scrollmagic.debug.js

by Jan Paepke 2014 (@janpaepke) http://janpaepke.github.io/ScrollMagic - @version 1.0.0 + @version 1.0.1 @license Dual licensed under MIT license and GPL. @author Jan Paepke - e-mail@janpaepke.de */ diff --git a/docs/jquery.scrollmagic.js.html b/docs/jquery.scrollmagic.js.html index 99d779b2..a53c6345 100644 --- a/docs/jquery.scrollmagic.js.html +++ b/docs/jquery.scrollmagic.js.html @@ -109,7 +109,7 @@

Source: jquery.scrollmagic.js

*/ /** @overview ##Info -@version 1.0.0 +@version 1.0.1 @license Dual licensed under MIT license and GPL. @author Jan Paepke - e-mail@janpaepke.de @@ -1417,7 +1417,10 @@

Source: jquery.scrollmagic.js

.css({ position: pinCSS.position == "absolute" ? "absolute" : "relative", "margin-left": "auto", - "margin-right": "auto" + "margin-right": "auto", + "box-sizing": "content-box", + "-moz-box-sizing": "content-box", + "-webkit-box-sizing": "content-box" }); if (pinCSS.position == "absolute" && settings.pushFollowers) { diff --git a/js/jquery.scrollmagic.debug.js b/js/jquery.scrollmagic.debug.js index c27f1a3a..db4c64e3 100644 --- a/js/jquery.scrollmagic.debug.js +++ b/js/jquery.scrollmagic.debug.js @@ -4,7 +4,7 @@ by Jan Paepke 2014 (@janpaepke) http://janpaepke.github.io/ScrollMagic - @version 1.0.0 + @version 1.0.1 @license Dual licensed under MIT license and GPL. @author Jan Paepke - e-mail@janpaepke.de */ diff --git a/js/jquery.scrollmagic.js b/js/jquery.scrollmagic.js index fafd1428..10c0d950 100644 --- a/js/jquery.scrollmagic.js +++ b/js/jquery.scrollmagic.js @@ -12,7 +12,7 @@ Greensock License info at http://www.greensock.com/licensing/ */ /** @overview ##Info -@version 1.0.0 +@version 1.0.1 @license Dual licensed under MIT license and GPL. @author Jan Paepke - e-mail@janpaepke.de @@ -1320,7 +1320,10 @@ Greensock License info at http://www.greensock.com/licensing/ .css({ position: pinCSS.position == "absolute" ? "absolute" : "relative", "margin-left": "auto", - "margin-right": "auto" + "margin-right": "auto", + "box-sizing": "content-box", + "-moz-box-sizing": "content-box", + "-webkit-box-sizing": "content-box" }); if (pinCSS.position == "absolute" && settings.pushFollowers) { diff --git a/js/jquery.scrollmagic.min.js b/js/jquery.scrollmagic.min.js index 7a1b2e87..12a41542 100644 --- a/js/jquery.scrollmagic.min.js +++ b/js/jquery.scrollmagic.min.js @@ -1,2 +1,2 @@ -/* ScrollMagic v1.0.0 | (c) Jan Paepke, @janpaepke | license & info: http://janpaepke.github.io/ScrollMagic */ -!function($){function e(e,t){var r={top:0,left:0};if(e.length>0){var n=e.get(0);if(void 0!==n.getBoundingClientRect){var o=n.getBoundingClientRect();r.top=o.top,r.left=o.left,t||(r.top+=$(document).scrollTop(),r.left+=$(document).scrollLeft())}else r=e.offset()||r,t&&(r.top-=$(document).scrollTop(),r.left-=$(document).scrollLeft())}return r}ScrollMagic=function(e){"use strict";var t="ScrollMagic",r={container:window,vertical:!0,globalSceneOptions:{},loglevel:2},o=this,i=$.extend({},r,e),a=[],l=!1,s=0,c="PAUSED",g=!0,u=0,d=!1,f=function(){if($.each(i,function(e){r.hasOwnProperty(e)||(v(2,'WARNING: Unknown option "'+e+'"'),delete i[e])}),i.container=$(i.container).first(),0==i.container.length)return void v(1,"ERROR creating object ScrollMagic: No valid scroll container supplied");g=!$.contains(document,i.container.get(0)),u=i.vertical?i.container.height():i.container.width(),i.container.on("scroll resize",p);try{TweenLite.ticker.addEventListener("tick",h),d=!0}catch(e){i.container.on("scroll resize",h),d=!1}v(3,"added new "+t+" controller")},h=function(){if(l){var e=$.isArray(l)?l:a,t=s;s=i.vertical?i.container.scrollTop():i.container.scrollLeft();var r=s-t;c=0==r?"PAUSED":r>0?"FORWARD":"REVERSE",$.each(e,function(t,r){v(3,"updating Scene "+(t+1)+"/"+e.length+" ("+a.length+" total)"),r.update(!0)}),0==e.length&&i.loglevel>=3&&v(3,"updating 0 Scenes (nothing added to controller)"),l=!1}},p=function(e){"resize"==e.type&&(u=i.vertical?i.container.height():i.container.width()),l=!0},v=function(e){if(i.loglevel>=e){var r="("+t+") ->",o=Array.prototype.splice.call(arguments,1),a=Function.prototype.bind.call(n,window);o.unshift(e,r),a.apply(window,o)}};return this.addScene=function(e){return $.isArray(e)?$.each(e,function(e,t){o.addScene(t)}):e.parent()!=o?e.addTo(o):-1==$.inArray(a,e)&&(a.push(e),$.each(i.globalSceneOptions,function(t,r){e[t]&&e[t].call(e,r)}),v(3,"added Scene ("+a.length+" total)")),o},this.removeScene=function(e){if($.isArray(e))$.each(e,function(e,t){o.removeScene(t)});else{var t=$.inArray(e,a);t>-1&&(a.splice(t,1),e.remove(),v(3,"removed Scene ("+a.length+" total)"))}return o},this.updateScene=function(e,t){return t?e.update(!0):($.isArray(l)||(l=[]),-1==$.inArray(e,l)&&l.push(e)),o},this.update=function(e){return p({type:"resize"}),e&&h(),o},this.info=function(e){var t={size:u,vertical:i.vertical,scrollPos:s,scrollDirection:c,container:i.container,isDocument:g};return arguments.length?void 0!==t[e]?t[e]:void v(1,'ERROR: option "'+e+'" is not available'):t},this.loglevel=function(e){return arguments.length?(i.loglevel!=e&&(i.loglevel=e),o):i.loglevel},this.destroy=function(e){for(;a.length>0;){var r=a[a.length-1];r.destroy(e)}return i.container.off("scroll resize",p),d?TweenLite.ticker.removeEventListener("tick",h):i.container.off("scroll resize",h),v(3,"destroyed "+t+" (reset: "+(e?"true":"false")+")"),null},f(),o},ScrollScene=function(t){"use strict";var r,o,i,a,l=["onCenter","onEnter","onLeave"],s="ScrollScene",c={duration:0,offset:0,triggerElement:null,triggerHook:l[0],reverse:!0,tweenChanges:!1,loglevel:2},g=this,u=$.extend({},c,t),d="BEFORE",f=0,h={start:0,end:0},p=function(){m(),g.on("change.internal",function(e){m(),"loglevel"!=e.what&&"tweenChanges"!=e.what&&("reverse"!=e.what&&null===u.triggerElement&&w(),g.update(),("DURING"!==d&&"duration"==e.what||"AFTER"===d&&0==u.duration)&&E())}),g.on("progress.internal",function(){R(),E()})},v=function(e){if(u.loglevel>=e){var t="("+s+") ->",r=Array.prototype.splice.call(arguments,1),o=Function.prototype.bind.call(n,window);r.unshift(e,t),o.apply(window,r)}},m=function(){if($.each(u,function(e){c.hasOwnProperty(e)||(v(2,'WARNING: Unknown option "'+e+'"'),delete u[e])}),u.duration=parseFloat(u.duration),(!$.isNumeric(u.duration)||u.duration<0)&&(v(1,'ERROR: Invalid value for option "duration":',u.duration),u.duration=c.duration),u.offset=parseFloat(u.offset),$.isNumeric(u.offset)||(v(1,'ERROR: Invalid value for option "offset":',u.offset),u.offset=c.offset),null!=u.triggerElement&&0==$(u.triggerElement).length&&(v(1,'ERROR: Element defined in option "triggerElement" was not found:',u.triggerElement),u.triggerElement=c.triggerElement),$.isNumeric(u.triggerHook)||-1!=$.inArray(u.triggerHook,l)||(v(1,'ERROR: Invalid value for option "triggerHook": ',u.triggerHook),u.triggerHook=c.triggerHook),!$.isNumeric(u.loglevel)||u.loglevel<0||u.loglevel>3){var e=u.loglevel;u.loglevel=c.loglevel,v(1,'ERROR: Invalid value for option "loglevel":',e)}if(o&&r&&u.triggerElement&&u.loglevel>=2){var t=o.getTweensOf($(u.triggerElement)),n=r.info("vertical");$.each(t,function(e,t){var r=t.vars.css||t.vars,o=n?void 0!==r.top||void 0!==r.bottom:void 0!==r.left||void 0!==r.right;return o?(v(2,"WARNING: Tweening the position of the trigger element affects the scene timing and should be avoided!"),!1):void 0})}},w=function(){h={start:g.startPosition()},r&&(h.start-=r.info("size")*g.triggerHook()),h.end=h.start+u.duration},R=function(e){var t=e>=0&&1>=e?e:f;if(o){if(-1===o.repeat())if(("DURING"===d||"AFTER"===d&&0==u.duration)&&o.paused())o.play();else{if("DURING"===d||o.paused())return!1;o.pause()}else{if(t==o.progress())return!1;0==u.duration?"AFTER"==d?o.play():o.reverse():u.tweenChanges?o.tweenTo(t*o.duration()):o.progress(t).pause()}return!0}return!1},E=function(){if(i&&r){var t=r.info();if("DURING"===d||"AFTER"===d&&0==u.duration){"fixed"!=i.css("position")&&(i.css("position","fixed"),y());var n=e(a.spacer,!0),o=u.reverse||0==u.duration?t.scrollPos-h.start:Math.round(f*u.duration*10)/10;n.top-=parseFloat(a.spacer.css("margin-top")),n[t.vertical?"top":"left"]+=o,i.css({top:n.top,left:n.left})}else{var l={position:"absolute"==a.origStyle.position?"absolute":"relative",top:0,left:0},s=i.css("position")!=l.position;"AFTER"===d?a.pushFollowers?0==parseFloat(a.spacer.css("padding-top"))&&(s=!0):l[t.vertical?"top":"left"]=u.duration*f:0==parseFloat(a.spacer.css("padding-bottom"))&&(s=!0),i.css(l),s&&y()}}},y=function(){if(i&&r&&"absolute"!=a.origStyle.position){var e="AFTER"===d,t="BEFORE"===d,n="DURING"===d,o=r.info("vertical"),l=a.spacer.children().first(),s=$.inArray(a.spacer.css("display"),["block","flex","list-item","table","-webkit-box"])>-1,c={};s?(c["margin-top"]=e?"auto":i.css("margin-top"),c["margin-bottom"]=t?"auto":i.css("margin-bottom")):c["margin-top"]=c["margin-bottom"]="auto",a.relSize.width?i.css("width",n?a.spacer.width():"100%"):(c["min-width"]=l.outerWidth(!0),c.width=n?c["min-width"]:"auto"),a.relSize.height?i.css("height",n?a.spacer.height():"100%"):(c["min-height"]=l.outerHeight(!s),c.height=n?c["min-height"]:"auto"),a.pushFollowers&&(o?(c.paddingTop=e?u.duration:0,c.paddingBottom=e?0:u.duration):(c.paddingLeft=e?u.duration:0,c.paddingRight=e?0:u.duration)),a.spacer.css(c)}},S=function(){r&&i&&"DURING"===d&&(r.info("isDocument")||E())},b=function(){r&&i&&"DURING"===d&&(a.relSize.width||a.relSize.height)&&y()};return this.parent=function(){return r},this.duration=function(e){return arguments.length?(u.duration!=e&&(u.duration=e,g.trigger("change",{what:"duration",newval:e})),g):u.duration},this.offset=function(e){return arguments.length?(u.offset!=e&&(u.offset=e,g.trigger("change",{what:"offset",newval:e})),g):u.offset},this.triggerElement=function(e){return arguments.length?(u.triggerElement!=e&&(u.triggerElement=e,g.trigger("change",{what:"triggerElement",newval:e})),g):u.triggerElement},this.triggerHook=function(e){if(!arguments.length){var t;if($.isNumeric(u.triggerHook))t=u.triggerHook;else switch(u.triggerHook){case"onCenter":t=.5;break;case"onLeave":t=0;break;case"onEnter":default:t=1}return t}return u.triggerHook!=e&&(u.triggerHook=e,g.trigger("change",{what:"triggerHook",newval:e})),g},this.reverse=function(e){return arguments.length?(u.reverse!=e&&(u.reverse=e,g.trigger("change",{what:"reverse",newval:e})),g):u.reverse},this.tweenChanges=function(e){return arguments.length?(u.tweenChanges!=e&&(u.tweenChanges=e,g.trigger("change",{what:"tweenChanges",newval:e})),g):u.tweenChanges},this.loglevel=function(e){return arguments.length?(u.loglevel!=e&&(u.loglevel=e,g.trigger("change",{what:"loglevel",newval:e})),g):u.loglevel},this.state=function(){return d},this.startPosition=function(){var t=u.offset;if(r){var n=r.info();if(null===u.triggerElement)t+=n.size*g.triggerHook();else{for(var o=$(u.triggerElement).first(),i=e(r.info("container"));o.parent().data("ScrollMagicPinSpacer");)o=o.parent();var a=e(o);n.isDocument||(i.top-=n.scrollPos,i.left-=n.scrollPos),t+=n.vertical?a.top-i.top:a.left-i.left}}return t},this.update=function(e){if(r)if(e){var t,n=r.info("scrollPos");null!==u.triggerElement&&w(),t=u.duration>0?(n-h.start)/(h.end-h.start):n>=h.start?1:0,g.trigger("update",{startPos:h.start,endPos:h.end,scrollPos:n}),g.progress(t)}else r.updateScene(g,!1);return g},this.progress=function(e){if(arguments.length){var t=!1,n=d,o=r?r.info("scrollDirection"):"PAUSED";if(0>=e&&"BEFORE"!==d&&(e>=f||u.reverse)?(f=0,d="BEFORE",t=!0):e>0&&1>e&&(e>=f||u.reverse)?(f=e,d="DURING",t=!0):e>=1&&"AFTER"!==d?(f=1,d="AFTER",t=!0):"DURING"!==d||u.reverse||E(),t){var i={progress:f,state:d,scrollDirection:o},a=d!=n,l="BEFORE"===d&&0==u.duration;a&&(("DURING"===d||0==u.duration)&&g.trigger("enter",i),("BEFORE"===d||"BEFORE"===n)&&g.trigger(l?"end":"start",i)),g.trigger("progress",i),a&&(("AFTER"===d||"AFTER"===n)&&g.trigger(l?"start":"end",i),("DURING"!==d||0==u.duration)&&g.trigger("leave",i))}return g}return f},this.setTween=function(e){o&&g.removeTween();try{o=new TimelineMax({smoothChildTiming:!0}).add(e).pause()}catch(e){v(1,"ERROR calling method 'setTween()': Supplied argument is not a valid TweenMaxObject")}finally{return e.repeat&&-1===e.repeat()&&(o.repeat(-1),o.yoyo(e.yoyo())),m(),v(3,"added tween"),R(),g}},this.removeTween=function(e){return o&&(e&&R(0),o.kill(),o=void 0,v(3,"removed tween (reset: "+(e?"true":"false")+")")),g},this.setPin=function(e,t){var r={pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"},t=$.extend({},r,t);if(e=$(e).first(),0==e.length)return v(1,"ERROR calling method 'setPin()': Invalid pin element supplied."),g;if(i){if(i===e)return g;g.removePin()}i=e,i.parent().hide();var n=i.css(["position","display","top","left","bottom","right"]),o=i.css(["width","height"]);if(i.parent().show(),"fixed"==n.position)return v(1,"ERROR: Pin does not work with elements that are positioned 'fixed'."),i=void 0,g;var l=$("
").addClass(t.spacerClass).css(n).data("ScrollMagicPinSpacer",!0).css({position:"absolute"==n.position?"absolute":"relative","margin-left":"auto","margin-right":"auto"});return"absolute"==n.position&&t.pushFollowers&&(v(2,"WARNING: If the pinned element is positioned absolutely pushFollowers is disabled."),t.pushFollowers=!1),a={spacer:l,relSize:{width:"%"===o.width.slice(-1),height:"%"===o.height.slice(-1)},pushFollowers:t.pushFollowers,origStyle:n},a.relSize.width&&l.css("width",o.width),a.relSize.height&&l.css("height",o.height),i.before(l).appendTo(l).css({position:"absolute"==n.position?"absolute":"relative",top:"auto",left:"auto",bottom:"auto",right:"auto"}),$(window).on("scroll resize",S),v(3,"added pin"),E(),g},this.removePin=function(e){if(i){if(e||!r)i.insertBefore(a.spacer).css(a.origStyle),a.spacer.remove();else{var t=r.info("vertical");i.css({position:"absolute",top:t?u.duration*f:0,left:t?0:u.duration*f})}$(window).off("scroll resize",S),i=void 0,v(3,"removed pin (reset: "+(e?"true":"false")+")")}return g},this.addTo=function(e){return r!=e?(r&&r.removeScene(g),r=e,m(),w(),y(),r.info("container").on("resize",b),v(3,"added "+s+" to controller"),e.addScene(g),g.update(),g):void 0},this.remove=function(){if(r){r.info("container").off("resize",b);var e=r;r=void 0,v(3,"removed "+s+" from controller"),e.removeScene(g)}return g},this.destroy=function(e){return this.removeTween(e),this.removePin(e),this.remove(),this.off("start end enter leave progress change update change.internal progress.internal"),v(3,"destroyed "+s+" (reset: "+(e?"true":"false")+")"),null},this.on=function(e,t){if($.isFunction(t)){var r=$.trim(e).toLowerCase().replace(/(\w+)\.(\w+)/g,"$1."+s+"_$2").replace(/( |^)(\w+)( |$)/g,"$1$2."+s+"$3");$(g).on(r,t)}else v(1,"ERROR calling method 'on()': Supplied argument is not a valid callback!");return g},this.off=function(e,t){var r=$.trim(e).toLowerCase().replace(/(\w+)\.(\w+)/g,"$1."+s+"_$2").replace(/( |^)(\w+)( |$)/g,"$1$2."+s+"$3");return $(g).off(r,t),g},this.trigger=function(e,t){v(3,"event fired:",e,"->",t);var r={type:$.trim(e).toLowerCase(),target:g};return $.isPlainObject(t)&&(r=$.extend({},t,r)),$(g).trigger(r),g},p(),g};var t=window.console=window.console||{},r=["error","warn","log"];t.log||(t.log=$.noop),$.each(r,function(e,r){t[r]||(t[r]=t.log)});var n=function(e){(e>r.length||0>=e)&&(e=r.length);var n=new Date,o=("0"+n.getHours()).slice(-2)+":"+("0"+n.getMinutes()).slice(-2)+":"+("0"+n.getSeconds()).slice(-2)+":"+("00"+n.getMilliseconds()).slice(-3),i=r[e-1],a=Array.prototype.splice.call(arguments,1),l=Function.prototype.bind.call(t[i],t);a.unshift(o),l.apply(t,a)}}(jQuery); \ No newline at end of file +/* ScrollMagic v1.0.1 | (c) Jan Paepke, @janpaepke | license & info: http://janpaepke.github.io/ScrollMagic */ +!function($){function e(e,t){var r={top:0,left:0};if(e.length>0){var n=e.get(0);if(void 0!==n.getBoundingClientRect){var o=n.getBoundingClientRect();r.top=o.top,r.left=o.left,t||(r.top+=$(document).scrollTop(),r.left+=$(document).scrollLeft())}else r=e.offset()||r,t&&(r.top-=$(document).scrollTop(),r.left-=$(document).scrollLeft())}return r}ScrollMagic=function(e){"use strict";var t="ScrollMagic",r={container:window,vertical:!0,globalSceneOptions:{},loglevel:2},o=this,i=$.extend({},r,e),a=[],s=!1,l=0,c="PAUSED",g=!0,u=0,d=!1,f=function(){if($.each(i,function(e){r.hasOwnProperty(e)||(v(2,'WARNING: Unknown option "'+e+'"'),delete i[e])}),i.container=$(i.container).first(),0==i.container.length)return void v(1,"ERROR creating object ScrollMagic: No valid scroll container supplied");g=!$.contains(document,i.container.get(0)),u=i.vertical?i.container.height():i.container.width(),i.container.on("scroll resize",p);try{TweenLite.ticker.addEventListener("tick",h),d=!0}catch(e){i.container.on("scroll resize",h),d=!1}v(3,"added new "+t+" controller")},h=function(){if(s){var e=$.isArray(s)?s:a,t=l;l=i.vertical?i.container.scrollTop():i.container.scrollLeft();var r=l-t;c=0==r?"PAUSED":r>0?"FORWARD":"REVERSE",$.each(e,function(t,r){v(3,"updating Scene "+(t+1)+"/"+e.length+" ("+a.length+" total)"),r.update(!0)}),0==e.length&&i.loglevel>=3&&v(3,"updating 0 Scenes (nothing added to controller)"),s=!1}},p=function(e){"resize"==e.type&&(u=i.vertical?i.container.height():i.container.width()),s=!0},v=function(e){if(i.loglevel>=e){var r="("+t+") ->",o=Array.prototype.splice.call(arguments,1),a=Function.prototype.bind.call(n,window);o.unshift(e,r),a.apply(window,o)}};return this.addScene=function(e){return $.isArray(e)?$.each(e,function(e,t){o.addScene(t)}):e.parent()!=o?e.addTo(o):-1==$.inArray(a,e)&&(a.push(e),$.each(i.globalSceneOptions,function(t,r){e[t]&&e[t].call(e,r)}),v(3,"added Scene ("+a.length+" total)")),o},this.removeScene=function(e){if($.isArray(e))$.each(e,function(e,t){o.removeScene(t)});else{var t=$.inArray(e,a);t>-1&&(a.splice(t,1),e.remove(),v(3,"removed Scene ("+a.length+" total)"))}return o},this.updateScene=function(e,t){return t?e.update(!0):($.isArray(s)||(s=[]),-1==$.inArray(e,s)&&s.push(e)),o},this.update=function(e){return p({type:"resize"}),e&&h(),o},this.info=function(e){var t={size:u,vertical:i.vertical,scrollPos:l,scrollDirection:c,container:i.container,isDocument:g};return arguments.length?void 0!==t[e]?t[e]:void v(1,'ERROR: option "'+e+'" is not available'):t},this.loglevel=function(e){return arguments.length?(i.loglevel!=e&&(i.loglevel=e),o):i.loglevel},this.destroy=function(e){for(;a.length>0;){var r=a[a.length-1];r.destroy(e)}return i.container.off("scroll resize",p),d?TweenLite.ticker.removeEventListener("tick",h):i.container.off("scroll resize",h),v(3,"destroyed "+t+" (reset: "+(e?"true":"false")+")"),null},f(),o},ScrollScene=function(t){"use strict";var r,o,i,a,s=["onCenter","onEnter","onLeave"],l="ScrollScene",c={duration:0,offset:0,triggerElement:null,triggerHook:s[0],reverse:!0,tweenChanges:!1,loglevel:2},g=this,u=$.extend({},c,t),d="BEFORE",f=0,h={start:0,end:0},p=function(){m(),g.on("change.internal",function(e){m(),"loglevel"!=e.what&&"tweenChanges"!=e.what&&("reverse"!=e.what&&null===u.triggerElement&&w(),g.update(),("DURING"!==d&&"duration"==e.what||"AFTER"===d&&0==u.duration)&&E())}),g.on("progress.internal",function(){R(),E()})},v=function(e){if(u.loglevel>=e){var t="("+l+") ->",r=Array.prototype.splice.call(arguments,1),o=Function.prototype.bind.call(n,window);r.unshift(e,t),o.apply(window,r)}},m=function(){if($.each(u,function(e){c.hasOwnProperty(e)||(v(2,'WARNING: Unknown option "'+e+'"'),delete u[e])}),u.duration=parseFloat(u.duration),(!$.isNumeric(u.duration)||u.duration<0)&&(v(1,'ERROR: Invalid value for option "duration":',u.duration),u.duration=c.duration),u.offset=parseFloat(u.offset),$.isNumeric(u.offset)||(v(1,'ERROR: Invalid value for option "offset":',u.offset),u.offset=c.offset),null!=u.triggerElement&&0==$(u.triggerElement).length&&(v(1,'ERROR: Element defined in option "triggerElement" was not found:',u.triggerElement),u.triggerElement=c.triggerElement),$.isNumeric(u.triggerHook)||-1!=$.inArray(u.triggerHook,s)||(v(1,'ERROR: Invalid value for option "triggerHook": ',u.triggerHook),u.triggerHook=c.triggerHook),!$.isNumeric(u.loglevel)||u.loglevel<0||u.loglevel>3){var e=u.loglevel;u.loglevel=c.loglevel,v(1,'ERROR: Invalid value for option "loglevel":',e)}if(o&&r&&u.triggerElement&&u.loglevel>=2){var t=o.getTweensOf($(u.triggerElement)),n=r.info("vertical");$.each(t,function(e,t){var r=t.vars.css||t.vars,o=n?void 0!==r.top||void 0!==r.bottom:void 0!==r.left||void 0!==r.right;return o?(v(2,"WARNING: Tweening the position of the trigger element affects the scene timing and should be avoided!"),!1):void 0})}},w=function(){h={start:g.startPosition()},r&&(h.start-=r.info("size")*g.triggerHook()),h.end=h.start+u.duration},R=function(e){var t=e>=0&&1>=e?e:f;if(o){if(-1===o.repeat())if(("DURING"===d||"AFTER"===d&&0==u.duration)&&o.paused())o.play();else{if("DURING"===d||o.paused())return!1;o.pause()}else{if(t==o.progress())return!1;0==u.duration?"AFTER"==d?o.play():o.reverse():u.tweenChanges?o.tweenTo(t*o.duration()):o.progress(t).pause()}return!0}return!1},E=function(){if(i&&r){var t=r.info();if("DURING"===d||"AFTER"===d&&0==u.duration){"fixed"!=i.css("position")&&(i.css("position","fixed"),y());var n=e(a.spacer,!0),o=u.reverse||0==u.duration?t.scrollPos-h.start:Math.round(f*u.duration*10)/10;n.top-=parseFloat(a.spacer.css("margin-top")),n[t.vertical?"top":"left"]+=o,i.css({top:n.top,left:n.left})}else{var s={position:"absolute"==a.origStyle.position?"absolute":"relative",top:0,left:0},l=i.css("position")!=s.position;"AFTER"===d?a.pushFollowers?0==parseFloat(a.spacer.css("padding-top"))&&(l=!0):s[t.vertical?"top":"left"]=u.duration*f:0==parseFloat(a.spacer.css("padding-bottom"))&&(l=!0),i.css(s),l&&y()}}},y=function(){if(i&&r&&"absolute"!=a.origStyle.position){var e="AFTER"===d,t="BEFORE"===d,n="DURING"===d,o=r.info("vertical"),s=a.spacer.children().first(),l=$.inArray(a.spacer.css("display"),["block","flex","list-item","table","-webkit-box"])>-1,c={};l?(c["margin-top"]=e?"auto":i.css("margin-top"),c["margin-bottom"]=t?"auto":i.css("margin-bottom")):c["margin-top"]=c["margin-bottom"]="auto",a.relSize.width?i.css("width",n?a.spacer.width():"100%"):(c["min-width"]=s.outerWidth(!0),c.width=n?c["min-width"]:"auto"),a.relSize.height?i.css("height",n?a.spacer.height():"100%"):(c["min-height"]=s.outerHeight(!l),c.height=n?c["min-height"]:"auto"),a.pushFollowers&&(o?(c.paddingTop=e?u.duration:0,c.paddingBottom=e?0:u.duration):(c.paddingLeft=e?u.duration:0,c.paddingRight=e?0:u.duration)),a.spacer.css(c)}},S=function(){r&&i&&"DURING"===d&&(r.info("isDocument")||E())},b=function(){r&&i&&"DURING"===d&&(a.relSize.width||a.relSize.height)&&y()};return this.parent=function(){return r},this.duration=function(e){return arguments.length?(u.duration!=e&&(u.duration=e,g.trigger("change",{what:"duration",newval:e})),g):u.duration},this.offset=function(e){return arguments.length?(u.offset!=e&&(u.offset=e,g.trigger("change",{what:"offset",newval:e})),g):u.offset},this.triggerElement=function(e){return arguments.length?(u.triggerElement!=e&&(u.triggerElement=e,g.trigger("change",{what:"triggerElement",newval:e})),g):u.triggerElement},this.triggerHook=function(e){if(!arguments.length){var t;if($.isNumeric(u.triggerHook))t=u.triggerHook;else switch(u.triggerHook){case"onCenter":t=.5;break;case"onLeave":t=0;break;case"onEnter":default:t=1}return t}return u.triggerHook!=e&&(u.triggerHook=e,g.trigger("change",{what:"triggerHook",newval:e})),g},this.reverse=function(e){return arguments.length?(u.reverse!=e&&(u.reverse=e,g.trigger("change",{what:"reverse",newval:e})),g):u.reverse},this.tweenChanges=function(e){return arguments.length?(u.tweenChanges!=e&&(u.tweenChanges=e,g.trigger("change",{what:"tweenChanges",newval:e})),g):u.tweenChanges},this.loglevel=function(e){return arguments.length?(u.loglevel!=e&&(u.loglevel=e,g.trigger("change",{what:"loglevel",newval:e})),g):u.loglevel},this.state=function(){return d},this.startPosition=function(){var t=u.offset;if(r){var n=r.info();if(null===u.triggerElement)t+=n.size*g.triggerHook();else{for(var o=$(u.triggerElement).first(),i=e(r.info("container"));o.parent().data("ScrollMagicPinSpacer");)o=o.parent();var a=e(o);n.isDocument||(i.top-=n.scrollPos,i.left-=n.scrollPos),t+=n.vertical?a.top-i.top:a.left-i.left}}return t},this.update=function(e){if(r)if(e){var t,n=r.info("scrollPos");null!==u.triggerElement&&w(),t=u.duration>0?(n-h.start)/(h.end-h.start):n>=h.start?1:0,g.trigger("update",{startPos:h.start,endPos:h.end,scrollPos:n}),g.progress(t)}else r.updateScene(g,!1);return g},this.progress=function(e){if(arguments.length){var t=!1,n=d,o=r?r.info("scrollDirection"):"PAUSED";if(0>=e&&"BEFORE"!==d&&(e>=f||u.reverse)?(f=0,d="BEFORE",t=!0):e>0&&1>e&&(e>=f||u.reverse)?(f=e,d="DURING",t=!0):e>=1&&"AFTER"!==d?(f=1,d="AFTER",t=!0):"DURING"!==d||u.reverse||E(),t){var i={progress:f,state:d,scrollDirection:o},a=d!=n,s="BEFORE"===d&&0==u.duration;a&&(("DURING"===d||0==u.duration)&&g.trigger("enter",i),("BEFORE"===d||"BEFORE"===n)&&g.trigger(s?"end":"start",i)),g.trigger("progress",i),a&&(("AFTER"===d||"AFTER"===n)&&g.trigger(s?"start":"end",i),("DURING"!==d||0==u.duration)&&g.trigger("leave",i))}return g}return f},this.setTween=function(e){o&&g.removeTween();try{o=new TimelineMax({smoothChildTiming:!0}).add(e).pause()}catch(e){v(1,"ERROR calling method 'setTween()': Supplied argument is not a valid TweenMaxObject")}finally{return e.repeat&&-1===e.repeat()&&(o.repeat(-1),o.yoyo(e.yoyo())),m(),v(3,"added tween"),R(),g}},this.removeTween=function(e){return o&&(e&&R(0),o.kill(),o=void 0,v(3,"removed tween (reset: "+(e?"true":"false")+")")),g},this.setPin=function(e,t){var r={pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"},t=$.extend({},r,t);if(e=$(e).first(),0==e.length)return v(1,"ERROR calling method 'setPin()': Invalid pin element supplied."),g;if(i){if(i===e)return g;g.removePin()}i=e,i.parent().hide();var n=i.css(["position","display","top","left","bottom","right"]),o=i.css(["width","height"]);if(i.parent().show(),"fixed"==n.position)return v(1,"ERROR: Pin does not work with elements that are positioned 'fixed'."),i=void 0,g;var s=$("
").addClass(t.spacerClass).css(n).data("ScrollMagicPinSpacer",!0).css({position:"absolute"==n.position?"absolute":"relative","margin-left":"auto","margin-right":"auto","box-sizing":"content-box","-moz-box-sizing":"content-box","-webkit-box-sizing":"content-box"});return"absolute"==n.position&&t.pushFollowers&&(v(2,"WARNING: If the pinned element is positioned absolutely pushFollowers is disabled."),t.pushFollowers=!1),a={spacer:s,relSize:{width:"%"===o.width.slice(-1),height:"%"===o.height.slice(-1)},pushFollowers:t.pushFollowers,origStyle:n},a.relSize.width&&s.css("width",o.width),a.relSize.height&&s.css("height",o.height),i.before(s).appendTo(s).css({position:"absolute"==n.position?"absolute":"relative",top:"auto",left:"auto",bottom:"auto",right:"auto"}),$(window).on("scroll resize",S),v(3,"added pin"),E(),g},this.removePin=function(e){if(i){if(e||!r)i.insertBefore(a.spacer).css(a.origStyle),a.spacer.remove();else{var t=r.info("vertical");i.css({position:"absolute",top:t?u.duration*f:0,left:t?0:u.duration*f})}$(window).off("scroll resize",S),i=void 0,v(3,"removed pin (reset: "+(e?"true":"false")+")")}return g},this.addTo=function(e){return r!=e?(r&&r.removeScene(g),r=e,m(),w(),y(),r.info("container").on("resize",b),v(3,"added "+l+" to controller"),e.addScene(g),g.update(),g):void 0},this.remove=function(){if(r){r.info("container").off("resize",b);var e=r;r=void 0,v(3,"removed "+l+" from controller"),e.removeScene(g)}return g},this.destroy=function(e){return this.removeTween(e),this.removePin(e),this.remove(),this.off("start end enter leave progress change update change.internal progress.internal"),v(3,"destroyed "+l+" (reset: "+(e?"true":"false")+")"),null},this.on=function(e,t){if($.isFunction(t)){var r=$.trim(e).toLowerCase().replace(/(\w+)\.(\w+)/g,"$1."+l+"_$2").replace(/( |^)(\w+)( |$)/g,"$1$2."+l+"$3");$(g).on(r,t)}else v(1,"ERROR calling method 'on()': Supplied argument is not a valid callback!");return g},this.off=function(e,t){var r=$.trim(e).toLowerCase().replace(/(\w+)\.(\w+)/g,"$1."+l+"_$2").replace(/( |^)(\w+)( |$)/g,"$1$2."+l+"$3");return $(g).off(r,t),g},this.trigger=function(e,t){v(3,"event fired:",e,"->",t);var r={type:$.trim(e).toLowerCase(),target:g};return $.isPlainObject(t)&&(r=$.extend({},t,r)),$(g).trigger(r),g},p(),g};var t=window.console=window.console||{},r=["error","warn","log"];t.log||(t.log=$.noop),$.each(r,function(e,r){t[r]||(t[r]=t.log)});var n=function(e){(e>r.length||0>=e)&&(e=r.length);var n=new Date,o=("0"+n.getHours()).slice(-2)+":"+("0"+n.getMinutes()).slice(-2)+":"+("0"+n.getSeconds()).slice(-2)+":"+("00"+n.getMilliseconds()).slice(-3),i=r[e-1],a=Array.prototype.splice.call(arguments,1),s=Function.prototype.bind.call(t[i],t);a.unshift(o),s.apply(t,a)}}(jQuery); \ No newline at end of file