/*! * ScrollMagic v2.0.7 (2019-05-07) * The javascript library for magical scroll interactions. * (c) 2019 Jan Paepke (@janpaepke) * Project Website: http://scrollmagic.io * * @version 2.0.7 * @license Dual licensed under MIT license and GPL. * @author Jan Paepke - e-mail@janpaepke.de * * @file ScrollMagic main library. */(function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ScrollMagic=t()})(this,function(){"use strict";var e=function(){n.log(2,"(COMPATIBILITY NOTICE) -> 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.")};e.version="2.0.7",window.addEventListener("mousewheel",function(){});e.Controller=function(o){var r,l,i=t.defaults,a=this,s=n.extend({},i,o),c=[],d=!1,g=0,p="PAUSED",u=!0,m=0,h=!0,f=function(){0=e&&(Array.prototype.splice.call(arguments,1,0,"(ScrollMagic.Controller) ->"),n.log.apply(window,arguments))};this._options=s;var T=function(e){if(1>=e.length)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(n.type.Array(t))t.forEach(function(e,t){a.addScene(e)});else if(!(t instanceof e.Scene))N(1,"ERROR: invalid argument supplied for '.addScene()'");else if(t.controller()!==a)t.addTo(a);else if(0>c.indexOf(t)){for(var o in c.push(t),c=T(c),t.on("shift.controller_sort",function(){c=T(c)}),s.globalSceneOptions)t[o]&&t[o].call(t,s.globalSceneOptions[o]);N(3,"adding Scene (now "+c.length+" total)")}return a},this.removeScene=function(e){if(n.type.Array(e))e.forEach(function(e,t){a.removeScene(e)});else{var t=c.indexOf(e);-1":"",o||""),i&&i.forEach(function(t,n){l&&l!==t.namespace||t.callback.call(g,new e.Event(r,t.namespace,g,o))})}else E(1,"ERROR: Invalid event name supplied.");return g},g.on("change.internal",function(t){"loglevel"!==t.what&&"tweenChanges"!==t.what&&("triggerElement"===t.what?b():"reverse"===t.what&&g.update())}).on("shift.internal",function(t){R(),g.update()});var E=this._log=function(e,t){p.loglevel>=e&&(Array.prototype.splice.call(arguments,1,0,"(ScrollMagic.Scene) ->"),n.log.apply(window,arguments))};this.addTo=function(t){return t instanceof e.Controller?l!=t&&(l&&l.removeScene(g),l=t,O(),w(!0),b(!0),R(),l.info("container").addEventListener("resize",N),t.addScene(g),g.trigger("add",{controller:l}),E(3,"added ScrollMagic.Scene to controller"),g.update()):E(1,"ERROR: supplied argument of 'addTo()' is not a valid ScrollMagic Controller"),g},this.enabled=function(e){return arguments.length?(v!=e&&(v=!!e,g.update(!0)),g):v},this.remove=function(){if(l){l.info("container").removeEventListener("resize",N);var e=l;l=void 0,e.removeScene(g),g.trigger("remove"),E(3,"removed ScrollMagic.Scene from controller")}return g},this.destroy=function(e){return g.trigger("destroy",{reset:e}),g.remove(),g.off("*.*"),E(3,"destroyed ScrollMagic.Scene (reset: "+(e?"true":"false")+")"),null},this.update=function(e){if(l)if(!e)l.updateScene(g,!1);else if(l.enabled()&&v){var t,o=l.info("scrollPos");t=0=h.start?1:0,g.trigger("update",{startPos:h.start,endPos:h.end,scrollPos:o}),g.progress(t)}else I&&"DURING"===u&&P(!0);return g},this.refresh=function(){return w(),b(),g},this.progress=function(e){if(!arguments.length)return m;var t=!1,o=u,n=l?l.info("scrollDirection"):"PAUSED",r=p.reverse||e>=m;if(0===p.duration?(t=m!=e,m=1>e&&r?0:1,u=0===m?"BEFORE":"DURING"):0>e&&"BEFORE"!==u&&r?(m=0,u="BEFORE",t=!0):0<=e&&1>e&&r?(m=e,u="DURING",t=!0):1<=e&&"AFTER"!==u?(m=1,u="AFTER",t=!0):"DURING"===u&&!r&&P(),t){var i={progress:m,state:u,scrollDirection:n},a=u!=o,s=function(e){g.trigger(e,i)};a&&"DURING"!==o&&(s("enter"),s("BEFORE"===o?"start":"end")),s("progress"),a&&"DURING"!==u&&(s("BEFORE"===u?"start":"end"),s("leave"))}return g};var R=function(){h={start:f+p.offset},l&&p.triggerElement&&(h.start-=l.info("size")*p.triggerHook),h.end=h.start+p.duration},w=function(e){if(r){var t="duration";C("duration",r.call(g))&&!e&&(g.trigger("change",{what:"duration",newval:p.duration}),g.trigger("shift",{reason:"duration"}))}},b=function(e){var t=0,o=p.triggerElement;if(l&&(o||0t)if(r)throw r=void 0,["Invalid return value of supplied function for option \"duration\":",t];else throw["Invalid value for option \"duration\":",t];return t}}),O=function(e){e=arguments.length?[e]:Object.keys(T),e.forEach(function(t,o){var r;if(T[t])try{r=T[t](p[t])}catch(o){r=d[t];var l=n.type.String(o)?[o]:o;n.type.Array(l)?(l[0]="ERROR: "+l[0],l.unshift(1),E.apply(this,l)):E(1,"ERROR: Problem executing validation callback for option '"+t+"':",o.message)}finally{p[t]=r}})},C=function(e,t){var o=!1,n=p[e];return p[e]!=t&&(p[e]=t,O(e),o=n!=p[e]),o},F=function(e){g[e]||(g[e]=function(t){return arguments.length?("duration"===e&&(r=void 0),C(e,t)&&(g.trigger("change",{what:e,newval:p[e]}),-1e||3 Cannot add Scene option '"+t+"', because it already exists."):(o.defaults[t]=n,o.validate[t]=r,l&&o.shifts.push(t))},e.Scene.extend=function(t){var o=this;e.Scene=function(){return o.apply(this,arguments),this.$super=n.extend({},this),t.apply(this,arguments)||this},n.extend(e.Scene,o),e.Scene.prototype=o.prototype,e.Scene.prototype.constructor=e.Scene},e.Event=function(e,t,o,n){for(var r in n=n||{},n)this[r]=n[r];return this.type=e,this.target=this.currentTarget=o,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this};var n=e._util=function(e){var t,o={},n=function(e){return parseFloat(e)||0},r=function(t){return t.currentStyle?t.currentStyle:e.getComputedStyle(t)},l=function(t,o,l,i){if(o=o===document?e:o,o===e)i=!1;else if(!h.DomElement(o))return 0;t=t.charAt(0).toUpperCase()+t.substr(1).toLowerCase();var a=(l?o["offset"+t]||o["outer"+t]:o["client"+t]||o["inner"+t])||0;if(l&&i){var s=r(o);a+="Height"===t?n(s.marginTop)+n(s.marginBottom):n(s.marginLeft)+n(s.marginRight)}return a},a=function(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})};o.extend=function(e){for(e=e||{},t=1;tp.length||0>=e)&&(e=p.length);var t=new Date,o=("0"+t.getHours()).slice(-2)+":"+("0"+t.getMinutes()).slice(-2)+":"+("0"+t.getSeconds()).slice(-2)+":"+("00"+t.getMilliseconds()).slice(-3),n=p[e-1],r=Array.prototype.splice.call(arguments,1),l=Function.prototype.bind.call(u[n],u);r.unshift(o),l.apply(u,r)};var h=o.type=function(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};h.String=function(e){return"string"===h(e)},h.Function=function(e){return"function"===h(e)},h.Array=function(e){return Array.isArray(e)},h.Number=function(e){return!h.Array(e)&&0<=e-parseFloat(e)+1},h.DomElement=function(e){return"object"==typeof HTMLElement||"function"==typeof HTMLElement?e instanceof HTMLElement||e instanceof SVGElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var f=o.get={};return f.elements=function(t){var o=[];if(h.String(t))try{t=document.querySelectorAll(t)}catch(t){return o}if("nodelist"===h(t)||h.Array(t)||t instanceof NodeList)for(var n,r=0,l=o.length=t.length;r ERROR calling addIndicators() due to missing Plugin 'debug.addIndicators'. Please make sure to include plugins/debug.addIndicators.js"),this},e.Scene.prototype.removeIndicators=function(){return e._util.log(1,"(ScrollMagic.Scene) -> ERROR calling removeIndicators() due to missing Plugin 'debug.addIndicators'. Please make sure to include plugins/debug.addIndicators.js"),this},e.Scene.prototype.setTween=function(){return e._util.log(1,"(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin 'animation.gsap'. Please make sure to include plugins/animation.gsap.js"),this},e.Scene.prototype.removeTween=function(){return e._util.log(1,"(ScrollMagic.Scene) -> ERROR calling removeTween() due to missing Plugin 'animation.gsap'. Please make sure to include plugins/animation.gsap.js"),this},e.Scene.prototype.setVelocity=function(){return e._util.log(1,"(ScrollMagic.Scene) -> ERROR calling setVelocity() due to missing Plugin 'animation.velocity'. Please make sure to include plugins/animation.velocity.js"),this},e.Scene.prototype.removeVelocity=function(){return e._util.log(1,"(ScrollMagic.Scene) -> ERROR calling removeVelocity() due to missing Plugin 'animation.velocity'. Please make sure to include plugins/animation.velocity.js"),this},e});