Socket
Socket
Sign inDemoInstall

parallaxis

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.1

1

dist/parallaxis.js

@@ -205,2 +205,3 @@ (function (global, factory) {

updateOffsetsOnResize(els);
updateFunc();
window.addEventListener('scroll', function () {

@@ -207,0 +208,0 @@ return index(updateFunc);

2

dist/parallaxis.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.parallaxis=t()}(this,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}for(var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=e(function(e){(function(){var t,n,a;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-a)/1e6},n=process.hrtime,t=function(){var e;return e=n(),1e9*e[0]+e[1]},a=t()):Date.now?(e.exports=function(){return Date.now()-a},a=Date.now()):(e.exports=function(){return(new Date).getTime()-a},a=(new Date).getTime())}).call(n)}),r="undefined"==typeof window?n:window,o=["moz","webkit"],i="AnimationFrame",s=r["request"+i],f=r["cancel"+i]||r["cancelRequest"+i],l=0;!s&&l<o.length;l++)s=r[o[l]+"Request"+i],f=r[o[l]+"Cancel"+i]||r[o[l]+"CancelRequest"+i];if(!s||!f){var u=0,c=0,d=[],p=1e3/60;s=function(e){if(0===d.length){var t=a(),n=Math.max(0,p-(t-u));u=n+t,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(u)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return d.push({handle:++c,callback:e,cancelled:!1}),c},f=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}var m=function(e){return s.call(r,e)},v=function(){f.apply(r,arguments)},y=function(){r.requestAnimationFrame=s,r.cancelAnimationFrame=f};m.cancel=v,m.polyfill=y;var w=new WeakMap,h=function(e,t){return Math.abs(e-t)},x=function(e){var n=[].concat(t(document.querySelectorAll("."+e)));return n.map(function(e){var t="true"===e.dataset.relative,n=t?g(e):0,a=parseInt(e.dataset.end,10),r=parseInt(e.dataset.start,10),o=parseFloat(e.dataset.opacityStart),i=parseFloat(e.dataset.opacityEnd),s=parseInt(e.dataset.translatexStart,10),f=parseInt(e.dataset.translatexEnd,10),l=parseInt(e.dataset.translateyStart,10),u=parseInt(e.dataset.translateyEnd,10),c=parseFloat(e.dataset.scaleStart),d=parseFloat(e.dataset.scaleEnd),p={};return isNaN(o)||isNaN(i)||(p.opacity={end:i,start:o}),isNaN(s)||isNaN(f)||(p.translateX={end:f,start:s}),isNaN(l)||isNaN(u)||(p.translateY={end:u,start:l}),isNaN(c)||isNaN(d)||(p.scale={end:d,start:c}),"undefined"==typeof a||"undefined"==typeof r||0===Object.keys(p)?null:{el:e,end:a,offset:n,relative:t,start:r,updates:p}}).filter(function(e){return e})},g=function(e){return A()+e.getBoundingClientRect().top},N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.className,n=void 0===t?"js-parallaxis":t,a=x(n);if(a.length){var r=E(a);k(a),window.addEventListener("scroll",function(){return m(r)})}},b=function(e,t,n){var a=h(e,t)*n;return e>t?e-a:e+a},F=function(e,t,n){return h(e,n)/h(e,t)},I=function(e,t,n){return Math.max(Math.min(n,t),e)},T=function(){var e=document.createElement("div"),t=["Webkit","webkit","Moz","moz","ms","o"];if(null!=e.style.transform)return"transform";for(var n in t){var a=t[n]+"Transform";if("undefined"!=typeof e.style[a])return a}},A=function(){return parseInt(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,10)},E=function(e){var t=T();return function(){var n=A();e.map(function(e){var a=e.el,r=e.end,o=e.offset,i=e.start,s=e.updates,f=o+i,l=o+r,u=w.get(a);if(n>=f&&n<=l||"before"!==u&&n<f||"after"!==u&&n>l){var c=0,d=0,p=1,m=I(f,l,n),v=F(f,l,m);if(s.opacity){var y=s.opacity,h=y.end,x=y.start,g=b(x,h,v).toFixed(2);a.style.opacity=g}if(s.translateX){var N=s.translateX,T=N.end,A=N.start;c=parseInt(b(A,T,v),10)}if(s.translateY){var E=s.translateY,k=E.end,M=E.start;d=parseInt(b(M,k,v),10)}if(s.scale){var q=s.scale,D=q.end,S=q.start;p=b(S,D,v).toFixed(2)}a.style[t]="translate3d("+c+"px, "+d+"px, 0) scale("+p+")",n<f?w.set(a,"before"):n>l?w.set(a,"after"):w.set(a,"during")}})}},k=function(e){var t=function(){return e.map(function(e){e.relative&&(e.offset=g(e.el))})},n=void 0;window.addEventListener("resize",function(){window.clearTimeout(n),n=window.setTimeout(t,50)})};return N});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.parallaxis=t()}(this,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}function t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}for(var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=e(function(e){(function(){var t,n,a;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-a)/1e6},n=process.hrtime,t=function(){var e;return e=n(),1e9*e[0]+e[1]},a=t()):Date.now?(e.exports=function(){return Date.now()-a},a=Date.now()):(e.exports=function(){return(new Date).getTime()-a},a=(new Date).getTime())}).call(n)}),r="undefined"==typeof window?n:window,o=["moz","webkit"],i="AnimationFrame",s=r["request"+i],f=r["cancel"+i]||r["cancelRequest"+i],l=0;!s&&l<o.length;l++)s=r[o[l]+"Request"+i],f=r[o[l]+"Cancel"+i]||r[o[l]+"CancelRequest"+i];if(!s||!f){var u=0,c=0,d=[],p=1e3/60;s=function(e){if(0===d.length){var t=a(),n=Math.max(0,p-(t-u));u=n+t,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(u)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return d.push({handle:++c,callback:e,cancelled:!1}),c},f=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}var m=function(e){return s.call(r,e)},v=function(){f.apply(r,arguments)},y=function(){r.requestAnimationFrame=s,r.cancelAnimationFrame=f};m.cancel=v,m.polyfill=y;var w=new WeakMap,h=function(e,t){return Math.abs(e-t)},x=function(e){var n=[].concat(t(document.querySelectorAll("."+e)));return n.map(function(e){var t="true"===e.dataset.relative,n=t?g(e):0,a=parseInt(e.dataset.end,10),r=parseInt(e.dataset.start,10),o=parseFloat(e.dataset.opacityStart),i=parseFloat(e.dataset.opacityEnd),s=parseInt(e.dataset.translatexStart,10),f=parseInt(e.dataset.translatexEnd,10),l=parseInt(e.dataset.translateyStart,10),u=parseInt(e.dataset.translateyEnd,10),c=parseFloat(e.dataset.scaleStart),d=parseFloat(e.dataset.scaleEnd),p={};return isNaN(o)||isNaN(i)||(p.opacity={end:i,start:o}),isNaN(s)||isNaN(f)||(p.translateX={end:f,start:s}),isNaN(l)||isNaN(u)||(p.translateY={end:u,start:l}),isNaN(c)||isNaN(d)||(p.scale={end:d,start:c}),"undefined"==typeof a||"undefined"==typeof r||0===Object.keys(p)?null:{el:e,end:a,offset:n,relative:t,start:r,updates:p}}).filter(function(e){return e})},g=function(e){return A()+e.getBoundingClientRect().top},N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.className,n=void 0===t?"js-parallaxis":t,a=x(n);if(a.length){var r=E(a);k(a),r(),window.addEventListener("scroll",function(){return m(r)})}},b=function(e,t,n){var a=h(e,t)*n;return e>t?e-a:e+a},F=function(e,t,n){return h(e,n)/h(e,t)},I=function(e,t,n){return Math.max(Math.min(n,t),e)},T=function(){var e=document.createElement("div"),t=["Webkit","webkit","Moz","moz","ms","o"];if(null!=e.style.transform)return"transform";for(var n in t){var a=t[n]+"Transform";if("undefined"!=typeof e.style[a])return a}},A=function(){return parseInt(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,10)},E=function(e){var t=T();return function(){var n=A();e.map(function(e){var a=e.el,r=e.end,o=e.offset,i=e.start,s=e.updates,f=o+i,l=o+r,u=w.get(a);if(n>=f&&n<=l||"before"!==u&&n<f||"after"!==u&&n>l){var c=0,d=0,p=1,m=I(f,l,n),v=F(f,l,m);if(s.opacity){var y=s.opacity,h=y.end,x=y.start,g=b(x,h,v).toFixed(2);a.style.opacity=g}if(s.translateX){var N=s.translateX,T=N.end,A=N.start;c=parseInt(b(A,T,v),10)}if(s.translateY){var E=s.translateY,k=E.end,M=E.start;d=parseInt(b(M,k,v),10)}if(s.scale){var q=s.scale,D=q.end,S=q.start;p=b(S,D,v).toFixed(2)}a.style[t]="translate3d("+c+"px, "+d+"px, 0) scale("+p+")",n<f?w.set(a,"before"):n>l?w.set(a,"after"):w.set(a,"during")}})}},k=function(e){var t=function(){return e.map(function(e){e.relative&&(e.offset=g(e.el))})},n=void 0;window.addEventListener("resize",function(){window.clearTimeout(n),n=window.setTimeout(t,50)})};return N});

@@ -91,2 +91,3 @@ 'use strict';

updateOffsetsOnResize(els);
updateFunc();
window.addEventListener('scroll', function () {

@@ -93,0 +94,0 @@ return (0, _raf2.default)(updateFunc);

@@ -53,5 +53,7 @@ {

"rollup-plugin-uglify": "^1.0.1",
"semantic-release": "^6.3.2",
"semantic-release": "15.1.5",
"semantic-release-cli": "^3.6.4",
"snazzy": "^6.0.0",
"standard": "^9.0.2"
"standard": "^9.0.2",
"travis-deploy-once": "^4.4.1"
},

@@ -85,7 +87,8 @@ "keywords": [

"prepublish": "npm run tidy && npm run build",
"semantic-release": "semantic-release",
"tidy": "rimraf lib dist",
"test": "exit 0",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"travis-deploy-once": "travis-deploy-once"
},
"version": "1.2.0"
}
"version": "1.2.1"
}
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