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.

36 lines (35 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Roll = void 0; const OptionsColor_1 = require("../../OptionsColor"); const RollLight_1 = require("./RollLight"); const Utils_1 = require("../../../../Utils"); class Roll { constructor() { this.darken = new RollLight_1.RollLight(); this.enable = false; this.enlighten = new RollLight_1.RollLight(); this.mode = "vertical"; this.speed = 25; } load(data) { if (!data) { return; } if (data.backColor !== undefined) { this.backColor = OptionsColor_1.OptionsColor.create(this.backColor, data.backColor); } this.darken.load(data.darken); if (data.enable !== undefined) { this.enable = data.enable; } this.enlighten.load(data.enlighten); if (data.mode !== undefined) { this.mode = data.mode; } if (data.speed !== undefined) { this.speed = (0, Utils_1.setRangeValue)(data.speed); } } } exports.Roll = Roll;