@tsparticles/plugin-polygon-mask
Version:
tsParticles polygon mask plugin
41 lines (40 loc) • 1.32 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", "@tsparticles/engine"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PolygonMaskLocalSvg = void 0;
const engine_1 = require("@tsparticles/engine");
class PolygonMaskLocalSvg {
constructor() {
this.path = [];
this.size = {
height: 0,
width: 0,
};
}
load(data) {
if ((0, engine_1.isNull)(data)) {
return;
}
if (data.path !== undefined) {
this.path = data.path;
}
if (data.size !== undefined) {
if (data.size.width !== undefined) {
this.size.width = data.size.width;
}
if (data.size.height !== undefined) {
this.size.height = data.size.height;
}
}
}
}
exports.PolygonMaskLocalSvg = PolygonMaskLocalSvg;
});