@tsparticles/shape-rounded-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/{512.min.js → 603.min.js} +1 -1
- package/README.md +35 -0
- package/browser/index.js +3 -3
- package/cjs/index.js +3 -3
- package/dist_browser_RoundedPolygonDrawer_js.js +1 -1
- package/esm/index.js +3 -3
- package/package.json +4 -5
- package/report.html +84 -29
- package/tsparticles.shape.rounded-polygon.js +2 -2
- package/tsparticles.shape.rounded-polygon.min.js +2 -2
- package/types/Utils.d.ts +2 -2
- package/umd/IRoundedPolygonShape.js +0 -12
- package/umd/RoundedParticle.js +0 -12
- package/umd/RoundedPolygonDrawer.js +0 -31
- package/umd/Utils.js +0 -40
- package/umd/index.js +0 -56
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_rounded_polygon=this.webpackChunk_tsparticles_shape_rounded_polygon||[]).push([[
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_rounded_polygon=this.webpackChunk_tsparticles_shape_rounded_polygon||[]).push([[603],{603(e,t,a){a.d(t,{RoundedPolygonDrawer:()=>s});var r=a(303);class s{draw(e){let{context:t,particle:a,radius:s}=e;!function(e,t,a){let s=t[0],l=t[1];if(!s||!l)return;let n=t.length;e.moveTo((s.x+l.x)*r.half,(s.y+l.y)*r.half);for(let o=1;o<=n;o++)s=l,l=t[(o+1)%n],s&&l&&e.arcTo(s.x,s.y,(s.x+l.x)*r.half,(s.y+l.y)*r.half,a)}(t,function(e,t,a=0){let s=r.doublePI/e,l=[];for(let r=0;r<e;r++)l.push({x:Math.cos(r*s+a)*t,y:Math.sin(r*s+a)*t});return l}(a.sides,s),a.borderRadius??5)}getSidesCount(e){let t=e.shapeData;return Math.round((0,r.getRangeValue)(t?.sides??5))}particleInit(e,t){let a=t.shapeData;t.borderRadius=Math.round((0,r.getRangeValue)(a?.radius??5))*e.retina.pixelRatio}}}}]);
|
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
[tsParticles](https://github.com/tsparticles/tsparticles) additional rounded polygon shape.
|
|
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
|
|
@@ -74,3 +80,32 @@ import { loadRoundedPolygonShape } from "@tsparticles/shape-rounded-polygon";
|
|
|
74
80
|
await loadRoundedPolygonShape(tsParticles);
|
|
75
81
|
})();
|
|
76
82
|
```
|
|
83
|
+
|
|
84
|
+
## Option mapping
|
|
85
|
+
|
|
86
|
+
- Primary options key: `particles.shape.type: "rounded-polygon"`
|
|
87
|
+
- Shape-specific options key: `particles.shape.options.rounded-polygon`
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"particles": {
|
|
92
|
+
"shape": {
|
|
93
|
+
"type": "rounded-polygon",
|
|
94
|
+
"options": {
|
|
95
|
+
"rounded-polygon": {}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Common pitfalls
|
|
103
|
+
|
|
104
|
+
- Calling `tsParticles.load(...)` before `loadRoundedPolygonShape(...)`
|
|
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,7 +1,7 @@
|
|
|
1
1
|
export async function loadRoundedPolygonShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["rounded-polygon"], async () => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addShape(["rounded-polygon"], async () => {
|
|
5
5
|
const { RoundedPolygonDrawer } = await import("./RoundedPolygonDrawer.js");
|
|
6
6
|
return new RoundedPolygonDrawer();
|
|
7
7
|
});
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function loadRoundedPolygonShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["rounded-polygon"], async () => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addShape(["rounded-polygon"], async () => {
|
|
5
5
|
const { RoundedPolygonDrawer } = await import("./RoundedPolygonDrawer.js");
|
|
6
6
|
return new RoundedPolygonDrawer();
|
|
7
7
|
});
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function loadRoundedPolygonShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["rounded-polygon"], async () => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addShape(["rounded-polygon"], async () => {
|
|
5
5
|
const { RoundedPolygonDrawer } = await import("./RoundedPolygonDrawer.js");
|
|
6
6
|
return new RoundedPolygonDrawer();
|
|
7
7
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/shape-rounded-polygon",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.10",
|
|
4
4
|
"description": "tsParticles rounded polygon shape",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -53,13 +53,12 @@
|
|
|
53
53
|
"browser": "./browser/index.js",
|
|
54
54
|
"import": "./esm/index.js",
|
|
55
55
|
"require": "./cjs/index.js",
|
|
56
|
-
"
|
|
57
|
-
"default": "./cjs/index.js"
|
|
56
|
+
"default": "./esm/index.js"
|
|
58
57
|
},
|
|
59
58
|
"./package.json": "./package.json"
|
|
60
59
|
},
|
|
61
|
-
"
|
|
62
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@tsparticles/engine": "4.0.0-beta.10"
|
|
63
62
|
},
|
|
64
63
|
"publishConfig": {
|
|
65
64
|
"access": "public"
|