@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.
30 lines (29 loc) • 1.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangedAnimationValueWithRandom = exports.AnimationValueWithRandom = exports.ValueWithRandom = void 0;
const AnimationOptions_js_1 = require("./AnimationOptions.js");
const OptionLoader_js_1 = require("../../Utils/OptionLoader.js");
const TypeUtils_js_1 = require("../../Utils/TypeUtils.js");
const OptionsUtils_js_1 = require("../../Utils/OptionsUtils.js");
const MathUtils_js_1 = require("../../Utils/MathUtils.js");
class ValueWithRandom extends OptionLoader_js_1.OptionLoader {
value = 0;
doLoad(data) {
if (!(0, TypeUtils_js_1.isNull)(data.value)) {
this.value = (0, MathUtils_js_1.setRangeValue)(data.value);
}
}
}
exports.ValueWithRandom = ValueWithRandom;
class AnimationValueWithRandom extends ValueWithRandom {
animation = new AnimationOptions_js_1.AnimationOptions();
doLoad(data) {
super.doLoad(data);
(0, OptionsUtils_js_1.loadNestedProperty)(this, "animation", data.animation);
}
}
exports.AnimationValueWithRandom = AnimationValueWithRandom;
class RangedAnimationValueWithRandom extends AnimationValueWithRandom {
animation = new AnimationOptions_js_1.RangedAnimationOptions();
}
exports.RangedAnimationValueWithRandom = RangedAnimationValueWithRandom;