UNPKG

@tsparticles/updater-orbit

Version:

tsParticles particles orbit updater

48 lines (47 loc) 1.77 kB
(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", "@tsparticles/engine", "./OrbitRotation.js"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Orbit = void 0; const engine_1 = require("@tsparticles/engine"); const OrbitRotation_js_1 = require("./OrbitRotation.js"); class Orbit { constructor() { this.animation = new engine_1.AnimationOptions(); this.enable = false; this.opacity = 1; this.rotation = new OrbitRotation_js_1.OrbitRotation(); this.width = 1; } load(data) { if ((0, engine_1.isNull)(data)) { return; } this.animation.load(data.animation); this.rotation.load(data.rotation); if (data.enable !== undefined) { this.enable = data.enable; } if (data.opacity !== undefined) { this.opacity = (0, engine_1.setRangeValue)(data.opacity); } if (data.width !== undefined) { this.width = (0, engine_1.setRangeValue)(data.width); } if (data.radius !== undefined) { this.radius = (0, engine_1.setRangeValue)(data.radius); } if (data.color !== undefined) { this.color = engine_1.OptionsColor.create(this.color, data.color); } } } exports.Orbit = Orbit; });