tsparticles-interaction-particles-attract
Advanced tools
Comparing version 2.10.1 to 2.11.0
import { Attractor } from "./Attractor"; | ||
export async function loadParticlesAttractInteraction(engine) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor(container)); | ||
export async function loadParticlesAttractInteraction(engine, refresh = true) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor(container), refresh); | ||
} |
@@ -5,5 +5,5 @@ "use strict"; | ||
const Attractor_1 = require("./Attractor"); | ||
async function loadParticlesAttractInteraction(engine) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container)); | ||
async function loadParticlesAttractInteraction(engine, refresh = true) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container), refresh); | ||
} | ||
exports.loadParticlesAttractInteraction = loadParticlesAttractInteraction; |
import { Attractor } from "./Attractor"; | ||
export async function loadParticlesAttractInteraction(engine) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor(container)); | ||
export async function loadParticlesAttractInteraction(engine, refresh = true) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor(container), refresh); | ||
} |
{ | ||
"name": "tsparticles-interaction-particles-attract", | ||
"version": "2.10.1", | ||
"version": "2.11.0", | ||
"description": "tsParticles attract particles interaction", | ||
@@ -76,5 +76,6 @@ "homepage": "https://particles.js.org", | ||
"types": "types/index.d.ts", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"tsparticles-engine": "^2.10.1" | ||
"tsparticles-engine": "^2.11.0" | ||
} | ||
} |
@@ -29,7 +29,12 @@ [![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org) | ||
```javascript | ||
loadParticlesAttractInteraction(tsParticles); | ||
(async () => { | ||
await loadParticlesAttractInteraction(tsParticles); | ||
tsParticles.load("tsparticles", { | ||
/* options */ | ||
}); | ||
await tsParticles.load({ | ||
id: "tsparticles", | ||
options: { | ||
/* options */ | ||
}, | ||
}); | ||
})(); | ||
``` | ||
@@ -57,3 +62,5 @@ | ||
loadParticlesAttractInteraction(tsParticles); | ||
(async () => { | ||
await loadParticlesAttractInteraction(tsParticles); | ||
})(); | ||
``` | ||
@@ -67,3 +74,5 @@ | ||
loadParticlesAttractInteraction(tsParticles); | ||
(async () => { | ||
await loadParticlesAttractInteraction(tsParticles); | ||
})(); | ||
``` |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.10.1 | ||
* v2.11.0 | ||
*/ | ||
@@ -140,4 +140,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
async function loadParticlesAttractInteraction(engine) { | ||
await engine.addInteractor("particlesAttract", container => new Attractor(container)); | ||
async function loadParticlesAttractInteraction(engine, refresh = true) { | ||
await engine.addInteractor("particlesAttract", container => new Attractor(container), refresh); | ||
} | ||
@@ -144,0 +144,0 @@ })(); |
/*! For license information please see tsparticles.interaction.particles.attract.min.js.LICENSE.txt */ | ||
!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 r="object"==typeof exports?t(require("tsparticles-engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{"use strict";var t={961:t=>{t.exports=e}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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 n={};return(()=>{o.r(n),o.d(n,{loadParticlesAttractInteraction:()=>r});var e=o(961);class t extends e.ParticlesInteractorBase{constructor(e){super(e)}clear(){}init(){}async interact(t){const r=this.container,o=t.retina.attractDistance??r.retina.attractDistance,n=t.getPosition(),i=r.particles.quadTree.queryCircle(n,o);for(const r of i){if(t===r||!r.options.move.attract.enable||r.destroyed||r.spawning)continue;const o=r.getPosition(),{dx:i,dy:a}=(0,e.getDistances)(n,o),s=t.options.move.attract.rotate,c=i/(1e3*s.x),l=a/(1e3*s.y),p=r.size.value/t.size.value,d=1/p;t.velocity.x-=c*p,t.velocity.y-=l*p,r.velocity.x+=c*d,r.velocity.y+=l*d}}isEnabled(e){return e.options.move.attract.enable}reset(){}}async function r(e){await e.addInteractor("particlesAttract",(e=>new t(e)))}})(),n})())); | ||
!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 r="object"==typeof exports?t(require("tsparticles-engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{"use strict";var t={961:t=>{t.exports=e}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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 n={};return(()=>{o.r(n),o.d(n,{loadParticlesAttractInteraction:()=>r});var e=o(961);class t extends e.ParticlesInteractorBase{constructor(e){super(e)}clear(){}init(){}async interact(t){const r=this.container,o=t.retina.attractDistance??r.retina.attractDistance,n=t.getPosition(),i=r.particles.quadTree.queryCircle(n,o);for(const r of i){if(t===r||!r.options.move.attract.enable||r.destroyed||r.spawning)continue;const o=r.getPosition(),{dx:i,dy:a}=(0,e.getDistances)(n,o),s=t.options.move.attract.rotate,c=i/(1e3*s.x),l=a/(1e3*s.y),p=r.size.value/t.size.value,d=1/p;t.velocity.x-=c*p,t.velocity.y-=l*p,r.velocity.x+=c*d,r.velocity.y+=l*d}}isEnabled(e){return e.options.move.attract.enable}reset(){}}async function r(e,r=!0){await e.addInteractor("particlesAttract",(e=>new t(e)),r)}})(),n})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Attract Particles Interaction v2.10.1 by Matteo Bruni */ | ||
/*! tsParticles Attract Particles Interaction v2.11.0 by Matteo Bruni */ |
import type { Engine } from "tsparticles-engine"; | ||
export declare function loadParticlesAttractInteraction(engine: Engine): Promise<void>; | ||
export declare function loadParticlesAttractInteraction(engine: Engine, refresh?: boolean): Promise<void>; |
@@ -14,6 +14,6 @@ (function (factory) { | ||
const Attractor_1 = require("./Attractor"); | ||
async function loadParticlesAttractInteraction(engine) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container)); | ||
async function loadParticlesAttractInteraction(engine, refresh = true) { | ||
await engine.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container), refresh); | ||
} | ||
exports.loadParticlesAttractInteraction = loadParticlesAttractInteraction; | ||
}); |
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
299245
76
Updatedtsparticles-engine@^2.11.0