Socket
Socket
Sign inDemoInstall

vue-mouse-parallax

Package Overview
Dependencies
11
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

5

dist/vue-mouse-parallax.common.js

@@ -987,2 +987,3 @@ module.exports =

var context = this;
var newDelay = this.animationDuration > 1000 ? delay : this.animationDuration / 10;
var now = +new Date(); // eslint-disable-next-line prefer-rest-params

@@ -992,3 +993,3 @@

if (last && now < last + delay) {
if (last && now < last + newDelay) {
clearTimeout(timer);

@@ -998,3 +999,3 @@ timer = setTimeout(function () {

callback.apply(context, args);
}, delay);
}, newDelay);
} else {

@@ -1001,0 +1002,0 @@ last = now;

@@ -996,2 +996,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var context = this;
var newDelay = this.animationDuration > 1000 ? delay : this.animationDuration / 10;
var now = +new Date(); // eslint-disable-next-line prefer-rest-params

@@ -1001,3 +1002,3 @@

if (last && now < last + delay) {
if (last && now < last + newDelay) {
clearTimeout(timer);

@@ -1007,3 +1008,3 @@ timer = setTimeout(function () {

callback.apply(context, args);
}, delay);
}, newDelay);
} else {

@@ -1010,0 +1011,0 @@ last = now;

2

dist/vue-mouse-parallax.umd.min.js

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

(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-mouse-parallax"]=e():t["vue-mouse-parallax"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fae3")}({"0d58":function(t,e,n){var r=n("ce10"),o=n("e11e");t.exports=Object.keys||function(t){return r(t,o)}},"11e9":function(t,e,n){var r=n("52a7"),o=n("4630"),i=n("6821"),a=n("6a99"),c=n("69a8"),u=n("c69a"),f=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?f:function(t,e){if(t=i(t),e=a(e,!0),u)try{return f(t,e)}catch(n){}if(c(t,e))return o(!r.f.call(t,e),t[e])}},1495:function(t,e,n){var r=n("86cc"),o=n("cb7c"),i=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){o(t);var n,a=i(e),c=a.length,u=0;while(c>u)r.f(t,n=a[u++],e[n]);return t}},"230e":function(t,e,n){var r=n("d3f4"),o=n("7726").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"2aba":function(t,e,n){var r=n("7726"),o=n("32e9"),i=n("69a8"),a=n("ca5a")("src"),c=n("fa5b"),u="toString",f=(""+c).split(u);n("8378").inspectSource=function(t){return c.call(t)},(t.exports=function(t,e,n,c){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(u&&(i(n,a)||o(n,a,t[e]?""+t[e]:f.join(String(e)))),t===r?t[e]=n:c?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[a]||c.call(this)}))},"2aeb":function(t,e,n){var r=n("cb7c"),o=n("1495"),i=n("e11e"),a=n("613b")("IE_PROTO"),c=function(){},u="prototype",f=function(){var t,e=n("230e")("iframe"),r=i.length,o="<",a=">";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+a+"document.F=Object"+o+"/script"+a),t.close(),f=t.F;while(r--)delete f[u][i[r]];return f()};t.exports=Object.create||function(t,e){var n;return null!==t?(c[u]=r(t),n=new c,c[u]=null,n[a]=t):n=f(),void 0===e?n:o(n,e)}},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"32e9":function(t,e,n){var r=n("86cc"),o=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},4588:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"52a7":function(t,e){e.f={}.propertyIsEnumerable},5537:function(t,e,n){var r=n("8378"),o=n("7726"),i="__core-js_shared__",a=o[i]||(o[i]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"5ca1":function(t,e,n){var r=n("7726"),o=n("8378"),i=n("32e9"),a=n("2aba"),c=n("9b43"),u="prototype",f=function(t,e,n){var s,p,l,d,v=t&f.F,h=t&f.G,y=t&f.S,m=t&f.P,g=t&f.B,b=h?r:y?r[e]||(r[e]={}):(r[e]||{})[u],x=h?o:o[e]||(o[e]={}),_=x[u]||(x[u]={});for(s in h&&(n=e),n)p=!v&&b&&void 0!==b[s],l=(p?b:n)[s],d=g&&p?c(l,r):m&&"function"==typeof l?c(Function.call,l):l,b&&a(b,s,l,t&f.U),x[s]!=l&&i(x,s,d),m&&_[s]!=l&&(_[s]=l)};r.core=o,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},"5dbc":function(t,e,n){var r=n("d3f4"),o=n("8b97").set;t.exports=function(t,e,n){var i,a=e.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(t,i),t}},"613b":function(t,e,n){var r=n("5537")("keys"),o=n("ca5a");t.exports=function(t){return r[t]||(r[t]=o(t))}},"626a":function(t,e,n){var r=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},6821:function(t,e,n){var r=n("626a"),o=n("be13");t.exports=function(t){return r(o(t))}},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"6a99":function(t,e,n){var r=n("d3f4");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")}},7726: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)},"77f1":function(t,e,n){var r=n("4588"),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},8378:function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},"86cc":function(t,e,n){var r=n("cb7c"),o=n("c69a"),i=n("6a99"),a=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(c){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"8b97":function(t,e,n){var r=n("d3f4"),o=n("cb7c"),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n("9b43")(Function.call,n("11e9").f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(o){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},9093:function(t,e,n){var r=n("ce10"),o=n("e11e").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},"9b43":function(t,e,n){var r=n("d8e8");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)}}},"9def":function(t,e,n){var r=n("4588"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},aa77:function(t,e,n){var r=n("5ca1"),o=n("be13"),i=n("79e5"),a=n("fdef"),c="["+a+"]",u="​…",f=RegExp("^"+c+c+"*"),s=RegExp(c+c+"*$"),p=function(t,e,n){var o={},c=i((function(){return!!a[t]()||u[t]()!=u})),f=o[t]=c?e(l):a[t];n&&(o[n]=f),r(r.P+r.F*c,"String",o)},l=p.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(f,"")),2&e&&(t=t.replace(s,"")),t};t.exports=p},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},c366:function(t,e,n){var r=n("6821"),o=n("9def"),i=n("77f1");t.exports=function(t){return function(e,n,a){var c,u=r(e),f=o(u.length),s=i(a,f);if(t&&n!=n){while(f>s)if(c=u[s++],c!=c)return!0}else for(;f>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}}},c5f6:function(t,e,n){"use strict";var r=n("7726"),o=n("69a8"),i=n("2d95"),a=n("5dbc"),c=n("6a99"),u=n("79e5"),f=n("9093").f,s=n("11e9").f,p=n("86cc").f,l=n("aa77").trim,d="Number",v=r[d],h=v,y=v.prototype,m=i(n("2aeb")(y))==d,g="trim"in String.prototype,b=function(t){var e=c(t,!1);if("string"==typeof e&&e.length>2){e=g?e.trim():l(e,3);var n,r,o,i=e.charCodeAt(0);if(43===i||45===i){if(n=e.charCodeAt(2),88===n||120===n)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+e}for(var a,u=e.slice(2),f=0,s=u.length;f<s;f++)if(a=u.charCodeAt(f),a<48||a>o)return NaN;return parseInt(u,r)}}return+e};if(!v(" 0o1")||!v("0b1")||v("+0x1")){v=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof v&&(m?u((function(){y.valueOf.call(n)})):i(n)!=d)?a(new h(b(e)),n,v):b(e)};for(var x,_=n("9e1e")?f(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;_.length>S;S++)o(h,x=_[S])&&!o(v,x)&&p(v,x,s(h,x));v.prototype=y,y.constructor=v,n("2aba")(r,d,v)}},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")((function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a}))},ca5a:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},ce10:function(t,e,n){var r=n("69a8"),o=n("6821"),i=n("c366")(!1),a=n("613b")("IE_PROTO");t.exports=function(t,e){var n,c=o(t),u=0,f=[];for(n in c)n!=a&&r(c,n)&&f.push(n);while(e.length>u)r(c,n=e[u++])&&(~i(f,n)||f.push(n));return f}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(r){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},fa5b:function(t,e,n){t.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,n){var r=n("7726").document;t.exports=r&&r.documentElement},fae3:function(t,e,n){"use strict";var r;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",style:{perspective:t.perspective+"px"},on:{mousemove:t.getMousePosition,mouseleave:t.parallaxStop,mouseenter:t.parallaxStart}},[t._t("default")],2)},i=[];n("c5f6");function a(t,e){var n,r;return function(){var o=this,i=+new Date,a=arguments;n&&i<n+e?(clearTimeout(r),r=setTimeout((function(){n=i,t.apply(o,a)}),e)):(n=i,t.apply(o,a))}}var c={name:"ParallaxContainer",data:function(){return{mousePosition:{x:0,y:0},isHovering:!1,didEnter:!1}},props:{animationDuration:{type:Number,default:1e3},easing:{type:String,default:"cubic-bezier(0.23, 1, 0.32, 1)"},tag:{type:String,default:"div"},perspective:{type:Number,default:1e3}},methods:{getRelativePosition:function(){var t=this.$el.getBoundingClientRect();return{top:t.top,left:t.left}},getMousePosition:a((function(t){this.mousePosition.x=t.clientX,this.mousePosition.y=t.clientY}),100),parallaxStart:function(){var t=this;this.isHovering=!0,this.didEnter=!1,setTimeout((function(){t.didEnter=!0}),1e3)},parallaxStop:function(){this.isHovering=!1,this.didEnter=!1}}},u=c;function f(t,e,n,r,o,i,a,c){var u,f="function"===typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},f._ssrRegister=u):o&&(u=c?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(f.functional){f._injectStyles=u;var s=f.render;f.render=function(t,e){return u.call(e),s(t,e)}}else{var p=f.beforeCreate;f.beforeCreate=p?[].concat(p,u):[u]}return{exports:t,options:f}}var s=f(u,o,i,!1,null,null,null),p=s.exports,l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",style:Object.assign({},t.transform,t.transformParameters)},[t._t("default")],2)},d=[],v={name:"ParallaxElement",props:{parallaxStrength:{type:Number,default:10},type:{type:String,default:"translation"},tag:{type:String,default:"div"}},computed:{parent:function(){return this.$parent},isHovering:function(){return this.parent.isHovering},mousePosition:function(){return this.parent.mousePosition},transform:function(){if(this.parent.isHovering){var t,e=this.$el?this.parent.$el.getBoundingClientRect():{top:0,left:0},n="depth"===this.type?Math.abs(this.parallaxStrength):this.parallaxStrength,r=this.mousePosition.x-e.left,o=this.mousePosition.y-e.top,i=(r-e.width/2)/(e.width/2)*n,a=(o-e.height/2)/(e.height/2)*n;if("translation"===this.type)t="translateX(".concat(-i,"px) translateY(").concat(-a,"px)");else if("rotation"===this.type){var c=i+a;t="rotateZ(".concat(c,"deg)")}else"depth"===this.type&&(t="rotateX(".concat(-a,"deg) rotateY(").concat(i,"deg) translateZ(").concat(2*this.parallaxStrength,"px) "));return{transform:t}}},transformParameters:function(){return{transitionProperty:"transform",transitionDuration:this.transitionDuration,transformOrigin:"center",transitionTimingFunction:this.transitionTimingFunction}},transitionDuration:function(){var t=this.parent.animationDuration,e=t>400?t:400,n=this.parent.didEnter?t:e;return"".concat(n,"ms")},transitionTimingFunction:function(){return this.parent.easing}}},h=v,y=f(h,l,d,!1,null,null,null),m=y.exports;n.d(e,"ParallaxContainer",(function(){return p})),n.d(e,"ParallaxElement",(function(){return m}))},fdef:function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"}})}));
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-mouse-parallax"]=e():t["vue-mouse-parallax"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fae3")}({"0d58":function(t,e,n){var r=n("ce10"),o=n("e11e");t.exports=Object.keys||function(t){return r(t,o)}},"11e9":function(t,e,n){var r=n("52a7"),o=n("4630"),i=n("6821"),a=n("6a99"),c=n("69a8"),u=n("c69a"),f=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?f:function(t,e){if(t=i(t),e=a(e,!0),u)try{return f(t,e)}catch(n){}if(c(t,e))return o(!r.f.call(t,e),t[e])}},1495:function(t,e,n){var r=n("86cc"),o=n("cb7c"),i=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){o(t);var n,a=i(e),c=a.length,u=0;while(c>u)r.f(t,n=a[u++],e[n]);return t}},"230e":function(t,e,n){var r=n("d3f4"),o=n("7726").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"2aba":function(t,e,n){var r=n("7726"),o=n("32e9"),i=n("69a8"),a=n("ca5a")("src"),c=n("fa5b"),u="toString",f=(""+c).split(u);n("8378").inspectSource=function(t){return c.call(t)},(t.exports=function(t,e,n,c){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(u&&(i(n,a)||o(n,a,t[e]?""+t[e]:f.join(String(e)))),t===r?t[e]=n:c?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[a]||c.call(this)}))},"2aeb":function(t,e,n){var r=n("cb7c"),o=n("1495"),i=n("e11e"),a=n("613b")("IE_PROTO"),c=function(){},u="prototype",f=function(){var t,e=n("230e")("iframe"),r=i.length,o="<",a=">";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+a+"document.F=Object"+o+"/script"+a),t.close(),f=t.F;while(r--)delete f[u][i[r]];return f()};t.exports=Object.create||function(t,e){var n;return null!==t?(c[u]=r(t),n=new c,c[u]=null,n[a]=t):n=f(),void 0===e?n:o(n,e)}},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"32e9":function(t,e,n){var r=n("86cc"),o=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},4588:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"52a7":function(t,e){e.f={}.propertyIsEnumerable},5537:function(t,e,n){var r=n("8378"),o=n("7726"),i="__core-js_shared__",a=o[i]||(o[i]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"5ca1":function(t,e,n){var r=n("7726"),o=n("8378"),i=n("32e9"),a=n("2aba"),c=n("9b43"),u="prototype",f=function(t,e,n){var s,p,l,d,v=t&f.F,h=t&f.G,y=t&f.S,m=t&f.P,g=t&f.B,b=h?r:y?r[e]||(r[e]={}):(r[e]||{})[u],x=h?o:o[e]||(o[e]={}),_=x[u]||(x[u]={});for(s in h&&(n=e),n)p=!v&&b&&void 0!==b[s],l=(p?b:n)[s],d=g&&p?c(l,r):m&&"function"==typeof l?c(Function.call,l):l,b&&a(b,s,l,t&f.U),x[s]!=l&&i(x,s,d),m&&_[s]!=l&&(_[s]=l)};r.core=o,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},"5dbc":function(t,e,n){var r=n("d3f4"),o=n("8b97").set;t.exports=function(t,e,n){var i,a=e.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(t,i),t}},"613b":function(t,e,n){var r=n("5537")("keys"),o=n("ca5a");t.exports=function(t){return r[t]||(r[t]=o(t))}},"626a":function(t,e,n){var r=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},6821:function(t,e,n){var r=n("626a"),o=n("be13");t.exports=function(t){return r(o(t))}},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"6a99":function(t,e,n){var r=n("d3f4");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")}},7726: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)},"77f1":function(t,e,n){var r=n("4588"),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},8378:function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},"86cc":function(t,e,n){var r=n("cb7c"),o=n("c69a"),i=n("6a99"),a=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(c){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"8b97":function(t,e,n){var r=n("d3f4"),o=n("cb7c"),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n("9b43")(Function.call,n("11e9").f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(o){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},9093:function(t,e,n){var r=n("ce10"),o=n("e11e").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},"9b43":function(t,e,n){var r=n("d8e8");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)}}},"9def":function(t,e,n){var r=n("4588"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},aa77:function(t,e,n){var r=n("5ca1"),o=n("be13"),i=n("79e5"),a=n("fdef"),c="["+a+"]",u="​…",f=RegExp("^"+c+c+"*"),s=RegExp(c+c+"*$"),p=function(t,e,n){var o={},c=i((function(){return!!a[t]()||u[t]()!=u})),f=o[t]=c?e(l):a[t];n&&(o[n]=f),r(r.P+r.F*c,"String",o)},l=p.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(f,"")),2&e&&(t=t.replace(s,"")),t};t.exports=p},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},c366:function(t,e,n){var r=n("6821"),o=n("9def"),i=n("77f1");t.exports=function(t){return function(e,n,a){var c,u=r(e),f=o(u.length),s=i(a,f);if(t&&n!=n){while(f>s)if(c=u[s++],c!=c)return!0}else for(;f>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}}},c5f6:function(t,e,n){"use strict";var r=n("7726"),o=n("69a8"),i=n("2d95"),a=n("5dbc"),c=n("6a99"),u=n("79e5"),f=n("9093").f,s=n("11e9").f,p=n("86cc").f,l=n("aa77").trim,d="Number",v=r[d],h=v,y=v.prototype,m=i(n("2aeb")(y))==d,g="trim"in String.prototype,b=function(t){var e=c(t,!1);if("string"==typeof e&&e.length>2){e=g?e.trim():l(e,3);var n,r,o,i=e.charCodeAt(0);if(43===i||45===i){if(n=e.charCodeAt(2),88===n||120===n)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+e}for(var a,u=e.slice(2),f=0,s=u.length;f<s;f++)if(a=u.charCodeAt(f),a<48||a>o)return NaN;return parseInt(u,r)}}return+e};if(!v(" 0o1")||!v("0b1")||v("+0x1")){v=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof v&&(m?u((function(){y.valueOf.call(n)})):i(n)!=d)?a(new h(b(e)),n,v):b(e)};for(var x,_=n("9e1e")?f(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;_.length>S;S++)o(h,x=_[S])&&!o(v,x)&&p(v,x,s(h,x));v.prototype=y,y.constructor=v,n("2aba")(r,d,v)}},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")((function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a}))},ca5a:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},ce10:function(t,e,n){var r=n("69a8"),o=n("6821"),i=n("c366")(!1),a=n("613b")("IE_PROTO");t.exports=function(t,e){var n,c=o(t),u=0,f=[];for(n in c)n!=a&&r(c,n)&&f.push(n);while(e.length>u)r(c,n=e[u++])&&(~i(f,n)||f.push(n));return f}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(r){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},fa5b:function(t,e,n){t.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,n){var r=n("7726").document;t.exports=r&&r.documentElement},fae3:function(t,e,n){"use strict";var r;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",style:{perspective:t.perspective+"px"},on:{mousemove:t.getMousePosition,mouseleave:t.parallaxStop,mouseenter:t.parallaxStart}},[t._t("default")],2)},i=[];n("c5f6");function a(t,e){var n,r;return function(){var o=this,i=this.animationDuration>1e3?e:this.animationDuration/10,a=+new Date,c=arguments;n&&a<n+i?(clearTimeout(r),r=setTimeout((function(){n=a,t.apply(o,c)}),i)):(n=a,t.apply(o,c))}}var c={name:"ParallaxContainer",data:function(){return{mousePosition:{x:0,y:0},isHovering:!1,didEnter:!1}},props:{animationDuration:{type:Number,default:1e3},easing:{type:String,default:"cubic-bezier(0.23, 1, 0.32, 1)"},tag:{type:String,default:"div"},perspective:{type:Number,default:1e3}},methods:{getRelativePosition:function(){var t=this.$el.getBoundingClientRect();return{top:t.top,left:t.left}},getMousePosition:a((function(t){this.mousePosition.x=t.clientX,this.mousePosition.y=t.clientY}),100),parallaxStart:function(){var t=this;this.isHovering=!0,this.didEnter=!1,setTimeout((function(){t.didEnter=!0}),1e3)},parallaxStop:function(){this.isHovering=!1,this.didEnter=!1}}},u=c;function f(t,e,n,r,o,i,a,c){var u,f="function"===typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},f._ssrRegister=u):o&&(u=c?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(f.functional){f._injectStyles=u;var s=f.render;f.render=function(t,e){return u.call(e),s(t,e)}}else{var p=f.beforeCreate;f.beforeCreate=p?[].concat(p,u):[u]}return{exports:t,options:f}}var s=f(u,o,i,!1,null,null,null),p=s.exports,l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",style:Object.assign({},t.transform,t.transformParameters)},[t._t("default")],2)},d=[],v={name:"ParallaxElement",props:{parallaxStrength:{type:Number,default:10},type:{type:String,default:"translation"},tag:{type:String,default:"div"}},computed:{parent:function(){return this.$parent},isHovering:function(){return this.parent.isHovering},mousePosition:function(){return this.parent.mousePosition},transform:function(){if(this.parent.isHovering){var t,e=this.$el?this.parent.$el.getBoundingClientRect():{top:0,left:0},n="depth"===this.type?Math.abs(this.parallaxStrength):this.parallaxStrength,r=this.mousePosition.x-e.left,o=this.mousePosition.y-e.top,i=(r-e.width/2)/(e.width/2)*n,a=(o-e.height/2)/(e.height/2)*n;if("translation"===this.type)t="translateX(".concat(-i,"px) translateY(").concat(-a,"px)");else if("rotation"===this.type){var c=i+a;t="rotateZ(".concat(c,"deg)")}else"depth"===this.type&&(t="rotateX(".concat(-a,"deg) rotateY(").concat(i,"deg) translateZ(").concat(2*this.parallaxStrength,"px) "));return{transform:t}}},transformParameters:function(){return{transitionProperty:"transform",transitionDuration:this.transitionDuration,transformOrigin:"center",transitionTimingFunction:this.transitionTimingFunction}},transitionDuration:function(){var t=this.parent.animationDuration,e=t>400?t:400,n=this.parent.didEnter?t:e;return"".concat(n,"ms")},transitionTimingFunction:function(){return this.parent.easing}}},h=v,y=f(h,l,d,!1,null,null,null),m=y.exports;n.d(e,"ParallaxContainer",(function(){return p})),n.d(e,"ParallaxElement",(function(){return m}))},fdef:function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"}})}));
//# sourceMappingURL=vue-mouse-parallax.umd.min.js.map
{
"name": "vue-mouse-parallax",
"version": "1.0.2",
"version": "1.0.3",
"licence": "MIT",
"author": {
"name": "Amine Bouyarmane",
"email": "amine.bouyarmane@gmail.com"
},
"scripts": {

@@ -5,0 +10,0 @@ "serve": "vue-cli-service serve",

@@ -7,6 +7,7 @@ export default function throttle(callback, delay) {

const context = this;
const newDelay = this.animationDuration > 1000 ? delay : this.animationDuration / 10;
const now = +new Date();
// eslint-disable-next-line prefer-rest-params
const args = arguments;
if (last && now < last + delay) {
if (last && now < last + newDelay) {
clearTimeout(timer);

@@ -16,3 +17,3 @@ timer = setTimeout(() => {

callback.apply(context, args);
}, delay);
}, newDelay);
} else {

@@ -19,0 +20,0 @@ last = now;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc