From 065b0927d4948513c3787a4f5110cbcbd4d8ce13 Mon Sep 17 00:00:00 2001 From: Jan Paepke Date: Thu, 26 Feb 2015 16:35:17 +0100 Subject: [PATCH] built 2.0.0 --- CHANGELOG.md | 2 +- README.md | 4 +- ScrollMagic.jquery.json | 2 +- bower.json | 2 +- dev/build/config.json | 4 +- dev/todo.md | 4 +- docs/index.html | 4 +- package.json | 2 +- scrollmagic/minified/ScrollMagic.min.js | 4 +- .../minified/plugins/animation.gsap.min.js | 2 +- .../plugins/animation.velocity.min.js | 2 +- .../plugins/debug.addIndicators.min.js | 2 +- .../plugins/jquery.ScrollMagic.min.js | 2 +- scrollmagic/uncompressed/ScrollMagic.js | 86 +++++++++---------- .../uncompressed/plugins/animation.gsap.js | 6 +- .../plugins/animation.velocity.js | 4 +- .../plugins/debug.addIndicators.js | 34 ++++---- .../plugins/jquery.ScrollMagic.js | 4 +- 18 files changed, 86 insertions(+), 84 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ca24157..cc8c9448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ CHANGELOG ========= -## 2.0.0 (unreleased) +## 2.0.0 (2015-02-26) #### changes (non-breaking) - **removal of all dependencies (jQuery & GSAP) – _ScrollMagic is now stand-alone._** diff --git a/README.md b/README.md index 86992543..d5310eb9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -#ScrollMagic v2.0.0-beta [![Build Status](https://api.travis-ci.org/janpaepke/ScrollMagic.svg?branch=master)](https://travis-ci.org/janpaepke/ScrollMagic) +#ScrollMagic v2.0.0 [![Build Status](https://api.travis-ci.org/janpaepke/ScrollMagic.svg?branch=master)](https://travis-ci.org/janpaepke/ScrollMagic) ###The javascript library for magical scroll interactions. [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif "Shut up and take my money!")](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8BJC8B58XHKLL "Shut up and take my money!") @@ -75,7 +75,7 @@ __Option 4: CDN__ If you don't want to host ScrollMagic yourself, you can include it from [cdnjs](https://cdnjs.com/libraries/scrollmagic): ``` -http://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.0-beta/ScrollMagic.min.js +http://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.0/ScrollMagic.min.js ``` All plugins and uncompressed files are also available on cdnjs. diff --git a/ScrollMagic.jquery.json b/ScrollMagic.jquery.json index 03a49a85..3342c3c6 100644 --- a/ScrollMagic.jquery.json +++ b/ScrollMagic.jquery.json @@ -1,7 +1,7 @@ { "name": "scrollmagic", "title": "ScrollMagic", - "version": "2.0.0-beta", + "version": "2.0.0", "description": "The javascript library for magical scroll interactions.", "author": { "name": "Jan Paepke", diff --git a/bower.json b/bower.json index e9d80b0a..fe25d077 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "scrollmagic", - "version": "2.0.0-beta", + "version": "2.0.0", "description": "The javascript library for magical scroll interactions.", "homepage": "http://janpaepke.github.io/ScrollMagic/", "repository": { diff --git a/dev/build/config.json b/dev/build/config.json index 5016c12b..69a22543 100644 --- a/dev/build/config.json +++ b/dev/build/config.json @@ -1,6 +1,6 @@ { - "version": "2.0.0-beta", - "lastupdate": "2015-01-30", + "version": "2.0.0", + "lastupdate": "2015-02-26", "info": { "description": "The javascript library for magical scroll interactions.", "homepage": "http://janpaepke.github.io/ScrollMagic/", diff --git a/dev/todo.md b/dev/todo.md index 9adda480..ffc8e8fc 100644 --- a/dev/todo.md +++ b/dev/todo.md @@ -40,4 +40,6 @@ - send pull request to cdnjs - share on twitter -- send mail \ No newline at end of file +- send mail + +- update fiddle (contributing) \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index b71cadd3..dd7059de 100644 --- a/docs/index.html +++ b/docs/index.html @@ -161,7 +161,7 @@
-

ScrollMagic v2.0.0-beta Build Status

The javascript library for magical scroll interactions. Donate

ScrollMagic helps you to easily react to the user's current scroll position.
It's the perfect library for you, if you want to ...

+

ScrollMagic v2.0.0 Build Status

The javascript library for magical scroll interactions. Donate

