58 lines
2.3 KiB
JavaScript
58 lines
2.3 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.Pusher = void 0;
|
|
const tsparticles_engine_1 = require("tsparticles-engine");
|
|
const Push_1 = require("./Options/Classes/Push");
|
|
const tsparticles_engine_2 = require("tsparticles-engine");
|
|
class Pusher extends tsparticles_engine_1.ExternalInteractorBase {
|
|
constructor(container) {
|
|
super(container);
|
|
this.handleClickMode = (mode) => {
|
|
if (mode !== "push") {
|
|
return;
|
|
}
|
|
const container = this.container, options = container.actualOptions, pushOptions = options.interactivity.modes.push;
|
|
if (!pushOptions) {
|
|
return;
|
|
}
|
|
const pushNb = pushOptions.quantity;
|
|
if (pushNb <= 0) {
|
|
return;
|
|
}
|
|
const group = (0, tsparticles_engine_2.itemFromArray)([undefined, ...pushOptions.groups]), groupOptions = group !== undefined ? container.actualOptions.particles.groups[group] : undefined;
|
|
container.particles.push(pushNb, container.interactivity.mouse, groupOptions, group);
|
|
};
|
|
}
|
|
clear() {
|
|
}
|
|
init() {
|
|
}
|
|
interact() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
});
|
|
}
|
|
isEnabled() {
|
|
return true;
|
|
}
|
|
loadModeOptions(options, ...sources) {
|
|
if (!options.push) {
|
|
options.push = new Push_1.Push();
|
|
}
|
|
for (const source of sources) {
|
|
options.push.load(source === null || source === void 0 ? void 0 : source.push);
|
|
}
|
|
}
|
|
reset() {
|
|
}
|
|
}
|
|
exports.Pusher = Pusher;
|