tsparticles-interaction-external-bounce
Advanced tools
Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "tsparticles-interaction-external-bounce", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "tsParticles bounce external interaction", | ||
@@ -42,4 +42,4 @@ "homepage": "https://particles.js.org/", | ||
"main": "index.js", | ||
"jsdelivr": "tsparticles.interaction.particles.bounce.min.js", | ||
"unpkg": "tsparticles.interaction.particles.bounce.min.js", | ||
"jsdelivr": "tsparticles.interaction.external.bounce.min.js", | ||
"unpkg": "tsparticles.interaction.external.bounce.min.js", | ||
"browser": "index.js", | ||
@@ -66,4 +66,4 @@ "module": "index.js", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.0.4" | ||
"tsparticles-engine": "^2.0.5" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.0.4 | ||
* v2.0.5 | ||
*/ | ||
@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) { |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Bounce External Interaction v2.0.4 by Matteo Bruni */ | ||
/*! tsParticles Bounce External Interaction v2.0.5 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 n="object"==typeof exports?t(require("tsparticles-engine")):t(e.window);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,(function(e){return(()=>{"use strict";var t={818:t=>{t.exports=e}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,o),r.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{o.r(i),o.d(i,{loadExternalBounceInteraction:()=>c});var e=o(818),t=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class n extends e.ExternalInteractorBase{constructor(e){super(e)}isEnabled(){const t=this.container,n=t.actualOptions,o=t.interactivity.mouse,i=n.interactivity.events,r=i.onDiv;return o.position&&i.onHover.enable&&(0,e.isInArray)("bounce",i.onHover.mode)||(0,e.isDivModeEnabled)("bounce",r)}interact(){return t(this,void 0,void 0,(function*(){const t=this.container,n=t.actualOptions.interactivity.events,o=t.interactivity.status===e.mouseMoveEvent,i=n.onHover.enable,r=n.onHover.mode,c=n.onDiv;o&&i&&(0,e.isInArray)("bounce",r)?this.processMouseBounce():(0,e.divModeExecute)("bounce",c,((e,t)=>this.singleSelectorBounce(e,t)))}))}reset(){}processMouseBounce(){const t=this.container,n=10*t.retina.pixelRatio,o=t.interactivity.mouse.position,i=t.retina.bounceModeDistance;o&&this.processBounce(o,i,new e.Circle(o.x,o.y,i+n))}singleSelectorBounce(t,n){const o=this.container,i=document.querySelectorAll(t);i.length&&i.forEach((t=>{const i=t,r=o.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,u="circle"===n.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,u)}))}processBounce(t,n,o){const i=this.container.particles.quadTree.query(o);for(const r of i)o instanceof e.Circle?(0,e.circleBounce)((0,e.circleBounceDataFromParticle)(r),{position:t,radius:n,mass:Math.pow(n,2)*Math.PI/2,velocity:e.Vector.origin,factor:e.Vector.origin}):o instanceof e.Rectangle&&(0,e.rectBounce)(r,(0,e.calculateBounds)(t,n))}}var r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function c(e){return r(this,void 0,void 0,(function*(){yield e.addInteractor("externalBounce",(e=>new n(e)))}))}})(),i})()})); |
Sorry, the diff of this file is not supported yet
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
301076
Updatedtsparticles-engine@^2.0.5