Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

intersection-events

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intersection-events - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

6

dist/intersection-events.es.js
/*!
* 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).

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc