@tsparticles/plugin-emitters-shape-polygon 4.1.2 → 4.2.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/Options/Classes/EmittersPolygonShapeOptions.js +2 -6
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Options/Classes/EmittersPolygonShapeOptions.js +2 -6
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/Options/Classes/EmittersPolygonShapeOptions.js +2 -6
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.plugin.emitters.shape.polygon.js +4 -8
- package/tsparticles.plugin.emitters.shape.polygon.min.js +1 -1
- package/types/Options/Classes/EmittersPolygonShapeOptions.d.ts +0 -1
package/browser/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureEmittersPluginLoaded } from "@tsparticles/plugin-emitters";
|
|
2
2
|
import { EmittersPolygonShapeGenerator } from "./EmittersPolygonShapeGenerator.js";
|
|
3
3
|
export async function loadEmittersShapePolygon(engine) {
|
|
4
|
-
engine.checkVersion("4.
|
|
4
|
+
engine.checkVersion("4.2.0");
|
|
5
5
|
await engine.pluginManager.register((e) => {
|
|
6
6
|
ensureEmittersPluginLoaded(e);
|
|
7
7
|
e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadEmittersShapePolygon(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureEmittersPluginLoaded } = await import("@tsparticles/plugin-emitters/lazy");
|
|
5
5
|
ensureEmittersPluginLoaded(e);
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureEmittersPluginLoaded } from "@tsparticles/plugin-emitters";
|
|
2
2
|
import { EmittersPolygonShapeGenerator } from "./EmittersPolygonShapeGenerator.js";
|
|
3
3
|
export async function loadEmittersShapePolygon(engine) {
|
|
4
|
-
engine.checkVersion("4.
|
|
4
|
+
engine.checkVersion("4.2.0");
|
|
5
5
|
await engine.pluginManager.register((e) => {
|
|
6
6
|
ensureEmittersPluginLoaded(e);
|
|
7
7
|
e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadEmittersShapePolygon(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureEmittersPluginLoaded } = await import("@tsparticles/plugin-emitters/lazy");
|
|
5
5
|
ensureEmittersPluginLoaded(e);
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureEmittersPluginLoaded } from "@tsparticles/plugin-emitters";
|
|
2
2
|
import { EmittersPolygonShapeGenerator } from "./EmittersPolygonShapeGenerator.js";
|
|
3
3
|
export async function loadEmittersShapePolygon(engine) {
|
|
4
|
-
engine.checkVersion("4.
|
|
4
|
+
engine.checkVersion("4.2.0");
|
|
5
5
|
await engine.pluginManager.register((e) => {
|
|
6
6
|
ensureEmittersPluginLoaded(e);
|
|
7
7
|
e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadEmittersShapePolygon(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureEmittersPluginLoaded } = await import("@tsparticles/plugin-emitters/lazy");
|
|
5
5
|
ensureEmittersPluginLoaded(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-emitters-shape-polygon",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "tsParticles emitters shape polygon plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"./package.json": "./package.json"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
|
-
"@tsparticles/engine": "4.
|
|
110
|
-
"@tsparticles/plugin-emitters": "4.
|
|
109
|
+
"@tsparticles/engine": "4.2.0",
|
|
110
|
+
"@tsparticles/plugin-emitters": "4.2.0"
|
|
111
111
|
},
|
|
112
112
|
"publishConfig": {
|
|
113
113
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.plugin.emitters.shape.polygon.js","children":[{"name":"dist/browser","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.plugin.emitters.shape.polygon.js","children":[{"name":"dist/browser","children":[{"uid":"e8a6c96b-1","name":"utils.js"},{"uid":"e8a6c96b-3","name":"EmittersPolygonShape.js"},{"name":"Options/Classes/EmittersPolygonShapeOptions.js","uid":"e8a6c96b-5"},{"uid":"e8a6c96b-7","name":"EmittersPolygonShapeGenerator.js"},{"uid":"e8a6c96b-9","name":"index.js"},{"uid":"e8a6c96b-11","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"e8a6c96b-1":{"renderedLength":2689,"gzipLength":0,"brotliLength":0,"metaUid":"e8a6c96b-0"},"e8a6c96b-3":{"renderedLength":926,"gzipLength":0,"brotliLength":0,"metaUid":"e8a6c96b-2"},"e8a6c96b-5":{"renderedLength":389,"gzipLength":0,"brotliLength":0,"metaUid":"e8a6c96b-4"},"e8a6c96b-7":{"renderedLength":308,"gzipLength":0,"brotliLength":0,"metaUid":"e8a6c96b-6"},"e8a6c96b-9":{"renderedLength":324,"gzipLength":0,"brotliLength":0,"metaUid":"e8a6c96b-8"},"e8a6c96b-11":{"renderedLength":191,"gzipLength":0,"brotliLength":0,"metaUid":"e8a6c96b-10"}},"nodeMetas":{"e8a6c96b-0":{"id":"/dist/browser/utils.js","moduleParts":{"tsparticles.plugin.emitters.shape.polygon.js":"e8a6c96b-1"},"imported":[{"uid":"e8a6c96b-13"}],"importedBy":[{"uid":"e8a6c96b-2"}]},"e8a6c96b-2":{"id":"/dist/browser/EmittersPolygonShape.js","moduleParts":{"tsparticles.plugin.emitters.shape.polygon.js":"e8a6c96b-3"},"imported":[{"uid":"e8a6c96b-12"},{"uid":"e8a6c96b-13"},{"uid":"e8a6c96b-0"}],"importedBy":[{"uid":"e8a6c96b-6"}]},"e8a6c96b-4":{"id":"/dist/browser/Options/Classes/EmittersPolygonShapeOptions.js","moduleParts":{"tsparticles.plugin.emitters.shape.polygon.js":"e8a6c96b-5"},"imported":[{"uid":"e8a6c96b-13"}],"importedBy":[{"uid":"e8a6c96b-6"}]},"e8a6c96b-6":{"id":"/dist/browser/EmittersPolygonShapeGenerator.js","moduleParts":{"tsparticles.plugin.emitters.shape.polygon.js":"e8a6c96b-7"},"imported":[{"uid":"e8a6c96b-2"},{"uid":"e8a6c96b-4"}],"importedBy":[{"uid":"e8a6c96b-8"}]},"e8a6c96b-8":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.plugin.emitters.shape.polygon.js":"e8a6c96b-9"},"imported":[{"uid":"e8a6c96b-12"},{"uid":"e8a6c96b-6"}],"importedBy":[{"uid":"e8a6c96b-10"}]},"e8a6c96b-10":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.plugin.emitters.shape.polygon.js":"e8a6c96b-11"},"imported":[{"uid":"e8a6c96b-8"}],"importedBy":[],"isEntry":true},"e8a6c96b-12":{"id":"@tsparticles/plugin-emitters","moduleParts":{},"imported":[],"importedBy":[{"uid":"e8a6c96b-8"},{"uid":"e8a6c96b-2"}],"isExternal":true},"e8a6c96b-13":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"e8a6c96b-2"},{"uid":"e8a6c96b-4"},{"uid":"e8a6c96b-0"}],"isExternal":true}},"env":{"rollup":"4.62.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Emitters Shape v4.
|
|
2
|
+
/* Emitters Shape v4.2.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-emitters'), require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-emitters', '@tsparticles/engine'], factory) :
|
|
@@ -102,12 +102,8 @@
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
class EmittersPolygonShapeOptions {
|
|
105
|
-
angle;
|
|
106
|
-
sides;
|
|
107
|
-
constructor() {
|
|
108
|
-
this.angle = 0;
|
|
109
|
-
this.sides = 5;
|
|
110
|
-
}
|
|
105
|
+
angle = 0;
|
|
106
|
+
sides = 5;
|
|
111
107
|
load(data) {
|
|
112
108
|
if (engine.isNull(data)) {
|
|
113
109
|
return;
|
|
@@ -130,7 +126,7 @@
|
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
async function loadEmittersShapePolygon(engine) {
|
|
133
|
-
engine.checkVersion("4.
|
|
129
|
+
engine.checkVersion("4.2.0");
|
|
134
130
|
await engine.pluginManager.register((e) => {
|
|
135
131
|
pluginEmitters.ensureEmittersPluginLoaded(e);
|
|
136
132
|
e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-emitters"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-emitters","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.plugins.emittersShapes.polygon=s.__tsParticlesInternals.plugins.emittersShapes.polygon||{}),s.__tsParticlesInternals.plugins.emitters,s.__tsParticlesInternals.engine)}(this,function(s,t,e){"use strict";function n(s,t,n,a=0){const l=[],r=e.doublePI/t;for(let e=0;e<t;e++){const t=r*e+a;l.push({x:s.x+n*Math.cos(t),y:s.y+n*Math.sin(t)})}return l}function a(s,t){let e=!1;for(let n=0,a=t.length-1;n<t.length;a=n++){const l=t[n],r=t[a];if(!l||!r)continue;l.y>s.y!=r.y>s.y&&s.x<(r.x-l.x)*(s.y-l.y)/(r.y-l.y)+l.x&&(e=!e)}return e}class l extends t.EmitterShapeBase{angle;polygon;sides;constructor(s,t,a,l){super(s,t,a,l),this.sides=l.sides,this.angle=e.degToRad(l.angle),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}async init(){}randomPosition(){const s=this.fill,t=this.polygon,n=s?function(s){const t=s[0];if(!t)return null;const n={...t},l={...t};for(const t of s)t.x<n.x&&(n.x=t.x),t.x>l.x&&(l.x=t.x),t.y<n.y&&(n.y=t.y),t.y>l.y&&(l.y=t.y);let r=null;for(let t=0;t<100;t++){const t={x:n.x+e.getRandom()*(l.x-n.x),y:n.y+e.getRandom()*(l.y-n.y)};if(a(t,s)){r=t;break}}return r}(t):function(s){const t=Math.floor(e.getRandom()*s.length),n=s[t];if(!n)return;const a=s[(t+1)%s.length];if(!a)return;const l=e.getRandom();return{x:n.x+(a.x-n.x)*l,y:n.y+(a.y-n.y)*l}}(t);return n?{position:n}:null}resize(s,t){super.resize(s,t),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}}class r{angle
|
|
1
|
+
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-emitters"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-emitters","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.plugins.emittersShapes.polygon=s.__tsParticlesInternals.plugins.emittersShapes.polygon||{}),s.__tsParticlesInternals.plugins.emitters,s.__tsParticlesInternals.engine)}(this,function(s,t,e){"use strict";function n(s,t,n,a=0){const l=[],r=e.doublePI/t;for(let e=0;e<t;e++){const t=r*e+a;l.push({x:s.x+n*Math.cos(t),y:s.y+n*Math.sin(t)})}return l}function a(s,t){let e=!1;for(let n=0,a=t.length-1;n<t.length;a=n++){const l=t[n],r=t[a];if(!l||!r)continue;l.y>s.y!=r.y>s.y&&s.x<(r.x-l.x)*(s.y-l.y)/(r.y-l.y)+l.x&&(e=!e)}return e}class l extends t.EmitterShapeBase{angle;polygon;sides;constructor(s,t,a,l){super(s,t,a,l),this.sides=l.sides,this.angle=e.degToRad(l.angle),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}async init(){}randomPosition(){const s=this.fill,t=this.polygon,n=s?function(s){const t=s[0];if(!t)return null;const n={...t},l={...t};for(const t of s)t.x<n.x&&(n.x=t.x),t.x>l.x&&(l.x=t.x),t.y<n.y&&(n.y=t.y),t.y>l.y&&(l.y=t.y);let r=null;for(let t=0;t<100;t++){const t={x:n.x+e.getRandom()*(l.x-n.x),y:n.y+e.getRandom()*(l.y-n.y)};if(a(t,s)){r=t;break}}return r}(t):function(s){const t=Math.floor(e.getRandom()*s.length),n=s[t];if(!n)return;const a=s[(t+1)%s.length];if(!a)return;const l=e.getRandom();return{x:n.x+(a.x-n.x)*l,y:n.y+(a.y-n.y)*l}}(t);return n?{position:n}:null}resize(s,t){super.resize(s,t),this.polygon=n(s,this.sides,t.width*e.half,this.angle)}}class r{angle=0;sides=5;load(s){e.isNull(s)||(void 0!==s.angle&&(this.angle=s.angle),void 0!==s.sides&&(this.sides=s.sides))}}class i{generate(s,t,e,n,a){const i=new r;return i.load(a),new l(t,e,n,i)}}async function _(s){s.checkVersion("4.2.0"),await s.pluginManager.register(s=>{t.ensureEmittersPluginLoaded(s),s.pluginManager.addEmitterShapeGenerator?.("polygon",new i)})}const c=globalThis;c.__tsParticlesInternals=c.__tsParticlesInternals??{},c.loadEmittersShapePolygon=_,s.loadEmittersShapePolygon=_}),Object.assign(globalThis.window||globalThis,{loadEmittersShapePolygon:(globalThis.__tsParticlesInternals.plugins.emittersShapes.polygon||{}).loadEmittersShapePolygon}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -3,6 +3,5 @@ import type { IEmittersPolygonShapeOptions } from "../Interfaces/IEmittersPolygo
|
|
|
3
3
|
export declare class EmittersPolygonShapeOptions implements IEmittersPolygonShapeOptions, IOptionLoader<IEmittersPolygonShapeOptions> {
|
|
4
4
|
angle: number;
|
|
5
5
|
sides: number;
|
|
6
|
-
constructor();
|
|
7
6
|
load(data?: RecursivePartial<IEmittersPolygonShapeOptions>): void;
|
|
8
7
|
}
|