@tsparticles/plugin-emitters-shape-canvas 3.6.0-beta.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/EmittersCanvasShape.js +2 -2
- package/browser/Options/Classes/EmittersCanvasShapeOptions.js +2 -1
- package/browser/Options/Classes/PixelsOptions.js +2 -1
- package/browser/Options/Classes/TextFontOptions.js +2 -1
- package/browser/Options/Classes/TextLinesOptions.js +2 -1
- package/browser/Options/Classes/TextOptions.js +2 -1
- package/cjs/EmittersCanvasShape.js +1 -1
- package/cjs/Options/Classes/EmittersCanvasShapeOptions.js +2 -1
- package/cjs/Options/Classes/PixelsOptions.js +2 -1
- package/cjs/Options/Classes/TextFontOptions.js +2 -1
- package/cjs/Options/Classes/TextLinesOptions.js +2 -1
- package/cjs/Options/Classes/TextOptions.js +2 -1
- package/esm/EmittersCanvasShape.js +2 -2
- package/esm/Options/Classes/EmittersCanvasShapeOptions.js +2 -1
- package/esm/Options/Classes/PixelsOptions.js +2 -1
- package/esm/Options/Classes/TextFontOptions.js +2 -1
- package/esm/Options/Classes/TextLinesOptions.js +2 -1
- package/esm/Options/Classes/TextOptions.js +2 -1
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.plugin.emitters.shape.canvas.js +7 -7
- package/tsparticles.plugin.emitters.shape.canvas.min.js +1 -1
- package/tsparticles.plugin.emitters.shape.canvas.min.js.LICENSE.txt +1 -1
- package/types/Options/Classes/EmittersCanvasShapeOptions.d.ts +1 -1
- package/types/Options/Classes/PixelsOptions.d.ts +1 -1
- package/types/Options/Classes/TextFontOptions.d.ts +1 -1
- package/types/Options/Classes/TextLinesOptions.d.ts +1 -1
- package/types/Options/Classes/TextOptions.d.ts +1 -1
- package/umd/EmittersCanvasShape.js +1 -1
- package/umd/Options/Classes/EmittersCanvasShapeOptions.js +3 -2
- package/umd/Options/Classes/PixelsOptions.js +3 -2
- package/umd/Options/Classes/TextFontOptions.js +3 -2
- package/umd/Options/Classes/TextLinesOptions.js +3 -2
- package/umd/Options/Classes/TextOptions.js +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmitterShapeBase } from "@tsparticles/plugin-emitters";
|
|
2
|
-
import { getRandom, isFunction, isString } from "@tsparticles/engine";
|
|
2
|
+
import { getRandom, isFunction, isNull, isString, } from "@tsparticles/engine";
|
|
3
3
|
import { getCanvasImageData, getImageData, getTextData } from "./utils.js";
|
|
4
4
|
const maxRetries = 100, half = 0.5;
|
|
5
5
|
export class EmittersCanvasShape extends EmitterShapeBase {
|
|
@@ -40,7 +40,7 @@ export class EmittersCanvasShape extends EmitterShapeBase {
|
|
|
40
40
|
}
|
|
41
41
|
else if (text) {
|
|
42
42
|
const data = getTextData(text, offset, this.fill);
|
|
43
|
-
if (
|
|
43
|
+
if (isNull(data)) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
pixelData = data;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNull } from "@tsparticles/engine";
|
|
1
2
|
import { PixelsOptions } from "./PixelsOptions.js";
|
|
2
3
|
import { TextOptions } from "./TextOptions.js";
|
|
3
4
|
const minAlpha = 0;
|
|
@@ -10,7 +11,7 @@ export class EmittersCanvasShapeOptions {
|
|
|
10
11
|
this.text = new TextOptions();
|
|
11
12
|
}
|
|
12
13
|
load(data) {
|
|
13
|
-
if (
|
|
14
|
+
if (isNull(data)) {
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
16
17
|
if (data.element !== undefined) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNull } from "@tsparticles/engine";
|
|
1
2
|
export class TextFontOptions {
|
|
2
3
|
constructor() {
|
|
3
4
|
this.family = "Verdana";
|
|
@@ -7,7 +8,7 @@ export class TextFontOptions {
|
|
|
7
8
|
this.weight = "";
|
|
8
9
|
}
|
|
9
10
|
load(data) {
|
|
10
|
-
if (
|
|
11
|
+
if (isNull(data)) {
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
14
|
if (data.family !== undefined) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNull } from "@tsparticles/engine";
|
|
1
2
|
import { TextFontOptions } from "./TextFontOptions.js";
|
|
2
3
|
import { TextLinesOptions } from "./TextLinesOptions.js";
|
|
3
4
|
export class TextOptions {
|
|
@@ -8,7 +9,7 @@ export class TextOptions {
|
|
|
8
9
|
this.text = "";
|
|
9
10
|
}
|
|
10
11
|
load(data) {
|
|
11
|
-
if (
|
|
12
|
+
if (isNull(data)) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
if (data.color !== undefined) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmittersCanvasShapeOptions = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
4
5
|
const PixelsOptions_js_1 = require("./PixelsOptions.js");
|
|
5
6
|
const TextOptions_js_1 = require("./TextOptions.js");
|
|
6
7
|
const minAlpha = 0;
|
|
@@ -13,7 +14,7 @@ class EmittersCanvasShapeOptions {
|
|
|
13
14
|
this.text = new TextOptions_js_1.TextOptions();
|
|
14
15
|
}
|
|
15
16
|
load(data) {
|
|
16
|
-
if (
|
|
17
|
+
if ((0, engine_1.isNull)(data)) {
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
if (data.element !== undefined) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PixelsOptions = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
4
5
|
class PixelsOptions {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.offset = 4;
|
|
7
8
|
}
|
|
8
9
|
load(data) {
|
|
9
|
-
if (
|
|
10
|
+
if ((0, engine_1.isNull)(data)) {
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
if (data.offset !== undefined) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextFontOptions = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
4
5
|
class TextFontOptions {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.family = "Verdana";
|
|
@@ -10,7 +11,7 @@ class TextFontOptions {
|
|
|
10
11
|
this.weight = "";
|
|
11
12
|
}
|
|
12
13
|
load(data) {
|
|
13
|
-
if (
|
|
14
|
+
if ((0, engine_1.isNull)(data)) {
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
16
17
|
if (data.family !== undefined) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextLinesOptions = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
4
5
|
class TextLinesOptions {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.separator = "\n";
|
|
7
8
|
this.spacing = 0;
|
|
8
9
|
}
|
|
9
10
|
load(data) {
|
|
10
|
-
if (
|
|
11
|
+
if ((0, engine_1.isNull)(data)) {
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
14
|
if (data.separator !== undefined) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextOptions = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
4
5
|
const TextFontOptions_js_1 = require("./TextFontOptions.js");
|
|
5
6
|
const TextLinesOptions_js_1 = require("./TextLinesOptions.js");
|
|
6
7
|
class TextOptions {
|
|
@@ -11,7 +12,7 @@ class TextOptions {
|
|
|
11
12
|
this.text = "";
|
|
12
13
|
}
|
|
13
14
|
load(data) {
|
|
14
|
-
if (
|
|
15
|
+
if ((0, engine_1.isNull)(data)) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
if (data.color !== undefined) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmitterShapeBase } from "@tsparticles/plugin-emitters";
|
|
2
|
-
import { getRandom, isFunction, isString } from "@tsparticles/engine";
|
|
2
|
+
import { getRandom, isFunction, isNull, isString, } from "@tsparticles/engine";
|
|
3
3
|
import { getCanvasImageData, getImageData, getTextData } from "./utils.js";
|
|
4
4
|
const maxRetries = 100, half = 0.5;
|
|
5
5
|
export class EmittersCanvasShape extends EmitterShapeBase {
|
|
@@ -40,7 +40,7 @@ export class EmittersCanvasShape extends EmitterShapeBase {
|
|
|
40
40
|
}
|
|
41
41
|
else if (text) {
|
|
42
42
|
const data = getTextData(text, offset, this.fill);
|
|
43
|
-
if (
|
|
43
|
+
if (isNull(data)) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
pixelData = data;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNull } from "@tsparticles/engine";
|
|
1
2
|
import { PixelsOptions } from "./PixelsOptions.js";
|
|
2
3
|
import { TextOptions } from "./TextOptions.js";
|
|
3
4
|
const minAlpha = 0;
|
|
@@ -10,7 +11,7 @@ export class EmittersCanvasShapeOptions {
|
|
|
10
11
|
this.text = new TextOptions();
|
|
11
12
|
}
|
|
12
13
|
load(data) {
|
|
13
|
-
if (
|
|
14
|
+
if (isNull(data)) {
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
16
17
|
if (data.element !== undefined) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNull } from "@tsparticles/engine";
|
|
1
2
|
export class TextFontOptions {
|
|
2
3
|
constructor() {
|
|
3
4
|
this.family = "Verdana";
|
|
@@ -7,7 +8,7 @@ export class TextFontOptions {
|
|
|
7
8
|
this.weight = "";
|
|
8
9
|
}
|
|
9
10
|
load(data) {
|
|
10
|
-
if (
|
|
11
|
+
if (isNull(data)) {
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
14
|
if (data.family !== undefined) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNull } from "@tsparticles/engine";
|
|
1
2
|
import { TextFontOptions } from "./TextFontOptions.js";
|
|
2
3
|
import { TextLinesOptions } from "./TextLinesOptions.js";
|
|
3
4
|
export class TextOptions {
|
|
@@ -8,7 +9,7 @@ export class TextOptions {
|
|
|
8
9
|
this.text = "";
|
|
9
10
|
}
|
|
10
11
|
load(data) {
|
|
11
|
-
if (
|
|
12
|
+
if (isNull(data)) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
if (data.color !== undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-emitters-shape-canvas",
|
|
3
|
-
"version": "3.6.0
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "tsParticles emitters shape canvas plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"./package.json": "./package.json"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tsparticles/engine": "^3.6.0
|
|
104
|
-
"@tsparticles/plugin-emitters": "^3.6.0
|
|
103
|
+
"@tsparticles/engine": "^3.6.0",
|
|
104
|
+
"@tsparticles/plugin-emitters": "^3.6.0"
|
|
105
105
|
},
|
|
106
106
|
"publishConfig": {
|
|
107
107
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/plugin-emitters-shape-canvas [
|
|
6
|
+
<title>@tsparticles/plugin-emitters-shape-canvas [19 Nov 2024 at 00:02]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.6.0
|
|
7
|
+
* v3.6.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -34,7 +34,7 @@ return /******/ (() => { // webpackBootstrap
|
|
|
34
34
|
\*********************************************/
|
|
35
35
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
36
36
|
|
|
37
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersCanvasShape: () => (/* binding */ EmittersCanvasShape)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-emitters */ \"@tsparticles/plugin-emitters\");\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"./dist/browser/utils.js\");\n\n\n\nconst maxRetries = 100,\n half = 0.5;\nclass EmittersCanvasShape extends _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__.EmitterShapeBase {\n constructor(position, size, fill, options) {\n super(position, size, fill, options);\n const filter = options.filter,\n minAlpha = 0;\n let filterFunc = pixel => pixel.a > minAlpha;\n if (filter !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isString)(filter)) {\n if (Object.hasOwn(window, filter)) {\n const wndFilter = window[filter];\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isFunction)(wndFilter)) {\n filterFunc = wndFilter;\n }\n }\n } else {\n filterFunc = filter;\n }\n }\n this.filter = filterFunc;\n this.scale = options.scale;\n this.pixelData = {\n pixels: [],\n height: 0,\n width: 0\n };\n }\n async init() {\n let pixelData;\n const options = this.options,\n selector = options.selector,\n pixels = options.pixels,\n image = options.image,\n element = options.element,\n text = options.text,\n offset = pixels.offset;\n if (image) {\n const url = image.src;\n if (!url) {\n return;\n }\n pixelData = await (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.getImageData)(url, offset);\n } else if (text) {\n const data = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.getTextData)(text, offset, this.fill);\n if (
|
|
37
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersCanvasShape: () => (/* binding */ EmittersCanvasShape)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-emitters */ \"@tsparticles/plugin-emitters\");\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"./dist/browser/utils.js\");\n\n\n\nconst maxRetries = 100,\n half = 0.5;\nclass EmittersCanvasShape extends _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__.EmitterShapeBase {\n constructor(position, size, fill, options) {\n super(position, size, fill, options);\n const filter = options.filter,\n minAlpha = 0;\n let filterFunc = pixel => pixel.a > minAlpha;\n if (filter !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isString)(filter)) {\n if (Object.hasOwn(window, filter)) {\n const wndFilter = window[filter];\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isFunction)(wndFilter)) {\n filterFunc = wndFilter;\n }\n }\n } else {\n filterFunc = filter;\n }\n }\n this.filter = filterFunc;\n this.scale = options.scale;\n this.pixelData = {\n pixels: [],\n height: 0,\n width: 0\n };\n }\n async init() {\n let pixelData;\n const options = this.options,\n selector = options.selector,\n pixels = options.pixels,\n image = options.image,\n element = options.element,\n text = options.text,\n offset = pixels.offset;\n if (image) {\n const url = image.src;\n if (!url) {\n return;\n }\n pixelData = await (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.getImageData)(url, offset);\n } else if (text) {\n const data = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.getTextData)(text, offset, this.fill);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isNull)(data)) {\n return;\n }\n pixelData = data;\n } else if (element ?? selector) {\n const canvas = element ?? (selector && document.querySelector(selector));\n if (!canvas) {\n return;\n }\n const context = canvas.getContext(\"2d\");\n if (!context) {\n return;\n }\n pixelData = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.getCanvasImageData)(context, canvas, offset);\n }\n if (!pixelData) {\n return;\n }\n this.pixelData = pixelData;\n }\n randomPosition() {\n const {\n height,\n width\n } = this.pixelData,\n data = this.pixelData,\n position = this.position,\n scale = this.scale,\n positionOffset = {\n x: position.x - width * scale * half,\n y: position.y - height * scale * half\n };\n for (let i = 0; i < maxRetries; i++) {\n const nextIndex = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.getRandom)() * width * height),\n pixelPos = {\n x: nextIndex % width,\n y: Math.floor(nextIndex / width)\n },\n pixel = data.pixels[pixelPos.y][pixelPos.x],\n shouldCreateParticle = this.filter(pixel);\n if (!shouldCreateParticle) {\n continue;\n }\n return {\n position: {\n x: pixelPos.x * scale + positionOffset.x,\n y: pixelPos.y * scale + positionOffset.y\n },\n color: {\n ...pixel\n },\n opacity: pixel.a\n };\n }\n return null;\n }\n resize(position, size) {\n super.resize(position, size);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-canvas/./dist/browser/EmittersCanvasShape.js?");
|
|
38
38
|
|
|
39
39
|
/***/ }),
|
|
40
40
|
|
|
@@ -54,7 +54,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
54
54
|
\********************************************************************/
|
|
55
55
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
56
56
|
|
|
57
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersCanvasShapeOptions: () => (/* binding */ EmittersCanvasShapeOptions)\n/* harmony export */ });\n/* harmony import */ var
|
|
57
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersCanvasShapeOptions: () => (/* binding */ EmittersCanvasShapeOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _PixelsOptions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PixelsOptions.js */ \"./dist/browser/Options/Classes/PixelsOptions.js\");\n/* harmony import */ var _TextOptions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TextOptions.js */ \"./dist/browser/Options/Classes/TextOptions.js\");\n\n\n\nconst minAlpha = 0;\nclass EmittersCanvasShapeOptions {\n constructor() {\n this.filter = pixel => pixel.a > minAlpha;\n this.pixels = new _PixelsOptions_js__WEBPACK_IMPORTED_MODULE_1__.PixelsOptions();\n this.scale = 1;\n this.selector = \"\";\n this.text = new _TextOptions_js__WEBPACK_IMPORTED_MODULE_2__.TextOptions();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.element !== undefined) {\n this.element = data.element;\n }\n if (data.filter !== undefined) {\n this.filter = data.filter;\n }\n this.pixels.load(data.pixels);\n if (data.scale !== undefined) {\n this.scale = data.scale;\n }\n if (data.selector !== undefined) {\n this.selector = data.selector;\n }\n if (data.image !== undefined) {\n this.image = data.image;\n }\n this.text.load(data.text);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-canvas/./dist/browser/Options/Classes/EmittersCanvasShapeOptions.js?");
|
|
58
58
|
|
|
59
59
|
/***/ }),
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
64
64
|
\*******************************************************/
|
|
65
65
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
66
66
|
|
|
67
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PixelsOptions: () => (/* binding */ PixelsOptions)\n/* harmony export */ });\nclass PixelsOptions {\n constructor() {\n this.offset = 4;\n }\n load(data) {\n if (
|
|
67
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PixelsOptions: () => (/* binding */ PixelsOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass PixelsOptions {\n constructor() {\n this.offset = 4;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.offset !== undefined) {\n this.offset = data.offset;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-canvas/./dist/browser/Options/Classes/PixelsOptions.js?");
|
|
68
68
|
|
|
69
69
|
/***/ }),
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
74
74
|
\*********************************************************/
|
|
75
75
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
76
76
|
|
|
77
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TextFontOptions: () => (/* binding */ TextFontOptions)\n/* harmony export */ });\nclass TextFontOptions {\n constructor() {\n this.family = \"Verdana\";\n this.size = 32;\n this.style = \"\";\n this.variant = \"\";\n this.weight = \"\";\n }\n load(data) {\n if (
|
|
77
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TextFontOptions: () => (/* binding */ TextFontOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass TextFontOptions {\n constructor() {\n this.family = \"Verdana\";\n this.size = 32;\n this.style = \"\";\n this.variant = \"\";\n this.weight = \"\";\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.family !== undefined) {\n this.family = data.family;\n }\n if (data.size !== undefined) {\n this.size = data.size;\n }\n if (data.style !== undefined) {\n this.style = data.style;\n }\n if (data.variant !== undefined) {\n this.variant = data.variant;\n }\n if (data.weight !== undefined) {\n this.weight = data.weight;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-canvas/./dist/browser/Options/Classes/TextFontOptions.js?");
|
|
78
78
|
|
|
79
79
|
/***/ }),
|
|
80
80
|
|
|
@@ -84,7 +84,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
84
84
|
\**********************************************************/
|
|
85
85
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
86
86
|
|
|
87
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TextLinesOptions: () => (/* binding */ TextLinesOptions)\n/* harmony export */ });\nclass TextLinesOptions {\n constructor() {\n this.separator = \"\\n\";\n this.spacing = 0;\n }\n load(data) {\n if (
|
|
87
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TextLinesOptions: () => (/* binding */ TextLinesOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass TextLinesOptions {\n constructor() {\n this.separator = \"\\n\";\n this.spacing = 0;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.separator !== undefined) {\n this.separator = data.separator;\n }\n if (data.spacing !== undefined) {\n this.spacing = data.spacing;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-canvas/./dist/browser/Options/Classes/TextLinesOptions.js?");
|
|
88
88
|
|
|
89
89
|
/***/ }),
|
|
90
90
|
|
|
@@ -94,7 +94,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
94
94
|
\*****************************************************/
|
|
95
95
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
96
96
|
|
|
97
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TextOptions: () => (/* binding */ TextOptions)\n/* harmony export */ });\n/* harmony import */ var
|
|
97
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TextOptions: () => (/* binding */ TextOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _TextFontOptions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TextFontOptions.js */ \"./dist/browser/Options/Classes/TextFontOptions.js\");\n/* harmony import */ var _TextLinesOptions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TextLinesOptions.js */ \"./dist/browser/Options/Classes/TextLinesOptions.js\");\n\n\n\nclass TextOptions {\n constructor() {\n this.color = \"#000000\";\n this.font = new _TextFontOptions_js__WEBPACK_IMPORTED_MODULE_1__.TextFontOptions();\n this.lines = new _TextLinesOptions_js__WEBPACK_IMPORTED_MODULE_2__.TextLinesOptions();\n this.text = \"\";\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.color !== undefined) {\n this.color = data.color;\n }\n this.font.load(data.font);\n this.lines.load(data.lines);\n if (data.text !== undefined) {\n this.text = data.text;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-canvas/./dist/browser/Options/Classes/TextOptions.js?");
|
|
98
98
|
|
|
99
99
|
/***/ }),
|
|
100
100
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.plugin.emitters.shape.canvas.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-emitters","@tsparticles/engine"],e);else{var i="object"==typeof exports?e(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine")):e(t.window,t.window);for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,((t,e)=>(()=>{var i={303:t=>{t.exports=e},526:e=>{e.exports=t}},s={};function o(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}};return i[t](r,r.exports,o),r.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{loadEmittersShapeCanvas:()=>m});var n=o(526),a=o(303);const l={x:0,y:0};function c(t,e,i,s=!0){const o=t.getImageData(l.x,l.y,e.width,e.height).data;s&&t.clearRect(l.x,l.y,e.width,e.height);const r=[];for(let t=0;t<o.length;t+=i){const s=t/i,n={x:s%e.width,y:Math.floor(s/e.width)};r[n.y]||(r[n.y]=[]);const a={r:0,g:1,b:2,a:3},l=255;r[n.y][n.x]={r:o[t+a.r],g:o[t+a.g],b:o[t+a.b],a:o[t+a.a]/l}}return{pixels:r,width:Math.min(...r.map((t=>t.length))),height:r.length}}class h extends n.EmitterShapeBase{constructor(t,e,i,s){super(t,e,i,s);const o=s.filter;let r=t=>t.a>0;if(void 0!==o)if((0,a.isString)(o)){if(Object.hasOwn(window,o)){const t=window[o];(0,a.isFunction)(t)&&(r=t)}}else r=o;this.filter=r,this.scale=s.scale,this.pixelData={pixels:[],height:0,width:0}}async init(){let t;const e=this.options,i=e.selector,s=e.pixels,o=e.image,r=e.element,n=e.text,h=s.offset;if(o){const e=o.src;if(!e)return;t=await function(t,e){const i=new Image;i.crossOrigin="Anonymous";const s=new Promise(((t,s)=>{i.onerror=s,i.onload=()=>{const o=document.createElement("canvas");o.width=i.width,o.height=i.height;const r=o.getContext("2d");if(!r)return s(new Error(`${a.errorPrefix} Could not get canvas context`));r.drawImage(i,l.x,l.y,i.width,i.height,l.x,l.y,o.width,o.height),t(c(r,o,e))}}));return i.src=t,s}(e,h)}else if(n){const e=function(t,e,i){const s=document.createElement("canvas"),o=s.getContext("2d"),{font:r,text:n,lines:h,color:d}=t;if(!n||!o)return;const f=n.split(h.separator),
|
|
2
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-emitters","@tsparticles/engine"],e);else{var i="object"==typeof exports?e(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine")):e(t.window,t.window);for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,((t,e)=>(()=>{var i={303:t=>{t.exports=e},526:e=>{e.exports=t}},s={};function o(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}};return i[t](r,r.exports,o),r.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{loadEmittersShapeCanvas:()=>m});var n=o(526),a=o(303);const l={x:0,y:0};function c(t,e,i,s=!0){const o=t.getImageData(l.x,l.y,e.width,e.height).data;s&&t.clearRect(l.x,l.y,e.width,e.height);const r=[];for(let t=0;t<o.length;t+=i){const s=t/i,n={x:s%e.width,y:Math.floor(s/e.width)};r[n.y]||(r[n.y]=[]);const a={r:0,g:1,b:2,a:3},l=255;r[n.y][n.x]={r:o[t+a.r],g:o[t+a.g],b:o[t+a.b],a:o[t+a.a]/l}}return{pixels:r,width:Math.min(...r.map((t=>t.length))),height:r.length}}class h extends n.EmitterShapeBase{constructor(t,e,i,s){super(t,e,i,s);const o=s.filter;let r=t=>t.a>0;if(void 0!==o)if((0,a.isString)(o)){if(Object.hasOwn(window,o)){const t=window[o];(0,a.isFunction)(t)&&(r=t)}}else r=o;this.filter=r,this.scale=s.scale,this.pixelData={pixels:[],height:0,width:0}}async init(){let t;const e=this.options,i=e.selector,s=e.pixels,o=e.image,r=e.element,n=e.text,h=s.offset;if(o){const e=o.src;if(!e)return;t=await function(t,e){const i=new Image;i.crossOrigin="Anonymous";const s=new Promise(((t,s)=>{i.onerror=s,i.onload=()=>{const o=document.createElement("canvas");o.width=i.width,o.height=i.height;const r=o.getContext("2d");if(!r)return s(new Error(`${a.errorPrefix} Could not get canvas context`));r.drawImage(i,l.x,l.y,i.width,i.height,l.x,l.y,o.width,o.height),t(c(r,o,e))}}));return i.src=t,s}(e,h)}else if(n){const e=function(t,e,i){const s=document.createElement("canvas"),o=s.getContext("2d"),{font:r,text:n,lines:h,color:d}=t;if(!n||!o)return;const f=n.split(h.separator),u=(0,a.isNumber)(r.size)?`${r.size}px`:r.size,p=[];let x=0,g=0;for(const t of f){o.font=`${r.style||""} ${r.variant||""} ${r.weight||""} ${u} ${r.family}`;const e=o.measureText(t),i={measure:e,text:t,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,width:e.width};x=Math.max(x||0,i.width),g+=i.height+h.spacing,p.push(i)}s.width=x,s.height=g;let m=0;for(const t of p)o.font=`${r.style||""} ${r.variant||""} ${r.weight||""} ${u} ${r.family}`,i?(o.fillStyle=d,o.fillText(t.text,l.x,m+t.measure.actualBoundingBoxAscent)):(o.strokeStyle=d,o.strokeText(t.text,l.x,m+t.measure.actualBoundingBoxAscent)),m+=t.height+h.spacing;return c(o,s,e)}(n,h,this.fill);if((0,a.isNull)(e))return;t=e}else if(r??i){const e=r??(i&&document.querySelector(i));if(!e)return;const s=e.getContext("2d");if(!s)return;t=c(s,e,h)}t&&(this.pixelData=t)}randomPosition(){const{height:t,width:e}=this.pixelData,i=this.pixelData,s=this.position,o=this.scale,r=s.x-e*o*.5,n=s.y-t*o*.5;for(let s=0;s<100;s++){const s=Math.floor((0,a.getRandom)()*e*t),l={x:s%e,y:Math.floor(s/e)},c=i.pixels[l.y][l.x];if(this.filter(c))return{position:{x:l.x*o+r,y:l.y*o+n},color:{...c},opacity:c.a}}return null}resize(t,e){super.resize(t,e)}}class d{constructor(){this.offset=4}load(t){(0,a.isNull)(t)||void 0!==t.offset&&(this.offset=t.offset)}}class f{constructor(){this.family="Verdana",this.size=32,this.style="",this.variant="",this.weight=""}load(t){(0,a.isNull)(t)||(void 0!==t.family&&(this.family=t.family),void 0!==t.size&&(this.size=t.size),void 0!==t.style&&(this.style=t.style),void 0!==t.variant&&(this.variant=t.variant),void 0!==t.weight&&(this.weight=t.weight))}}class u{constructor(){this.separator="\n",this.spacing=0}load(t){(0,a.isNull)(t)||(void 0!==t.separator&&(this.separator=t.separator),void 0!==t.spacing&&(this.spacing=t.spacing))}}class p{constructor(){this.color="#000000",this.font=new f,this.lines=new u,this.text=""}load(t){(0,a.isNull)(t)||(void 0!==t.color&&(this.color=t.color),this.font.load(t.font),this.lines.load(t.lines),void 0!==t.text&&(this.text=t.text))}}class x{constructor(){this.filter=t=>t.a>0,this.pixels=new d,this.scale=1,this.selector="",this.text=new p}load(t){(0,a.isNull)(t)||(void 0!==t.element&&(this.element=t.element),void 0!==t.filter&&(this.filter=t.filter),this.pixels.load(t.pixels),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.selector&&(this.selector=t.selector),void 0!==t.image&&(this.image=t.image),this.text.load(t.text))}}class g{generate(t,e,i,s){const o=new x;return o.load(s),new h(t,e,i,o)}}async function m(t,e=!0){const i=t;i.addEmitterShapeGenerator?.("canvas",new g),await i.refresh(e)}return r})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Emitters Shape Canvas Plugin v3.6.0
|
|
1
|
+
/*! tsParticles Emitters Shape Canvas Plugin v3.6.0 by Matteo Bruni */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IOptionLoader, type IRgba, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { IEmittersCanvasShapeOptions } from "../Interfaces/IEmittersCanvasShapeOptions.js";
|
|
3
3
|
import { PixelsOptions } from "./PixelsOptions.js";
|
|
4
4
|
import { TextOptions } from "./TextOptions.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { IPixelsOptions } from "../Interfaces/IPixelsOptions.js";
|
|
3
3
|
export declare class PixelsOptions implements IPixelsOptions, IOptionLoader<IPixelsOptions> {
|
|
4
4
|
offset: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { ITextFontOptions } from "../Interfaces/ITextFontOptions.js";
|
|
3
3
|
export declare class TextFontOptions implements ITextFontOptions, IOptionLoader<ITextFontOptions> {
|
|
4
4
|
family: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { ITextLinesOptions } from "../Interfaces/ITextLinesOptions.js";
|
|
3
3
|
export declare class TextLinesOptions implements ITextLinesOptions, IOptionLoader<ITextLinesOptions> {
|
|
4
4
|
separator: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { ITextOptions } from "../Interfaces/ITextOptions.js";
|
|
3
3
|
import { TextFontOptions } from "./TextFontOptions.js";
|
|
4
4
|
import { TextLinesOptions } from "./TextLinesOptions.js";
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./PixelsOptions.js", "./TextOptions.js"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./PixelsOptions.js", "./TextOptions.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.EmittersCanvasShapeOptions = void 0;
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
13
14
|
const PixelsOptions_js_1 = require("./PixelsOptions.js");
|
|
14
15
|
const TextOptions_js_1 = require("./TextOptions.js");
|
|
15
16
|
const minAlpha = 0;
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
this.text = new TextOptions_js_1.TextOptions();
|
|
23
24
|
}
|
|
24
25
|
load(data) {
|
|
25
|
-
if (
|
|
26
|
+
if ((0, engine_1.isNull)(data)) {
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
if (data.element !== undefined) {
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PixelsOptions = void 0;
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
13
14
|
class PixelsOptions {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.offset = 4;
|
|
16
17
|
}
|
|
17
18
|
load(data) {
|
|
18
|
-
if (
|
|
19
|
+
if ((0, engine_1.isNull)(data)) {
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
if (data.offset !== undefined) {
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TextFontOptions = void 0;
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
13
14
|
class TextFontOptions {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.family = "Verdana";
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
this.weight = "";
|
|
20
21
|
}
|
|
21
22
|
load(data) {
|
|
22
|
-
if (
|
|
23
|
+
if ((0, engine_1.isNull)(data)) {
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
if (data.family !== undefined) {
|
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TextLinesOptions = void 0;
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
13
14
|
class TextLinesOptions {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.separator = "\n";
|
|
16
17
|
this.spacing = 0;
|
|
17
18
|
}
|
|
18
19
|
load(data) {
|
|
19
|
-
if (
|
|
20
|
+
if ((0, engine_1.isNull)(data)) {
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
if (data.separator !== undefined) {
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./TextFontOptions.js", "./TextLinesOptions.js"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./TextFontOptions.js", "./TextLinesOptions.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TextOptions = void 0;
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
13
14
|
const TextFontOptions_js_1 = require("./TextFontOptions.js");
|
|
14
15
|
const TextLinesOptions_js_1 = require("./TextLinesOptions.js");
|
|
15
16
|
class TextOptions {
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
this.text = "";
|
|
21
22
|
}
|
|
22
23
|
load(data) {
|
|
23
|
-
if (
|
|
24
|
+
if ((0, engine_1.isNull)(data)) {
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
if (data.color !== undefined) {
|