50 lines
1.9 KiB
JavaScript
50 lines
1.9 KiB
JavaScript
"use strict";
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Remover = void 0;
|
|
const tsparticles_engine_1 = require("tsparticles-engine");
|
|
const Remove_1 = require("./Options/Classes/Remove");
|
|
class Remover extends tsparticles_engine_1.ExternalInteractorBase {
|
|
constructor(container) {
|
|
super(container);
|
|
this.handleClickMode = (mode) => {
|
|
const container = this.container, options = container.actualOptions;
|
|
if (!options.interactivity.modes.remove || mode !== "remove") {
|
|
return;
|
|
}
|
|
const removeNb = options.interactivity.modes.remove.quantity;
|
|
container.particles.removeQuantity(removeNb);
|
|
};
|
|
}
|
|
clear() {
|
|
}
|
|
init() {
|
|
}
|
|
interact() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
});
|
|
}
|
|
isEnabled() {
|
|
return true;
|
|
}
|
|
loadModeOptions(options, ...sources) {
|
|
if (!options.remove) {
|
|
options.remove = new Remove_1.Remove();
|
|
}
|
|
for (const source of sources) {
|
|
options.remove.load(source === null || source === void 0 ? void 0 : source.remove);
|
|
}
|
|
}
|
|
reset() {
|
|
}
|
|
}
|
|
exports.Remover = Remover;
|