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

tsparticles-interaction-external-bounce

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsparticles-interaction-external-bounce - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

4

package.json
{
"name": "tsparticles-interaction-external-bounce",
"version": "2.1.3",
"version": "2.1.4",
"description": "tsParticles bounce external interaction",

@@ -75,4 +75,4 @@ "homepage": "https://particles.js.org/",

"dependencies": {
"tsparticles-engine": "^2.1.3"
"tsparticles-engine": "^2.1.4"
}
}

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v2.1.3
* v2.1.4
*/

@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) {

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

/*! tsParticles Bounce External Interaction v2.1.3 by Matteo Bruni */
/*! tsParticles Bounce External Interaction v2.1.4 by Matteo Bruni */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("tsparticles-engine"));else if("function"==typeof define&&define.amd)define(["tsparticles-engine"],t);else{var o="object"==typeof exports?t(require("tsparticles-engine")):t(e.window);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(e=>(()=>{"use strict";var t={818:t=>{t.exports=e}},o={};function n(e){var i=o[e];if(void 0!==i)return i.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{loadExternalBounceInteraction:()=>o});var e=n(818);class t extends e.ExternalInteractorBase{constructor(e){super(e)}clear(){}init(){}async interact(){const t=this.container,o=t.actualOptions.interactivity.events,n=t.interactivity.status===e.mouseMoveEvent,i=o.onHover.enable,r=o.onHover.mode,c=o.onDiv;n&&i&&(0,e.isInArray)("bounce",r)?this.processMouseBounce():(0,e.divModeExecute)("bounce",c,((e,t)=>this.singleSelectorBounce(e,t)))}isEnabled(t){var o;const n=this.container,i=n.actualOptions,r=n.interactivity.mouse,c=(null!==(o=null==t?void 0:t.interactivity)&&void 0!==o?o:i.interactivity).events,s=c.onDiv;return r.position&&c.onHover.enable&&(0,e.isInArray)("bounce",c.onHover.mode)||(0,e.isDivModeEnabled)("bounce",s)}reset(){}processBounce(t,o,n){const i=this.container.particles.quadTree.query(n,(e=>this.isEnabled(e)));for(const r of i)n instanceof e.Circle?(0,e.circleBounce)((0,e.circleBounceDataFromParticle)(r),{position:t,radius:o,mass:o**2*Math.PI/2,velocity:e.Vector.origin,factor:e.Vector.origin}):n instanceof e.Rectangle&&(0,e.rectBounce)(r,(0,e.calculateBounds)(t,o))}processMouseBounce(){const t=this.container,o=10*t.retina.pixelRatio,n=t.interactivity.mouse.position,i=t.retina.bounceModeDistance;n&&this.processBounce(n,i,new e.Circle(n.x,n.y,i+o))}singleSelectorBounce(t,o){const n=this.container,i=document.querySelectorAll(t);i.length&&i.forEach((t=>{const i=t,r=n.retina.pixelRatio,c={x:(i.offsetLeft+i.offsetWidth/2)*r,y:(i.offsetTop+i.offsetHeight/2)*r},s=i.offsetWidth/2*r,a=10*r,l="circle"===o.type?new e.Circle(c.x,c.y,s+a):new e.Rectangle(i.offsetLeft*r-a,i.offsetTop*r-a,i.offsetWidth*r+2*a,i.offsetHeight*r+2*a);this.processBounce(c,s,l)}))}}async function o(e){await e.addInteractor("externalBounce",(e=>new t(e)))}})(),i})()));

Sorry, the diff of this file is not supported yet

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