UNPKG

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.

31 lines (30 loc) 864 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Interactivity = void 0; const Events_1 = require("./Events/Events"); const Modes_1 = require("./Modes/Modes"); class Interactivity { constructor(engine, container) { this.detectsOn = "window"; this.events = new Events_1.Events(); this.modes = new Modes_1.Modes(engine, container); } get detect_on() { return this.detectsOn; } set detect_on(value) { this.detectsOn = value; } load(data) { if (!data) { return; } const detectsOn = data.detectsOn ?? data.detect_on; if (detectsOn !== undefined) { this.detectsOn = detectsOn; } this.events.load(data.events); this.modes.load(data.modes); } } exports.Interactivity = Interactivity;