intersection-events
Advanced tools
Comparing version 0.1.2 to 0.1.3
/*! | ||
* intersection-events v0.1.2 | ||
* intersection-events v0.1.3 | ||
* https://github.com/ko-yelie/intersection-events#readme | ||
@@ -11,7 +11,7 @@ * | ||
* https://www.npmjs.com/package/get-elements-array | ||
* https://www.npmjs.com/package/noop-es2015 | ||
*/ | ||
import noop from 'noop-es2015'; | ||
import getElements from 'get-elements-array'; | ||
function noop() {} | ||
var MAX_THRESHOLD = 0.99; // If it is 1, a device that will not fire an animation comes out, so avoid it. | ||
@@ -18,0 +18,0 @@ |
/*! | ||
* intersection-events v0.1.2 | ||
* intersection-events v0.1.3 | ||
* https://github.com/ko-yelie/intersection-events#readme | ||
@@ -11,3 +11,2 @@ * | ||
* https://www.npmjs.com/package/get-elements-array | ||
* https://www.npmjs.com/package/noop-es2015 | ||
*/ | ||
@@ -17,3 +16,3 @@ var IntersectionEvents = (function () { | ||
function noop () {} | ||
function noop() {} | ||
@@ -20,0 +19,0 @@ /*! npm.im/get-elements-array */ |
/*! | ||
* intersection-events v0.1.2 | ||
* intersection-events v0.1.3 | ||
* https://github.com/ko-yelie/intersection-events#readme | ||
@@ -11,4 +11,3 @@ * | ||
* https://www.npmjs.com/package/get-elements-array | ||
* https://www.npmjs.com/package/noop-es2015 | ||
*/ | ||
var IntersectionEvents=function(){"use strict";function n(){}return function(t,e){void 0===e&&(e={});var r=e.onEnter,i=e.onLeave;void 0===i&&(i=n);var o=e.enterThreshold;void 0===o&&(o=.99);var s,a,c=e.leaveThreshold;void 0===c&&(c=0),1===o&&(o=.99),1===c&&(c=.99),o===c?(s=function(n){return n.isIntersecting},a=function(n){return 0===c?!n.isIntersecting:n.isIntersecting}):(s=function(n){return Math.abs(n.intersectionRatio-o)<=Math.abs(n.intersectionRatio-c)},a=function(n){return Math.abs(n.intersectionRatio-o)>=Math.abs(n.intersectionRatio-c)});var u,v=function(n){n.forEach(function(n){var t=n.target;!t.isEnter&&s(n)?(t.isEnter=!0,r()):t.isEnter&&a(n)&&(t.isEnter=!1,i())})},h=new IntersectionObserver(v,{threshold:[c,o]});(u=t,u?("string"==typeof u&&(u=document.querySelectorAll(u)),"length"in u&&u.nodeType!==Node.ELEMENT_NODE&&!function(n){return n.location&&n.document&&n.alert&&n.setInterval}(u)?Array.apply(null,u):[u]):[]).forEach(function(n){n.isEnter=!1;var t=window.innerHeight/n.offsetHeight,e=o>t,r=c>t,i=h;(e||r)&&(i=new IntersectionObserver(v,{threshold:[r?c*t:c,e?o*t:o]})),i.observe(n)})}}(); |
{ | ||
"name": "intersection-events", | ||
"moduleName": "IntersectionEvents", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Wrapper of IntersectionObserver", | ||
@@ -34,10 +34,8 @@ "main": "dist/intersection-events.es.js", | ||
"bili": "^3.0.15", | ||
"esdoc": "^1.0.4", | ||
"esdoc-standard-plugin": "^1.0.0", | ||
"marked": "^0.3.19" | ||
"esdoc": "^1.1.0", | ||
"esdoc-standard-plugin": "^1.0.0" | ||
}, | ||
"dependencies": { | ||
"get-elements-array": "^1.0.1", | ||
"noop-es2015": "^1.0.1" | ||
"get-elements-array": "^1.0.1" | ||
} | ||
} |
@@ -45,3 +45,3 @@ # intersection-events | ||
--- | ||
## Note | ||
@@ -48,0 +48,0 @@ If you should support browsers that do not support IntersectionObserver, use [IntersectionObserver polyfill](https://github.com/w3c/IntersectionObserver/tree/master/polyfill). |
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
1
4
10783
181
- Removednoop-es2015@^1.0.1
- Removednoop-es2015@1.0.3(transitive)