@tsparticles/plugin-emitters-shape-path 4.0.0-alpha.2 → 4.0.0-alpha.4

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/181.min.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 181.min.js.LICENSE.txt */
2
+ (this.webpackChunk_tsparticles_plugin_emitters_shape_path=this.webpackChunk_tsparticles_plugin_emitters_shape_path||[]).push([[181],{181(t,e,n){n.d(e,{EmittersPathShapeGenerator:()=>c});var i=n(526),o=n(303);class h extends i.EmitterShapeBase{constructor(t,e,n,i){super(t,e,n,i);const h=(0,o.safeDocument)().createElement("canvas").getContext("2d");if(!h)throw new Error("No 2d context available");this.checkContext=h,this.points=i.points;const s=this.points,a=new Path2D,r=t.x-e.width*o.half,c=t.y-e.height*o.half;for(const[t,n]of s.entries()){const i={x:r+n.x*e.width/o.percentDenominator,y:c+n.y*e.height/o.percentDenominator};t?a.lineTo(i.x,i.y):a.moveTo(i.x,i.y)}const l=s[0];if(!l)throw new Error("No path data available");const p={x:r+l.x*e.width/o.percentDenominator,y:c+l.y*e.height/o.percentDenominator};a.lineTo(p.x,p.y),this.path=a}async init(){}randomPosition(){const t=this.checkContext,e=this.position,n=this.size,i=this.fill,h=this.path,s=i?function(t,e,n,i){let h=null;for(let s=0;s<100;s++){const s={x:n.x+(0,o.getRandom)()*i.width-i.width*o.half,y:n.y+(0,o.getRandom)()*i.height-i.height*o.half};if(t.isPointInPath(e,s.x,s.y)){h=s;break}}return h}(t,h,e,n):function(t,e,n,i){let h=null;for(let s=0;s<100;s++){const s={x:n.x+(0,o.getRandom)()*i.width-i.width*o.half,y:n.y+(0,o.getRandom)()*i.height-i.height*o.half};if(t.isPointInStroke(e,s.x,s.y)){h=s;break}}return h}(t,h,e,n);return s?{position:s}:null}resize(t,e){super.resize(t,e);const n=this.points,i=new Path2D,h=t.x-e.width*o.half,s=t.y-e.height*o.half;for(const[t,a]of n.entries()){const n={x:h+a.x*e.width/o.percentDenominator,y:s+a.y*e.height/o.percentDenominator};t?i.lineTo(n.x,n.y):i.moveTo(n.x,n.y)}const a=n[0];if(!a)throw new Error("No path data available");const r={x:h+a.x*e.width/o.percentDenominator,y:s+a.y*e.height/o.percentDenominator};i.lineTo(r.x,r.y),this.path=i}}const s=50,a=50;class r{constructor(){this.points=[]}load(t){(0,o.isNull)(t)||void 0!==t.points&&(this.points=t.points.map((t=>({x:t.x??s,y:t.y??a}))))}}class c{generate(t,e,n,i){const o=new r;return o.load(i),new h(t,e,n,o)}}}}]);
@@ -0,0 +1 @@
1
+ /*! tsParticles Emitters Shape Path Plugin v4.0.0-alpha.4 by Matteo Bruni */
@@ -1,7 +1,6 @@
1
1
  import { EmitterShapeBase } from "@tsparticles/plugin-emitters";
2
- import { percentDenominator, safeDocument } from "@tsparticles/engine";
2
+ import { half, percentDenominator, safeDocument } from "@tsparticles/engine";
3
3
  import { generateRandomPointOnPathPerimeter, generateRandomPointWithinPath } from "./utils.js";
