Comparing version 1.2.6 to 1.2.7
/** | ||
* scrolldir - Vertical scroll direction in CSS | ||
* @version v1.2.5 | ||
* @version v1.2.6 | ||
* @link https://github.com/dollarshaveclub/scrolldir.git | ||
@@ -8,2 +8,2 @@ * @author Patrick Fisher <patrick@pwfisher.com> | ||
**/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(0,function(){"use strict";!function(){var t=document.documentElement,e=window,n=document.body,o=Array(32),i="down",d=void 0,r=void 0,a=0,f=function(){var f=e.scrollY,u=d.timeStamp,c="down"===i?Math.max:Math.min,s=n.offsetHeight-e.innerHeight;if(f=Math.max(0,f),f=Math.min(s,f),o.unshift({y:f,t:u}),o.pop(),f===c(r,f))return a=u,void(r=f);var m=u-512;if(m>a){r=f;for(var l=0;l<32&&o[l]&&!(o[l].t<m);l+=1)r=c(r,o[l].y)}Math.abs(f-r)>64&&(r=f,a=u,i="down"===i?"up":"down",t.setAttribute("data-scrolldir",i))},u=function(t){d=t,e.requestAnimationFrame(f)};r=e.scrollY,t.setAttribute("data-scrolldir",i),e.addEventListener("scroll",u)}()}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(this,function(){"use strict";function t(){var t=document.documentElement,e=window,n="data-scrolldir",o=document.body,i=32,r=512,d=64,a=Array(i),f="down",u=void 0,c=void 0,s=0,m=function(){var m=e.scrollY,l=u.timeStamp,h="down"===f?Math.max:Math.min,p=o.offsetHeight-e.innerHeight;if(m=Math.max(0,m),m=Math.min(p,m),a.unshift({y:m,t:l}),a.pop(),m===h(c,m))return s=l,void(c=m);var v=l-r;if(v>s){c=m;for(var y=0;y<i&&(a[y]&&!(a[y].t<v));y+=1)c=h(c,a[y].y)}Math.abs(m-c)>d&&(c=m,s=l,f="down"===f?"up":"down",t.setAttribute(n,f))},l=function(t){u=t,e.requestAnimationFrame(m)};return c=e.scrollY,t.setAttribute(n,f),e.addEventListener("scroll",l)}t()}); |
/** | ||
* scrolldir - Vertical scroll direction in CSS | ||
* @version v1.2.5 | ||
* @version v1.2.6 | ||
* @link https://github.com/dollarshaveclub/scrolldir.git | ||
@@ -5,0 +5,0 @@ * @author Patrick Fisher <patrick@pwfisher.com> |
{ | ||
"name": "scrolldir", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "Vertical scroll direction in CSS", | ||
@@ -45,5 +45,5 @@ "main": "dist/scrolldir.min.js", | ||
"rollup-plugin-eslint": "^3.0.0", | ||
"rollup-plugin-node-resolve": "^2.0.0", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-uglify": "^1.0.1" | ||
} | ||
} |
@@ -15,2 +15,5 @@ <figure align="center"> | ||
</a> | ||
<a href="https://greenkeeper.io/"> | ||
<img alt="Greenkeeper" src="https://badges.greenkeeper.io/dollarshaveclub/scrolldir.svg" /> | ||
</a> | ||
<a href="https://www.npmjs.com/package/scrolldir"> | ||
@@ -34,2 +37,3 @@ <img alt="npm version" src="https://badge.fury.io/js/scrolldir.svg" /> | ||
### ScrollDir is perfect for: | ||
- showing or hiding sticky elements based on scroll direction 🐥 | ||
@@ -36,0 +40,0 @@ - only changing its direction attribute when scrolled a significant amount 🔥 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125722
120