Comparing version 1.2.7 to 1.2.9
/** | ||
* scrolldir - Vertical scroll direction in CSS | ||
* @version v1.2.6 | ||
* @version v1.2.8 | ||
* @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()}(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()}); | ||
!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 (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.scrollDir = factory()); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.scrollDir = factory()); | ||
}(this, (function () { 'use strict'; | ||
@@ -6,0 +6,0 @@ |
/** | ||
* scrolldir - Vertical scroll direction in CSS | ||
* @version v1.2.6 | ||
* @version v1.2.8 | ||
* @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?module.exports=e():"function"==typeof define&&define.amd?define(e):t.scrollDir=e()}(this,function(){"use strict";function t(){var t=r.scrollY,e=m.timeStamp,n="down"===c?Math.max:Math.min,i=u.offsetHeight-r.innerHeight;if(t=Math.max(0,t),t=Math.min(i,t),l.unshift({y:t,t:e}),l.pop(),t===n(v,t))return b=e,void(v=t);var h=e-f;if(h>b){v=t;for(var p=0;p<a&&(l[p]&&!(l[p].t<h));p+=1)v=n(v,l[p].y)}Math.abs(t-v)>s&&(v=t,b=e,c="down"===c?"up":"down",o.setAttribute(d,c))}function e(e){return m=e,r.requestAnimationFrame(t)}function n(t){return o=t&&t.el||i.el,r=t&&t.win||i.win,d=t&&t.attribute||i.attribute,t&&t.off===!0?(o.setAttribute(d,"off"),r.removeEventListener("scroll",e)):(v=r.scrollY,o.setAttribute(d,c),r.addEventListener("scroll",e))}var i={el:document.documentElement,win:window,attribute:"data-scrolldir"},o=void 0,r=void 0,d=void 0,u=document.body,a=32,f=512,s=64,l=Array(a),c="down",m=void 0,v=void 0,b=0;return n}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.scrollDir=e()}(this,function(){"use strict";function t(){var t=r.scrollY,e=m.timeStamp,n="down"===c?Math.max:Math.min,i=u.offsetHeight-r.innerHeight;if(t=Math.max(0,t),t=Math.min(i,t),l.unshift({y:t,t:e}),l.pop(),t===n(v,t))return b=e,void(v=t);var h=e-f;if(h>b){v=t;for(var p=0;p<a&&(l[p]&&!(l[p].t<h));p+=1)v=n(v,l[p].y)}Math.abs(t-v)>s&&(v=t,b=e,c="down"===c?"up":"down",o.setAttribute(d,c))}function e(e){return m=e,r.requestAnimationFrame(t)}function n(t){return o=t&&t.el||i.el,r=t&&t.win||i.win,d=t&&t.attribute||i.attribute,t&&!0===t.off?(o.setAttribute(d,"off"),r.removeEventListener("scroll",e)):(v=r.scrollY,o.setAttribute(d,c),r.addEventListener("scroll",e))}var i={el:document.documentElement,win:window,attribute:"data-scrolldir"},o=void 0,r=void 0,d=void 0,u=document.body,a=32,f=512,s=64,l=Array(a),c="down",m=void 0,v=void 0,b=0;return n}); |
{ | ||
"name": "scrolldir", | ||
"version": "1.2.7", | ||
"version": "1.2.9", | ||
"description": "Vertical scroll direction in CSS", | ||
@@ -8,3 +8,3 @@ "main": "dist/scrolldir.min.js", | ||
"test": "gulp test", | ||
"start": "rollup -c && rollup -c --environment entry:.auto && gulp", | ||
"build": "rollup -c && rollup -c --environment entry:.auto && gulp", | ||
"postpublish": "git tag $npm_package_version && git push origin --tags" | ||
@@ -35,3 +35,3 @@ }, | ||
"eslint": "^3.9.1", | ||
"eslint-config-airbnb": "^12.0.0", | ||
"eslint-config-airbnb": "^15.0.0", | ||
"eslint-plugin-import": "^2.1.0", | ||
@@ -41,3 +41,3 @@ "gulp": "^3.9.1", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-uglify": "^2.0.0", | ||
"gulp-uglify": "^3.0.0", | ||
"node-qunit-phantomjs": "^1.4.0", | ||
@@ -49,4 +49,4 @@ "rollup": "^0.36.3", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-uglify": "^1.0.1" | ||
"rollup-plugin-uglify": "^2.0.0" | ||
} | ||
} |
@@ -61,3 +61,3 @@ <figure align="center"> | ||
## In Action🎥 | ||
## In Action 🎥 | ||
@@ -116,6 +116,6 @@ <p align="center"> | ||
## Examples 🌴 | ||
## Example 🌴 | ||
- [scrolldir](http://codepen.io/yowainwright/pen/9d5a6c6dcf2c17e351dcccfe98158e8b) on codepen. | ||
This is a modular version of [pwfisher](https://github.com/pwfisher)'s [scroll-intent](https://github.com/pwfisher/scroll-intent.js). If you'd like to easily use scrolldir with jQuery—use Scroll Intent. ~TY! | ||
This is a modular version of [pwfisher](https://github.com/pwfisher)'s [scroll-intent](https://github.com/pwfisher/scroll-intent.js). If you'd like to use scrolldir with jQuery—use Scroll Intent. Scrolldir should work easily within any front-end framework so it ditches library dependencies. ~TY! |
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
125800