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.
24 lines (23 loc) • 670 B
JavaScript
import { BubbleBase } from "./BubbleBase";
import { BubbleDiv } from "./BubbleDiv";
export class Bubble extends BubbleBase {
load(data) {
super.load(data);
if (!(data !== undefined && data.divs !== undefined)) {
return;
}
if (data.divs instanceof Array) {
this.divs = data.divs.map((s) => {
const tmp = new BubbleDiv();
tmp.load(s);
return tmp;
});
}
else {
if (this.divs instanceof Array || !this.divs) {
this.divs = new BubbleDiv();
}
this.divs.load(data.divs);
}
}
}