@tsparticles/path-polygon 4.0.0-beta.0 → 4.0.0-beta.10
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/{990.min.js → 677.min.js} +1 -1
- package/README.md +37 -0
- package/browser/index.js +3 -3
- package/cjs/index.js +3 -3
- package/dist_browser_PolygonPathGenerator_js.js +1 -1
- package/esm/index.js +3 -3
- package/package.json +5 -6
- package/report.html +84 -29
- package/tsparticles.path.polygon.js +2 -2
- package/tsparticles.path.polygon.min.js +2 -2
- package/umd/IPolygonPathOptions.js +0 -12
- package/umd/PolygonPathGenerator.js +0 -72
- package/umd/PolygonPathParticle.js +0 -12
- package/umd/index.js +0 -60
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_path_polygon=this.webpackChunk_tsparticles_path_polygon||[]).push([[
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_path_polygon=this.webpackChunk_tsparticles_path_polygon||[]).push([[677],{677(t,e,s){s.d(e,{PolygonPathGenerator:()=>n});var i=s(303);let o={sides:6,turnSteps:20,angle:30};class n{dirsList;options;_container;_res;constructor(t){this._container=t,this._res=i.Vector.origin,this.dirsList=[],this.options=(0,i.deepExtend)({},o)}generate(t){let{sides:e,turnSteps:s}=this.options;t.hexStep??=0,t.hexDirection??=6===e?(3*(0,i.getRandom)()|0)*2:(0,i.getRandom)()*e|0,t.hexSpeed??=t.velocity.length,t.hexStep%s==0&&(t.hexDirection=(0,i.getRandom)()>.5?(t.hexDirection+1)%e:(t.hexDirection+e-1)%e),t.velocity.x=0,t.velocity.y=0,t.hexStep++;let o=this.dirsList[t.hexDirection];return this._res.x=o.x*t.hexSpeed,this._res.y=o.y*t.hexSpeed,this._res}init(){let t=this._container.actualOptions.particles.move.path.options;this.options.sides=t.sides>0?t.sides:this.options.sides,this.options.angle=t.angle??this.options.angle,this.options.turnSteps=t.turnSteps>=0?t.turnSteps:this.options.turnSteps,this._createDirs()}reset(t){delete t.hexStep,delete t.hexDirection,delete t.hexSpeed}update(){}_createDirs=()=>{let{options:t}=this;this.dirsList=[];for(let e=0;e<360;e+=360/t.sides){let s=t.angle+e;this.dirsList.push(i.Vector.create(Math.cos(s*Math.PI/180),Math.sin(s*Math.PI/180)))}}}}}]);
|
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
[tsParticles](https://github.com/tsparticles/tsparticles) path plugin for polygon movement.
|
|
10
10
|
|
|
11
|
+
## Quick checklist
|
|
12
|
+
|
|
13
|
+
1. Install `@tsparticles/engine` (or use the CDN bundle below)
|
|
14
|
+
2. Call the package loader function(s) before `tsParticles.load(...)`
|
|
15
|
+
3. Apply the package options in your `tsParticles.load(...)` config
|
|
16
|
+
|
|
11
17
|
## How to use it
|
|
12
18
|
|
|
13
19
|
### CDN / Vanilla JS / jQuery
|
|
@@ -72,3 +78,34 @@ import { loadPolygonPath } from "@tsparticles/path-polygon";
|
|
|
72
78
|
await loadPolygonPath(tsParticles);
|
|
73
79
|
})();
|
|
74
80
|
```
|
|
81
|
+
|
|
82
|
+
## Option mapping
|
|
83
|
+
|
|
84
|
+
- Primary options key: `particles.move.path`
|
|
85
|
+
- Path generator name: `"polygon"`
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"particles": {
|
|
90
|
+
"move": {
|
|
91
|
+
"enable": true,
|
|
92
|
+
"path": {
|
|
93
|
+
"enable": true,
|
|
94
|
+
"generator": "polygon",
|
|
95
|
+
"options": {}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Common pitfalls
|
|
103
|
+
|
|
104
|
+
- Calling `tsParticles.load(...)` before `loadPolygonPath(...)`
|
|
105
|
+
- Verify required peer packages before enabling advanced options
|
|
106
|
+
- Change one option group at a time to isolate regressions quickly
|
|
107
|
+
|
|
108
|
+
## Related docs
|
|
109
|
+
|
|
110
|
+
- All packages catalog: <https://github.com/tsparticles/tsparticles>
|
|
111
|
+
- Main docs: <https://particles.js.org/docs/>
|
package/browser/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const polygonPathName = "polygonPathGenerator";
|
|
2
2
|
export async function loadPolygonPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
4
|
-
await engine.register(async (e) => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
5
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
6
|
ensureBaseMoverLoaded(e);
|
|
7
|
-
e.addPathGenerator?.(polygonPathName, async (container) => {
|
|
7
|
+
e.pluginManager.addPathGenerator?.(polygonPathName, async (container) => {
|
|
8
8
|
const { PolygonPathGenerator } = await import("./PolygonPathGenerator.js");
|
|
9
9
|
return new PolygonPathGenerator(container);
|
|
10
10
|
});
|
package/cjs/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const polygonPathName = "polygonPathGenerator";
|
|
2
2
|
export async function loadPolygonPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
4
|
-
await engine.register(async (e) => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
5
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
6
|
ensureBaseMoverLoaded(e);
|
|
7
|
-
e.addPathGenerator?.(polygonPathName, async (container) => {
|
|
7
|
+
e.pluginManager.addPathGenerator?.(polygonPathName, async (container) => {
|
|
8
8
|
const { PolygonPathGenerator } = await import("./PolygonPathGenerator.js");
|
|
9
9
|
return new PolygonPathGenerator(container);
|
|
10
10
|
});
|
package/esm/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const polygonPathName = "polygonPathGenerator";
|
|
2
2
|
export async function loadPolygonPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
4
|
-
await engine.register(async (e) => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
5
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
6
|
ensureBaseMoverLoaded(e);
|
|
7
|
-
e.addPathGenerator?.(polygonPathName, async (container) => {
|
|
7
|
+
e.pluginManager.addPathGenerator?.(polygonPathName, async (container) => {
|
|
8
8
|
const { PolygonPathGenerator } = await import("./PolygonPathGenerator.js");
|
|
9
9
|
return new PolygonPathGenerator(container);
|
|
10
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/path-polygon",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.10",
|
|
4
4
|
"description": "tsParticles polygon path",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -98,14 +98,13 @@
|
|
|
98
98
|
"browser": "./browser/index.js",
|
|
99
99
|
"import": "./esm/index.js",
|
|
100
100
|
"require": "./cjs/index.js",
|
|
101
|
-
"
|
|
102
|
-
"default": "./cjs/index.js"
|
|
101
|
+
"default": "./esm/index.js"
|
|
103
102
|
},
|
|
104
103
|
"./package.json": "./package.json"
|
|
105
104
|
},
|
|
106
|
-
"
|
|
107
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
108
|
-
"@tsparticles/plugin-move": "4.0.0-beta.
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"@tsparticles/engine": "4.0.0-beta.10",
|
|
107
|
+
"@tsparticles/plugin-move": "4.0.0-beta.10"
|
|
109
108
|
},
|
|
110
109
|
"type": "module"
|
|
111
110
|
}
|