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.
41 lines (40 loc) • 1.36 kB
JavaScript
(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", "../../AnimationOptions"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpacityAnimation = void 0;
const AnimationOptions_1 = require("../../AnimationOptions");
class OpacityAnimation extends AnimationOptions_1.RangedAnimationOptions {
constructor() {
super();
this.destroy = "none";
this.speed = 2;
}
get opacity_min() {
return this.minimumValue;
}
set opacity_min(value) {
this.minimumValue = value;
}
load(data) {
if (data?.opacity_min !== undefined && data.minimumValue === undefined) {
data.minimumValue = data.opacity_min;
}
super.load(data);
if (!data) {
return;
}
if (data.destroy !== undefined) {
this.destroy = data.destroy;
}
}
}
exports.OpacityAnimation = OpacityAnimation;
});