ScrollMagic helps you to easily react to the user's current scroll position.
It's the perfect library for you, if you want to ...

  • animate based on scroll position – either trigger an animation or synchronize it to the scrollbar movement (like a playback scrub control).
  • pin an element starting at a specific scroll position – either indefinitely or for a limited amount of scroll progress (sticky elements).
  • @@ -197,7 +197,7 @@

    Availability

    To get your copy of ScrollMagic you have the choice betw

    git clone git://github.com/janpaepke/ScrollMagic.git

    Option 2: Bower
    ScrollMagic is also available on bower and will only install the necessary source code, ignoring all example and documentation files.
    Please mind that since they are not core dependencies, you will have to add frameworks like GSAP, jQuery or Velocity manually, should you choose to use them.

    bower install scrollmagic

    Option 3: npm
    If you prefer the node package manager, feel free to use it.
    Keep in mind that like with bower non-crucial files will be ignored (see above).

    npm install scrollmagic

    Option 4: CDN
    If you don't want to host ScrollMagic yourself, you can include it from cdnjs:

    -
    http://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.0-beta/ScrollMagic.min.js

    All plugins and uncompressed files are also available on cdnjs.

    +
    http://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.0/ScrollMagic.min.js

    All plugins and uncompressed files are also available on cdnjs.

    Installation

    Include the core library in your HTML file:

    <script src="js/scrollmagic/uncompressed/ScrollMagic.js"></script>

    And you're ready to go!
    For deployment use the minified version instead:

    <script src="js/scrollmagic/minified/ScrollMagic.min.js"></script>

    NOTE: The logging feature is removed in the minified version due to file size considerations.

    diff --git a/package.json b/package.json index f32bca69..4cfa6c74 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "scrollmagic", "title": "ScrollMagic", - "version": "2.0.0-beta", + "version": "2.0.0", "description": "The javascript library for magical scroll interactions.", "author": { "name": "Jan Paepke", diff --git a/scrollmagic/minified/ScrollMagic.min.js b/scrollmagic/minified/ScrollMagic.min.js index bb4b331f..859d87e9 100644 --- a/scrollmagic/minified/ScrollMagic.min.js +++ b/scrollmagic/minified/ScrollMagic.min.js @@ -1,2 +1,2 @@ -/*! ScrollMagic v2.0.0-beta | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ -!function(e,t){"function"==typeof define&&define.amd?define(t):e.ScrollMagic=t()}(this,function(){"use strict";var e=function(){};e.version="2.0.0-beta",e.Controller=function(n){var i,o,s="ScrollMagic.Controller",a={f:"FORWARD",r:"REVERSE",p:"PAUSED"},l=t.defaults,c=this,u=r.extend({},l,n),f=[],h=!1,d=0,g=a.p,p=!0,v=0,m=!0,w=function(){for(var e in u)l.hasOwnProperty(e)||delete u[e];if(u.container=r.get.elements(u.container)[0],!u.container)throw s+" init failed.";p=u.container===window||u.container===document.body||!document.body.contains(u.container),p&&(u.container=window),v=u.vertical?r.get.height(u.container):r.get.width(u.container),u.container.addEventListener("resize",T),u.container.addEventListener("scroll",T),u.refreshInterval=parseInt(u.refreshInterval)||l.refreshInterval,y()},y=function(){u.refreshInterval>0&&(o=window.setTimeout(x,u.refreshInterval))},E=function(){return u.vertical?r.get.scrollTop(u.container):r.get.scrollLeft(u.container)},S=function(e){u.vertical?p?window.scrollTo(r.get.scrollLeft(),e):u.container.scrollTop=e:p?window.scrollTo(e,r.get.scrollTop()):u.container.scrollLeft=e},b=function(){var e=d;d=c.scrollPos();var t=d-e;g=0===t?a.p:t>0?a.f:a.r},F=function(){if(m&&h){var e=r.type.Array(h)?h:f.slice(0);g===a.r&&e.reverse(),e.forEach(function(e){e.update(!0)}),0===e.length&&u.loglevel>=3,h=!1}},z=function(){i=r.rAF(F)},T=function(e){"resize"==e.type&&(v=u.vertical?r.get.height(u.container):r.get.width(u.container)),b(),h||(h=!0,z())},x=function(){if(!p&&v!=(u.vertical?r.get.height(u.container):r.get.width(u.container))){var e;try{e=new Event("resize",{bubbles:!1,cancelable:!1})}catch(t){e=document.createEvent("Event"),e.initEvent("resize",!1,!1)}u.container.dispatchEvent(e)}f.forEach(function(e){e.refresh()}),y()};this._options=u;var R=function(e){if(e.length<=1)return e;var t=e.slice(0);return t.sort(function(e,t){return e.scrollOffset()>t.scrollOffset()?1:-1}),t};return this.addScene=function(t){if(r.type.Array(t))t.forEach(function(e){c.addScene(e)});else if(t instanceof e.Scene)if(t.controller()!==c)t.addTo(c);else if(f.indexOf(t)<0){f.push(t),f=R(f),t.on("shift.controller_sort",function(){f=R(f)});for(var n in u.globalSceneOptions)t[n]&&t[n].call(t,u.globalSceneOptions[n])}return c},this.removeScene=function(e){if(r.type.Array(e))e.forEach(function(e){c.removeScene(e)});else{var t=f.indexOf(e);t>-1&&(e.off("shift.controller_sort"),f.splice(t,1),e.remove())}return c},this.updateScene=function(t,n){return r.type.Array(t)?t.forEach(function(e){c.updateScene(e,n)}):n?t.update(!0):h!==!0&&t instanceof e.Scene&&(h=h||[],-1==h.indexOf(t)&&h.push(t),h=R(h),z()),c},this.update=function(e){return T({type:"resize"}),e&&F(),c},this.scrollTo=function(t){if(r.type.Number(t))S.call(u.container,t);else if(t instanceof e.Scene)t.controller()===c?c.scrollTo(t.scrollOffset()):log(2,"scrollTo(): The supplied scene does not belong to this controller. Scroll cancelled.",t);else if(r.type.Function(t))S=t;else{var n=r.get.elements(t)[0];if(n){var i=u.vertical?"top":"left",o=r.get.offset(u.container),s=r.get.offset(n);p||(o[i]-=c.scrollPos()),c.scrollTo(s[i]-o[i])}else log(2,"scrollTo(): The supplied argument is invalid. Scroll cancelled.",t)}return c},this.scrollPos=function(e){return arguments.length?(r.type.Function(e)&&(E=e),c):E.call(c)},this.info=function(e){var t={size:v,vertical:u.vertical,scrollPos:d,scrollDirection:g,container:u.container,isDocument:p};return arguments.length?void 0!==t[e]?t[e]:void 0:t},this.loglevel=function(e){return arguments.length?(u.loglevel!=e&&(u.loglevel=e),c):u.loglevel},this.enabled=function(e){return arguments.length?(m!=e&&(m=!!e,c.updateScene(f,!0)),c):m},this.destroy=function(e){window.clearTimeout(o);for(var t=f.length;t--;)f[t].destroy(e);return u.container.removeEventListener("resize",T),u.container.removeEventListener("scroll",T),r.cAF(i),null},w(),c};var t={defaults:{container:window,vertical:!0,globalSceneOptions:{},loglevel:2,refreshInterval:100}};e.Controller.addOption=function(e,n){t.defaults[e]=n},e.Controller.extend=function(t){var n=this;e.Controller=function(){return n.apply(this,arguments),this.$super=r.extend({},this),t.apply(this,arguments)||this},r.extend(e.Controller,n),e.Controller.prototype=n.prototype,e.Controller.prototype.constructor=e.Controller},e.Scene=function(t){var i,o,s="data-scrollmagic-pin-spacer",a=n.defaults,l=this,c=r.extend({},a,t),u="BEFORE",f=0,h={start:0,end:0},d=0,g=!0,p=function(){for(var e in c)a.hasOwnProperty(e)||delete c[e];for(var t in a)F(t);S(),l.on("change.internal",function(e){"loglevel"!==e.what&&"tweenChanges"!==e.what&&("triggerElement"===e.what?w():"reverse"===e.what&&l.update())}).on("shift.internal",function(){v(),l.update()})};this.addTo=function(t){return t instanceof e.Controller&&o!=t&&(o&&o.removeScene(l),o=t,S(),m(!0),w(!0),v(),o.info("container").addEventListener("resize",y),t.addScene(l),l.trigger("add",{controller:o}),l.update()),l},this.enabled=function(e){return arguments.length?(g!=e&&(g=!!e,l.update(!0)),l):g},this.remove=function(){if(o){o.info("container").removeEventListener("resize",y);var e=o;o=void 0,e.removeScene(l),l.trigger("remove")}return l},this.destroy=function(e){return l.trigger("destroy",{reset:e}),l.remove(),l.off("*.*"),null},this.update=function(e){if(o)if(e)if(o.enabled()&&g){var t,n=o.info("scrollPos");t=c.duration>0?(n-h.start)/(h.end-h.start):n>=h.start?1:0,l.trigger("update",{startPos:h.start,endPos:h.end,scrollPos:n}),l.progress(t)}else T&&"DURING"===u&&R(!0);else o.updateScene(l,!1);return l},this.refresh=function(){return m(),w(),l},this.progress=function(e){if(arguments.length){var t=!1,n=u,r=o?o.info("scrollDirection"):"PAUSED",i=c.reverse||e>=f;if(0===c.duration?(t=f!=e,f=1>e&&i?0:1,u=0===f?"BEFORE":"DURING"):0>=e&&"BEFORE"!==u&&i?(f=0,u="BEFORE",t=!0):e>0&&1>e&&i?(f=e,u="DURING",t=!0):e>=1&&"AFTER"!==u?(f=1,u="AFTER",t=!0):"DURING"!==u||i||R(),t){var s={progress:f,state:u,scrollDirection:r},a=u!=n,h=function(e){l.trigger(e,s)};a&&"DURING"!==n&&(h("enter"),h("BEFORE"===n?"start":"end")),h("progress"),a&&"DURING"!==u&&(h("BEFORE"===u?"start":"end"),h("leave"))}return l}return f};var v=function(){h={start:d+c.offset},o&&c.triggerElement&&(h.start-=o.info("size")*c.triggerHook),h.end=h.start+c.duration},m=function(e){if(i){var t="duration";b(t,i.call(l))&&!e&&(l.trigger("change",{what:t,newval:c[t]}),l.trigger("shift",{reason:t}))}},w=function(e){var t=0,n=c.triggerElement;if(o&&n){for(var i=o.info(),a=r.get.offset(i.container),u=i.vertical?"top":"left";n.parentNode.hasAttribute(s);)n=n.parentNode;var f=r.get.offset(n);i.isDocument||(a[u]-=o.scrollPos()),t=f[u]-a[u]}var h=t!=d;d=t,h&&!e&&l.trigger("shift",{reason:"triggerElementPosition"})},y=function(){c.triggerHook>0&&l.trigger("shift",{reason:"containerResize"})},E=r.extend(n.validate,{duration:function(e){if(r.type.String(e)&&e.match(/^(\.|\d)*\d+%$/)){var t=parseFloat(e)/100;e=function(){return o?o.info("size")*t:0}}if(r.type.Function(e)){i=e;try{e=parseFloat(i())}catch(n){e=-1}}if(e=parseFloat(e),!r.type.Number(e)||0>e)throw i?(i=void 0,0):0;return e}}),S=function(e){e=arguments.length?[e]:Object.keys(E),e.forEach(function(e){var t;if(E[e])try{t=E[e](c[e])}catch(n){t=a[e]}finally{c[e]=t}})},b=function(e,t){var n=!1,r=c[e];return c[e]!=t&&(c[e]=t,S(e),n=r!=c[e]),n},F=function(e){l[e]||(l[e]=function(t){return arguments.length?("duration"===e&&(i=void 0),b(e,t)&&(l.trigger("change",{what:e,newval:c[e]}),n.shifts.indexOf(e)>-1&&l.trigger("shift",{reason:e})),l):c[e]})};this.controller=function(){return o},this.state=function(){return u},this.scrollOffset=function(){return h.start},this.triggerPosition=function(){var e=c.offset;return o&&(e+=c.triggerElement?d:o.info("size")*l.triggerHook()),e};var z={};this.on=function(e,t){return r.type.Function(t)&&(e=e.trim().split(" "),e.forEach(function(e){var n=e.split("."),r=n[0],i=n[1];"*"!=r&&(z[r]||(z[r]=[]),z[r].push({namespace:i||"",callback:t}))})),l},this.off=function(e,t){return e?(e=e.trim().split(" "),e.forEach(function(e){var n=e.split("."),r=n[0],i=n[1]||"",o="*"===r?Object.keys(z):[r];o.forEach(function(e){for(var n=z[e]||[],r=n.length;r--;){var o=n[r];!o||i!==o.namespace&&"*"!==i||t&&t!=o.callback||n.splice(r,1)}n.length||delete z[e]})}),l):l},this.trigger=function(t,n){if(t){var r=t.trim().split("."),i=r[0],o=r[1],s=z[i];s&&s.forEach(function(t){o&&o!==t.namespace||t.callback.call(l,new e.Event(i,t.namespace,l,n))})}return l};var T,x;l.on("shift.internal",function(e){var t="duration"===e.reason;("AFTER"===u&&t||"DURING"===u&&0===c.duration)&&R(),t&&C()}).on("progress.internal",function(){R()}).on("add.internal",function(){C()}).on("destroy.internal",function(e){l.removePin(e.reset)});var R=function(e){if(T&&o){var t=o.info();if(e||"DURING"!==u){var n={position:x.inFlow?"relative":"absolute",top:0,left:0},i=r.css(T,"position")!=n.position;x.pushFollowers?c.duration>0&&("AFTER"===u&&0===parseFloat(r.css(x.spacer,"padding-top"))?i=!0:"BEFORE"===u&&0===parseFloat(r.css(x.spacer,"padding-bottom"))&&(i=!0)):n[t.vertical?"top":"left"]=c.duration*f,r.css(T,n),i&&C()}else{"fixed"!=r.css(T,"position")&&(r.css(T,{position:"fixed"}),C());var s=r.get.offset(x.spacer,!0),a=c.reverse||0===c.duration?t.scrollPos-h.start:Math.round(f*c.duration*10)/10;s[t.vertical?"top":"left"]+=a,r.css(T,{top:s.top,left:s.left})}}},C=function(){if(T&&o&&x.inFlow){var e="DURING"===u,t=o.info("vertical"),n=x.spacer.children[0],i=r.isMarginCollapseType(r.css(x.spacer,"display")),s={};x.relSize.width||x.relSize.autoFullWidth?e?r.get.width(window)==r.get.width(x.spacer.parentNode)?r.css(T,{width:x.relSize.autoFullWidth?"100%":"inherit"}):r.css(T,{width:r.get.width(x.spacer)}):r.css(T,{width:"100%"}):(s["min-width"]=r.get.width(t?T:n,!0,!0),s.width=e?s["min-width"]:"auto"),x.relSize.height?e?r.get.height(window)==r.get.height(x.spacer.parentNode)?r.css(T,{height:"inherit"}):r.css(T,{height:r.get.height(x.spacer)}):r.css(T,{height:"100%"}):(s["min-height"]=r.get.height(t?n:T,!0,!i),s.height=e?s["min-height"]:"auto"),x.pushFollowers&&(s["padding"+(t?"Top":"Left")]=c.duration*f,s["padding"+(t?"Bottom":"Right")]=c.duration*(1-f)),r.css(x.spacer,s)}},L=function(){o&&T&&"DURING"===u&&!o.info("isDocument")&&R()},N=function(){o&&T&&"DURING"===u&&((x.relSize.width||x.relSize.autoFullWidth)&&r.get.width(window)!=r.get.width(x.spacer.parentNode)||x.relSize.height&&r.get.height(window)!=r.get.height(x.spacer.parentNode))&&C()},D=function(e){o&&T&&"DURING"===u&&!o.info("isDocument")&&(e.preventDefault(),o.scrollTo(o.info("scrollPos")-(e[o.info("vertical")?"wheelDeltaY":"wheelDeltaX"]/3||30*-e.detail)))};this.setPin=function(e,t){var n={pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"};if(t=r.extend({},n,t),e=r.get.elements(e)[0],!e)return l;if("fixed"===r.css(e,"position"))return l;if(T){if(T===e)return l;l.removePin()}T=e;var i=T.parentNode.style.display,o=["top","left","bottom","right","margin","marginLeft","marginRight","marginTop","marginBottom"];T.parentNode.style.display="none";var a="absolute"!=r.css(T,"position"),c=r.css(T,o.concat(["display"])),u=r.css(T,["width","height"]);T.parentNode.style.display=i,!a&&t.pushFollowers&&(t.pushFollowers=!1);var f=T.parentNode.insertBefore(document.createElement("div"),T),h=r.extend(c,{position:a?"relative":"absolute",boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});if(a||r.extend(h,r.css(T,["width","height"])),r.css(f,h),f.setAttribute(s,""),r.addClass(f,t.spacerClass),x={spacer:f,relSize:{width:"%"===u.width.slice(-1),height:"%"===u.height.slice(-1),autoFullWidth:"auto"===u.width&&a&&r.isMarginCollapseType(c.display)},pushFollowers:t.pushFollowers,inFlow:a},!T.___origStyle){T.___origStyle={};var d=T.style,g=o.concat(["width","height","position","boxSizing","mozBoxSizing","webkitBoxSizing"]);g.forEach(function(e){T.___origStyle[e]=d[e]||""})}return x.relSize.width&&r.css(f,{width:u.width}),x.relSize.height&&r.css(f,{height:u.height}),f.appendChild(T),r.css(T,{position:a?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(x.relSize.width||x.relSize.autoFullWidth)&&r.css(T,{boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"}),window.addEventListener("scroll",L),window.addEventListener("resize",L),window.addEventListener("resize",N),T.addEventListener("mousewheel",D),T.addEventListener("DOMMouseScroll",D),R(),l},this.removePin=function(e){if(T){if("DURING"===u&&R(!0),e||!o){var t=x.spacer.children[0];if(t.hasAttribute(s)){var n=x.spacer.style,i=["margin","marginLeft","marginRight","marginTop","marginBottom"];margins={},i.forEach(function(e){margins[e]=n[e]||""}),r.css(t,margins)}x.spacer.parentNode.insertBefore(t,x.spacer),x.spacer.parentNode.removeChild(x.spacer),T.parentNode.hasAttribute(s)||(r.css(T,T.___origStyle),delete T.___origStyle)}window.removeEventListener("scroll",L),window.removeEventListener("resize",L),window.removeEventListener("resize",N),T.removeEventListener("mousewheel",D),T.removeEventListener("DOMMouseScroll",D),T=void 0}return l};var O,A=[];return l.on("destroy.internal",function(e){l.removeClassToggle(e.reset)}),this.setClassToggle=function(e,t){var n=r.get.elements(e);return 0!==n.length&&r.type.String(t)?(A.length>0&&l.removeClassToggle(),O=t,A=n,l.on("enter.internal_class leave.internal_class",function(e){var t="enter"===e.type?r.addClass:r.removeClass;A.forEach(function(e){t(e,O)})}),l):l},this.removeClassToggle=function(e){return e&&A.forEach(function(e){r.removeClass(e,O)}),l.off("start.internal_class end.internal_class"),O=void 0,A=[],l},p(),l};var n={defaults:{duration:0,offset:0,triggerElement:void 0,triggerHook:.5,reverse:!0,loglevel:2},validate:{offset:function(e){if(e=parseFloat(e),!r.type.Number(e))throw 0;return e},triggerElement:function(e){if(e=e||void 0){var t=r.get.elements(e)[0];if(!t)throw 0;e=t}return e},triggerHook:function(e){var t={onCenter:.5,onEnter:1,onLeave:0};if(r.type.Number(e))e=Math.max(0,Math.min(parseFloat(e),1));else{if(!(e in t))throw 0;e=t[e]}return e},reverse:function(e){return!!e}},shifts:["duration","offset","triggerHook"]};e.Scene.addOption=function(e,t,r,i){e in n.defaults||(n.defaults[e]=t,n.validate[e]=r,i&&n.shifts.push(e))},e.Scene.extend=function(t){var n=this;e.Scene=function(){return n.apply(this,arguments),this.$super=r.extend({},this),t.apply(this,arguments)||this},r.extend(e.Scene,n),e.Scene.prototype=n.prototype,e.Scene.prototype.constructor=e.Scene},e.Event=function(e,t,n,r){r=r||{};for(var i in r)this[i]=r[i];return this.type=e,this.target=this.currentTarget=n,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this};var r=e._util=function(e){var t,n={},r=function(e){return parseFloat(e)||0},i=function(t){return t.currentStyle?t.currentStyle:e.getComputedStyle(t)},o=function(t,n,o,s){if(n=n===document?e:n,n===e)s=!1;else if(!f.DomElement(n))return 0;t=t.charAt(0).toUpperCase()+t.substr(1).toLowerCase();var a=(o?n["offset"+t]||n["outer"+t]:n["client"+t]||n["inner"+t])||0;if(o&&s){var l=i(n);a+="Height"===t?r(l.marginTop)+r(l.marginBottom):r(l.marginLeft)+r(l.marginRight)}return a},s=function(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})};n.extend=function(e){for(e=e||{},t=1;t-1};var a=0,l=["ms","moz","webkit","o"],c=e.requestAnimationFrame,u=e.cancelAnimationFrame;for(t=0;!c&&t=0},f.DomElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var h=n.get={};return h.elements=function(t){var n=[];if(f.String(t))try{t=document.querySelectorAll(t)}catch(r){return n}if("nodelist"===f(t)||f.Array(t))for(var i=0,o=n.length=t.length;o>i;i++){var s=t[i];n[i]=f.DomElement(s)?s:h.elements(s)}else(f.DomElement(t)||t===document||t===e)&&(n=[t]);return n},h.scrollTop=function(t){return t&&"number"==typeof t.scrollTop?t.scrollTop:e.pageYOffset||0},h.scrollLeft=function(t){return t&&"number"==typeof t.scrollLeft?t.scrollLeft:e.pageXOffset||0},h.width=function(e,t,n){return o("width",e,t,n)},h.height=function(e,t,n){return o("height",e,t,n)},h.offset=function(e,t){var n={top:0,left:0};if(e&&e.getBoundingClientRect){var r=e.getBoundingClientRect();n.top=r.top,n.left=r.left,t||(n.top+=h.scrollTop(),n.left+=h.scrollLeft())}return n},n.addClass=function(e,t){t&&(e.classList?e.classList.add(t):e.className+=" "+t)},n.removeClass=function(e,t){t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))},n.css=function(e,t){if(f.String(t))return i(e)[s(t)];if(f.Array(t)){var n={},r=i(e);return t.forEach(function(e){n[e]=r[s(e)]}),n}for(var o in t){var a=t[o];a==parseFloat(a)&&(a+="px"),e.style[s(o)]=a}},n}(window||{});return e}); \ No newline at end of file +/*! ScrollMagic v2.0.0 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ +!function(e,t){"function"==typeof define&&define.amd?define(t):e.ScrollMagic=t()}(this,function(){"use strict";var e=function(){};e.version="2.0.0",e.Controller=function(n){var i,o,s="ScrollMagic.Controller",a={f:"FORWARD",r:"REVERSE",p:"PAUSED"},l=t.defaults,c=this,u=r.extend({},l,n),f=[],h=!1,d=0,g=a.p,p=!0,v=0,m=!0,w=function(){for(var e in u)l.hasOwnProperty(e)||delete u[e];if(u.container=r.get.elements(u.container)[0],!u.container)throw s+" init failed.";p=u.container===window||u.container===document.body||!document.body.contains(u.container),p&&(u.container=window),v=u.vertical?r.get.height(u.container):r.get.width(u.container),u.container.addEventListener("resize",T),u.container.addEventListener("scroll",T),u.refreshInterval=parseInt(u.refreshInterval)||l.refreshInterval,y()},y=function(){u.refreshInterval>0&&(o=window.setTimeout(x,u.refreshInterval))},E=function(){return u.vertical?r.get.scrollTop(u.container):r.get.scrollLeft(u.container)},S=function(e){u.vertical?p?window.scrollTo(r.get.scrollLeft(),e):u.container.scrollTop=e:p?window.scrollTo(e,r.get.scrollTop()):u.container.scrollLeft=e},b=function(){var e=d;d=c.scrollPos();var t=d-e;g=0===t?a.p:t>0?a.f:a.r},F=function(){if(m&&h){var e=r.type.Array(h)?h:f.slice(0);g===a.r&&e.reverse(),e.forEach(function(e){e.update(!0)}),0===e.length&&u.loglevel>=3,h=!1}},z=function(){i=r.rAF(F)},T=function(e){"resize"==e.type&&(v=u.vertical?r.get.height(u.container):r.get.width(u.container)),b(),h||(h=!0,z())},x=function(){if(!p&&v!=(u.vertical?r.get.height(u.container):r.get.width(u.container))){var e;try{e=new Event("resize",{bubbles:!1,cancelable:!1})}catch(t){e=document.createEvent("Event"),e.initEvent("resize",!1,!1)}u.container.dispatchEvent(e)}f.forEach(function(e){e.refresh()}),y()};this._options=u;var R=function(e){if(e.length<=1)return e;var t=e.slice(0);return t.sort(function(e,t){return e.scrollOffset()>t.scrollOffset()?1:-1}),t};return this.addScene=function(t){if(r.type.Array(t))t.forEach(function(e){c.addScene(e)});else if(t instanceof e.Scene)if(t.controller()!==c)t.addTo(c);else if(f.indexOf(t)<0){f.push(t),f=R(f),t.on("shift.controller_sort",function(){f=R(f)});for(var n in u.globalSceneOptions)t[n]&&t[n].call(t,u.globalSceneOptions[n])}return c},this.removeScene=function(e){if(r.type.Array(e))e.forEach(function(e){c.removeScene(e)});else{var t=f.indexOf(e);t>-1&&(e.off("shift.controller_sort"),f.splice(t,1),e.remove())}return c},this.updateScene=function(t,n){return r.type.Array(t)?t.forEach(function(e){c.updateScene(e,n)}):n?t.update(!0):h!==!0&&t instanceof e.Scene&&(h=h||[],-1==h.indexOf(t)&&h.push(t),h=R(h),z()),c},this.update=function(e){return T({type:"resize"}),e&&F(),c},this.scrollTo=function(t){if(r.type.Number(t))S.call(u.container,t);else if(t instanceof e.Scene)t.controller()===c?c.scrollTo(t.scrollOffset()):log(2,"scrollTo(): The supplied scene does not belong to this controller. Scroll cancelled.",t);else if(r.type.Function(t))S=t;else{var n=r.get.elements(t)[0];if(n){var i=u.vertical?"top":"left",o=r.get.offset(u.container),s=r.get.offset(n);p||(o[i]-=c.scrollPos()),c.scrollTo(s[i]-o[i])}else log(2,"scrollTo(): The supplied argument is invalid. Scroll cancelled.",t)}return c},this.scrollPos=function(e){return arguments.length?(r.type.Function(e)&&(E=e),c):E.call(c)},this.info=function(e){var t={size:v,vertical:u.vertical,scrollPos:d,scrollDirection:g,container:u.container,isDocument:p};return arguments.length?void 0!==t[e]?t[e]:void 0:t},this.loglevel=function(e){return arguments.length?(u.loglevel!=e&&(u.loglevel=e),c):u.loglevel},this.enabled=function(e){return arguments.length?(m!=e&&(m=!!e,c.updateScene(f,!0)),c):m},this.destroy=function(e){window.clearTimeout(o);for(var t=f.length;t--;)f[t].destroy(e);return u.container.removeEventListener("resize",T),u.container.removeEventListener("scroll",T),r.cAF(i),null},w(),c};var t={defaults:{container:window,vertical:!0,globalSceneOptions:{},loglevel:2,refreshInterval:100}};e.Controller.addOption=function(e,n){t.defaults[e]=n},e.Controller.extend=function(t){var n=this;e.Controller=function(){return n.apply(this,arguments),this.$super=r.extend({},this),t.apply(this,arguments)||this},r.extend(e.Controller,n),e.Controller.prototype=n.prototype,e.Controller.prototype.constructor=e.Controller},e.Scene=function(t){var i,o,s="data-scrollmagic-pin-spacer",a=n.defaults,l=this,c=r.extend({},a,t),u="BEFORE",f=0,h={start:0,end:0},d=0,g=!0,p=function(){for(var e in c)a.hasOwnProperty(e)||delete c[e];for(var t in a)F(t);S(),l.on("change.internal",function(e){"loglevel"!==e.what&&"tweenChanges"!==e.what&&("triggerElement"===e.what?w():"reverse"===e.what&&l.update())}).on("shift.internal",function(){v(),l.update()})};this.addTo=function(t){return t instanceof e.Controller&&o!=t&&(o&&o.removeScene(l),o=t,S(),m(!0),w(!0),v(),o.info("container").addEventListener("resize",y),t.addScene(l),l.trigger("add",{controller:o}),l.update()),l},this.enabled=function(e){return arguments.length?(g!=e&&(g=!!e,l.update(!0)),l):g},this.remove=function(){if(o){o.info("container").removeEventListener("resize",y);var e=o;o=void 0,e.removeScene(l),l.trigger("remove")}return l},this.destroy=function(e){return l.trigger("destroy",{reset:e}),l.remove(),l.off("*.*"),null},this.update=function(e){if(o)if(e)if(o.enabled()&&g){var t,n=o.info("scrollPos");t=c.duration>0?(n-h.start)/(h.end-h.start):n>=h.start?1:0,l.trigger("update",{startPos:h.start,endPos:h.end,scrollPos:n}),l.progress(t)}else T&&"DURING"===u&&R(!0);else o.updateScene(l,!1);return l},this.refresh=function(){return m(),w(),l},this.progress=function(e){if(arguments.length){var t=!1,n=u,r=o?o.info("scrollDirection"):"PAUSED",i=c.reverse||e>=f;if(0===c.duration?(t=f!=e,f=1>e&&i?0:1,u=0===f?"BEFORE":"DURING"):0>=e&&"BEFORE"!==u&&i?(f=0,u="BEFORE",t=!0):e>0&&1>e&&i?(f=e,u="DURING",t=!0):e>=1&&"AFTER"!==u?(f=1,u="AFTER",t=!0):"DURING"!==u||i||R(),t){var s={progress:f,state:u,scrollDirection:r},a=u!=n,h=function(e){l.trigger(e,s)};a&&"DURING"!==n&&(h("enter"),h("BEFORE"===n?"start":"end")),h("progress"),a&&"DURING"!==u&&(h("BEFORE"===u?"start":"end"),h("leave"))}return l}return f};var v=function(){h={start:d+c.offset},o&&c.triggerElement&&(h.start-=o.info("size")*c.triggerHook),h.end=h.start+c.duration},m=function(e){if(i){var t="duration";b(t,i.call(l))&&!e&&(l.trigger("change",{what:t,newval:c[t]}),l.trigger("shift",{reason:t}))}},w=function(e){var t=0,n=c.triggerElement;if(o&&n){for(var i=o.info(),a=r.get.offset(i.container),u=i.vertical?"top":"left";n.parentNode.hasAttribute(s);)n=n.parentNode;var f=r.get.offset(n);i.isDocument||(a[u]-=o.scrollPos()),t=f[u]-a[u]}var h=t!=d;d=t,h&&!e&&l.trigger("shift",{reason:"triggerElementPosition"})},y=function(){c.triggerHook>0&&l.trigger("shift",{reason:"containerResize"})},E=r.extend(n.validate,{duration:function(e){if(r.type.String(e)&&e.match(/^(\.|\d)*\d+%$/)){var t=parseFloat(e)/100;e=function(){return o?o.info("size")*t:0}}if(r.type.Function(e)){i=e;try{e=parseFloat(i())}catch(n){e=-1}}if(e=parseFloat(e),!r.type.Number(e)||0>e)throw i?(i=void 0,0):0;return e}}),S=function(e){e=arguments.length?[e]:Object.keys(E),e.forEach(function(e){var t;if(E[e])try{t=E[e](c[e])}catch(n){t=a[e]}finally{c[e]=t}})},b=function(e,t){var n=!1,r=c[e];return c[e]!=t&&(c[e]=t,S(e),n=r!=c[e]),n},F=function(e){l[e]||(l[e]=function(t){return arguments.length?("duration"===e&&(i=void 0),b(e,t)&&(l.trigger("change",{what:e,newval:c[e]}),n.shifts.indexOf(e)>-1&&l.trigger("shift",{reason:e})),l):c[e]})};this.controller=function(){return o},this.state=function(){return u},this.scrollOffset=function(){return h.start},this.triggerPosition=function(){var e=c.offset;return o&&(e+=c.triggerElement?d:o.info("size")*l.triggerHook()),e};var z={};this.on=function(e,t){return r.type.Function(t)&&(e=e.trim().split(" "),e.forEach(function(e){var n=e.split("."),r=n[0],i=n[1];"*"!=r&&(z[r]||(z[r]=[]),z[r].push({namespace:i||"",callback:t}))})),l},this.off=function(e,t){return e?(e=e.trim().split(" "),e.forEach(function(e){var n=e.split("."),r=n[0],i=n[1]||"",o="*"===r?Object.keys(z):[r];o.forEach(function(e){for(var n=z[e]||[],r=n.length;r--;){var o=n[r];!o||i!==o.namespace&&"*"!==i||t&&t!=o.callback||n.splice(r,1)}n.length||delete z[e]})}),l):l},this.trigger=function(t,n){if(t){var r=t.trim().split("."),i=r[0],o=r[1],s=z[i];s&&s.forEach(function(t){o&&o!==t.namespace||t.callback.call(l,new e.Event(i,t.namespace,l,n))})}return l};var T,x;l.on("shift.internal",function(e){var t="duration"===e.reason;("AFTER"===u&&t||"DURING"===u&&0===c.duration)&&R(),t&&C()}).on("progress.internal",function(){R()}).on("add.internal",function(){C()}).on("destroy.internal",function(e){l.removePin(e.reset)});var R=function(e){if(T&&o){var t=o.info();if(e||"DURING"!==u){var n={position:x.inFlow?"relative":"absolute",top:0,left:0},i=r.css(T,"position")!=n.position;x.pushFollowers?c.duration>0&&("AFTER"===u&&0===parseFloat(r.css(x.spacer,"padding-top"))?i=!0:"BEFORE"===u&&0===parseFloat(r.css(x.spacer,"padding-bottom"))&&(i=!0)):n[t.vertical?"top":"left"]=c.duration*f,r.css(T,n),i&&C()}else{"fixed"!=r.css(T,"position")&&(r.css(T,{position:"fixed"}),C());var s=r.get.offset(x.spacer,!0),a=c.reverse||0===c.duration?t.scrollPos-h.start:Math.round(f*c.duration*10)/10;s[t.vertical?"top":"left"]+=a,r.css(T,{top:s.top,left:s.left})}}},C=function(){if(T&&o&&x.inFlow){var e="DURING"===u,t=o.info("vertical"),n=x.spacer.children[0],i=r.isMarginCollapseType(r.css(x.spacer,"display")),s={};x.relSize.width||x.relSize.autoFullWidth?e?r.get.width(window)==r.get.width(x.spacer.parentNode)?r.css(T,{width:x.relSize.autoFullWidth?"100%":"inherit"}):r.css(T,{width:r.get.width(x.spacer)}):r.css(T,{width:"100%"}):(s["min-width"]=r.get.width(t?T:n,!0,!0),s.width=e?s["min-width"]:"auto"),x.relSize.height?e?r.get.height(window)==r.get.height(x.spacer.parentNode)?r.css(T,{height:"inherit"}):r.css(T,{height:r.get.height(x.spacer)}):r.css(T,{height:"100%"}):(s["min-height"]=r.get.height(t?n:T,!0,!i),s.height=e?s["min-height"]:"auto"),x.pushFollowers&&(s["padding"+(t?"Top":"Left")]=c.duration*f,s["padding"+(t?"Bottom":"Right")]=c.duration*(1-f)),r.css(x.spacer,s)}},L=function(){o&&T&&"DURING"===u&&!o.info("isDocument")&&R()},N=function(){o&&T&&"DURING"===u&&((x.relSize.width||x.relSize.autoFullWidth)&&r.get.width(window)!=r.get.width(x.spacer.parentNode)||x.relSize.height&&r.get.height(window)!=r.get.height(x.spacer.parentNode))&&C()},D=function(e){o&&T&&"DURING"===u&&!o.info("isDocument")&&(e.preventDefault(),o.scrollTo(o.info("scrollPos")-(e[o.info("vertical")?"wheelDeltaY":"wheelDeltaX"]/3||30*-e.detail)))};this.setPin=function(e,t){var n={pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"};if(t=r.extend({},n,t),e=r.get.elements(e)[0],!e)return l;if("fixed"===r.css(e,"position"))return l;if(T){if(T===e)return l;l.removePin()}T=e;var i=T.parentNode.style.display,o=["top","left","bottom","right","margin","marginLeft","marginRight","marginTop","marginBottom"];T.parentNode.style.display="none";var a="absolute"!=r.css(T,"position"),c=r.css(T,o.concat(["display"])),u=r.css(T,["width","height"]);T.parentNode.style.display=i,!a&&t.pushFollowers&&(t.pushFollowers=!1);var f=T.parentNode.insertBefore(document.createElement("div"),T),h=r.extend(c,{position:a?"relative":"absolute",boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});if(a||r.extend(h,r.css(T,["width","height"])),r.css(f,h),f.setAttribute(s,""),r.addClass(f,t.spacerClass),x={spacer:f,relSize:{width:"%"===u.width.slice(-1),height:"%"===u.height.slice(-1),autoFullWidth:"auto"===u.width&&a&&r.isMarginCollapseType(c.display)},pushFollowers:t.pushFollowers,inFlow:a},!T.___origStyle){T.___origStyle={};var d=T.style,g=o.concat(["width","height","position","boxSizing","mozBoxSizing","webkitBoxSizing"]);g.forEach(function(e){T.___origStyle[e]=d[e]||""})}return x.relSize.width&&r.css(f,{width:u.width}),x.relSize.height&&r.css(f,{height:u.height}),f.appendChild(T),r.css(T,{position:a?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(x.relSize.width||x.relSize.autoFullWidth)&&r.css(T,{boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"}),window.addEventListener("scroll",L),window.addEventListener("resize",L),window.addEventListener("resize",N),T.addEventListener("mousewheel",D),T.addEventListener("DOMMouseScroll",D),R(),l},this.removePin=function(e){if(T){if("DURING"===u&&R(!0),e||!o){var t=x.spacer.children[0];if(t.hasAttribute(s)){var n=x.spacer.style,i=["margin","marginLeft","marginRight","marginTop","marginBottom"];margins={},i.forEach(function(e){margins[e]=n[e]||""}),r.css(t,margins)}x.spacer.parentNode.insertBefore(t,x.spacer),x.spacer.parentNode.removeChild(x.spacer),T.parentNode.hasAttribute(s)||(r.css(T,T.___origStyle),delete T.___origStyle)}window.removeEventListener("scroll",L),window.removeEventListener("resize",L),window.removeEventListener("resize",N),T.removeEventListener("mousewheel",D),T.removeEventListener("DOMMouseScroll",D),T=void 0}return l};var O,A=[];return l.on("destroy.internal",function(e){l.removeClassToggle(e.reset)}),this.setClassToggle=function(e,t){var n=r.get.elements(e);return 0!==n.length&&r.type.String(t)?(A.length>0&&l.removeClassToggle(),O=t,A=n,l.on("enter.internal_class leave.internal_class",function(e){var t="enter"===e.type?r.addClass:r.removeClass;A.forEach(function(e){t(e,O)})}),l):l},this.removeClassToggle=function(e){return e&&A.forEach(function(e){r.removeClass(e,O)}),l.off("start.internal_class end.internal_class"),O=void 0,A=[],l},p(),l};var n={defaults:{duration:0,offset:0,triggerElement:void 0,triggerHook:.5,reverse:!0,loglevel:2},validate:{offset:function(e){if(e=parseFloat(e),!r.type.Number(e))throw 0;return e},triggerElement:function(e){if(e=e||void 0){var t=r.get.elements(e)[0];if(!t)throw 0;e=t}return e},triggerHook:function(e){var t={onCenter:.5,onEnter:1,onLeave:0};if(r.type.Number(e))e=Math.max(0,Math.min(parseFloat(e),1));else{if(!(e in t))throw 0;e=t[e]}return e},reverse:function(e){return!!e}},shifts:["duration","offset","triggerHook"]};e.Scene.addOption=function(e,t,r,i){e in n.defaults||(n.defaults[e]=t,n.validate[e]=r,i&&n.shifts.push(e))},e.Scene.extend=function(t){var n=this;e.Scene=function(){return n.apply(this,arguments),this.$super=r.extend({},this),t.apply(this,arguments)||this},r.extend(e.Scene,n),e.Scene.prototype=n.prototype,e.Scene.prototype.constructor=e.Scene},e.Event=function(e,t,n,r){r=r||{};for(var i in r)this[i]=r[i];return this.type=e,this.target=this.currentTarget=n,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this};var r=e._util=function(e){var t,n={},r=function(e){return parseFloat(e)||0},i=function(t){return t.currentStyle?t.currentStyle:e.getComputedStyle(t)},o=function(t,n,o,s){if(n=n===document?e:n,n===e)s=!1;else if(!f.DomElement(n))return 0;t=t.charAt(0).toUpperCase()+t.substr(1).toLowerCase();var a=(o?n["offset"+t]||n["outer"+t]:n["client"+t]||n["inner"+t])||0;if(o&&s){var l=i(n);a+="Height"===t?r(l.marginTop)+r(l.marginBottom):r(l.marginLeft)+r(l.marginRight)}return a},s=function(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})};n.extend=function(e){for(e=e||{},t=1;t-1};var a=0,l=["ms","moz","webkit","o"],c=e.requestAnimationFrame,u=e.cancelAnimationFrame;for(t=0;!c&&t=0},f.DomElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var h=n.get={};return h.elements=function(t){var n=[];if(f.String(t))try{t=document.querySelectorAll(t)}catch(r){return n}if("nodelist"===f(t)||f.Array(t))for(var i=0,o=n.length=t.length;o>i;i++){var s=t[i];n[i]=f.DomElement(s)?s:h.elements(s)}else(f.DomElement(t)||t===document||t===e)&&(n=[t]);return n},h.scrollTop=function(t){return t&&"number"==typeof t.scrollTop?t.scrollTop:e.pageYOffset||0},h.scrollLeft=function(t){return t&&"number"==typeof t.scrollLeft?t.scrollLeft:e.pageXOffset||0},h.width=function(e,t,n){return o("width",e,t,n)},h.height=function(e,t,n){return o("height",e,t,n)},h.offset=function(e,t){var n={top:0,left:0};if(e&&e.getBoundingClientRect){var r=e.getBoundingClientRect();n.top=r.top,n.left=r.left,t||(n.top+=h.scrollTop(),n.left+=h.scrollLeft())}return n},n.addClass=function(e,t){t&&(e.classList?e.classList.add(t):e.className+=" "+t)},n.removeClass=function(e,t){t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))},n.css=function(e,t){if(f.String(t))return i(e)[s(t)];if(f.Array(t)){var n={},r=i(e);return t.forEach(function(e){n[e]=r[s(e)]}),n}for(var o in t){var a=t[o];a==parseFloat(a)&&(a+="px"),e.style[s(o)]=a}},n}(window||{});return e}); \ No newline at end of file diff --git a/scrollmagic/minified/plugins/animation.gsap.min.js b/scrollmagic/minified/plugins/animation.gsap.min.js index 30a75a2f..d0a686dd 100644 --- a/scrollmagic/minified/plugins/animation.gsap.min.js +++ b/scrollmagic/minified/plugins/animation.gsap.min.js @@ -1,2 +1,2 @@ -/*! ScrollMagic v2.0.0-beta | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ +/*! ScrollMagic v2.0.0 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ !function(e,n){"function"==typeof define&&define.amd?define(["ScrollMagic","TweenMax","TimelineMax"],n):n(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic,e.TweenMax||e.TweenLite,e.TimelineMax||e.TimelineLite)}(this,function(e,n,t){"use strict";e.Scene.addOption("tweenChanges",!1,function(e){return!!e}),e.Scene.extend(function(){var e,r=this;r.on("progress.plugin_gsap",function(){i()}),r.on("destroy.plugin_gsap",function(e){r.removeTween(e.reset)});var i=function(){if(e){var n=r.progress(),t=r.state();e.repeat&&-1===e.repeat()?"DURING"===t&&e.paused()?e.play():"DURING"===t||e.paused()||e.pause():n!=e.progress()&&(0===r.duration()?n>0?e.play():e.reverse():r.tweenChanges()&&e.tweenTo?e.tweenTo(n*e.duration()):e.progress(n).pause())}};r.setTween=function(o,a,s){var u;arguments.length>1&&(arguments.length<3&&(s=a,a=1),o=n.to(o,a,s));try{u=t?new t({smoothChildTiming:!0}).add(o):o,u.pause()}catch(p){return r}return e&&r.removeTween(),e=u,o.repeat&&-1===o.repeat()&&(e.repeat(-1),e.yoyo(o.yoyo())),i(),r},r.removeTween=function(n){return e&&(n&&e.progress(0).pause(),e.kill(),e=void 0),r}})}); \ No newline at end of file diff --git a/scrollmagic/minified/plugins/animation.velocity.min.js b/scrollmagic/minified/plugins/animation.velocity.min.js index 0ee7e0a2..cd3f2c15 100644 --- a/scrollmagic/minified/plugins/animation.velocity.min.js +++ b/scrollmagic/minified/plugins/animation.velocity.min.js @@ -1,2 +1,2 @@ -/*! ScrollMagic v2.0.0-beta | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ +/*! ScrollMagic v2.0.0 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ !function(e,i){"function"==typeof define&&define.amd?define(["ScrollMagic","velocity"],i):i(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic,e.Velocity||e.jQuery&&e.jQuery.Velocity)}(this,function(e,i){"use strict";var t="animation.velocity",o=0;e.Scene.extend(function(){var u,r,n,c,l=this,s=e._util,a=0;l.on("progress.plugin_velocity",function(){y()}),l.on("destroy.plugin_velocity",function(e){l.off("*.plugin_velocity"),l.removeVelocity(e.reset)});var f=function(e,t,o){s.type.Array(e)?e.forEach(function(e){f(e,t,o)}):(i.Utilities.data(e,c)||i.Utilities.data(e,c,{reverseProps:s.css(e,Object.keys(r))}),i(e,t,o),void 0!==o.queue&&i.Utilities.dequeue(e,o.queue))},v=function(e,t){if(s.type.Array(e))e.forEach(function(e){v(e,t)});else{var o=i.Utilities.data(e,c);o&&o.reverseProps&&(i(e,o.reverseProps,t),void 0!==t.queue&&i.Utilities.dequeue(e,t.queue))}},y=function(){if(u){var e=l.progress();e!=a&&(0===l.duration()&&(e>0?f(u,r,n):v(u,n)),a=e)}};l.setVelocity=function(e,i,a){return u&&l.removeVelocity(),u=s.get.elements(e),r=i||{},n=a||{},c="ScrollMagic."+t+"["+o++ +"]",void 0!==n.queue&&(n.queue=c+"_queue"),y(),l},l.removeVelocity=function(e){return u&&(void 0!==n.queue&&i(u,"stop",n.queue),e&&v(u,{duration:0}),u.forEach(function(e){i.Utilities.removeData(e,c)}),u=r=n=c=void 0),l}})}); \ No newline at end of file diff --git a/scrollmagic/minified/plugins/debug.addIndicators.min.js b/scrollmagic/minified/plugins/debug.addIndicators.min.js index 267e1fd9..fe53c2ec 100644 --- a/scrollmagic/minified/plugins/debug.addIndicators.min.js +++ b/scrollmagic/minified/plugins/debug.addIndicators.min.js @@ -1,2 +1,2 @@ -/*! ScrollMagic v2.0.0-beta | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ +/*! ScrollMagic v2.0.0 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://janpaepke.github.io/ScrollMagic */ !function(e,r){"function"==typeof define&&define.amd?define(["ScrollMagic"],r):r(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic)}(this,function(e){"use strict";var r="0.85em",t="9999",i=15,o=e._util,n=0;e.Scene.extend(function(){var e,r=this;r.addIndicators=function(t){if(!e){var i={name:"",indent:0,parent:void 0,colorStart:"green",colorEnd:"red",colorTrigger:"blue"};t=o.extend({},i,t),n++,e=new s(r,t),r.on("add.plugin_addIndicators",e.add),r.on("remove.plugin_addIndicators",e.remove),r.on("destroy.plugin_addIndicators",r.removeIndicators),r.controller()&&e.add()}return r},r.removeIndicators=function(){return e&&(e.remove(),this.off("*.plugin_addIndicators"),e=void 0),r}}),e.Controller.addOption("addIndicators",!1),e.Controller.extend(function(){var r=this,t=r.info(),n=t.container,s=t.isDocument,d=t.vertical,a={groups:[]};this._indicators=a;var g=function(){a.updateBoundsPositions()},p=function(){a.updateTriggerGroupPositions()};return n.addEventListener("resize",p),s||(window.addEventListener("resize",p),window.addEventListener("scroll",p)),n.addEventListener("resize",g),n.addEventListener("scroll",g),this._indicators.updateBoundsPositions=function(e){for(var r,t,s,g=e?[o.extend({},e.triggerGroup,{members:[e]})]:a.groups,p=g.length,u={},c=d?"left":"top",l=d?"width":"height",f=d?o.get.scrollLeft(n)+o.get.width(n)-i:o.get.scrollTop(n)+o.get.height(n)-i;p--;)for(s=g[p],r=s.members.length,t=o.get[l](s.element.firstChild);r--;)u[c]=f-t,o.css(s.members[r].bounds,u)},this._indicators.updateTriggerGroupPositions=function(e){for(var t,g,p,u,c,l=e?[e]:a.groups,f=l.length,m=s?document.body:n,h=s?{top:0,left:0}:o.get.offset(m,!0),v=d?o.get.width(n)-i:o.get.height(n)-i,b=d?"width":"height",G=d?"Y":"X";f--;)t=l[f],g=t.element,p=t.triggerHook*r.info("size"),u=o.get[b](g.firstChild.firstChild),c=p>u?"translate"+G+"(-100%)":"",o.css(g,{top:h.top+(d?p:v-t.members[0].options.indent),left:h.left+(d?v-t.members[0].options.indent:p)}),o.css(g.firstChild.firstChild,{"-ms-transform":c,"-webkit-transform":c,transform:c})},this._indicators.updateTriggerGroupLabel=function(e){var r="trigger"+(e.members.length>1?"":" "+e.members[0].options.name),t=e.element.firstChild.firstChild,i=t.textContent!==r;i&&(t.textContent=r,d&&a.updateBoundsPositions())},this.addScene=function(t){this._options.addIndicators&&t instanceof e.Scene&&t.controller()===r&&t.addIndicators(),this.$super.addScene.apply(this,arguments)},this.destroy=function(){n.removeEventListener("resize",p),s||(window.removeEventListener("resize",p),window.removeEventListener("scroll",p)),n.removeEventListener("resize",g),n.removeEventListener("scroll",g),this.$super.destroy.apply(this,arguments)},r});var s=function(e,r){var t,i,s=this,a=d.bounds(),g=d.start(r.colorStart),p=d.end(r.colorEnd),u=r.parent&&o.get.elements(r.parent)[0];r.name=r.name||n,g.firstChild.textContent+=" "+r.name,p.textContent+=" "+r.name,a.appendChild(g),a.appendChild(p),s.options=r,s.bounds=a,s.triggerGroup=void 0,this.add=function(){i=e.controller(),t=i.info("vertical");var r=i.info("isDocument");u||(u=r?document.body:i.info("container")),r||"static"!==o.css(u,"position")||o.css(u,{position:"relative"}),e.on("change.plugin_addIndicators",l),e.on("shift.plugin_addIndicators",c),G(),h(),setTimeout(function(){i._indicators.updateBoundsPositions(s)},0)},this.remove=function(){if(s.triggerGroup){if(e.off("change.plugin_addIndicators",l),e.off("shift.plugin_addIndicators",c),s.triggerGroup.members.length>1){var r=s.triggerGroup;r.members.splice(r.members.indexOf(s),1),i._indicators.updateTriggerGroupLabel(r),i._indicators.updateTriggerGroupPositions(r),s.triggerGroup=void 0}else b();m()}};var c=function(){h()},l=function(e){"triggerHook"===e.what&&G()},f=function(){var e=i.info("vertical");o.css(g.firstChild,{"border-bottom-width":e?1:0,"border-right-width":e?0:1,bottom:e?-1:r.indent,right:e?r.indent:-1,padding:e?"0 8px":"2px 4px"}),o.css(p,{"border-top-width":e?1:0,"border-left-width":e?0:1,top:e?"100%":"",right:e?r.indent:"",bottom:e?"":r.indent,left:e?"":"100%",padding:e?"0 8px":"2px 4px"}),u.appendChild(a)},m=function(){a.parentNode.removeChild(a)},h=function(){a.parentNode!==u&&f();var r={};r[t?"top":"left"]=e.triggerPosition(),r[t?"height":"width"]=e.duration(),o.css(a,r),o.css(p,{display:e.duration()>0?"":"none"})},v=function(){var n=d.trigger(r.colorTrigger),a={};a[t?"right":"bottom"]=0,a[t?"border-top-width":"border-left-width"]=1,o.css(n.firstChild,a),o.css(n.firstChild.firstChild,{padding:t?"0 8px 3px 8px":"3px 4px"}),document.body.appendChild(n);var g={triggerHook:e.triggerHook(),element:n,members:[s]};i._indicators.groups.push(g),s.triggerGroup=g,i._indicators.updateTriggerGroupLabel(g),i._indicators.updateTriggerGroupPositions(g)},b=function(){i._indicators.groups.splice(i._indicators.groups.indexOf(s.triggerGroup),1),s.triggerGroup.element.parentNode.removeChild(s.triggerGroup.element),s.triggerGroup=void 0},G=function(){var r=e.triggerHook(),t=1e-4;if(!(s.triggerGroup&&Math.abs(s.triggerGroup.triggerHook-r) As of ScrollMagic 2.0.0 you need to use \'new ScrollMagic.Controller()\' to create a new controller instance. Use \'new ScrollMagic.Scene()\' to instance a scene.'); }; - ScrollMagic.version = "2.0.0-beta"; + ScrollMagic.version = "2.0.0"; /** * The main class that is needed once per scroll container. @@ -57,11 +57,11 @@ * */ ScrollMagic.Controller = function (options) { - /* - * ---------------------------------------------------------------- - * settings - * ---------------------------------------------------------------- - */ +/* + * ---------------------------------------------------------------- + * settings + * ---------------------------------------------------------------- + */ var NAMESPACE = "ScrollMagic.Controller", SCROLL_DIRECTIONS = { @@ -71,11 +71,11 @@ }, DEFAULT_OPTIONS = CONTROLLER_OPTIONS.defaults; - /* - * ---------------------------------------------------------------- - * private vars - * ---------------------------------------------------------------- - */ +/* + * ---------------------------------------------------------------- + * private vars + * ---------------------------------------------------------------- + */ var Controller = this, _options = _util.extend({}, DEFAULT_OPTIONS, options), @@ -89,11 +89,11 @@ _enabled = true, _updateCycle, _refreshTimeout; - /* - * ---------------------------------------------------------------- - * private functions - * ---------------------------------------------------------------- - */ +/* + * ---------------------------------------------------------------- + * private functions + * ---------------------------------------------------------------- + */ /** * Internal constructor function of the ScrollMagic Controller @@ -671,9 +671,9 @@ refreshInterval: 100 } }; - /* - * method used to add an option to ScrollMagic Scenes. - */ +/* + * method used to add an option to ScrollMagic Scenes. + */ ScrollMagic.Controller.addOption = function (name, defaultValue) { CONTROLLER_OPTIONS.defaults[name] = defaultValue; }; @@ -731,22 +731,22 @@ */ ScrollMagic.Scene = function (options) { - /* - * ---------------------------------------------------------------- - * settings - * ---------------------------------------------------------------- - */ +/* + * ---------------------------------------------------------------- + * settings + * ---------------------------------------------------------------- + */ var NAMESPACE = "ScrollMagic.Scene", PIN_SPACER_ATTRIBUTE = "data-scrollmagic-pin-spacer", DEFAULT_OPTIONS = SCENE_OPTIONS.defaults; - /* - * ---------------------------------------------------------------- - * private vars - * ---------------------------------------------------------------- - */ +/* + * ---------------------------------------------------------------- + * private vars + * ---------------------------------------------------------------- + */ var Scene = this, @@ -1508,11 +1508,11 @@ return pos; }; - /* - * ---------------------------------------------------------------- - * Event Management - * ---------------------------------------------------------------- - */ +/* + * ---------------------------------------------------------------- + * Event Management + * ---------------------------------------------------------------- + */ var _listeners = {}; /** @@ -2391,10 +2391,10 @@ shifts: ["duration", "offset", "triggerHook"], // list of options that trigger a `shift` event }; - /* - * method used to add an option to ScrollMagic Scenes. - * TODO: DOC (private for dev) - */ +/* + * method used to add an option to ScrollMagic Scenes. + * TODO: DOC (private for dev) + */ ScrollMagic.Scene.addOption = function (name, defaultValue, validationCallback, shifts) { if (!(name in SCENE_OPTIONS.defaults)) { SCENE_OPTIONS.defaults[name] = defaultValue; @@ -2438,9 +2438,9 @@ return this; }; - /* - * TODO: DOCS (private for dev) - */ +/* + * TODO: DOCS (private for dev) + */ var _util = ScrollMagic._util = (function (window) { var U = {}, diff --git a/scrollmagic/uncompressed/plugins/animation.gsap.js b/scrollmagic/uncompressed/plugins/animation.gsap.js index 03abcfbc..cd37c1bd 100644 --- a/scrollmagic/uncompressed/plugins/animation.gsap.js +++ b/scrollmagic/uncompressed/plugins/animation.gsap.js @@ -1,10 +1,10 @@ /*! - * ScrollMagic v2.0.0-beta (2015-01-30) + * ScrollMagic v2.0.0 (2015-02-26) * The javascript library for magical scroll interactions. * (c) 2015 Jan Paepke (@janpaepke) * Project Website: http://janpaepke.github.io/ScrollMagic * - * @version 2.0.0-beta + * @version 2.0.0 * @license Dual licensed under MIT license and GPL. * @author Jan Paepke - e-mail@janpaepke.de * @@ -46,7 +46,7 @@ err("(" + NAMESPACE + ") -> ERROR: TweenLite or TweenMax could not be found. Please make sure GSAP is loaded before ScrollMagic or use an asynchronous loader like requirejs."); } - /* +/* * ---------------------------------------------------------------- * Extensions for Scene * ---------------------------------------------------------------- diff --git a/scrollmagic/uncompressed/plugins/animation.velocity.js b/scrollmagic/uncompressed/plugins/animation.velocity.js index b677c2b8..f58f01bb 100644 --- a/scrollmagic/uncompressed/plugins/animation.velocity.js +++ b/scrollmagic/uncompressed/plugins/animation.velocity.js @@ -1,10 +1,10 @@ /*! - * ScrollMagic v2.0.0-beta (2015-01-30) + * ScrollMagic v2.0.0 (2015-02-26) * The javascript library for magical scroll interactions. * (c) 2015 Jan Paepke (@janpaepke) * Project Website: http://janpaepke.github.io/ScrollMagic * - * @version 2.0.0-beta + * @version 2.0.0 * @license Dual licensed under MIT license and GPL. * @author Jan Paepke - e-mail@janpaepke.de * diff --git a/scrollmagic/uncompressed/plugins/debug.addIndicators.js b/scrollmagic/uncompressed/plugins/debug.addIndicators.js index 08f1558f..d580320c 100644 --- a/scrollmagic/uncompressed/plugins/debug.addIndicators.js +++ b/scrollmagic/uncompressed/plugins/debug.addIndicators.js @@ -1,10 +1,10 @@ /*! - * ScrollMagic v2.0.0-beta (2015-01-30) + * ScrollMagic v2.0.0 (2015-02-26) * The javascript library for magical scroll interactions. * (c) 2015 Jan Paepke (@janpaepke) * Project Website: http://janpaepke.github.io/ScrollMagic * - * @version 2.0.0-beta + * @version 2.0.0 * @license Dual licensed under MIT license and GPL. * @author Jan Paepke - e-mail@janpaepke.de * @@ -131,7 +131,7 @@ }); - /* +/* * ---------------------------------------------------------------- * Extension for controller to store and update related indicators * ---------------------------------------------------------------- @@ -177,14 +177,14 @@ // add indicators container this._indicators = _indicators; - /* - needed updates: - +++++++++++++++ - start/end position on scene shift (handled in Indicator class) - trigger parameters on triggerHook value change (handled in Indicator class) - bounds position on container scroll or resize (to keep alignment to bottom/right) - trigger position on container resize, window resize (if container isn't document) and window scroll (if container isn't document) - */ +/* + needed updates: + +++++++++++++++ + start/end position on scene shift (handled in Indicator class) + trigger parameters on triggerHook value change (handled in Indicator class) + bounds position on container scroll or resize (to keep alignment to bottom/right) + trigger position on container resize, window resize (if container isn't document) and window scroll (if container isn't document) + */ // event handler for when associated bounds markers need to be repositioned var handleBoundsPositionChange = function () { @@ -305,7 +305,7 @@ }); - /* +/* * ---------------------------------------------------------------- * Internal class for the construction of Indicators * ---------------------------------------------------------------- @@ -396,7 +396,7 @@ } }; - /* +/* * ---------------------------------------------------------------- * internal Event Handlers * ---------------------------------------------------------------- @@ -414,7 +414,7 @@ } }; - /* +/* * ---------------------------------------------------------------- * Bounds (start / stop) management * ---------------------------------------------------------------- @@ -463,7 +463,7 @@ }); }; - /* +/* * ---------------------------------------------------------------- * trigger and trigger group management * ---------------------------------------------------------------- @@ -499,7 +499,7 @@ }; // updates the trigger group -> either join existing or add new one - /* +/* * Logic: * 1 if a trigger group exist, check if it's in sync with Scene settings – if so, nothing else needs to happen * 2 try to find an existing one that matches Scene parameters @@ -577,7 +577,7 @@ }; }; - /* +/* * ---------------------------------------------------------------- * Templates for the indicators * ---------------------------------------------------------------- diff --git a/scrollmagic/uncompressed/plugins/jquery.ScrollMagic.js b/scrollmagic/uncompressed/plugins/jquery.ScrollMagic.js index 8a8b239d..3c79c2e5 100644 --- a/scrollmagic/uncompressed/plugins/jquery.ScrollMagic.js +++ b/scrollmagic/uncompressed/plugins/jquery.ScrollMagic.js @@ -1,10 +1,10 @@ /*! - * ScrollMagic v2.0.0-beta (2015-01-30) + * ScrollMagic v2.0.0 (2015-02-26) * The javascript library for magical scroll interactions. * (c) 2015 Jan Paepke (@janpaepke) * Project Website: http://janpaepke.github.io/ScrollMagic * - * @version 2.0.0-beta + * @version 2.0.0 * @license Dual licensed under MIT license and GPL. * @author Jan Paepke - e-mail@janpaepke.de *