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

@tsparticles/interaction-particles-collisions

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/interaction-particles-collisions - npm Package Compare versions

Comparing version 3.7.0 to 3.7.1

2

browser/index.js
import { assertValidVersion } from "@tsparticles/engine";
import { Collider } from "./Collider.js";
export async function loadParticlesCollisionsInteraction(engine, refresh = true) {
assertValidVersion(engine, "3.7.0");
assertValidVersion(engine, "3.7.1");
await engine.addInteractor("particlesCollisions", container => {

@@ -6,0 +6,0 @@ return Promise.resolve(new Collider(container));

@@ -7,3 +7,3 @@ "use strict";

async function loadParticlesCollisionsInteraction(engine, refresh = true) {
(0, engine_1.assertValidVersion)(engine, "3.7.0");
(0, engine_1.assertValidVersion)(engine, "3.7.1");
await engine.addInteractor("particlesCollisions", container => {

@@ -10,0 +10,0 @@ return Promise.resolve(new Collider_js_1.Collider(container));

import { assertValidVersion } from "@tsparticles/engine";
import { Collider } from "./Collider.js";
export async function loadParticlesCollisionsInteraction(engine, refresh = true) {
assertValidVersion(engine, "3.7.0");
assertValidVersion(engine, "3.7.1");
await engine.addInteractor("particlesCollisions", container => {

@@ -6,0 +6,0 @@ return Promise.resolve(new Collider(container));

{
"name": "@tsparticles/interaction-particles-collisions",
"version": "3.7.0",
"version": "3.7.1",
"description": "tsParticles collisions particles interaction",

@@ -90,3 +90,3 @@ "homepage": "https://particles.js.org",

"dependencies": {
"@tsparticles/engine": "3.7.0"
"@tsparticles/engine": "3.7.1"
},

@@ -93,0 +93,0 @@ "publishConfig": {

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

* How to use? : Check the GitHub README
* v3.7.0
* v3.7.1
*/

@@ -88,3 +88,3 @@ /*

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadParticlesCollisionsInteraction: () => (/* binding */ loadParticlesCollisionsInteraction)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Collider_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Collider.js */ \"./dist/browser/Collider.js\");\n\n\nasync function loadParticlesCollisionsInteraction(engine, refresh = true) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.assertValidVersion)(engine, \"3.7.0\");\n await engine.addInteractor(\"particlesCollisions\", container => {\n return Promise.resolve(new _Collider_js__WEBPACK_IMPORTED_MODULE_1__.Collider(container));\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-collisions/./dist/browser/index.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadParticlesCollisionsInteraction: () => (/* binding */ loadParticlesCollisionsInteraction)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Collider_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Collider.js */ \"./dist/browser/Collider.js\");\n\n\nasync function loadParticlesCollisionsInteraction(engine, refresh = true) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.assertValidVersion)(engine, \"3.7.1\");\n await engine.addInteractor(\"particlesCollisions\", container => {\n return Promise.resolve(new _Collider_js__WEBPACK_IMPORTED_MODULE_1__.Collider(container));\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-collisions/./dist/browser/index.js?");

@@ -91,0 +91,0 @@ /***/ }),

/*! For license information please see tsparticles.interaction.particles.collisions.min.js.LICENSE.txt */
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],o);else{var i="object"==typeof exports?o(require("@tsparticles/engine")):o(e.window);for(var t in i)("object"==typeof exports?exports:e)[t]=i[t]}}(this,(e=>(()=>{var o={303:o=>{o.exports=e}},i={};function t(e){var s=i[e];if(void 0!==s)return s.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,t),n.exports}t.d=(e,o)=>{for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};t.r(s),t.d(s,{loadParticlesCollisionsInteraction:()=>v});var n=t(303);const r=.5,a=10,l=0;function c(e,o,i,t,s,c){const d=(0,n.clamp)(e.options.collisions.absorb.speed*s.factor/a,l,t);e.size.value+=d*r,i.size.value-=d,t<=c&&(i.size.value=0,i.destroy())}const d=e=>{void 0===e.collisionMaxSpeed&&(e.collisionMaxSpeed=(0,n.getRangeValue)(e.options.collisions.maxSpeed)),e.velocity.length>e.collisionMaxSpeed&&(e.velocity.length=e.collisionMaxSpeed)};function u(e,o){(0,n.circleBounce)((0,n.circleBounceDataFromParticle)(e),(0,n.circleBounceDataFromParticle)(o)),d(e),d(o)}function p(e,o,i,t){switch(e.options.collisions.mode){case n.CollisionMode.absorb:!function(e,o,i,t){const s=e.getRadius(),n=o.getRadius();void 0===s&&void 0!==n?e.destroy():void 0!==s&&void 0===n?o.destroy():void 0!==s&&void 0!==n&&(s>=n?c(e,0,o,n,i,t):c(o,0,e,s,i,t))}(e,o,i,t);break;case n.CollisionMode.bounce:u(e,o);break;case n.CollisionMode.destroy:!function(e,o){e.unbreakable||o.unbreakable||u(e,o),void 0===e.getRadius()&&void 0!==o.getRadius()?e.destroy():void 0!==e.getRadius()&&void 0===o.getRadius()?o.destroy():void 0!==e.getRadius()&&void 0!==o.getRadius()&&(e.getRadius()>=o.getRadius()?o:e).destroy()}(e,o)}}class f extends n.ParticlesInteractorBase{constructor(e){super(e)}clear(){}init(){}interact(e,o){if(e.destroyed||e.spawning)return;const i=this.container,t=e.getPosition(),s=e.getRadius(),r=i.particles.quadTree.queryCircle(t,2*s);for(const a of r){if(e===a||!a.options.collisions.enable||e.options.collisions.mode!==a.options.collisions.mode||a.destroyed||a.spawning)continue;const r=a.getPosition(),l=a.getRadius();if(Math.abs(Math.round(t.z)-Math.round(r.z))>s+l)continue;(0,n.getDistance)(t,r)>s+l||p(e,a,o,i.retina.pixelRatio)}}isEnabled(e){return e.options.collisions.enable}reset(){}}async function v(e,o=!0){(0,n.assertValidVersion)(e,"3.7.0"),await e.addInteractor("particlesCollisions",(e=>Promise.resolve(new f(e))),o)}return s})()));
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],o);else{var i="object"==typeof exports?o(require("@tsparticles/engine")):o(e.window);for(var t in i)("object"==typeof exports?exports:e)[t]=i[t]}}(this,(e=>(()=>{var o={303:o=>{o.exports=e}},i={};function t(e){var s=i[e];if(void 0!==s)return s.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,t),n.exports}t.d=(e,o)=>{for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};t.r(s),t.d(s,{loadParticlesCollisionsInteraction:()=>v});var n=t(303);const r=.5,a=10,l=0;function c(e,o,i,t,s,c){const d=(0,n.clamp)(e.options.collisions.absorb.speed*s.factor/a,l,t);e.size.value+=d*r,i.size.value-=d,t<=c&&(i.size.value=0,i.destroy())}const d=e=>{void 0===e.collisionMaxSpeed&&(e.collisionMaxSpeed=(0,n.getRangeValue)(e.options.collisions.maxSpeed)),e.velocity.length>e.collisionMaxSpeed&&(e.velocity.length=e.collisionMaxSpeed)};function u(e,o){(0,n.circleBounce)((0,n.circleBounceDataFromParticle)(e),(0,n.circleBounceDataFromParticle)(o)),d(e),d(o)}function p(e,o,i,t){switch(e.options.collisions.mode){case n.CollisionMode.absorb:!function(e,o,i,t){const s=e.getRadius(),n=o.getRadius();void 0===s&&void 0!==n?e.destroy():void 0!==s&&void 0===n?o.destroy():void 0!==s&&void 0!==n&&(s>=n?c(e,0,o,n,i,t):c(o,0,e,s,i,t))}(e,o,i,t);break;case n.CollisionMode.bounce:u(e,o);break;case n.CollisionMode.destroy:!function(e,o){e.unbreakable||o.unbreakable||u(e,o),void 0===e.getRadius()&&void 0!==o.getRadius()?e.destroy():void 0!==e.getRadius()&&void 0===o.getRadius()?o.destroy():void 0!==e.getRadius()&&void 0!==o.getRadius()&&(e.getRadius()>=o.getRadius()?o:e).destroy()}(e,o)}}class f extends n.ParticlesInteractorBase{constructor(e){super(e)}clear(){}init(){}interact(e,o){if(e.destroyed||e.spawning)return;const i=this.container,t=e.getPosition(),s=e.getRadius(),r=i.particles.quadTree.queryCircle(t,2*s);for(const a of r){if(e===a||!a.options.collisions.enable||e.options.collisions.mode!==a.options.collisions.mode||a.destroyed||a.spawning)continue;const r=a.getPosition(),l=a.getRadius();if(Math.abs(Math.round(t.z)-Math.round(r.z))>s+l)continue;(0,n.getDistance)(t,r)>s+l||p(e,a,o,i.retina.pixelRatio)}}isEnabled(e){return e.options.collisions.enable}reset(){}}async function v(e,o=!0){(0,n.assertValidVersion)(e,"3.7.1"),await e.addInteractor("particlesCollisions",(e=>Promise.resolve(new f(e))),o)}return s})()));

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

/*! tsParticles Collisions Particles Interaction v3.7.0 by Matteo Bruni */
/*! tsParticles Collisions Particles Interaction v3.7.1 by Matteo Bruni */

@@ -16,3 +16,3 @@ (function (factory) {

async function loadParticlesCollisionsInteraction(engine, refresh = true) {
(0, engine_1.assertValidVersion)(engine, "3.7.0");
(0, engine_1.assertValidVersion)(engine, "3.7.1");
await engine.addInteractor("particlesCollisions", container => {

@@ -19,0 +19,0 @@ return Promise.resolve(new Collider_js_1.Collider(container));

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