You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

motion-parallax

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion-parallax - npm Package Compare versions

Comparing version

to
1.2.1

82

dest/parallax.js

@@ -824,28 +824,2 @@ /******/ (function(modules) { // webpackBootstrap

/** 获取dom上的配置数据 */
var getDomConfigData = function getDomConfigData(ele) {
var xRange = void 0,
yRange = void 0;
if (ele.element.dataset) {
if (parseInt(ele.element.dataset.xrange, 0) === 0) {
xRange = 0;
} else {
xRange = parseInt(ele.element.dataset.xrange, 0) || ele.config.xRange;
}
if (parseInt(ele.element.dataset.yrange, 0) === 0) {
yRange = 0;
} else {
yRange = parseInt(ele.element.dataset.yrange, 0) || ele.config.yRange;
}
} else {
xRange = ele.config.xRange;
yRange = ele.config.yRange;
}
return {
xRange: xRange,
yRange: yRange
};
};
/** 导出 */

@@ -869,3 +843,3 @@

this.animateElements = [];
this.animateElementsConfig; // 需要进行动画的所有dom有关的细节
this.animateElementsQueue; // 需要进行动画的所有dom有关的细节
this.isMobile = Boolean(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i));

@@ -875,3 +849,3 @@ this.isEnter = false; // 是否进入tag

this.add(); // add all element to this.animateElements
this._init(); // this.animateElementsConfig
this._init(); // this.animateElementsQueue
this._resize();

@@ -889,8 +863,12 @@ this._start();

this.animateElementsConfig = this.animateElements.map(function (ele, index) {
this.animateElementsQueue = this.animateElements.map(function (ele, index) {
_this2._clearStyle(ele.element); // 清除之前的top,left样式
var _getDomConfigData = getDomConfigData(ele),
xRange = _getDomConfigData.xRange,
yRange = _getDomConfigData.yRange,
var _ele$config = ele.config,
xRange = _ele$config.xRange,
yRange = _ele$config.yRange,
isInvert = _ele$config.isInvert,
isAnimate = _ele$config.isAnimate,
maxXrange = _ele$config.maxXrange,
maxYrange = _ele$config.maxYrange,
offsetLeft = ele.element.offsetLeft,

@@ -900,4 +878,3 @@ offsetTop = ele.element.offsetTop,

listenElementWidth = listenElement.innerWidth ? listenElement.innerWidth : listenElement.clientWidth,
listenElementHeight = listenElement.innerHeight ? listenElement.innerHeight : listenElement.clientHeight,
isInvert = ele.element.dataset ? parseData(ele.element.dataset.invert) || ele.config.invert : ele.config.invert; // 默认优先dom上的参数;
listenElementHeight = listenElement.innerHeight ? listenElement.innerHeight : listenElement.clientHeight; // 监听的元素的高度

@@ -920,3 +897,6 @@ if (_this2.isMobile && _this2._config.animate) {

listenElementHeight: listenElementHeight,
isInvert: isInvert
isInvert: isInvert,
isAnimate: isAnimate,
maxXrange: maxXrange,
maxYrange: maxYrange
};

@@ -950,3 +930,3 @@ });

_this3.animateElementsConfig.forEach(function (item) {
_this3.animateElementsQueue.forEach(function (item) {
var top = y / 9.78049 * item.yRange,

@@ -976,3 +956,3 @@ left = -x / 9.78049 * item.xRange;

}
_this3.animateElementsConfig.forEach(function (item) {
_this3.animateElementsQueue.forEach(function (item) {
var top = e.pageY / item.listenElementHeight * item.yRange,

@@ -1020,3 +1000,3 @@ left = e.pageX / item.listenElementWidth * item.xRange;

element: element[i],
config: config
config: (0, _assign2.default)({}, config, this._getDomConfigData(element[i], config))
});

@@ -1027,3 +1007,3 @@ }

element: element,
config: config
config: (0, _assign2.default)({}, config, this._getDomConfigData(element, config))
});

@@ -1096,2 +1076,26 @@ }

}
/** 获取dom上的配置数据 */
}, {
key: '_getDomConfigData',
value: function _getDomConfigData(ele, config) {
var data = {};
if (ele.dataset) {
if (parseInt(ele.dataset.xrange, 0) === 0) {
data.xRange = 0;
} else {
data.xRange = parseInt(ele.dataset.xrange, 0) || config.xRange;
}
if (parseInt(ele.dataset.yrange, 0) === 0) {
data.yRange = 0;
} else {
data.yRange = parseInt(ele.dataset.yrange, 0) || config.yRange;
}
data.isInvert = parseData(ele.dataset.invert);
data.isAnimate = parseData(ele.dataset.animate);
}
return data;
}
}]);

@@ -1098,0 +1102,0 @@ return Parallax;

@@ -1,1 +0,1 @@

