Socket
Socket
Sign inDemoInstall

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.0.0-alpha.0 to 2.0.0-alpha.1

4

package.json
{
"name": "tsparticles-interaction-external-bounce",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"description": "tsParticles Bounce external interaction",

@@ -48,4 +48,4 @@ "homepage": "https://particles.matteobruni.it/",

"dependencies": {
"tsparticles-core": "^1.0.0-alpha.0"
"tsparticles-core": "^2.0.0-alpha.0"
}
}

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

* How to use? : Check the GitHub README
* v2.0.0-alpha.0
* v2.0.0-alpha.1
*/

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

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

/*! tsParticles Bounce External Interaction v2.0.0-alpha.0 by Matteo Bruni */
/*! tsParticles Bounce External Interaction v2.0.0-alpha.1 by Matteo Bruni */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("tsparticles-core"));else if("function"==typeof define&&define.amd)define(["tsparticles-core"],t);else{var o="object"==typeof exports?t(require("tsparticles-core")):t(e.window);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(function(e){return(()=>{"use strict";var t={775:(e,t,o)=>{o.r(t),o.d(t,{loadInteraction:()=>i});var n=o(646);class r extends n.ExternalInteractorBase{constructor(e){super(e,"bounce")}isEnabled(){const e=this.container,t=e.options,o=e.interactivity.mouse,r=t.interactivity.events,i=r.onDiv;return o.position&&r.onHover.enable&&(0,n.isInArray)("bounce",r.onHover.mode)||(0,n.isDivModeEnabled)("bounce",i)}interact(){const e=this.container,t=e.options.interactivity.events,o=e.interactivity.status===n.Constants.mouseMoveEvent,r=t.onHover.enable,i=t.onHover.mode,c=t.onDiv;o&&r&&(0,n.isInArray)("bounce",i)?this.processMouseBounce():(0,n.divModeExecute)("bounce",c,((e,t)=>this.singleSelectorBounce(e,t)))}reset(){}processMouseBounce(){const e=this.container,t=10*e.retina.pixelRatio,o=e.interactivity.mouse.position,r=e.retina.bounceModeDistance;o&&this.processBounce(o,r,new n.Circle(o.x,o.y,r+t))}singleSelectorBounce(e,t){const o=this.container,r=document.querySelectorAll(e);r.length&&r.forEach((e=>{const r=e,i=o.retina.pixelRatio,c={x:(r.offsetLeft+r.offsetWidth/2)*i,y:(r.offsetTop+r.offsetHeight/2)*i},s=r.offsetWidth/2*i,a=10*i,u="circle"===t.type?new n.Circle(c.x,c.y,s+a):new n.Rectangle(r.offsetLeft*i-a,r.offsetTop*i-a,r.offsetWidth*i+2*a,r.offsetHeight*i+2*a);this.processBounce(c,s,u)}))}processBounce(e,t,o){const r=this.container.particles.quadTree.query(o);for(const i of r)o instanceof n.Circle?(0,n.circleBounce)((0,n.circleBounceDataFromParticle)(i),{position:e,radius:t,velocity:new n.Vector(0,0),factor:new n.Vector(0,0)}):o instanceof n.Rectangle&&(0,n.rectBounce)(i,(0,n.calculateBounds)(e,t))}}function i(e){e.addInteractor((e=>new r(e)))}i(n.tsParticles)},646:t=>{t.exports=e}},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}return 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})},n(775)})()}));

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