{"version":3,"file":"ScrollAnimation.js","names":["ScrollAnimation","$el","config","document","querySelector","init","animate","initEventHandlers","style","opacity","Math","min","max","window","scrollY","toFixed","addEventListener","bind","el","opts"],"sources":["components/ScrollAnimation.js"],"sourcesContent":["import _ from 'lodash';\r\n\r\nexport class ScrollAnimation {\r\n\r\n constructor($el, config = {}) {\r\n this.$el = document.querySelector($el);\r\n this.init();\r\n }\r\n\r\n /*\r\n Initialize this mother lover\r\n */\r\n init() {\r\n if(this.$el) {\r\n this.animate(); //Set the opacity depending on our loaded scroll position\r\n this.initEventHandlers();\r\n }\r\n }\r\n\r\n /*\r\n Animate the element\r\n */\r\n animate() {\r\n this.$el.style.opacity = Math.min(Math.max(0, window.scrollY * 0.003), 1).toFixed(2);\r\n }\r\n\r\n /*\r\n Add required event listeners\r\n */\r\n initEventHandlers() {\r\n window.addEventListener('scroll', this.animate.bind(this));\r\n window.addEventListener('resize', this.animate.bind(this));\r\n }\r\n}\r\n\r\nexport let animate = (el, opts) => new ScrollAnimation(el, opts);"],"mappings":";;;;;;AAAA;AAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAEVA,eAAe;EAExB,yBAAYC,GAAG,EAAe;IAAA,IAAbC,MAAM,uEAAG,CAAC,CAAC;IAAA;IACxB,IAAI,CAACD,GAAG,GAAGE,QAAQ,CAACC,aAAa,CAACH,GAAG,CAAC;IACtC,IAAI,CAACI,IAAI,EAAE;EACf;;EAEA;AACJ;AACA;EAFI;IAAA;IAAA,OAGA,gBAAO;MACH,IAAG,IAAI,CAACJ,GAAG,EAAE;QACT,IAAI,CAACK,OAAO,EAAE,CAAC,CAAC;QAChB,IAAI,CAACC,iBAAiB,EAAE;MAC5B;IACJ;;IAEA;AACJ;AACA;EAFI;IAAA;IAAA,OAGA,mBAAU;MACN,IAAI,CAACN,GAAG,CAACO,KAAK,CAACC,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEC,MAAM,CAACC,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,CAAC;IACxF;;IAEA;AACJ;AACA;EAFI;IAAA;IAAA,OAGA,6BAAoB;MAChBF,MAAM,CAACG,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAACV,OAAO,CAACW,IAAI,CAAC,IAAI,CAAC,CAAC;MAC1DJ,MAAM,CAACG,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAACV,OAAO,CAACW,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D;EAAC;EAAA;AAAA;AAAA;AAGE,IAAIX,OAAO,GAAG,SAAVA,OAAO,CAAIY,EAAE,EAAEC,IAAI;EAAA,OAAK,IAAInB,eAAe,CAACkB,EAAE,EAAEC,IAAI,CAAC;AAAA;AAAC"}