@tsparticles/plugin-absorbers
Advanced tools
Comparing version 3.0.0-beta.0 to 3.0.0-beta.1
import { Vector, calcPositionOrRandomFromSize, calcPositionOrRandomFromSizeRanged, getDistance, getDistances, getRandom, getRangeValue, getStyleFromRgb, isPointInside, rangeColorToRgb, } from "@tsparticles/engine"; | ||
import { Absorber } from "./Options/Classes/Absorber"; | ||
import { Absorber } from "./Options/Classes/Absorber.js"; | ||
export class AbsorberInstance { | ||
@@ -4,0 +4,0 @@ constructor(absorbers, container, options, position) { |
import { executeOnSingleOrMultiple, isNumber, itemFromSingleOrMultiple, } from "@tsparticles/engine"; | ||
import { AbsorberInstance } from "./AbsorberInstance"; | ||
import { AbsorberInstance } from "./AbsorberInstance.js"; | ||
export class Absorbers { | ||
@@ -4,0 +4,0 @@ constructor(container) { |
import { executeOnSingleOrMultiple, isArray, isInArray, } from "@tsparticles/engine"; | ||
import { Absorber } from "./Options/Classes/Absorber"; | ||
import { Absorbers } from "./Absorbers"; | ||
import { Absorber } from "./Options/Classes/Absorber.js"; | ||
import { Absorbers } from "./Absorbers.js"; | ||
class AbsorbersPlugin { | ||
@@ -49,3 +49,3 @@ constructor() { | ||
} | ||
export * from "./AbsorberContainer"; | ||
export * from "./Enums/AbsorberClickMode"; | ||
export * from "./AbsorberContainer.js"; | ||
export * from "./Enums/AbsorberClickMode.js"; |
import { OptionsColor, setRangeValue, } from "@tsparticles/engine"; | ||
import { AbsorberSize } from "./AbsorberSize"; | ||
import { AbsorberSize } from "./AbsorberSize.js"; | ||
export class Absorber { | ||
@@ -4,0 +4,0 @@ constructor() { |
import { ValueWithRandom, isNumber } from "@tsparticles/engine"; | ||
import { AbsorberSizeLimit } from "./AbsorberSizeLimit"; | ||
import { AbsorberSizeLimit } from "./AbsorberSizeLimit.js"; | ||
export class AbsorberSize extends ValueWithRandom { | ||
@@ -4,0 +4,0 @@ constructor() { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const Absorber_1 = require("./Options/Classes/Absorber"); | ||
const Absorber_js_1 = require("./Options/Classes/Absorber.js"); | ||
class AbsorberInstance { | ||
@@ -65,7 +65,7 @@ constructor(absorbers, container, options, position) { | ||
this.initialPosition = position ? engine_1.Vector.create(position.x, position.y) : undefined; | ||
if (options instanceof Absorber_1.Absorber) { | ||
if (options instanceof Absorber_js_1.Absorber) { | ||
this.options = options; | ||
} | ||
else { | ||
this.options = new Absorber_1.Absorber(); | ||
this.options = new Absorber_js_1.Absorber(); | ||
this.options.load(options); | ||
@@ -72,0 +72,0 @@ } |
@@ -5,3 +5,3 @@ "use strict"; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const AbsorberInstance_1 = require("./AbsorberInstance"); | ||
const AbsorberInstance_js_1 = require("./AbsorberInstance.js"); | ||
class Absorbers { | ||
@@ -19,3 +19,3 @@ constructor(container) { | ||
addAbsorber(options, position) { | ||
const absorber = new AbsorberInstance_1.AbsorberInstance(this, this.container, options, position); | ||
const absorber = new AbsorberInstance_js_1.AbsorberInstance(this, this.container, options, position); | ||
this.array.push(absorber); | ||
@@ -22,0 +22,0 @@ return absorber; |
@@ -19,4 +19,4 @@ "use strict"; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const Absorber_1 = require("./Options/Classes/Absorber"); | ||
const Absorbers_1 = require("./Absorbers"); | ||
const Absorber_js_1 = require("./Options/Classes/Absorber.js"); | ||
const Absorbers_js_1 = require("./Absorbers.js"); | ||
class AbsorbersPlugin { | ||
@@ -27,3 +27,3 @@ constructor() { | ||
getPlugin(container) { | ||
return new Absorbers_1.Absorbers(container); | ||
return new Absorbers_js_1.Absorbers(container); | ||
} | ||
@@ -36,3 +36,3 @@ loadOptions(options, source) { | ||
options.absorbers = (0, engine_1.executeOnSingleOrMultiple)(source.absorbers, (absorber) => { | ||
const tmp = new Absorber_1.Absorber(); | ||
const tmp = new Absorber_js_1.Absorber(); | ||
tmp.load(absorber); | ||
@@ -43,3 +43,3 @@ return tmp; | ||
options.interactivity.modes.absorbers = (0, engine_1.executeOnSingleOrMultiple)(source?.interactivity?.modes?.absorbers, (absorber) => { | ||
const tmp = new Absorber_1.Absorber(); | ||
const tmp = new Absorber_js_1.Absorber(); | ||
tmp.load(absorber); | ||
@@ -71,3 +71,3 @@ return tmp; | ||
exports.loadAbsorbersPlugin = loadAbsorbersPlugin; | ||
__exportStar(require("./AbsorberContainer"), exports); | ||
__exportStar(require("./Enums/AbsorberClickMode"), exports); | ||
__exportStar(require("./AbsorberContainer.js"), exports); | ||
__exportStar(require("./Enums/AbsorberClickMode.js"), exports); |
@@ -5,3 +5,3 @@ "use strict"; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const AbsorberSize_1 = require("./AbsorberSize"); | ||
const AbsorberSize_js_1 = require("./AbsorberSize.js"); | ||
class Absorber { | ||
@@ -15,3 +15,3 @@ constructor() { | ||
this.orbits = false; | ||
this.size = new AbsorberSize_1.AbsorberSize(); | ||
this.size = new AbsorberSize_js_1.AbsorberSize(); | ||
} | ||
@@ -18,0 +18,0 @@ load(data) { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const AbsorberSizeLimit_1 = require("./AbsorberSizeLimit"); | ||
const AbsorberSizeLimit_js_1 = require("./AbsorberSizeLimit.js"); | ||
class AbsorberSize extends engine_1.ValueWithRandom { | ||
@@ -12,3 +12,3 @@ constructor() { | ||
this.value = 50; | ||
this.limit = new AbsorberSizeLimit_1.AbsorberSizeLimit(); | ||
this.limit = new AbsorberSizeLimit_js_1.AbsorberSizeLimit(); | ||
} | ||
@@ -15,0 +15,0 @@ load(data) { |
import { Vector, calcPositionOrRandomFromSize, calcPositionOrRandomFromSizeRanged, getDistance, getDistances, getRandom, getRangeValue, getStyleFromRgb, isPointInside, rangeColorToRgb, } from "@tsparticles/engine"; | ||
import { Absorber } from "./Options/Classes/Absorber"; | ||
import { Absorber } from "./Options/Classes/Absorber.js"; | ||
export class AbsorberInstance { | ||
@@ -4,0 +4,0 @@ constructor(absorbers, container, options, position) { |
import { executeOnSingleOrMultiple, isNumber, itemFromSingleOrMultiple, } from "@tsparticles/engine"; | ||
import { AbsorberInstance } from "./AbsorberInstance"; | ||
import { AbsorberInstance } from "./AbsorberInstance.js"; | ||
export class Absorbers { | ||
@@ -4,0 +4,0 @@ constructor(container) { |
import { executeOnSingleOrMultiple, isArray, isInArray, } from "@tsparticles/engine"; | ||
import { Absorber } from "./Options/Classes/Absorber"; | ||
import { Absorbers } from "./Absorbers"; | ||
import { Absorber } from "./Options/Classes/Absorber.js"; | ||
import { Absorbers } from "./Absorbers.js"; | ||
class AbsorbersPlugin { | ||
@@ -49,3 +49,3 @@ constructor() { | ||
} | ||
export * from "./AbsorberContainer"; | ||
export * from "./Enums/AbsorberClickMode"; | ||
export * from "./AbsorberContainer.js"; | ||
export * from "./Enums/AbsorberClickMode.js"; |
import { OptionsColor, setRangeValue, } from "@tsparticles/engine"; | ||
import { AbsorberSize } from "./AbsorberSize"; | ||
import { AbsorberSize } from "./AbsorberSize.js"; | ||
export class Absorber { | ||
@@ -4,0 +4,0 @@ constructor() { |
import { ValueWithRandom, isNumber } from "@tsparticles/engine"; | ||
import { AbsorberSizeLimit } from "./AbsorberSizeLimit"; | ||
import { AbsorberSizeLimit } from "./AbsorberSizeLimit.js"; | ||
export class AbsorberSize extends ValueWithRandom { | ||
@@ -4,0 +4,0 @@ constructor() { |
{ | ||
"name": "@tsparticles/plugin-absorbers", | ||
"version": "3.0.0-beta.0", | ||
"version": "3.0.0-beta.1", | ||
"description": "tsParticles absorbers plugin", | ||
@@ -70,10 +70,22 @@ "homepage": "https://particles.js.org", | ||
}, | ||
"main": "cjs/index.js", | ||
"sideEffects": false, | ||
"jsdelivr": "tsparticles.plugin.absorbers.min.js", | ||
"unpkg": "tsparticles.plugin.absorbers.min.js", | ||
"browser": "browser/index.js", | ||
"main": "cjs/index.js", | ||
"module": "esm/index.js", | ||
"types": "types/index.d.ts", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"types": "./types/index.d.ts", | ||
"browser": "./browser/index.js", | ||
"import": "./esm/index.js", | ||
"require": "./cjs/index.js", | ||
"umd": "./umd/index.js", | ||
"default": "./cjs/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"dependencies": { | ||
"@tsparticles/engine": "^3.0.0-beta.0" | ||
"@tsparticles/engine": "^3.0.0-beta.1" | ||
}, | ||
@@ -80,0 +92,0 @@ "publishConfig": { |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v3.0.0-beta.0 | ||
* v3.0.0-beta.1 | ||
*/ | ||
@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) { |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Absorbers Plugin v3.0.0-beta.0 by Matteo Bruni */ | ||
/*! tsParticles Absorbers Plugin v3.0.0-beta.1 by Matteo Bruni */ |
import type { Container, ICoordinates, RecursivePartial } from "@tsparticles/engine"; | ||
import type { AbsorberInstance } from "./AbsorberInstance"; | ||
import type { AbsorberOptions } from "./types"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber"; | ||
import type { AbsorberInstance } from "./AbsorberInstance.js"; | ||
import type { AbsorberOptions } from "./types.js"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js"; | ||
export interface AbsorberContainer extends Container { | ||
@@ -6,0 +6,0 @@ actualOptions: AbsorberOptions; |
import { type Container, type ICoordinates, type IRgb, type Particle, type RecursivePartial, RotateDirection, Vector } from "@tsparticles/engine"; | ||
import type { Absorbers } from "./Absorbers"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber"; | ||
import type { IAbsorberSizeLimit } from "./Options/Interfaces/IAbsorberSizeLimit"; | ||
import type { Absorbers } from "./Absorbers.js"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js"; | ||
import type { IAbsorberSizeLimit } from "./Options/Interfaces/IAbsorberSizeLimit.js"; | ||
type OrbitingParticle = Particle & { | ||
@@ -6,0 +6,0 @@ absorberOrbit?: Vector; |
import { type IContainerPlugin, type ICoordinates, type Particle, type RecursivePartial, type SingleOrMultiple } from "@tsparticles/engine"; | ||
import type { Absorber } from "./Options/Classes/Absorber"; | ||
import type { AbsorberContainer } from "./AbsorberContainer"; | ||
import { AbsorberInstance } from "./AbsorberInstance"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber"; | ||
import type { Absorber } from "./Options/Classes/Absorber.js"; | ||
import type { AbsorberContainer } from "./AbsorberContainer.js"; | ||
import { AbsorberInstance } from "./AbsorberInstance.js"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js"; | ||
export declare class Absorbers implements IContainerPlugin { | ||
@@ -7,0 +7,0 @@ private readonly container; |
import { type Engine } from "@tsparticles/engine"; | ||
export declare function loadAbsorbersPlugin(engine: Engine, refresh?: boolean): Promise<void>; | ||
export * from "./AbsorberContainer"; | ||
export * from "./Enums/AbsorberClickMode"; | ||
export * from "./AbsorberContainer.js"; | ||
export * from "./Enums/AbsorberClickMode.js"; |
import { type IOptionLoader, type IRangedCoordinates, OptionsColor, type RecursivePartial } from "@tsparticles/engine"; | ||
import { AbsorberSize } from "./AbsorberSize"; | ||
import type { IAbsorber } from "../Interfaces/IAbsorber"; | ||
import { AbsorberSize } from "./AbsorberSize.js"; | ||
import type { IAbsorber } from "../Interfaces/IAbsorber.js"; | ||
export declare class Absorber implements IAbsorber, IOptionLoader<IAbsorber> { | ||
@@ -5,0 +5,0 @@ color: OptionsColor; |
import { type IOptionLoader, type RecursivePartial, ValueWithRandom } from "@tsparticles/engine"; | ||
import { AbsorberSizeLimit } from "./AbsorberSizeLimit"; | ||
import type { IAbsorberSize } from "../Interfaces/IAbsorberSize"; | ||
import { AbsorberSizeLimit } from "./AbsorberSizeLimit.js"; | ||
import type { IAbsorberSize } from "../Interfaces/IAbsorberSize.js"; | ||
export declare class AbsorberSize extends ValueWithRandom implements IAbsorberSize, IOptionLoader<IAbsorberSize> { | ||
@@ -5,0 +5,0 @@ density: number; |
import type { IOptionLoader, RecursivePartial } from "@tsparticles/engine"; | ||
import type { IAbsorberSizeLimit } from "../Interfaces/IAbsorberSizeLimit"; | ||
import type { IAbsorberSizeLimit } from "../Interfaces/IAbsorberSizeLimit.js"; | ||
export declare class AbsorberSizeLimit implements IAbsorberSizeLimit, IOptionLoader<IAbsorberSizeLimit> { | ||
@@ -4,0 +4,0 @@ mass: number; |
import type { IOptionsColor, IRangedCoordinates, RecursivePartial } from "@tsparticles/engine"; | ||
import type { IAbsorberSize } from "./IAbsorberSize"; | ||
import type { IAbsorberSize } from "./IAbsorberSize.js"; | ||
export interface IAbsorber { | ||
@@ -4,0 +4,0 @@ color: string | IOptionsColor; |
@@ -1,2 +0,2 @@ | ||
import type { IAbsorberSizeLimit } from "./IAbsorberSizeLimit"; | ||
import type { IAbsorberSizeLimit } from "./IAbsorberSizeLimit.js"; | ||
import type { IValueWithRandom } from "@tsparticles/engine"; | ||
@@ -3,0 +3,0 @@ export interface IAbsorberSize extends IValueWithRandom { |
import type { IOptions, Options, SingleOrMultiple } from "@tsparticles/engine"; | ||
import type { Absorber } from "./Options/Classes/Absorber"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber"; | ||
import type { Absorber } from "./Options/Classes/Absorber.js"; | ||
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js"; | ||
export type AbsorberOptions = Options & { | ||
@@ -5,0 +5,0 @@ absorbers: SingleOrMultiple<Absorber>; |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Absorber"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Absorber.js"], factory); | ||
} | ||
@@ -15,3 +15,3 @@ })(function (require, exports) { | ||
const engine_1 = require("@tsparticles/engine"); | ||
const Absorber_1 = require("./Options/Classes/Absorber"); | ||
const Absorber_js_1 = require("./Options/Classes/Absorber.js"); | ||
class AbsorberInstance { | ||
@@ -75,7 +75,7 @@ constructor(absorbers, container, options, position) { | ||
this.initialPosition = position ? engine_1.Vector.create(position.x, position.y) : undefined; | ||
if (options instanceof Absorber_1.Absorber) { | ||
if (options instanceof Absorber_js_1.Absorber) { | ||
this.options = options; | ||
} | ||
else { | ||
this.options = new Absorber_1.Absorber(); | ||
this.options = new Absorber_js_1.Absorber(); | ||
this.options.load(options); | ||
@@ -82,0 +82,0 @@ } |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@tsparticles/engine", "./AbsorberInstance"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "./AbsorberInstance.js"], factory); | ||
} | ||
@@ -15,3 +15,3 @@ })(function (require, exports) { | ||
const engine_1 = require("@tsparticles/engine"); | ||
const AbsorberInstance_1 = require("./AbsorberInstance"); | ||
const AbsorberInstance_js_1 = require("./AbsorberInstance.js"); | ||
class Absorbers { | ||
@@ -29,3 +29,3 @@ constructor(container) { | ||
addAbsorber(options, position) { | ||
const absorber = new AbsorberInstance_1.AbsorberInstance(this, this.container, options, position); | ||
const absorber = new AbsorberInstance_js_1.AbsorberInstance(this, this.container, options, position); | ||
this.array.push(absorber); | ||
@@ -32,0 +32,0 @@ return absorber; |
@@ -21,3 +21,3 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Absorber", "./Absorbers", "./AbsorberContainer", "./Enums/AbsorberClickMode"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Absorber.js", "./Absorbers.js", "./AbsorberContainer.js", "./Enums/AbsorberClickMode.js"], factory); | ||
} | ||
@@ -29,4 +29,4 @@ })(function (require, exports) { | ||
const engine_1 = require("@tsparticles/engine"); | ||
const Absorber_1 = require("./Options/Classes/Absorber"); | ||
const Absorbers_1 = require("./Absorbers"); | ||
const Absorber_js_1 = require("./Options/Classes/Absorber.js"); | ||
const Absorbers_js_1 = require("./Absorbers.js"); | ||
class AbsorbersPlugin { | ||
@@ -37,3 +37,3 @@ constructor() { | ||
getPlugin(container) { | ||
return new Absorbers_1.Absorbers(container); | ||
return new Absorbers_js_1.Absorbers(container); | ||
} | ||
@@ -46,3 +46,3 @@ loadOptions(options, source) { | ||
options.absorbers = (0, engine_1.executeOnSingleOrMultiple)(source.absorbers, (absorber) => { | ||
const tmp = new Absorber_1.Absorber(); | ||
const tmp = new Absorber_js_1.Absorber(); | ||
tmp.load(absorber); | ||
@@ -53,3 +53,3 @@ return tmp; | ||
options.interactivity.modes.absorbers = (0, engine_1.executeOnSingleOrMultiple)(source?.interactivity?.modes?.absorbers, (absorber) => { | ||
const tmp = new Absorber_1.Absorber(); | ||
const tmp = new Absorber_js_1.Absorber(); | ||
tmp.load(absorber); | ||
@@ -81,4 +81,4 @@ return tmp; | ||
exports.loadAbsorbersPlugin = loadAbsorbersPlugin; | ||
__exportStar(require("./AbsorberContainer"), exports); | ||
__exportStar(require("./Enums/AbsorberClickMode"), exports); | ||
__exportStar(require("./AbsorberContainer.js"), exports); | ||
__exportStar(require("./Enums/AbsorberClickMode.js"), exports); | ||
}); |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@tsparticles/engine", "./AbsorberSize"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "./AbsorberSize.js"], factory); | ||
} | ||
@@ -15,3 +15,3 @@ })(function (require, exports) { | ||
const engine_1 = require("@tsparticles/engine"); | ||
const AbsorberSize_1 = require("./AbsorberSize"); | ||
const AbsorberSize_js_1 = require("./AbsorberSize.js"); | ||
class Absorber { | ||
@@ -25,3 +25,3 @@ constructor() { | ||
this.orbits = false; | ||
this.size = new AbsorberSize_1.AbsorberSize(); | ||
this.size = new AbsorberSize_js_1.AbsorberSize(); | ||
} | ||
@@ -28,0 +28,0 @@ load(data) { |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@tsparticles/engine", "./AbsorberSizeLimit"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "./AbsorberSizeLimit.js"], factory); | ||
} | ||
@@ -15,3 +15,3 @@ })(function (require, exports) { | ||
const engine_1 = require("@tsparticles/engine"); | ||
const AbsorberSizeLimit_1 = require("./AbsorberSizeLimit"); | ||
const AbsorberSizeLimit_js_1 = require("./AbsorberSizeLimit.js"); | ||
class AbsorberSize extends engine_1.ValueWithRandom { | ||
@@ -22,3 +22,3 @@ constructor() { | ||
this.value = 50; | ||
this.limit = new AbsorberSizeLimit_1.AbsorberSizeLimit(); | ||
this.limit = new AbsorberSizeLimit_js_1.AbsorberSizeLimit(); | ||
} | ||
@@ -25,0 +25,0 @@ load(data) { |
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
378944
70