tsparticles-engine
Version:
Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.
42 lines (41 loc) • 1.3 kB
JavaScript
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "./ParticlesDensity"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParticlesNumber = void 0;
const ParticlesDensity_1 = require("./ParticlesDensity");
class ParticlesNumber {
constructor() {
this.density = new ParticlesDensity_1.ParticlesDensity();
this.limit = 0;
this.value = 0;
}
get max() {
return this.limit;
}
set max(value) {
this.limit = value;
}
load(data) {
if (!data) {
return;
}
this.density.load(data.density);
const limit = data.limit ?? data.max;
if (limit !== undefined) {
this.limit = limit;
}
if (data.value !== undefined) {
this.value = data.value;
}
}
}
exports.ParticlesNumber = ParticlesNumber;
});