(window["webpackJsonp_name_"] = window["webpackJsonp_name_"] || []).push([[13,63,71,79],{ /***/ 122: /***/ (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 _Counter = __webpack_require__(180); var _Counter2 = _interopRequireDefault(_Counter); __webpack_require__(424); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // Показує любі елеменити при скролі з заданим класом var ShowInViewport = function () { _createClass(ShowInViewport, null, [{ key: 'default', get: function get() { return { elems: null }; } }]); function ShowInViewport(params) { _classCallCheck(this, ShowInViewport); this._params = Object.assign({}, ShowInViewport.default, params); this._init(); } _createClass(ShowInViewport, [{ key: '_init', value: function _init() { if (!this.elems.length) { return false; } this.copyElems = Array.from(this.elems).slice(0); this._onScrollBind = this._onScroll.bind(this); this._setScrollBox(); this.scrollBox.addEventListener('scroll', this._onScrollBind); this._onScroll(); this._resize(); } }, { key: '_onScroll', value: function _onScroll(event) { var _this = this; if (!this.copyElems) { return false; } var _ref = [].concat(_toConsumableArray(this.copyElems)), tmp = _ref.slice(0); tmp.forEach(function (item, index) { var pos = item.getBoundingClientRect(); if (pos.top < window.innerHeight) { item.classList.add(ShowInViewport._activeClass); if (_this.copyElems.length > 1) { _this.copyElems.splice(index, 1); } else { _this.copyElems = null; } var elem = item.querySelector(ShowInViewport._counterClass); if (elem) { ShowInViewport.initCounter(item); } } }); if (!this.copyElems) { this.scrollBox.removeEventListener('scroll', this._onScrollBind); } } }, { key: '_setScrollBox', value: function _setScrollBox() { if (document.body.classList.contains('wpw-custom-scroll') && window.innerWidth > 991) { this.scrollBox = _global2.default.lumericMain; } else { this.scrollBox = document; } } }, { key: '_resize', value: function _resize() { var _this2 = this; var timeout = null; var resize = function () { clearTimeout(timeout); timeout = setTimeout(function () { if (!_this2.copyElems) { window.removeEventListener('resize', resize); return false; } _this2.scrollBox.removeEventListener('scroll', _this2._onScrollBind); _this2._setScrollBox(); _this2.scrollBox.addEventListener('scroll', _this2._onScrollBind); }, 100); }.bind(this); window.addEventListener('resize', resize); } }, { key: 'elems', get: function get() { return this._params.elems; } }], [{ key: 'initCounter', value: function initCounter(elem) { new _Counter2.default({ elem: elem, duration: elem.getAttribute('data-duration'), count: elem.getAttribute('data-count') }); } }]); return ShowInViewport; }(); Object.defineProperty(ShowInViewport, '_activeClass', { value: 'is-show', enumerable: false, writable: false, configurable: false }); Object.defineProperty(ShowInViewport, '_counterClass', { value: '.project-counter__number', enumerable: false, writable: false, configurable: false }); exports.default = ShowInViewport; /***/ }), /***/ 180: /***/ (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; }; }(); __webpack_require__(417); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Counter = function () { _createClass(Counter, null, [{ key: 'default', get: function get() { return { elem: null, duration: 2000, count: 20 }; } }]); function Counter(params) { _classCallCheck(this, Counter); this._params = Object.assign({}, Counter.default, params); if (!this.elem) { return; } this.run(); } _createClass(Counter, [{ key: 'run', value: function run() { var _this = this; var number = this.elem.querySelector(Counter._counterNumber); if (!number) { return false; } var preCount = 0; Counter.animate({ duration: this.duration, timing: function timing(timeFraction) { return timeFraction; }, draw: function draw(progress) { var count = Math.floor(_this.count * progress); count = count < 0 ? 0 : count; if (preCount !== count) { requestAnimationFrame(function () { number.innerHTML = count.toString(); }); preCount = count; } } }); } }, { key: 'elem', get: function get() { return this._params.elem; } }, { key: 'duration', get: function get() { return this._params.duration; } }, { key: 'count', get: function get() { return this._params.count; } }], [{ key: 'animate', value: function animate(options) { var start = performance.now(); requestAnimationFrame(function animate(time) { // timeFraction от 0 до 1 var timeFraction = (time - start) / options.duration; if (timeFraction > 1) { timeFraction = 1; } // текущее состояние анимации var progress = options.timing(timeFraction); options.draw(progress); if (timeFraction < 1) { requestAnimationFrame(animate); } }); } }]); return Counter; }(); Object.defineProperty(Counter, '_counterNumber', { value: '.project-counter__number', enumerable: false, writable: false, configurable: false }); exports.default = Counter; /***/ }), /***/ 417: /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(436); 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) {} /***/ }), /***/ 424: /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(444); 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) {} /***/ }), /***/ 436: /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(168)(false); // imports // module exports.push([module.i, ".project-counter{display:block}.project-counter.wpw-animate-box{opacity:0;transition:transform .6s ease,opacity .6s ease}.project-counter.wpw-animate-box.is-show{opacity:1;transform:translateY(0)}.project-counter__icon{display:inline-block;line-height:1}.project-counter__number,.project-counter__text{display:block}.project-counter__number:last-child{margin-bottom:0}.project-counter__icon-wrapper{display:inline-flex}.project-counter__icon-wrapper>span,.project-counter__icon-wrapper>span:first-child{flex:0 0 auto}.icon-placement-top{flex-direction:column}.icon-placement-bottom{flex-direction:column-reverse}.icon-placement-left{flex-direction:row;align-items:center}.icon-placement-right{flex-direction:row-reverse;align-items:center}", ""]); // exports /***/ }), /***/ 444: /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(168)(false); // imports // module exports.push([module.i, ".show-in-viewport,.wpw-animate-box{position:relative;transform:translateY(150px);opacity:0}.show-in-viewport:not(.project-counter),.wpw-animate-box:not(.project-counter){opacity:1;transition:transform .4s cubic-bezier(.32,.68,.57,.93),opacity .4s ease}.show-in-viewport:not(.project-counter):nth-child(2),.wpw-animate-box:not(.project-counter):nth-child(2){transition:transform .6s cubic-bezier(.32,.68,.57,.93),opacity .6s ease}.show-in-viewport.is-show,.wpw-animate-box.is-show{opacity:1;transform:translateY(0)}", ""]); // exports /***/ }) }]);