UNPKG

tsparticles

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.

40 lines (39 loc) 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Orbit = void 0; const AnimationOptions_1 = require("../../AnimationOptions"); const OptionsColor_1 = require("../../OptionsColor"); const OrbitRotation_1 = require("./OrbitRotation"); const Utils_1 = require("../../../../Utils"); class Orbit { constructor() { this.animation = new AnimationOptions_1.AnimationOptions(); this.enable = false; this.opacity = 1; this.rotation = new OrbitRotation_1.OrbitRotation(); this.width = 1; } load(data) { if (data === undefined) { 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, Utils_1.setRangeValue)(data.opacity); } if (data.width !== undefined) { this.width = (0, Utils_1.setRangeValue)(data.width); } if (data.radius !== undefined) { this.radius = (0, Utils_1.setRangeValue)(data.radius); } if (data.color !== undefined) { this.color = OptionsColor_1.OptionsColor.create(this.color, data.color); } } } exports.Orbit = Orbit;