@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.
35 lines (34 loc) • 1.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangedAnimationOptions = exports.AnimationOptions = void 0;
const OptionsUtils_js_1 = require("../../Utils/OptionsUtils.js");
const AnimationMode_js_1 = require("../../Enums/Modes/AnimationMode.js");
const OptionLoader_js_1 = require("../../Utils/OptionLoader.js");
const StartValueType_js_1 = require("../../Enums/Types/StartValueType.js");
class AnimationOptions extends OptionLoader_js_1.OptionLoader {
count = 0;
decay = 0;
delay = 0;
enable = false;
speed = 1;
sync = false;
doLoad(data) {
(0, OptionsUtils_js_1.loadRangeProperty)(this, "count", data.count);
(0, OptionsUtils_js_1.loadProperty)(this, "enable", data.enable);
(0, OptionsUtils_js_1.loadRangeProperty)(this, "speed", data.speed);
(0, OptionsUtils_js_1.loadRangeProperty)(this, "decay", data.decay);
(0, OptionsUtils_js_1.loadRangeProperty)(this, "delay", data.delay);
(0, OptionsUtils_js_1.loadProperty)(this, "sync", data.sync);
}
}
exports.AnimationOptions = AnimationOptions;
class RangedAnimationOptions extends AnimationOptions {
mode = AnimationMode_js_1.AnimationMode.auto;
startValue = StartValueType_js_1.StartValueType.random;
doLoad(data) {
super.doLoad(data);
(0, OptionsUtils_js_1.loadProperty)(this, "mode", data.mode);
(0, OptionsUtils_js_1.loadProperty)(this, "startValue", data.startValue);
}
}
exports.RangedAnimationOptions = RangedAnimationOptions;