(window["webpackJsonp_name_"] = window["webpackJsonp_name_"] || []).push([[14,45,46],{ /***/ 125: /***/ (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 _BlockParallax = __webpack_require__(179); var _BlockParallax2 = _interopRequireDefault(_BlockParallax); 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 Parallax = function () { function Parallax(elems) { _classCallCheck(this, Parallax); this.elems = elems; this._init(); } _createClass(Parallax, [{ key: '_init', value: function _init() { if (!this.elems.length) { return false; } [].concat(_toConsumableArray(this.elems)).forEach(function (el) { new _BlockParallax2.default({ el: el }); }); } }]); return Parallax; }(); exports.default = Parallax; /***/ }), /***/ 172: /***/ (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); 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 MouseMoveParallax = function () { function MouseMoveParallax(props) { _classCallCheck(this, MouseMoveParallax); this.isActive = false; this.mouseIsMoved = false; this._params = Object.assign({}, MouseMoveParallax.default, props); this._init(); } _createClass(MouseMoveParallax, [{ key: '_init', value: function _init() { var _this = this; if (!this.el) { return false; } if (this.el.classList.contains('vc_column_container')) { this.wrapper = this.el.querySelector('.vc_column-inner'); } else if (this.el.classList.contains('vc_row')) { this.wrapper = document.createElement('div'); this.el.parentNode.insertBefore(this.wrapper, this.el); this.wrapper.appendChild(this.el); } else { this.wrapper = document.createElement('div'); this.wrapper.innerHTML = this.el.innerHTML; this.el.innerHTML = ''; this.el.appendChild(this.wrapper); } if (!this.wrapper) { return false; } this.wrapper.classList.add('wpw-parallax-mouse-move-content'); this.step = 30; if (document.body.classList.contains('wpw-custom-scroll')) { MouseMoveParallax._mainScrollBox = _global2.default.scrollBox; } else { MouseMoveParallax._mainScrollBox = document; } var pos = this.pos = this.el.getBoundingClientRect(); if (pos.top >= 0 && pos.top < _global2.default.wh || pos.bottom < _global2.default.wh && pos.bottom >= 0 || pos.top <= 0 && pos.bottom > _global2.default.wh) { // here code document.addEventListener('mousemove', this.addEventListener.bind(this)); this.isActive = true; } else { this.isActive = false; } this.mouseIsMoved = false; var rAF = false; MouseMoveParallax._mainScrollBox.addEventListener('scroll', function (event) { if (_global2.default.ww < 768) { return; } if (rAF) { return; } rAF = true; requestAnimationFrame(function () { var pos = _this.pos = _this.el.getBoundingClientRect(); if (pos.top >= 0 && pos.top < _global2.default.wh || pos.bottom < _global2.default.wh && pos.bottom >= 0 || pos.top <= 0 && pos.bottom > _global2.default.wh) { // here code if (!_this.isActive) { _this.state = false; document.addEventListener('mousemove', _this.addEventListener.bind(_this)); } _this.isActive = true; if (!_this.mouseIsMoved) { _this._changePosition(_this.lastX, _this.lastY); } } else { if (_this.isActive) { document.removeEventListener('mousemove', _this.addEventListener.bind(_this)); } _this.isActive = false; } rAF = false; }); }); } }, { key: 'addEventListener', value: function addEventListener(event) { this._changePosition(event.clientX, event.clientY); } }, { key: '_changePosition', value: function _changePosition() { var _this2 = this; var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.innerWidth / 2; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.innerHeight / 2; if (this.state) { return; } this.state = true; if (this.isActive) { this.mouseIsMoved = true; var clientY = this.lastY = y; var clientX = this.lastX = x; var step = this.step; setTimeout(function () { requestAnimationFrame(function () { _this2.wrapper.style.transform = 'rotateX(' + (_this2.pos.top + _this2.pos.height / 2 - clientY) / step + 'deg) rotateY(' + -(_this2.pos.left + _this2.pos.width / 2 - clientX) / step + 'deg)'; _this2.wrapper.style.webkitTransform = 'rotateX(' + (_this2.pos.top + _this2.pos.height / 2 - clientY) / step + 'deg) rotateY(' + -(_this2.pos.left + _this2.pos.width / 2 - clientX) / step + 'deg)'; _this2.state = false; _this2.mouseIsMoved = false; }); }, 50); } } }, { key: 'el', get: function get() { return this._params.el; } }], [{ key: 'default', get: function get() { return { el: null }; } }]); return MouseMoveParallax; }(); exports.default = MouseMoveParallax; /***/ }), /***/ 179: /***/ (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 _MouseMoveParallax = __webpack_require__(172); var _MouseMoveParallax2 = _interopRequireDefault(_MouseMoveParallax); var _global = __webpack_require__(52); var _global2 = _interopRequireDefault(_global); 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"); } } /** * Parallax translate, rotate */ var BlockParallax = function () { function BlockParallax(props) { _classCallCheck(this, BlockParallax); this.isLeft = false; this.isRight = false; this.isTop = false; this.isBottom = false; this.isRotateLeft = false; this.isRotateRight = false; this.step = 0; this.startPositionY = 0; this.startPositionX = 0; this.currentScrollBox = null; this._params = Object.assign({}, BlockParallax.default, props); this._init(); } _createClass(BlockParallax, [{ key: '_getTransitionType', value: function _getTransitionType() { this.isLeft = this.el.classList.contains('wpw-parallax-left'); this.isRight = this.el.classList.contains('wpw-parallax-right'); this.isTop = this.el.classList.contains('wpw-parallax-top'); this.isBottom = this.el.classList.contains('wpw-parallax-bottom'); this.isRotateLeft = this.el.classList.contains('wpw-parallax-rotate-left'); this.isRotateRight = this.el.classList.contains('wpw-parallax-rotate-right'); if (this.isTop && this.isBottom) { this.isBottom = false; } if (this.isLeft && this.isRight) { this.isRight = false; } if (this.isRotateLeft && this.isRotateRight) { this.isRotateRight = false; } } }, { key: '_init', value: function _init() { var _this = this; if (!this.el) { return false; } if (this.el.classList.contains('wpw-parallax-mouse-move')) { new _MouseMoveParallax2.default({ el: this.el }); } this._getTransitionType(); var setPosition = function setPosition() { var pos = _this.el.getBoundingClientRect(); _this.step = 10; _this.startPositionY = _global2.default.wh / _this.step; _this.startPositionX = _global2.default.ww / _this.step; if (_global2.default.wh > pos.height) { //this.startPositionY /= 1.5; _this.startPositionY = (pos.height + (_global2.default.wh - pos.height) / 2) / _this.step; _this.startPositionX = (_global2.default.ww - pos.width) / _this.step; } if (_global2.default.ww >= 768) { _this.el.style.top = (_this.isTop ? _this.startPositionY : _this.isBottom ? -_this.startPositionY : 0) + 'px'; _this.el.style.left = (_this.isLeft ? _this.startPositionX : _this.isRight ? -_this.startPositionX : 0) + 'px'; _this.el.style.transform = 'translate3d(0,0px,0) rotate(0)'; _this.el.style.webkitTransform = 'translate3d(0,0px,0) rotate(0)'; if (pos.top >= 0 && pos.top < _global2.default.wh || pos.bottom < _global2.default.wh && pos.bottom >= 0 || pos.top <= 0 && pos.bottom > _global2.default.wh) { _this._runParallax(pos); } } }; setPosition(); window.addEventListener('resize', function (event) { _this.currentScrollBox && _this.currentScrollBox.removeEventListener('scroll', _this._onScroll.bind(_this)); if (_global2.default.ww < 768) { _this._clearParallax(); } else { _this._clearParallax(); setPosition(); _this.currentScrollBox = BlockParallax.getScrollBox; _this.currentScrollBox && _this.currentScrollBox.addEventListener('scroll', _this._onScroll.bind(_this)); } }); this.rAF = false; this.currentScrollBox = BlockParallax.getScrollBox; this.currentScrollBox && this.currentScrollBox.addEventListener('scroll', this._onScroll.bind(this)); } }, { key: '_onScroll', value: function _onScroll(event) { var _this2 = this; if (_global2.default.ww < 768) { return; } if (this.rAF) { return; } this.rAF = true; requestAnimationFrame(function () { var pos = _this2.el.getBoundingClientRect(); if (pos.top >= 0 && pos.top < _global2.default.wh || pos.bottom < _global2.default.wh && pos.bottom >= 0 || pos.top <= 0 && pos.bottom > _global2.default.wh) { _this2._runParallax(pos); } _this2.rAF = false; }); } }, { key: '_clearParallax', value: function _clearParallax() { this.el.style.top = ''; this.el.style.transform = ''; this.el.style.webkitTransform = ''; } }, { key: '_runParallax', value: function _runParallax(pos) { var translateY = this.isTop ? -(_global2.default.wh - pos.top) / this.step : this.isBottom ? (_global2.default.wh - pos.top) / this.step : 0; var translateX = this.isLeft ? -(_global2.default.ww - pos.top) / this.step : this.isRight ? (_global2.default.ww - pos.top) / this.step : 0; var rotate = this.isRotateLeft ? -(_global2.default.wh - pos.top) / this.step + this.startPositionY : this.isRotateRight ? (_global2.default.wh - pos.top) / this.step - this.startPositionY : 0; this.el.style.transform = 'translate3d(' + translateX + 'px,' + translateY + 'px,0) rotate(' + rotate + 'deg)'; this.el.style.webkitTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,0) rotate(' + rotate + 'deg)'; } }, { key: 'el', get: function get() { return this._params.el; } }], [{ key: 'default', get: function get() { return { el: null }; } }, { key: 'getScrollBox', get: function get() { return document.body.classList.contains('wpw-custom-scroll') && window.innerWidth > 991 ? _global2.default.lumericMain : document; } }]); return BlockParallax; }(); exports.default = BlockParallax; /***/ }) }]);