(window["webpackJsonp_name_"] = window["webpackJsonp_name_"] || []).push([[22,72],{ /***/ 129: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _global = __webpack_require__(52); var _global2 = _interopRequireDefault(_global); var _index = __webpack_require__(48); var _index2 = _interopRequireDefault(_index); __webpack_require__(425); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var LumericScroll = function () { function LumericScroll() { var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, LumericScroll); this.isInit = false; this.isSafari = false; this.hasScroll = false; this._params = Object.assign({}, LumericScroll.default, params); this.init(); } _createClass(LumericScroll, [{ key: 'init', value: function init() { var _this = this; if (!document.body.classList.contains('wpw-custom-scroll')) { return false; } if (!this.scrollBox) { return false; } //let height = GlobalVariables.mainContent.offsetHeight; //runObserver(GlobalVariables.mainContent, () => { // if(window.innerWidth < 991) { // return false; // } // // let currentHeight = GlobalVariables.mainContent.offsetHeight; // // if(height !== currentHeight) { // this.resize(); // } // // height = currentHeight; //}); this.isInit = true; this.parent = this.scrollBox.parentNode; this._createScroll()._setScrollSize()._onScroll(); this.isSafari = false; var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('safari') !== -1) { this.isSafari = !(ua.indexOf('chrome') > -1); } //let height = GlobalVariables.mainContent.offsetHeight; var initTimeout = null; (0, _index2.default)({ elems: _global2.default.mainWrapper, settings: { childList: true, subtree: true }, callback: function callback(mutations) { clearTimeout(initTimeout); initTimeout = setTimeout(function () { _this.resize(); }, 500); } }); } }, { key: '_createScroll', value: function _createScroll() { var _this2 = this; var scroll = this.scroll = document.createElement('DIV'); scroll.className = 'wpw-scroll'; var scrollLine = this.scrollLine = document.createElement('SPAN'); scrollLine.className = 'wpw-scroll__line'; scroll.appendChild(scrollLine); this.parent.appendChild(scroll); var isMouseDown = false, startY = void 0, endY = void 0, result = void 0, mouseMove = false; var onMouseEnter = function onMouseEnter() { scroll.classList.add('hovered'); }; var onMouseDown = function onMouseDown(event) { isMouseDown = true; event.preventDefault(); startY = event.clientY; _this2.currentScrollTop = _this2.scrollBox.scrollTop; _this2.scrollLine.style.transition = 'top 0s ease, height .3s ease, border-right-width .2s ease, opacity .3s ease'; _this2.scrollLine.style.WebkitTransition = 'top 0s ease, height .3s ease, border-right-width .2s ease, opacity .3s ease'; }; var onMouseMove = function onMouseMove(event) { if (!isMouseDown) { return false; } mouseMove = true; endY = event.clientY; result = endY - startY; _this2.scrollBox.scrollTop = _this2.currentScrollTop + result / _this2.precent; document.addEventListener('mouseup', onMouseUp); }; var onMouseUp = function onMouseUp() { isMouseDown = false; mouseMove = false; _this2.scrollLine.style.transition = ''; _this2.scrollLine.style.WebkitTransition = ''; document.removeEventListener('mouseup', onMouseUp); }; var onMouseLeave = function onMouseLeave() { scroll.classList.remove('hovered'); }; var onScrollClick = function onScrollClick(event) { event.preventDefault(); event.stopPropagation(); if (!mouseMove) { _this2.scrollBox.scrollTop = event.clientY / _this2.precent; mouseMove = false; } }; var onLineClick = function onLineClick(event) { event.preventDefault(); event.stopPropagation(); isMouseDown = false; _this2.scrollLine.style.transition = ''; _this2.scrollLine.style.WebkitTransition = ''; document.removeEventListener('mouseup', onMouseUp); }; scroll.addEventListener('mouseenter', onMouseEnter); scroll.addEventListener('mouseleave', onMouseLeave); scroll.addEventListener('click', onScrollClick); scrollLine.addEventListener('click', onLineClick); scrollLine.addEventListener('mousedown', onMouseDown); document.addEventListener('mousemove', onMouseMove); return this; } }, { key: '_setScrollSize', value: function _setScrollSize() { var minTop = this.minTop = 0; var visibleHeight = this.offsetHeight = this.scrollBox.offsetHeight, fullHeight = this.fullHeight = this.scrollBox.scrollHeight, isFullLayout = _global2.default.main && _global2.default.main.classList.contains('lg-container-fluid') || false; var n = 0; this.hasScroll = visibleHeight + 1 < fullHeight; if (this.hasScroll) { this.scroll.style.display = ''; this.scrollBox.style.width = ''; this.scrollBox.style.paddingRight = ''; if (_global2.default.ww < 992) { this.scrollLine.style.height = 0; this.scrollBox.style.width = ''; this.scrollBox.style.paddingRight = ''; } else { var height = this.scrollBox.clientHeight - minTop, fullheight = this.scrollBox.scrollHeight - minTop; this.precent = height / fullheight; this.lineHeight = height * this.precent + n; this.scrollLine.style.height = this.lineHeight + 'px'; this.scrollLine.style.top = this.minTop + 'px'; this.scrollHeight = this.scrollBox.clientHeight - this.lineHeight; if (_global2.default.scrollWidth) { this.scrollBox.style.width = _global2.default.scrollWidth + this.parent.clientWidth + 'px'; } } } else { this.scrollLine.style.height = 0; this.scroll.style.display = 'none'; this.scrollBox.style.width = ''; } return this; } }, { key: '_animateScroll', value: function _animateScroll() { var _this3 = this; clearTimeout(this.removeScrollShow); // //if(this.isAnimatingScroll) { // return false; //} if (_global2.default.ww < 992) { return false; } var top = this.scrollBox.scrollTop * this.precent + this.minTop; if (top < 0) { top = this.minTop; } else if (top > this.scrollHeight) { top = this.scrollHeight; } // //const f = () => { // this.isAnimatingScroll = false; // this.scrollLine.removeEventListener(transitionEvent, f.bind(this)); // this._animateScroll(); //}; // //if(this.currentTop === top) { // this.isAnimatingScroll = false; // this.scrollLine.removeEventListener(transitionEvent, f.bind(this)); // return false; //} // //this.scrollLine.addEventListener(transitionEvent, f.bind(this)); // //this.isAnimatingScroll = true; //this.scrollLine.style.top = top + 'px'; if (this.isSafari) { this.scrollLine.style.top = top + 'px'; } else { this.scrollLine.style.transform = 'translate3d(-50%, ' + top + 'px, 0)'; this.scrollLine.style.WebkitTransform = 'translate3d(-50%, ' + top + 'px, 0)'; } //this.currentTop = top; this.removeScrollShow = setTimeout(function () { _this3.scroll.classList.remove('wpw-scroll-show'); }, 500); } }, { key: '_onScroll', value: function _onScroll() { var _this4 = this; this.removeScrollShow = null; var scrollTop = 0; var update = function update() { //requestAnimationFrame(() => { _this4.scroll.classList.add('wpw-scroll-show'); _this4._animateScroll(); //}); }; var timeout = false; this.scrollBox.addEventListener('scroll', function (event) { //if ( timeout ) { // return false; //} //timeout = true; // //setTimeout( () => { event.stopPropagation(); //scrollTop = event.target.scrollTop; update(); // timeout = false; //}, 0 ); }); return this; } }, { key: 'remove', value: function remove() { if (this.scroll && this.scroll.parentNode) { this.scroll.parentNode.removeChild(this.scroll); } return this; } }, { key: 'resize', value: function resize() { if (!this.isInit) { return; } this._setScrollSize(); this._animateScroll(); } }, { key: 'scrollBox', get: function get() { return this._params.scrollBox; } }], [{ key: 'default', get: function get() { return { scrollBox: null }; } }]); return LumericScroll; }(); //function runObserver( elems, callback ) { // let initTimeout = null; // let observer = new MutationObserver( mutations => { // mutations.forEach( mutation => { // clearTimeout( initTimeout ); // initTimeout = setTimeout( () => { // if(typeof callback === 'function') { // callback(); // } // }, 500 ); // } ); // } ); // // const runObserver = wrapper => { // observer.observe( wrapper, { // childList : true, // attributes : true, // characterData : true, // subtree : true, // attributeOldValue : true, // characterDataOldValue: true // } ); // }; // // if(elems instanceof HTMLElement) { // runObserver(elems); // } else { // [].forEach.call( elems, runObserver ); // } //} exports.default = LumericScroll; /***/ }), /***/ 425: /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(446); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(167)(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ 446: /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(168)(false); // imports // module exports.push([module.i, ".wpw-scroll{position:absolute;z-index:20;top:0;display:none;overflow:hidden;height:100%;opacity:0;transition:opacity .2s ease;transform:translateZ(0)}@media (min-width:992px){.wpw-scroll{display:block}}.wpw-custom-scroll_show_always-animation .wpw-scroll,.wpw-custom-scroll_show_always .wpw-scroll{opacity:1}.wpw-custom-scroll_position_right .wpw-scroll{right:0}.wpw-custom-scroll_position_left .wpw-scroll{left:0}.wpw-scroll__line{position:absolute;top:0;left:50%;z-index:20;height:0;cursor:pointer;opacity:.6;transform:translateX(-50%);transition:opacity .2s ease-in-out;will-change:top,transform}.wpw-custom-scroll_show_always-animation .wpw-scroll__line{opacity:.6}.wpw-custom-scroll_show_always .wpw-scroll-show .wpw-scroll__line,.wpw-custom-scroll_show_always .wpw-scroll__line,.wpw-scroll-show,.wpw-scroll.hovered,.wpw-scroll.hovered .wpw-scroll__line{opacity:1}", ""]); // exports /***/ }) }]);