1/*! @yama-dev/js-scroll-effect-module Version 0.13.0 Repository https://github.com/yama-dev/js-scroll-effect-module Copyright yama-dev Licensed MIT */ 2!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SCROLL_EFFECT_MODULE=e():t.SCROLL_EFFECT_MODULE=e()}(self,(function(){return function(){"use strict";var t={d:function(e,i){for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};function i(t){try{return t instanceof HTMLElement}catch(t){return!1}}function n(t,e){if(e){var o,a=n(t),r=[];return!!a&&(a.map((function(t){if(!(o=i(e)?Array.prototype.slice.call(t.querySelectorAll(e.tagName.toLowerCase())):Array.prototype.slice.call(t.querySelectorAll(e))))return!1;r=r.concat(o)})),r)}if(!t)return!1;var s;if(!Array.isArray(t)&&!t.length||function(t){try{return"string"==typeof t}catch(t){return!1}}(t))s=i(t)?Array(t):Array.prototype.slice.call(document.querySelectorAll(t));else{if(!i(t[0]))return!1;s=Array.prototype.slice.call(t)}return 0===s.length&&(s=null),s}function o(t,e){return i(t)?t.classList.contains(e):document.querySelector(t).classList.contains(e)}function a(t,e){var i=n(t);if(!i)return!1;i.map((function(t){t.classList.remove(e)}))}function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function s(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){c(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.d(e,{default:function(){return u}});var u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l(this,t),this.state={NumScrolltopPre:window.pageYOffset,NumScrolltop:window.pageYOffset,PosList:[],PosListFixPre:[]};var i={target:null,classNameInview:"is-active",displayRatio:.8,displayReverse:!1,displayRatioReverse:null,firstDelay:100,throttleInterval:3,autoStart:!0,on:{Scroll:null,Change:null,In:null,Out:null}};this.config=s(s({},i),e),this.config.displayRatioReverse?this.config.displayRatioReverse<this.config.displayRatio&&(this.config.displayRatioReverse=this.config.displayRatio):this.config.displayRatioReverse=this.config.displayRatio,this.config.autoStart&&this.Init()}var e,i,r;return e=t,(i=[{key:"Init",value:function(){var t=this;"complete"==document.readyState||"interactive"==document.readyState?(this.Update(),this._BindEvent()):document.addEventListener("DOMContentLoaded",(function(){t.Update(),t._BindEvent()}))}},{key:"Start",value:function(){this.Stop(),this.Update(),this._StoreElementStateAtPosList()}},{key:"Update",value:function(){this._SetDom()}},{key:"Stop",value:function(){var t=this;this.state.PosList.map((function(e){a(e.el,t.config.classNameInview)})),this.state.PosList=[]}},{key:"_BindEvent",value:function(){var t,e,i,n=this,o=this;window.addEventListener("resize",(function(){n.Update()})),window.addEventListener("load",(function(){n.Update(),n.timer&&(clearTimeout(n.timer),n.timer=setTimeout((function(){n._StoreElementStateAtPosList()}),n.config.firstDelay))})),this.timer=setTimeout((function(){n._StoreElementStateAtPosList()}),this.config.firstDelay),window.addEventListener("scroll",(t=function(){o._StoreElementStateAtPosList()},e=this.config.throttleInterval,i=Date.now(),function(){i+e-Date.now()<0&&(t(),i=Date.now())}),{passive:!0})}},{key:"_SetDom",value:function(){var t=this;this.state.PosList=[],this.state.NumScrolltop=window.pageYOffset,this.NumWindowHeight=window.innerHeight;var e=n(this.config.target);e&&e.map((function(e,i){var n=0;e.dataset&&void 0!==e.dataset.semOffset&&(n=Number(e.dataset.semOffset));var o={el:e,index:i,pos:e.getBoundingClientRect().top+t.state.NumScrolltop-n,height:e.clientHeight,height2:e.offsetHeight,count:0,active:!1,changing:!1,dataset:e.dataset};t.state.PosList.push(o)}))}},{key:"_StoreElementStateAtPosList",value:function(){var t=this;if(!this.state.PosList.length)return!1;this.state.NumScrolltop=window.pageYOffset,this.state.PosList.map((function(e){t.config.displayRatio===t.config.displayRatioReverse&&(t.state.NumScrolltop+t.NumWindowHeight*t.config.displayRatio>e.pos?e.active||(e.changing=!0,e.active=!0):e.active&&(e.changing=!0,e.active=!1)),t.config.displayRatio!==t.config.displayRatioReverse&&(t.state.NumScrolltop+t.NumWindowHeight*t.config.displayRatio>e.pos||t.state.NumScrolltop+t.NumWindowHeight*t.config.displayRatioReverse>e.pos&&e.active?e.active||(e.changing=!0,e.active=!0):e.active&&(e.changing=!0,e.active=!1))})),this.state.PosList.filter((function(t){return!0===t.changing})).length&&this._ActionChange(),this.config.on.Scroll&&"function"==typeof this.config.on.Scroll&&this.config.on.Scroll(this.state.NumScrolltop),this.state.NumScrolltopPre=this.state.NumScrolltop,this.state.PosListFixPre=this.state.PosListFix}},{key:"_ActionChange",value:function(){var t=this;if(!this.state.PosList.length)return!1;this.state.PosList.map((function(e){e.active?o(e.el,t.config.classNameInview)||(e.count++,t.config.classNameInview&&function(t,e){var i=n(t);if(!i)return!1;i.map((function(t){t.classList.add(e)}))}(e.el,t.config.classNameInview),t.config.on.In&&"function"==typeof t.config.on.In&&t.config.on.In(e)):t.config.displayReverse&&o(e.el,t.config.classNameInview)&&(a(e.el,t.config.classNameInview),t.config.on.Out&&"function"==typeof t.config.on.Out&&t.config.on.Out(e)),e.changing&&(e.changing=!1,t.config.on.Change&&"function"==typeof t.config.on.Change&&t.config.on.Change(e,e.index,e.dataset.scrollName))}))}}
2])&&f(e.prototype,i),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();return e=e.default}()}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.