4
- const half = 0.5;
5
4
  export class EmittersPathShape extends EmitterShapeBase {
6
5
  constructor(position, size, fill, options) {
7
6
  super(position, size, fill, options);
package/browser/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  export function loadEmittersShapePath(engine) {
2
- engine.checkVersion("4.0.0-alpha.2");
3
- engine.register(async (emittersEngine) => {
2
+ engine.checkVersion("4.0.0-alpha.4");
3
+ engine.register(async (e) => {
4
+ if (!e.addEmitterShapeGenerator) {
5
+ throw new Error("tsParticles emitters plugin missing or initialized after shapes");
6
+ }
4
7
  const { EmittersPathShapeGenerator } = await import("./EmittersPathShapeGenerator.js");
5
- emittersEngine.addEmitterShapeGenerator?.("path", new EmittersPathShapeGenerator());
8
+ e.addEmitterShapeGenerator("path", new EmittersPathShapeGenerator());
6
9
  });
7
10
  }
package/browser/utils.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getRandom } from "@tsparticles/engine";
2
- const maxAttempts = 100, half = 0.5;
1
+ import { getRandom, half } from "@tsparticles/engine";
2
+ const maxAttempts = 100;
3
3
  export function generateRandomPointWithinPath(ctx, path, center, size) {
4
4
  let randomPoint = null;
5
5
  for (let attempts = 0; attempts < maxAttempts; attempts++) {
@@ -1,7 +1,6 @@
1
1
  import { EmitterShapeBase } from "@tsparticles/plugin-emitters";
2
- import { percentDenominator, safeDocument } from "@tsparticles/engine";
2
+ import { half, percentDenominator, safeDocument } from "@tsparticles/engine";
3
3
  import { generateRandomPointOnPathPerimeter, generateRandomPointWithinPath } from "./utils.js";
4
- const half = 0.5;
5
4
  export class EmittersPathShape extends EmitterShapeBase {
6
5
  constructor(position, size, fill, options) {
7
6
  super(position, size, fill, options);
package/cjs/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  export function loadEmittersShapePath(engine) {
2
- engine.checkVersion("4.0.0-alpha.2");
3
- engine.register(async (emittersEngine) => {
2
+ engine.checkVersion("4.0.0-alpha.4");
3
+ engine.register(async (e) => {
4
+ if (!e.addEmitterShapeGenerator) {
5
+ throw new Error("tsParticles emitters plugin missing or initialized after shapes");
6
+ }
4
7
  const { EmittersPathShapeGenerator } = await import("./EmittersPathShapeGenerator.js");
5
- emittersEngine.addEmitterShapeGenerator?.("path", new EmittersPathShapeGenerator());
8
+ e.addEmitterShapeGenerator("path", new EmittersPathShapeGenerator());
6
9
  });
7
10
  }
package/cjs/utils.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getRandom } from "@tsparticles/engine";
2
- const maxAttempts = 100, half = 0.5;
1
+ import { getRandom, half } from "@tsparticles/engine";
2
+ const maxAttempts = 100;
3
3
  export function generateRandomPointWithinPath(ctx, path, center, size) {
4
4
  let randomPoint = null;
5
5
  for (let attempts = 0; attempts < maxAttempts; attempts++) {
@@ -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
- * v4.0.0-alpha.2
7
+ * v4.0.0-alpha.4
8
8
  */
9
9
  "use strict";
10
10
  /*
@@ -23,7 +23,7 @@
23
23
  \*******************************************/
24
24
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25
25
 
26
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersPathShape: () => (/* binding */ EmittersPathShape)\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_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"./dist/browser/utils.js\");\n\n\n\nconst half = 0.5;\nclass EmittersPathShape extends _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__.EmitterShapeBase {\n constructor(position, size, fill, options) {\n super(position, size, fill, options);\n const ctx = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.safeDocument)().createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) {\n throw new Error(`No 2d context available`);\n }\n this.checkContext = ctx;\n this.points = options.points;\n const pathData = this.points,\n path = new Path2D(),\n offset = {\n x: position.x - size.width * half,\n y: position.y - size.height * half\n };\n for (const [index, point] of pathData.entries()) {\n const coords = {\n x: offset.x + point.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + point.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n if (!index) {\n path.moveTo(coords.x, coords.y);\n } else {\n path.lineTo(coords.x, coords.y);\n }\n }\n const firstIndex = 0,\n firstPathData = pathData[firstIndex];\n if (!firstPathData) {\n throw new Error(`No path data available`);\n }\n const coords = {\n x: offset.x + firstPathData.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + firstPathData.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n path.lineTo(coords.x, coords.y);\n this.path = path;\n }\n async init() {}\n randomPosition() {\n const ctx = this.checkContext,\n position = this.position,\n size = this.size,\n fill = this.fill,\n path = this.path,\n res = fill ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.generateRandomPointWithinPath)(ctx, path, position, size) : (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.generateRandomPointOnPathPerimeter)(ctx, path, position, size);\n return res ? {\n position: res\n } : null;\n }\n resize(position, size) {\n super.resize(position, size);\n const pathData = this.points,\n path = new Path2D(),\n offset = {\n x: position.x - size.width * half,\n y: position.y - size.height * half\n };\n for (const [index, point] of pathData.entries()) {\n const coords = {\n x: offset.x + point.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + point.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n if (!index) {\n path.moveTo(coords.x, coords.y);\n } else {\n path.lineTo(coords.x, coords.y);\n }\n }\n const firstIndex = 0,\n firstPathData = pathData[firstIndex];\n if (!firstPathData) {\n throw new Error(`No path data available`);\n }\n const coords = {\n x: offset.x + firstPathData.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + firstPathData.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n path.lineTo(coords.x, coords.y);\n this.path = path;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-path/./dist/browser/EmittersPathShape.js?\n}");
26
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersPathShape: () => (/* binding */ EmittersPathShape)\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_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"./dist/browser/utils.js\");\n\n\n\nclass EmittersPathShape extends _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__.EmitterShapeBase {\n constructor(position, size, fill, options) {\n super(position, size, fill, options);\n const ctx = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.safeDocument)().createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) {\n throw new Error(`No 2d context available`);\n }\n this.checkContext = ctx;\n this.points = options.points;\n const pathData = this.points,\n path = new Path2D(),\n offset = {\n x: position.x - size.width * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.half,\n y: position.y - size.height * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.half\n };\n for (const [index, point] of pathData.entries()) {\n const coords = {\n x: offset.x + point.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + point.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n if (!index) {\n path.moveTo(coords.x, coords.y);\n } else {\n path.lineTo(coords.x, coords.y);\n }\n }\n const firstIndex = 0,\n firstPathData = pathData[firstIndex];\n if (!firstPathData) {\n throw new Error(`No path data available`);\n }\n const coords = {\n x: offset.x + firstPathData.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + firstPathData.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n path.lineTo(coords.x, coords.y);\n this.path = path;\n }\n async init() {}\n randomPosition() {\n const ctx = this.checkContext,\n position = this.position,\n size = this.size,\n fill = this.fill,\n path = this.path,\n res = fill ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.generateRandomPointWithinPath)(ctx, path, position, size) : (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.generateRandomPointOnPathPerimeter)(ctx, path, position, size);\n return res ? {\n position: res\n } : null;\n }\n resize(position, size) {\n super.resize(position, size);\n const pathData = this.points,\n path = new Path2D(),\n offset = {\n x: position.x - size.width * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.half,\n y: position.y - size.height * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.half\n };\n for (const [index, point] of pathData.entries()) {\n const coords = {\n x: offset.x + point.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + point.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n if (!index) {\n path.moveTo(coords.x, coords.y);\n } else {\n path.lineTo(coords.x, coords.y);\n }\n }\n const firstIndex = 0,\n firstPathData = pathData[firstIndex];\n if (!firstPathData) {\n throw new Error(`No path data available`);\n }\n const coords = {\n x: offset.x + firstPathData.x * size.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator,\n y: offset.y + firstPathData.y * size.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.percentDenominator\n };\n path.lineTo(coords.x, coords.y);\n this.path = path;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-path/./dist/browser/EmittersPathShape.js?\n}");
27
27
 
28
28
  /***/ },
29
29
 
@@ -53,7 +53,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
53
53
  \*******************************/
54
54
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
55
55
 
56
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ generateRandomPointOnPathPerimeter: () => (/* binding */ generateRandomPointOnPathPerimeter),\n/* harmony export */ generateRandomPointWithinPath: () => (/* binding */ generateRandomPointWithinPath)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst maxAttempts = 100,\n half = 0.5;\nfunction generateRandomPointWithinPath(ctx, path, center, size) {\n let randomPoint = null;\n for (let attempts = 0; attempts < maxAttempts; attempts++) {\n const tmpPoint = {\n x: center.x + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.width - size.width * half,\n y: center.y + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.height - size.height * half\n };\n if (ctx.isPointInPath(path, tmpPoint.x, tmpPoint.y)) {\n randomPoint = tmpPoint;\n break;\n }\n }\n return randomPoint;\n}\nfunction generateRandomPointOnPathPerimeter(ctx, path, center, size) {\n let randomPoint = null;\n for (let attempts = 0; attempts < maxAttempts; attempts++) {\n const tmpPoint = {\n x: center.x + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.width - size.width * half,\n y: center.y + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.height - size.height * half\n };\n if (ctx.isPointInStroke(path, tmpPoint.x, tmpPoint.y)) {\n randomPoint = tmpPoint;\n break;\n }\n }\n return randomPoint;\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-path/./dist/browser/utils.js?\n}");
56
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ generateRandomPointOnPathPerimeter: () => (/* binding */ generateRandomPointOnPathPerimeter),\n/* harmony export */ generateRandomPointWithinPath: () => (/* binding */ generateRandomPointWithinPath)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst maxAttempts = 100;\nfunction generateRandomPointWithinPath(ctx, path, center, size) {\n let randomPoint = null;\n for (let attempts = 0; attempts < maxAttempts; attempts++) {\n const tmpPoint = {\n x: center.x + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.width - size.width * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half,\n y: center.y + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.height - size.height * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half\n };\n if (ctx.isPointInPath(path, tmpPoint.x, tmpPoint.y)) {\n randomPoint = tmpPoint;\n break;\n }\n }\n return randomPoint;\n}\nfunction generateRandomPointOnPathPerimeter(ctx, path, center, size) {\n let randomPoint = null;\n for (let attempts = 0; attempts < maxAttempts; attempts++) {\n const tmpPoint = {\n x: center.x + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.width - size.width * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half,\n y: center.y + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * size.height - size.height * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half\n };\n if (ctx.isPointInStroke(path, tmpPoint.x, tmpPoint.y)) {\n randomPoint = tmpPoint;\n break;\n }\n }\n return randomPoint;\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-path/./dist/browser/utils.js?\n}");
57
57
 
58
58
  /***/ }
59
59
 
@@ -1,7 +1,6 @@
1
1
  import { EmitterShapeBase } from "@tsparticles/plugin-emitters";
2
- import { percentDenominator, safeDocument } from "@tsparticles/engine";
2
+ import { half, percentDenominator, safeDocument } from "@tsparticles/engine";
3
3
  import { generateRandomPointOnPathPerimeter, generateRandomPointWithinPath } from "./utils.js";
4
- const half = 0.5;
5
4
  export class EmittersPathShape extends EmitterShapeBase {
6
5
  constructor(position, size, fill, options) {
7
6
  super(position, size, fill, options);
package/esm/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  export function loadEmittersShapePath(engine) {
2
- engine.checkVersion("4.0.0-alpha.2");
3
- engine.register(async (emittersEngine) => {
2
+ engine.checkVersion("4.0.0-alpha.4");
3
+ engine.register(async (e) => {
4
+ if (!e.addEmitterShapeGenerator) {
5
+ throw new Error("tsParticles emitters plugin missing or initialized after shapes");
6
+ }
4
7
  const { EmittersPathShapeGenerator } = await import("./EmittersPathShapeGenerator.js");
5
- emittersEngine.addEmitterShapeGenerator?.("path", new EmittersPathShapeGenerator());
8
+ e.addEmitterShapeGenerator("path", new EmittersPathShapeGenerator());
6
9
  });
7
10
  }
package/esm/utils.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getRandom } from "@tsparticles/engine";
2
- const maxAttempts = 100, half = 0.5;
1
+ import { getRandom, half } from "@tsparticles/engine";
2
+ const maxAttempts = 100;
3
3
  export function generateRandomPointWithinPath(ctx, path, center, size) {
4
4
  let randomPoint = null;
5
5
  for (let attempts = 0; attempts < maxAttempts; attempts++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/plugin-emitters-shape-path",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.4",
4
4
  "description": "tsParticles emitters shape path 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": "4.0.0-alpha.2",
104
- "@tsparticles/plugin-emitters": "4.0.0-alpha.2"
103
+ "@tsparticles/engine": "4.0.0-alpha.4",
104
+ "@tsparticles/plugin-emitters": "4.0.0-alpha.4"
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-path [8 Jan 2026 at 10:20]</title>
6
+ <title>@tsparticles/plugin-emitters-shape-path [21 Jan 2026 at 14:47]</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
- * v4.0.0-alpha.2
7
+ * v4.0.0-alpha.4
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___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 */ loadEmittersShapePath: () => (/* binding */ loadEmittersShapePath)\n/* harmony export */ });\nfunction loadEmittersShapePath(engine) {\n engine.checkVersion(\"4.0.0-alpha.2\");\n engine.register(async emittersEngine => {\n const {\n EmittersPathShapeGenerator\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_EmittersPathShapeGenerator_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersPathShapeGenerator.js */ \"./dist/browser/EmittersPathShapeGenerator.js\"));\n emittersEngine.addEmitterShapeGenerator?.(\"path\", new EmittersPathShapeGenerator());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-path/./dist/browser/index.js?\n}");
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadEmittersShapePath: () => (/* binding */ loadEmittersShapePath)\n/* harmony export */ });\nfunction loadEmittersShapePath(engine) {\n engine.checkVersion(\"4.0.0-alpha.4\");\n engine.register(async e => {\n if (!e.addEmitterShapeGenerator) {\n throw new Error(\"tsParticles emitters plugin missing or initialized after shapes\");\n }\n const {\n EmittersPathShapeGenerator\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_EmittersPathShapeGenerator_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersPathShapeGenerator.js */ \"./dist/browser/EmittersPathShapeGenerator.js\"));\n e.addEmitterShapeGenerator(\"path\", new EmittersPathShapeGenerator());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters-shape-path/./dist/browser/index.js?\n}");
38
38
 
39
39
  /***/ },
40
40
 
@@ -128,18 +128,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__;
128
128
  /******/ };
129
129
  /******/ })();
130
130
  /******/
131
- /******/ /* webpack/runtime/global */
132
- /******/ (() => {
133
- /******/ __webpack_require__.g = (function() {
134
- /******/ if (typeof globalThis === 'object') return globalThis;
135
- /******/ try {
136
- /******/ return this || new Function('return this')();
137
- /******/ } catch (e) {
138
- /******/ if (typeof window === 'object') return window;
139
- /******/ }
140
- /******/ })();
141
- /******/ })();
142
- /******/
143
131
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
144
132
  /******/ (() => {
145
133
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
@@ -204,8 +192,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__;
204
192
  /******/ /* webpack/runtime/publicPath */
205
193
  /******/ (() => {
206
194
  /******/ var scriptUrl;
207
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
208
- /******/ var document = __webpack_require__.g.document;
195
+ /******/ if (globalThis.importScripts) scriptUrl = globalThis.location + "";
196
+ /******/ var document = globalThis.document;
209
197
  /******/ if (!scriptUrl && document) {
210
198
  /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
211
199
  /******/ scriptUrl = document.currentScript.src;
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.plugin.emitters.shape.path.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-emitters","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine")):t(e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,((e,t)=>(()=>{var r,i,o={303(e){e.exports=t},526(t){t.exports=e}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.m=o,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},i="@tsparticles/plugin-emitters-shape-path:",a.l=(e,t,o,n)=>{if(r[e])r[e].push(t);else{var s,p;if(void 0!==o)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+o){s=u;break}}s||(p=!0,(s=document.createElement("script")).charset="utf-8",a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",i+o),s.src=e),r[e]=[t];var d=(t,i)=>{s.onerror=s.onload=null,clearTimeout(f);var o=r[e];if(delete r[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(i))),t)return t(i)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),p&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={395:0};a.f.j=(t,r)=>{var i=a.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var o=new Promise(((r,o)=>i=e[t]=[r,o]));r.push(i[2]=o);var n=a.p+a.u(t),s=new Error;a.l(n,(r=>{if(a.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",s.name="ChunkLoadError",s.type=o,s.request=n,i[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var i,o,[n,s,p]=r,l=0;if(n.some((t=>0!==e[t]))){for(i in s)a.o(s,i)&&(a.m[i]=s[i]);if(p)p(a)}for(t&&t(r);l<n.length;l++)o=n[l],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunk_tsparticles_plugin_emitters_shape_path=this.webpackChunk_tsparticles_plugin_emitters_shape_path||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var s={};function p(e){e.checkVersion("4.0.0-alpha.2"),e.register((async e=>{const{EmittersPathShapeGenerator:t}=await a.e(699).then(a.bind(a,699));e.addEmitterShapeGenerator?.("path",new t)}))}return a.r(s),a.d(s,{loadEmittersShapePath:()=>p}),s})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-emitters","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-emitters"),require("@tsparticles/engine")):t(e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,((e,t)=>(()=>{var r,i,a={303(e){e.exports=t},526(t){t.exports=e}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return a[e](r,r.exports,n),r.exports}n.m=a,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},i="@tsparticles/plugin-emitters-shape-path:",n.l=(e,t,a,o)=>{if(r[e])r[e].push(t);else{var s,p;if(void 0!==a)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+a){s=u;break}}s||(p=!0,(s=document.createElement("script")).charset="utf-8",n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",i+a),s.src=e),r[e]=[t];var d=(t,i)=>{s.onerror=s.onload=null,clearTimeout(h);var a=r[e];if(delete r[e],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((e=>e(i))),t)return t(i)},h=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),p&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={395:0};n.f.j=(t,r)=>{var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var a=new Promise(((r,a)=>i=e[t]=[r,a]));r.push(i[2]=a);var o=n.p+n.u(t),s=new Error;n.l(o,(r=>{if(n.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var i,a,[o,s,p]=r,l=0;if(o.some((t=>0!==e[t]))){for(i in s)n.o(s,i)&&(n.m[i]=s[i]);if(p)p(n)}for(t&&t(r);l<o.length;l++)a=o[l],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=this.webpackChunk_tsparticles_plugin_emitters_shape_path=this.webpackChunk_tsparticles_plugin_emitters_shape_path||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var s={};function p(e){e.checkVersion("4.0.0-alpha.4"),e.register((async e=>{if(!e.addEmitterShapeGenerator)throw new Error("tsParticles emitters plugin missing or initialized after shapes");const{EmittersPathShapeGenerator:t}=await n.e(181).then(n.bind(n,181));e.addEmitterShapeGenerator("path",new t)}))}return n.r(s),n.d(s,{loadEmittersShapePath:()=>p}),s})()));
@@ -1 +1 @@
1
- /*! tsParticles Emitters Shape Path Plugin v4.0.0-alpha.2 by Matteo Bruni */
1
+ /*! tsParticles Emitters Shape Path Plugin v4.0.0-alpha.4 by Matteo Bruni */
@@ -13,7 +13,6 @@
13
13
  const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
14
14
  const engine_1 = require("@tsparticles/engine");
15
15
  const utils_js_1 = require("./utils.js");
16
- const half = 0.5;
17
16
  class EmittersPathShape extends plugin_emitters_1.EmitterShapeBase {
18
17
  constructor(position, size, fill, options) {
19
18
  super(position, size, fill, options);
@@ -24,8 +23,8 @@
24
23
  this.checkContext = ctx;
25
24
  this.points = options.points;
26
25
  const pathData = this.points, path = new Path2D(), offset = {
27
- x: position.x - size.width * half,
28
- y: position.y - size.height * half,
26
+ x: position.x - size.width * engine_1.half,
27
+ y: position.y - size.height * engine_1.half,
29
28
  };
30
29
  for (const [index, point] of pathData.entries()) {
31
30
  const coords = {
@@ -61,8 +60,8 @@
61
60
  resize(position, size) {
62
61
  super.resize(position, size);
63
62
  const pathData = this.points, path = new Path2D(), offset = {
64
- x: position.x - size.width * half,
65
- y: position.y - size.height * half,
63
+ x: position.x - size.width * engine_1.half,
64
+ y: position.y - size.height * engine_1.half,
66
65
  };
67
66
  for (const [index, point] of pathData.entries()) {
68
67
  const coords = {
package/umd/index.js CHANGED
@@ -45,10 +45,13 @@ var __importStar = (this && this.__importStar) || (function () {
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.loadEmittersShapePath = loadEmittersShapePath;
47
47
  function loadEmittersShapePath(engine) {
48
- engine.checkVersion("4.0.0-alpha.2");
49
- engine.register(async (emittersEngine) => {
48
+ engine.checkVersion("4.0.0-alpha.4");
49
+ engine.register(async (e) => {
50
+ if (!e.addEmitterShapeGenerator) {
51
+ throw new Error("tsParticles emitters plugin missing or initialized after shapes");
52
+ }
50
53
  const { EmittersPathShapeGenerator } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./EmittersPathShapeGenerator.js"))) : new Promise((resolve_1, reject_1) => { require(["./EmittersPathShapeGenerator.js"], resolve_1, reject_1); }).then(__importStar));
51
- emittersEngine.addEmitterShapeGenerator?.("path", new EmittersPathShapeGenerator());
54
+ e.addEmitterShapeGenerator("path", new EmittersPathShapeGenerator());
52
55
  });
53
56
  }
54
57
  });
package/umd/utils.js CHANGED
@@ -12,13 +12,13 @@
12
12
  exports.generateRandomPointWithinPath = generateRandomPointWithinPath;
13
13
  exports.generateRandomPointOnPathPerimeter = generateRandomPointOnPathPerimeter;
14
14
  const engine_1 = require("@tsparticles/engine");
15
- const maxAttempts = 100, half = 0.5;
15
+ const maxAttempts = 100;
16
16
  function generateRandomPointWithinPath(ctx, path, center, size) {
17
17
  let randomPoint = null;
18
18
  for (let attempts = 0; attempts < maxAttempts; attempts++) {
19
19
  const tmpPoint = {
20
- x: center.x + (0, engine_1.getRandom)() * size.width - size.width * half,
21
- y: center.y + (0, engine_1.getRandom)() * size.height - size.height * half,
20
+ x: center.x + (0, engine_1.getRandom)() * size.width - size.width * engine_1.half,
21
+ y: center.y + (0, engine_1.getRandom)() * size.height - size.height * engine_1.half,
22
22
  };
23
23
  if (ctx.isPointInPath(path, tmpPoint.x, tmpPoint.y)) {
24
24
  randomPoint = tmpPoint;
@@ -31,8 +31,8 @@
31
31
  let randomPoint = null;
32
32
  for (let attempts = 0; attempts < maxAttempts; attempts++) {
33
33
  const tmpPoint = {
34
- x: center.x + (0, engine_1.getRandom)() * size.width - size.width * half,
35
- y: center.y + (0, engine_1.getRandom)() * size.height - size.height * half,
34
+ x: center.x + (0, engine_1.getRandom)() * size.width - size.width * engine_1.half,
35
+ y: center.y + (0, engine_1.getRandom)() * size.height - size.height * engine_1.half,
36
36
  };
37
37
  if (ctx.isPointInStroke(path, tmpPoint.x, tmpPoint.y)) {
38
38
  randomPoint = tmpPoint;
package/699.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 699.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_plugin_emitters_shape_path=this.webpackChunk_tsparticles_plugin_emitters_shape_path||[]).push([[699],{699(t,e,n){n.d(e,{EmittersPathShapeGenerator:()=>l});var o=n(526),i=n(303);const s=.5;const h=.5;class r extends o.EmitterShapeBase{constructor(t,e,n,o){super(t,e,n,o);const s=(0,i.safeDocument)().createElement("canvas").getContext("2d");if(!s)throw new Error("No 2d context available");this.checkContext=s,this.points=o.points;const r=this.points,a=new Path2D,c=t.x-e.width*h,p=t.y-e.height*h;for(const[t,n]of r.entries()){const o={x:c+n.x*e.width/i.percentDenominator,y:p+n.y*e.height/i.percentDenominator};t?a.lineTo(o.x,o.y):a.moveTo(o.x,o.y)}const l=r[0];if(!l)throw new Error("No path data available");const x={x:c+l.x*e.width/i.percentDenominator,y:p+l.y*e.height/i.percentDenominator};a.lineTo(x.x,x.y),this.path=a}async init(){}randomPosition(){const t=this.checkContext,e=this.position,n=this.size,o=this.fill,h=this.path,r=o?function(t,e,n,o){let h=null;for(let r=0;r<100;r++){const r={x:n.x+(0,i.getRandom)()*o.width-o.width*s,y:n.y+(0,i.getRandom)()*o.height-o.height*s};if(t.isPointInPath(e,r.x,r.y)){h=r;break}}return h}(t,h,e,n):function(t,e,n,o){let h=null;for(let r=0;r<100;r++){const r={x:n.x+(0,i.getRandom)()*o.width-o.width*s,y:n.y+(0,i.getRandom)()*o.height-o.height*s};if(t.isPointInStroke(e,r.x,r.y)){h=r;break}}return h}(t,h,e,n);return r?{position:r}:null}resize(t,e){super.resize(t,e);const n=this.points,o=new Path2D,s=t.x-e.width*h,r=t.y-e.height*h;for(const[t,h]of n.entries()){const n={x:s+h.x*e.width/i.percentDenominator,y:r+h.y*e.height/i.percentDenominator};t?o.lineTo(n.x,n.y):o.moveTo(n.x,n.y)}const a=n[0];if(!a)throw new Error("No path data available");const c={x:s+a.x*e.width/i.percentDenominator,y:r+a.y*e.height/i.percentDenominator};o.lineTo(c.x,c.y),this.path=o}}const a=50,c=50;class p{constructor(){this.points=[]}load(t){(0,i.isNull)(t)||void 0!==t.points&&(this.points=t.points.map((t=>({x:t.x??a,y:t.y??c}))))}}class l{generate(t,e,n,o){const i=new p;return i.load(o),new r(t,e,n,i)}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Emitters Shape Path Plugin v4.0.0-alpha.2 by Matteo Bruni */