!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=38)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(11),o=n(28),i=n(16),u=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(31),o=n(17);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(1),o=n(13);t.exports=n(2)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(20)("wks"),o=n(14),i=n(0).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.5.0"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(30),o=n(21);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(0),o=n(7),i=n(43),u=n(5),f=function(t,e,n){var a,c,s,l=t&f.F,p=t&f.G,v=t&f.S,y=t&f.P,h=t&f.B,d=t&f.W,m=p?o:o[e]||(o[e]={}),g=m.prototype,b=p?r:v?r[e]:(r[e]||{}).prototype;p&&(n=e);for(a in n)(c=!l&&b&&void 0!==b[a])&&a in m||(s=c?b[a]:n[a],m[a]=p&&"function"!=typeof b[a]?n[a]:h&&c?i(s,r):d&&b[a]==s?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(s):y&&"function"==typeof s?i(Function.call,s):s,y&&((m.virtual||(m.virtual={}))[a]=s,t&f.R&&g&&!g[a]&&u(g,a,s)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,e,n){var r=n(12);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(12);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(20)("keys"),o=n(14);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){t.exports=!0},function(t,e){t.exports={}},function(t,e,n){var r=n(1).f,o=n(3),i=n(6)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){e.f=n(6)},function(t,e,n){var r=n(0),o=n(7),i=n(23),u=n(26),f=n(1).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||f(e,t,{value:u.f(t)})}},function(t,e,n){t.exports=!n(2)&&!n(8)(function(){return 7!=Object.defineProperty(n(29)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(12),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(3),o=n(4),i=n(46)(!1),u=n(19)("IE_PROTO");t.exports=function(t,e){var n,f=o(t),a=0,c=[];for(n in f)n!=u&&r(f,n)&&c.push(n);for(;e.length>a;)r(f,n=e[a++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){var r=n(32);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(17);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(23),o=n(10),i=n(35),u=n(5),f=n(3),a=n(24),c=n(59),s=n(25),l=n(62),p=n(6)("iterator"),v=!([].keys&&"next"in[].keys()),y=function(){return this};t.exports=function(t,e,n,h,d,m,g){c(n,e,h);var b,x,w,_=function(t){if(!v&&t in j)return j[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",E="values"==d,O=!1,j=t.prototype,P=j[p]||j["@@iterator"]||d&&j[d],M=P||_(d),k=d?E?_("entries"):M:void 0,L="Array"==e?j.entries||P:P;if(L&&(w=l(L.call(new t)))!==Object.prototype&&w.next&&(s(w,S,!0),r||f(w,p)||u(w,p,y)),E&&P&&"values"!==P.name&&(O=!0,M=function(){return P.call(this)}),r&&!g||!v&&!O&&j[p]||u(j,p,M),a[e]=M,a[S]=y,d)if(b={values:E?M:_("values"),keys:m?M:_("keys"),entries:k},g)for(x in b)x in j||i(j,x,b[x]);else o(o.P+o.F*(v||O),e,b);return b}},function(t,e,n){t.exports=n(5)},function(t,e,n){var r=n(11),o=n(60),i=n(21),u=n(19)("IE_PROTO"),f=function(){},a=function(){var t,e=n(29)("iframe"),r=i.length;for(e.style.display="none",n(61).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[i[r]];return a()};t.exports=Object.create||function(t,e){var n;return null!==t?(f.prototype=r(t),n=new f,f.prototype=null,n[u]=t):n=a(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(30),o=n(21).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(39));"undefined"!=typeof window&&(window.Parallax=r.default),e.default=r.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(40)),i=r(n(49)),u=r(n(50)),f=r(n(54)),a=document.addEventListener?function(t,e,n){if(t.length)for(var r=0;r<t.length;r++)a(t[r],e,n);else t.addEventListener(e,n,!1)}:function(t,e,n){if(t.length)for(var r=0;r<t.length;r++)a(t[r],e,n);else t.attachEvent("on"+e,function(){return n.call(t,window.event)})},c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},s=function(t,e){if("object"===(void 0===t?"undefined":(0,f.default)(t)))return t;try{var n=document.querySelectorAll(t);return e?n[0]:n}catch(t){throw new Error(t)}},l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3/60,n=void 0,r=void 0;return function(){var o=this,i=arguments,u=Date.now();n&&u<n+e?(clearTimeout(r),r=setTimeout(function(){n=u,t.apply(o,i)},e)):(n=u,t.apply(this,arguments))}},p=function(t){if(!t)return!1;if(t.length&&0===t.length)return!1;switch(t){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!0}},v=function(t){var e=void 0,n=void 0;return t.element.dataset?(e=0===parseInt(t.element.dataset.xrange,0)?0:parseInt(t.element.dataset.xrange,0)||t.config.xRange,n=0===parseInt(t.element.dataset.yrange,0)?0:parseInt(t.element.dataset.yrange,0)||t.config.yRange):(e=t.config.xRange,n=t.config.yRange),{xRange:e,yRange:n}},y=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(this,t),this._config=(0,o.default)({xRange:20,yRange:20,listenElement:window,animate:!1,invert:!1,enterCallback:function(){},leaveCallback:function(){}},n),this.element=s(e),this.animateElements=[],this.animateElementsConfig,this.isMobile=Boolean(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)),this.isEnter=!1,this.add(),this._init(),this._resize(),this._start()}return(0,u.default)(t,[{key:"_init",value:function(){var t=this;this.animateElementsConfig=this.animateElements.map(function(e,n){t._clearStyle(e.element);var r=v(e),o=r.xRange,i=r.yRange,u=e.element.offsetLeft,f=e.element.offsetTop,a=s(e.config.listenElement,!0),c=a.innerWidth?a.innerWidth:a.clientWidth,l=a.innerHeight?a.innerHeight:a.clientHeight,y=e.element.dataset?p(e.element.dataset.invert)||e.config.invert:e.config.invert;return t.isMobile&&t._config.animate&&(e.element.style.transition="top,left 0.05s linear"),{element:e.element,xRange:o,yRange:i,offsetLeft:u,offsetTop:f,listenElement:a,listenElementWidth:c,listenElementHeight:l,isInvert:y}})}},{key:"_start",value:function(){var t=this;{if(!(this.isMobile&&"ondevicemotion"in window)){var e=s(this._config.listenElement,!0);return a(e,"mousemove",function(e){c(function(){t.isEnter||(t.isEnter=!0,t._config.enterCallback()),t.animateElementsConfig.forEach(function(t){var n=e.pageY/t.listenElementHeight*t.yRange,r=e.pageX/t.listenElementWidth*t.xRange;t.isInvert&&(n=-n,r=-r),t.element.style.top!==n&&(t.element.style.top=n+t.offsetTop+"px"),t.element.style.left!==r&&(t.element.style.left=r+t.offsetLeft+"px")})})}),a(e,"mouseleave",function(e){t.isEnter&&(t.isEnter=!1,t._config.leaveCallback())}),this}a(window,"devicemotion",function(e){c(function(){var n=e.accelerationIncludingGravity,r=n.x,o=n.y;try{r=parseFloat(r.toFixed(4)),o=parseFloat(o.toFixed(4))}catch(t){return void console.warn("你需要使用真实的移动设备来测试,并且需要有陀螺仪功能.")}0!==r&&0!==o&&t.animateElementsConfig.forEach(function(t){var e=o/9.78049*t.yRange,n=-r/9.78049*t.xRange;t.isInvert&&(e=-e,n=-n),t.element.style.top!==e&&(t.element.style.top=e+t.offsetTop+"px"),t.element.style.left!==n&&(t.element.style.left=n+t.offsetLeft+"px")})})})}}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=(0,o.default)({},this._config,e);var n=s(t);if(n&&0!==n.length){if(n.length)for(var r=0;r<n.length;r++)this.animateElements.push({element:n[r],config:e});else this.animateElements.push({element:n,config:e});return this}console.warn("Element not found!\n未找到元素!")}},{key:"remove",value:function(t){var e=s(t);{if(e&&0!==e.length){for(var n=0;n<e.length;n++)for(var r=0;r<this.animateElements.length;r++)(e[n]===this.animateElements[r].element||e[n].isEqualNode(this.animateElements[r].element))&&(this.animateElements[r].isRemove=!0);return this.animateElements=this.animateElements.filter(function(t){return!t.isRemove}),this}console.warn("Element not found!\n未找到需要删除的元素.")}}},{key:"refresh",value:function(){return this._init(),this}},{key:"_resize",value:function(){var t=this;a(window,"resize",l(function(){t.refresh()},200))}},{key:"_clearStyle",value:function(t){var e=t.getAttribute("style");e&&(e=e.split(";").filter(function(t){var e=t.trim();return"top"!==e.slice(0,3)&&"left"!==e.slice(0,4)}),t.setAttribute("style",e.join(";")))}}]),t}();e.default=y},function(t,e,n){t.exports={default:n(41),__esModule:!0}},function(t,e,n){n(42),t.exports=n(7).Object.assign},function(t,e,n){var r=n(10);r(r.S+r.F,"Object",{assign:n(45)})},function(t,e,n){var r=n(44);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(9),o=n(22),i=n(15),u=n(33),f=n(31),a=Object.assign;t.exports=!a||n(8)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=a({},t)[n]||Object.keys(a({},e)).join("")!=r})?function(t,e){for(var n=u(t),a=arguments.length,c=1,s=o.f,l=i.f;a>c;)for(var p,v=f(arguments[c++]),y=s?r(v).concat(s(v)):r(v),h=y.length,d=0;h>d;)l.call(v,p=y[d++])&&(n[p]=v[p]);return n}:a},function(t,e,n){var r=n(4),o=n(47),i=n(48);t.exports=function(t){return function(e,n,u){var f,a=r(e),c=o(a.length),s=i(u,c);if(t&&n!=n){for(;c>s;)if((f=a[s++])!=f)return!0}else for(;c>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}}},function(t,e,n){var r=n(18),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(18),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(51));e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,r.default)(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e,n){t.exports={default:n(52),__esModule:!0}},function(t,e,n){n(53);var r=n(7).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(10);r(r.S+r.F*!n(2),"Object",{defineProperty:n(1).f})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=r(n(55)),i=r(n(67)),u="function"==typeof i.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":typeof t};e.default="function"==typeof i.default&&"symbol"===u(o.default)?function(t){return void 0===t?"undefined":u(t)}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":void 0===t?"undefined":u(t)}},function(t,e,n){t.exports={default:n(56),__esModule:!0}},function(t,e,n){n(57),n(63),t.exports=n(26).f("iterator")},function(t,e,n){"use strict";var r=n(58)(!0);n(34)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(18),o=n(17);t.exports=function(t){return function(e,n){var i,u,f=String(o(e)),a=r(n),c=f.length;return a<0||a>=c?t?"":void 0:(i=f.charCodeAt(a))<55296||i>56319||a+1===c||(u=f.charCodeAt(a+1))<56320||u>57343?t?f.charAt(a):i:t?f.slice(a,a+2):u-56320+(i-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(36),o=n(13),i=n(25),u={};n(5)(u,n(6)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(1),o=n(11),i=n(9);t.exports=n(2)?Object.defineProperties:function(t,e){o(t);for(var n,u=i(e),f=u.length,a=0;f>a;)r.f(t,n=u[a++],e[n]);return t}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(3),o=n(33),i=n(19)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){n(64);for(var r=n(0),o=n(5),i=n(24),u=n(6)("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<f.length;a++){var c=f[a],s=r[c],l=s&&s.prototype;l&&!l[u]&&o(l,u,c),i[c]=i.Array}},function(t,e,n){"use strict";var r=n(65),o=n(66),i=n(24),u=n(4);t.exports=n(34)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(68),__esModule:!0}},function(t,e,n){n(69),n(76),n(77),n(78),t.exports=n(7).Symbol},function(t,e,n){"use strict";var r=n(0),o=n(3),i=n(2),u=n(10),f=n(35),a=n(70).KEY,c=n(8),s=n(20),l=n(25),p=n(14),v=n(6),y=n(26),h=n(27),d=n(71),m=n(72),g=n(73),b=n(11),x=n(4),w=n(16),_=n(13),S=n(36),E=n(74),O=n(75),j=n(1),P=n(9),M=O.f,k=j.f,L=E.f,T=r.Symbol,R=r.JSON,A=R&&R.stringify,F=v("_hidden"),C=v("toPrimitive"),I={}.propertyIsEnumerable,N=s("symbol-registry"),W=s("symbols"),D=s("op-symbols"),G=Object.prototype,q="function"==typeof T,H=r.QObject,V=!H||!H.prototype||!H.prototype.findChild,z=i&&c(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=M(G,e);r&&delete G[e],k(t,e,n),r&&t!==G&&k(G,e,r)}:k,B=function(t){var e=W[t]=S(T.prototype);return e._k=t,e},J=q&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},K=function(t,e,n){return t===G&&K(D,e,n),b(t),e=w(e,!0),b(n),o(W,e)?(n.enumerable?(o(t,F)&&t[F][e]&&(t[F][e]=!1),n=S(n,{enumerable:_(0,!1)})):(o(t,F)||k(t,F,_(1,{})),t[F][e]=!0),z(t,e,n)):k(t,e,n)},Y=function(t,e){b(t);for(var n,r=m(e=x(e)),o=0,i=r.length;i>o;)K(t,n=r[o++],e[n]);return t},Q=function(t){var e=I.call(this,t=w(t,!0));return!(this===G&&o(W,t)&&!o(D,t))&&(!(e||!o(this,t)||!o(W,t)||o(this,F)&&this[F][t])||e)},U=function(t,e){if(t=x(t),e=w(e,!0),t!==G||!o(W,e)||o(D,e)){var n=M(t,e);return!n||!o(W,e)||o(t,F)&&t[F][e]||(n.enumerable=!0),n}},X=function(t){for(var e,n=L(x(t)),r=[],i=0;n.length>i;)o(W,e=n[i++])||e==F||e==a||r.push(e);return r},Z=function(t){for(var e,n=t===G,r=L(n?D:x(t)),i=[],u=0;r.length>u;)!o(W,e=r[u++])||n&&!o(G,e)||i.push(W[e]);return i};q||(f((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===G&&e.call(D,n),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),z(this,t,_(1,n))};return i&&V&&z(G,t,{configurable:!0,set:e}),B(t)}).prototype,"toString",function(){return this._k}),O.f=U,j.f=K,n(37).f=E.f=X,n(15).f=Q,n(22).f=Z,i&&!n(23)&&f(G,"propertyIsEnumerable",Q,!0),y.f=function(t){return B(v(t))}),u(u.G+u.W+u.F*!q,{Symbol:T});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)v($[tt++]);for(var et=P(v.store),nt=0;et.length>nt;)h(et[nt++]);u(u.S+u.F*!q,"Symbol",{for:function(t){return o(N,t+="")?N[t]:N[t]=T(t)},keyFor:function(t){if(J(t))return d(N,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){V=!0},useSimple:function(){V=!1}}),u(u.S+u.F*!q,"Object",{create:function(t,e){return void 0===e?S(t):Y(S(t),e)},defineProperty:K,defineProperties:Y,getOwnPropertyDescriptor:U,getOwnPropertyNames:X,getOwnPropertySymbols:Z}),R&&u(u.S+u.F*(!q||c(function(){var t=T();return"[null]"!=A([t])||"{}"!=A({a:t})||"{}"!=A(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!J(t)){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);return"function"==typeof(e=r[1])&&(n=e),!n&&g(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!J(e))return e}),r[1]=e,A.apply(R,r)}}}),T.prototype[C]||n(5)(T.prototype,C,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(14)("meta"),o=n(12),i=n(3),u=n(1).f,f=0,a=Object.isExtensible||function(){return!0},c=!n(8)(function(){return a(Object.preventExtensions({}))}),s=function(t){u(t,r,{value:{i:"O"+ ++f,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!a(t))return"F";if(!e)return"E";s(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!a(t))return!0;if(!e)return!1;s(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&a(t)&&!i(t,r)&&s(t),t}}},function(t,e,n){var r=n(9),o=n(4);t.exports=function(t,e){for(var n,i=o(t),u=r(i),f=u.length,a=0;f>a;)if(i[n=u[a++]]===e)return n}},function(t,e,n){var r=n(9),o=n(22),i=n(15);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var u,f=n(t),a=i.f,c=0;f.length>c;)a.call(t,u=f[c++])&&e.push(u);return e}},function(t,e,n){var r=n(32);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(4),o=n(37).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],f=function(t){try{return o(t)}catch(t){return u.slice()}};t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?f(t):o(r(t))}},function(t,e,n){var r=n(15),o=n(13),i=n(4),u=n(16),f=n(3),a=n(28),c=Object.getOwnPropertyDescriptor;e.f=n(2)?c:function(t,e){if(t=i(t),e=u(e,!0),a)try{return c(t,e)}catch(t){}if(f(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e){},function(t,e,n){n(27)("asyncIterator")},function(t,e,n){n(27)("observable")}]);
!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=38)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(11),o=n(28),i=n(16),u=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(31),o=n(17);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(1),o=n(13);t.exports=n(2)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(20)("wks"),o=n(14),i=n(0).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.5.0"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(30),o=n(21);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(0),o=n(7),i=n(43),u=n(5),a=function(t,e,n){var f,c,s,l=t&a.F,p=t&a.G,v=t&a.S,y=t&a.P,h=t&a.B,d=t&a.W,m=p?o:o[e]||(o[e]={}),g=m.prototype,b=p?r:v?r[e]:(r[e]||{}).prototype;p&&(n=e);for(f in n)(c=!l&&b&&void 0!==b[f])&&f in m||(s=c?b[f]:n[f],m[f]=p&&"function"!=typeof b[f]?n[f]:h&&c?i(s,r):d&&b[f]==s?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(s):y&&"function"==typeof s?i(Function.call,s):s,y&&((m.virtual||(m.virtual={}))[f]=s,t&a.R&&g&&!g[f]&&u(g,f,s)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var r=n(12);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(12);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(20)("keys"),o=n(14);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){t.exports=!0},function(t,e){t.exports={}},function(t,e,n){var r=n(1).f,o=n(3),i=n(6)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){e.f=n(6)},function(t,e,n){var r=n(0),o=n(7),i=n(23),u=n(26),a=n(1).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:u.f(t)})}},function(t,e,n){t.exports=!n(2)&&!n(8)(function(){return 7!=Object.defineProperty(n(29)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(12),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(3),o=n(4),i=n(46)(!1),u=n(19)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),f=0,c=[];for(n in a)n!=u&&r(a,n)&&c.push(n);for(;e.length>f;)r(a,n=e[f++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){var r=n(32);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(17);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(23),o=n(10),i=n(35),u=n(5),a=n(3),f=n(24),c=n(59),s=n(25),l=n(62),p=n(6)("iterator"),v=!([].keys&&"next"in[].keys()),y=function(){return this};t.exports=function(t,e,n,h,d,m,g){c(n,e,h);var b,x,w,_=function(t){if(!v&&t in j)return j[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",E="values"==d,O=!1,j=t.prototype,P=j[p]||j["@@iterator"]||d&&j[d],M=P||_(d),k=d?E?_("entries"):M:void 0,L="Array"==e?j.entries||P:P;if(L&&(w=l(L.call(new t)))!==Object.prototype&&w.next&&(s(w,S,!0),r||a(w,p)||u(w,p,y)),E&&P&&"values"!==P.name&&(O=!0,M=function(){return P.call(this)}),r&&!g||!v&&!O&&j[p]||u(j,p,M),f[e]=M,f[S]=y,d)if(b={values:E?M:_("values"),keys:m?M:_("keys"),entries:k},g)for(x in b)x in j||i(j,x,b[x]);else o(o.P+o.F*(v||O),e,b);return b}},function(t,e,n){t.exports=n(5)},function(t,e,n){var r=n(11),o=n(60),i=n(21),u=n(19)("IE_PROTO"),a=function(){},f=function(){var t,e=n(29)("iframe"),r=i.length;for(e.style.display="none",n(61).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;r--;)delete f.prototype[i[r]];return f()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[u]=t):n=f(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(30),o=n(21).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(39));"undefined"!=typeof window&&(window.Parallax=r.default),e.default=r.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(40)),i=r(n(49)),u=r(n(50)),a=r(n(54)),f=document.addEventListener?function(t,e,n){if(t.length)for(var r=0;r<t.length;r++)f(t[r],e,n);else t.addEventListener(e,n,!1)}:function(t,e,n){if(t.length)for(var r=0;r<t.length;r++)f(t[r],e,n);else t.attachEvent("on"+e,function(){return n.call(t,window.event)})},c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},s=function(t,e){if("object"===(void 0===t?"undefined":(0,a.default)(t)))return t;try{var n=document.querySelectorAll(t);return e?n[0]:n}catch(t){throw new Error(t)}},l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3/60,n=void 0,r=void 0;return function(){var o=this,i=arguments,u=Date.now();n&&u<n+e?(clearTimeout(r),r=setTimeout(function(){n=u,t.apply(o,i)},e)):(n=u,t.apply(this,arguments))}},p=function(t){if(!t)return!1;if(t.length&&0===t.length)return!1;switch(t){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!0}},v=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(this,t),this._config=(0,o.default)({xRange:20,yRange:20,listenElement:window,animate:!1,invert:!1,enterCallback:function(){},leaveCallback:function(){}},n),this.element=s(e),this.animateElements=[],this.animateElementsQueue,this.isMobile=Boolean(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)),this.isEnter=!1,this.add(),this._init(),this._resize(),this._start()}return(0,u.default)(t,[{key:"_init",value:function(){var t=this;this.animateElementsQueue=this.animateElements.map(function(e,n){t._clearStyle(e.element);var r=e.config,o=r.xRange,i=r.yRange,u=r.isInvert,a=r.isAnimate,f=r.maxXrange,c=r.maxYrange,l=e.element.offsetLeft,p=e.element.offsetTop,v=s(e.config.listenElement,!0),y=v.innerWidth?v.innerWidth:v.clientWidth,h=v.innerHeight?v.innerHeight:v.clientHeight;return t.isMobile&&t._config.animate&&(e.element.style.transition="top,left 0.05s linear"),{element:e.element,xRange:o,yRange:i,offsetLeft:l,offsetTop:p,listenElement:v,listenElementWidth:y,listenElementHeight:h,isInvert:u,isAnimate:a,maxXrange:f,maxYrange:c}})}},{key:"_start",value:function(){var t=this;{if(!(this.isMobile&&"ondevicemotion"in window)){var e=s(this._config.listenElement,!0);return f(e,"mousemove",function(e){c(function(){t.isEnter||(t.isEnter=!0,t._config.enterCallback()),t.animateElementsQueue.forEach(function(t){var n=e.pageY/t.listenElementHeight*t.yRange,r=e.pageX/t.listenElementWidth*t.xRange;t.isInvert&&(n=-n,r=-r),t.element.style.top!==n&&(t.element.style.top=n+t.offsetTop+"px"),t.element.style.left!==r&&(t.element.style.left=r+t.offsetLeft+"px")})})}),f(e,"mouseleave",function(e){t.isEnter&&(t.isEnter=!1,t._config.leaveCallback())}),this}f(window,"devicemotion",function(e){c(function(){var n=e.accelerationIncludingGravity,r=n.x,o=n.y;try{r=parseFloat(r.toFixed(4)),o=parseFloat(o.toFixed(4))}catch(t){return void console.warn("你需要使用真实的移动设备来测试,并且需要有陀螺仪功能.")}0!==r&&0!==o&&t.animateElementsQueue.forEach(function(t){var e=o/9.78049*t.yRange,n=-r/9.78049*t.xRange;t.isInvert&&(e=-e,n=-n),t.element.style.top!==e&&(t.element.style.top=e+t.offsetTop+"px"),t.element.style.left!==n&&(t.element.style.left=n+t.offsetLeft+"px")})})})}}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=(0,o.default)({},this._config,e);var n=s(t);if(n&&0!==n.length){if(n.length)for(var r=0;r<n.length;r++)this.animateElements.push({element:n[r],config:(0,o.default)({},e,this._getDomConfigData(n[r],e))});else this.animateElements.push({element:n,config:(0,o.default)({},e,this._getDomConfigData(n,e))});return this}console.warn("Element not found!\n未找到元素!")}},{key:"remove",value:function(t){var e=s(t);{if(e&&0!==e.length){for(var n=0;n<e.length;n++)for(var r=0;r<this.animateElements.length;r++)(e[n]===this.animateElements[r].element||e[n].isEqualNode(this.animateElements[r].element))&&(this.animateElements[r].isRemove=!0);return this.animateElements=this.animateElements.filter(function(t){return!t.isRemove}),this}console.warn("Element not found!\n未找到需要删除的元素.")}}},{key:"refresh",value:function(){return this._init(),this}},{key:"_resize",value:function(){var t=this;f(window,"resize",l(function(){t.refresh()},200))}},{key:"_clearStyle",value:function(t){var e=t.getAttribute("style");e&&(e=e.split(";").filter(function(t){var e=t.trim();return"top"!==e.slice(0,3)&&"left"!==e.slice(0,4)}),t.setAttribute("style",e.join(";")))}},{key:"_getDomConfigData",value:function(t,e){var n={};return t.dataset&&(0===parseInt(t.dataset.xrange,0)?n.xRange=0:n.xRange=parseInt(t.dataset.xrange,0)||e.xRange,0===parseInt(t.dataset.yrange,0)?n.yRange=0:n.yRange=parseInt(t.dataset.yrange,0)||e.yRange,n.isInvert=p(t.dataset.invert),n.isAnimate=p(t.dataset.animate)),n}}]),t}();e.default=v},function(t,e,n){t.exports={default:n(41),__esModule:!0}},function(t,e,n){n(42),t.exports=n(7).Object.assign},function(t,e,n){var r=n(10);r(r.S+r.F,"Object",{assign:n(45)})},function(t,e,n){var r=n(44);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(9),o=n(22),i=n(15),u=n(33),a=n(31),f=Object.assign;t.exports=!f||n(8)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=f({},t)[n]||Object.keys(f({},e)).join("")!=r})?function(t,e){for(var n=u(t),f=arguments.length,c=1,s=o.f,l=i.f;f>c;)for(var p,v=a(arguments[c++]),y=s?r(v).concat(s(v)):r(v),h=y.length,d=0;h>d;)l.call(v,p=y[d++])&&(n[p]=v[p]);return n}:f},function(t,e,n){var r=n(4),o=n(47),i=n(48);t.exports=function(t){return function(e,n,u){var a,f=r(e),c=o(f.length),s=i(u,c);if(t&&n!=n){for(;c>s;)if((a=f[s++])!=a)return!0}else for(;c>s;s++)if((t||s in f)&&f[s]===n)return t||s||0;return!t&&-1}}},function(t,e,n){var r=n(18),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(18),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(51));e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,r.default)(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e,n){t.exports={default:n(52),__esModule:!0}},function(t,e,n){n(53);var r=n(7).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(10);r(r.S+r.F*!n(2),"Object",{defineProperty:n(1).f})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=r(n(55)),i=r(n(67)),u="function"==typeof i.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":typeof t};e.default="function"==typeof i.default&&"symbol"===u(o.default)?function(t){return void 0===t?"undefined":u(t)}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":void 0===t?"undefined":u(t)}},function(t,e,n){t.exports={default:n(56),__esModule:!0}},function(t,e,n){n(57),n(63),t.exports=n(26).f("iterator")},function(t,e,n){"use strict";var r=n(58)(!0);n(34)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var r=n(18),o=n(17);t.exports=function(t){return function(e,n){var i,u,a=String(o(e)),f=r(n),c=a.length;return f<0||f>=c?t?"":void 0:(i=a.charCodeAt(f))<55296||i>56319||f+1===c||(u=a.charCodeAt(f+1))<56320||u>57343?t?a.charAt(f):i:t?a.slice(f,f+2):u-56320+(i-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(36),o=n(13),i=n(25),u={};n(5)(u,n(6)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(1),o=n(11),i=n(9);t.exports=n(2)?Object.defineProperties:function(t,e){o(t);for(var n,u=i(e),a=u.length,f=0;a>f;)r.f(t,n=u[f++],e[n]);return t}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(3),o=n(33),i=n(19)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){n(64);for(var r=n(0),o=n(5),i=n(24),u=n(6)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;f<a.length;f++){var c=a[f],s=r[c],l=s&&s.prototype;l&&!l[u]&&o(l,u,c),i[c]=i.Array}},function(t,e,n){"use strict";var r=n(65),o=n(66),i=n(24),u=n(4);t.exports=n(34)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(68),__esModule:!0}},function(t,e,n){n(69),n(76),n(77),n(78),t.exports=n(7).Symbol},function(t,e,n){"use strict";var r=n(0),o=n(3),i=n(2),u=n(10),a=n(35),f=n(70).KEY,c=n(8),s=n(20),l=n(25),p=n(14),v=n(6),y=n(26),h=n(27),d=n(71),m=n(72),g=n(73),b=n(11),x=n(4),w=n(16),_=n(13),S=n(36),E=n(74),O=n(75),j=n(1),P=n(9),M=O.f,k=j.f,L=E.f,T=r.Symbol,R=r.JSON,A=R&&R.stringify,F=v("_hidden"),I=v("toPrimitive"),C={}.propertyIsEnumerable,N=s("symbol-registry"),D=s("symbols"),W=s("op-symbols"),G=Object.prototype,q="function"==typeof T,H=r.QObject,V=!H||!H.prototype||!H.prototype.findChild,z=i&&c(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=M(G,e);r&&delete G[e],k(t,e,n),r&&t!==G&&k(G,e,r)}:k,Q=function(t){var e=D[t]=S(T.prototype);return e._k=t,e},Y=q&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},B=function(t,e,n){return t===G&&B(W,e,n),b(t),e=w(e,!0),b(n),o(D,e)?(n.enumerable?(o(t,F)&&t[F][e]&&(t[F][e]=!1),n=S(n,{enumerable:_(0,!1)})):(o(t,F)||k(t,F,_(1,{})),t[F][e]=!0),z(t,e,n)):k(t,e,n)},J=function(t,e){b(t);for(var n,r=m(e=x(e)),o=0,i=r.length;i>o;)B(t,n=r[o++],e[n]);return t},K=function(t){var e=C.call(this,t=w(t,!0));return!(this===G&&o(D,t)&&!o(W,t))&&(!(e||!o(this,t)||!o(D,t)||o(this,F)&&this[F][t])||e)},X=function(t,e){if(t=x(t),e=w(e,!0),t!==G||!o(D,e)||o(W,e)){var n=M(t,e);return!n||!o(D,e)||o(t,F)&&t[F][e]||(n.enumerable=!0),n}},U=function(t){for(var e,n=L(x(t)),r=[],i=0;n.length>i;)o(D,e=n[i++])||e==F||e==f||r.push(e);return r},Z=function(t){for(var e,n=t===G,r=L(n?W:x(t)),i=[],u=0;r.length>u;)!o(D,e=r[u++])||n&&!o(G,e)||i.push(D[e]);return i};q||(a((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===G&&e.call(W,n),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),z(this,t,_(1,n))};return i&&V&&z(G,t,{configurable:!0,set:e}),Q(t)}).prototype,"toString",function(){return this._k}),O.f=X,j.f=B,n(37).f=E.f=U,n(15).f=K,n(22).f=Z,i&&!n(23)&&a(G,"propertyIsEnumerable",K,!0),y.f=function(t){return Q(v(t))}),u(u.G+u.W+u.F*!q,{Symbol:T});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)v($[tt++]);for(var et=P(v.store),nt=0;et.length>nt;)h(et[nt++]);u(u.S+u.F*!q,"Symbol",{for:function(t){return o(N,t+="")?N[t]:N[t]=T(t)},keyFor:function(t){if(Y(t))return d(N,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){V=!0},useSimple:function(){V=!1}}),u(u.S+u.F*!q,"Object",{create:function(t,e){return void 0===e?S(t):J(S(t),e)},defineProperty:B,defineProperties:J,getOwnPropertyDescriptor:X,getOwnPropertyNames:U,getOwnPropertySymbols:Z}),R&&u(u.S+u.F*(!q||c(function(){var t=T();return"[null]"!=A([t])||"{}"!=A({a:t})||"{}"!=A(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!Y(t)){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);return"function"==typeof(e=r[1])&&(n=e),!n&&g(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,A.apply(R,r)}}}),T.prototype[I]||n(5)(T.prototype,I,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(14)("meta"),o=n(12),i=n(3),u=n(1).f,a=0,f=Object.isExtensible||function(){return!0},c=!n(8)(function(){return f(Object.preventExtensions({}))}),s=function(t){u(t,r,{value:{i:"O"+ ++a,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!f(t))return"F";if(!e)return"E";s(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!f(t))return!0;if(!e)return!1;s(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&f(t)&&!i(t,r)&&s(t),t}}},function(t,e,n){var r=n(9),o=n(4);t.exports=function(t,e){for(var n,i=o(t),u=r(i),a=u.length,f=0;a>f;)if(i[n=u[f++]]===e)return n}},function(t,e,n){var r=n(9),o=n(22),i=n(15);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var u,a=n(t),f=i.f,c=0;a.length>c;)f.call(t,u=a[c++])&&e.push(u);return e}},function(t,e,n){var r=n(32);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(4),o=n(37).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return o(t)}catch(t){return u.slice()}};t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?a(t):o(r(t))}},function(t,e,n){var r=n(15),o=n(13),i=n(4),u=n(16),a=n(3),f=n(28),c=Object.getOwnPropertyDescriptor;e.f=n(2)?c:function(t,e){if(t=i(t),e=u(e,!0),f)try{return c(t,e)}catch(t){}if(a(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e){},function(t,e,n){n(27)("asyncIterator")},function(t,e,n){n(27)("observable")}]);
{
"name": "motion-parallax",
"version": "1.2.0",
"version": "1.2.1",
"description": "Focus on interaction, rather than just rolling parallax",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -104,27 +104,2 @@ /** 兼容ie */

/** 获取dom上的配置数据 */
const getDomConfigData = function(ele) {
let xRange, yRange;
if (ele.element.dataset) {
if (parseInt(ele.element.dataset.xrange, 0) === 0) {
xRange = 0;
} else {
xRange = parseInt(ele.element.dataset.xrange, 0) || ele.config.xRange;
}
if (parseInt(ele.element.dataset.yrange, 0) === 0) {
yRange = 0;
} else {
yRange = parseInt(ele.element.dataset.yrange, 0) || ele.config.yRange;
}
} else {
xRange = ele.config.xRange;
yRange = ele.config.yRange;
}
return {
xRange,
yRange
}
}
/** 导出 */

@@ -144,3 +119,3 @@ export default class Parallax {

this.animateElements = [];
this.animateElementsConfig; // 需要进行动画的所有dom有关的细节
this.animateElementsQueue; // 需要进行动画的所有dom有关的细节
this.isMobile = Boolean(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i));

@@ -150,3 +125,3 @@ this.isEnter = false; // 是否进入tag

this.add(); // add all element to this.animateElements
this._init(); // this.animateElementsConfig
this._init(); // this.animateElementsQueue
this._resize();

@@ -158,6 +133,12 @@ this._start();

_init() {
this.animateElementsConfig = this.animateElements.map((ele, index) => {
this.animateElementsQueue = this.animateElements.map((ele, index) => {
this._clearStyle(ele.element); // 清除之前的top,left样式
const
{ xRange, yRange } = getDomConfigData(ele),
{ xRange,
yRange,
isInvert,
isAnimate,
maxXrange,
maxYrange
} = ele.config,
offsetLeft = ele.element.offsetLeft, // 左边的距离

@@ -167,4 +148,3 @@ offsetTop = ele.element.offsetTop, // 上边的距离

listenElementWidth = listenElement.innerWidth ? listenElement.innerWidth : listenElement.clientWidth, // 监听的元素的宽度
listenElementHeight = listenElement.innerHeight ? listenElement.innerHeight : listenElement.clientHeight, // 监听的元素的高度
isInvert = ele.element.dataset ? parseData(ele.element.dataset.invert) || ele.config.invert : ele.config.invert; // 默认优先dom上的参数;
listenElementHeight = listenElement.innerHeight ? listenElement.innerHeight : listenElement.clientHeight; // 监听的元素的高度

@@ -180,10 +160,13 @@ if (this.isMobile && this._config.animate) {

element: ele.element,
xRange: xRange,
yRange: yRange,
offsetLeft: offsetLeft,
offsetTop: offsetTop,
listenElement: listenElement,
listenElementWidth: listenElementWidth,
listenElementHeight: listenElementHeight,
isInvert: isInvert
xRange,
yRange,
offsetLeft,
offsetTop,
listenElement,
listenElementWidth,
listenElementHeight,
isInvert,
isAnimate,
maxXrange,
maxYrange
}

@@ -209,3 +192,3 @@ });

this.animateElementsConfig.forEach(item => {
this.animateElementsQueue.forEach(item => {
let top = (y / 9.78049) * item.yRange,

@@ -235,3 +218,3 @@ left = (-x / 9.78049) * item.xRange;

}
this.animateElementsConfig.forEach(item => {
this.animateElementsQueue.forEach(item => {
let top = (e.pageY / item.listenElementHeight) * item.yRange,

@@ -273,3 +256,3 @@ left = (e.pageX / item.listenElementWidth) * item.xRange;

element: element[i],
config: config
config: Object.assign({}, config, this._getDomConfigData(element[i], config))
});

@@ -280,3 +263,3 @@ }

element: element,
config: config
config: Object.assign({}, config, this._getDomConfigData(element, config))
});

@@ -333,2 +316,23 @@ }

}
/** 获取dom上的配置数据 */
_getDomConfigData(ele, config) {
let data = {};
if (ele.dataset) {
if (parseInt(ele.dataset.xrange, 0) === 0) {
data.xRange = 0;
} else {
data.xRange = parseInt(ele.dataset.xrange, 0) || config.xRange;
}
if (parseInt(ele.dataset.yrange, 0) === 0) {
data.yRange = 0;
} else {
data.yRange = parseInt(ele.dataset.yrange, 0) || config.yRange;
}
data.isInvert = parseData(ele.dataset.invert);
data.isAnimate = parseData(ele.dataset.animate);
}
return data;
}
}