@tsparticles/shape-spiral 4.0.0-alpha.5 → 4.0.0-beta.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/13.min.js +1 -0
- package/browser/SpiralDrawer.js +0 -3
- package/browser/index.js +6 -4
- package/cjs/SpiralDrawer.js +0 -3
- package/cjs/index.js +6 -4
- package/dist_browser_SpiralDrawer_js.js +3 -3
- package/esm/SpiralDrawer.js +0 -3
- package/esm/index.js +6 -4
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.shape.spiral.js +31 -19
- package/tsparticles.shape.spiral.min.js +2 -2
- package/types/SpiralDrawer.d.ts +0 -1
- package/umd/SpiralDrawer.js +0 -3
- package/umd/index.js +6 -4
- package/761.min.js +0 -2
- package/761.min.js.LICENSE.txt +0 -1
- package/tsparticles.shape.spiral.min.js.LICENSE.txt +0 -1
package/13.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_spiral=this.webpackChunk_tsparticles_shape_spiral||[]).push([[13],{13(a,i,e){e.d(i,{SpiralDrawer:()=>s});var r=e(303);class s{draw(a){!function(a){let{context:i,particle:e,radius:r}=a;if(void 0===e.spiralInnerRadius||void 0===e.spiralLineSpacing||void 0===e.spiralWidthFactor)return;let s=(r-e.spiralInnerRadius)/e.spiralLineSpacing;for(let a=0;a<10*s;a++){let r=a/10,s=e.spiralInnerRadius+e.spiralLineSpacing*r,n={x:s*Math.cos(r),y:s*Math.sin(r)};i.lineTo(n.x,n.y)}}(a)}particleInit(a,i){let e=a.retina.pixelRatio,s=i.shapeData;i.spiralInnerRadius=(0,r.getRangeValue)(s?.innerRadius??1)*e,i.spiralLineSpacing=(0,r.getRangeValue)(s?.lineSpacing??1)*e,i.spiralWidthFactor=(0,r.getRangeValue)(s?.widthFactor??10)}}}}]);
|
package/browser/SpiralDrawer.js
CHANGED
|
@@ -2,9 +2,6 @@ import { getRangeValue } from "@tsparticles/engine";
|
|
|
2
2
|
import { drawSpiral } from "./Utils.js";
|
|
3
3
|
const defaultInnerRadius = 1, defaultLineSpacing = 1, defaultWidthFactor = 10;
|
|
4
4
|
export class SpiralDrawer {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.validTypes = ["spiral"];
|
|
7
|
-
}
|
|
8
5
|
draw(data) {
|
|
9
6
|
drawSpiral(data);
|
|
10
7
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export async function loadSpiralShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
3
|
-
await engine.register(
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
|
+
await engine.register(e => {
|
|
4
|
+
e.addShape(["spiral"], async () => {
|
|
5
|
+
const { SpiralDrawer } = await import("./SpiralDrawer.js");
|
|
6
|
+
return new SpiralDrawer();
|
|
7
|
+
});
|
|
6
8
|
});
|
|
7
9
|
}
|
package/cjs/SpiralDrawer.js
CHANGED
|
@@ -2,9 +2,6 @@ import { getRangeValue } from "@tsparticles/engine";
|
|
|
2
2
|
import { drawSpiral } from "./Utils.js";
|
|
3
3
|
const defaultInnerRadius = 1, defaultLineSpacing = 1, defaultWidthFactor = 10;
|
|
4
4
|
export class SpiralDrawer {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.validTypes = ["spiral"];
|
|
7
|
-
}
|
|
8
5
|
draw(data) {
|
|
9
6
|
drawSpiral(data);
|
|
10
7
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export async function loadSpiralShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
3
|
-
await engine.register(
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
|
+
await engine.register(e => {
|
|
4
|
+
e.addShape(["spiral"], async () => {
|
|
5
|
+
const { SpiralDrawer } = await import("./SpiralDrawer.js");
|
|
6
|
+
return new SpiralDrawer();
|
|
7
|
+
});
|
|
6
8
|
});
|
|
7
9
|
}
|
|
@@ -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-
|
|
7
|
+
* v4.0.0-beta.0
|
|
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 */ SpiralDrawer: () => (/* binding */ SpiralDrawer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\nconst defaultInnerRadius = 1
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SpiralDrawer: () => (/* binding */ SpiralDrawer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\nconst defaultInnerRadius = 1, defaultLineSpacing = 1, defaultWidthFactor = 10;\nclass SpiralDrawer {\n draw(data) {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawSpiral)(data);\n }\n particleInit(container, particle) {\n const pixelRatio = container.retina.pixelRatio, shapeData = particle.shapeData;\n particle.spiralInnerRadius = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(shapeData?.innerRadius ?? defaultInnerRadius) * pixelRatio;\n particle.spiralLineSpacing = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(shapeData?.lineSpacing ?? defaultLineSpacing) * pixelRatio;\n particle.spiralWidthFactor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(shapeData?.widthFactor ?? defaultWidthFactor);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-spiral/./dist/browser/SpiralDrawer.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ },
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
33
33
|
\*******************************/
|
|
34
34
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
35
|
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawSpiral: () => (/* binding */ drawSpiral)\n/* harmony export */ });\nfunction drawSpiral(data) {\n
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawSpiral: () => (/* binding */ drawSpiral)\n/* harmony export */ });\nfunction drawSpiral(data) {\n const { context, particle, radius } = data;\n if (particle.spiralInnerRadius === undefined || particle.spiralLineSpacing === undefined || particle.spiralWidthFactor === undefined) {\n return;\n }\n const realWidth = (radius - particle.spiralInnerRadius) / particle.spiralLineSpacing, widthFactor = 10;\n for(let i = 0; i < realWidth * widthFactor; i++){\n const angle = i / widthFactor, factor = particle.spiralInnerRadius + particle.spiralLineSpacing * angle, pos = {\n x: factor * Math.cos(angle),\n y: factor * Math.sin(angle)\n };\n context.lineTo(pos.x, pos.y);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-spiral/./dist/browser/Utils.js?\n}");
|
|
37
37
|
|
|
38
38
|
/***/ }
|
|
39
39
|
|
package/esm/SpiralDrawer.js
CHANGED
|
@@ -2,9 +2,6 @@ import { getRangeValue } from "@tsparticles/engine";
|
|
|
2
2
|
import { drawSpiral } from "./Utils.js";
|
|
3
3
|
const defaultInnerRadius = 1, defaultLineSpacing = 1, defaultWidthFactor = 10;
|
|
4
4
|
export class SpiralDrawer {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.validTypes = ["spiral"];
|
|
7
|
-
}
|
|
8
5
|
draw(data) {
|
|
9
6
|
drawSpiral(data);
|
|
10
7
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export async function loadSpiralShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
3
|
-
await engine.register(
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
|
+
await engine.register(e => {
|
|
4
|
+
e.addShape(["spiral"], async () => {
|
|
5
|
+
const { SpiralDrawer } = await import("./SpiralDrawer.js");
|
|
6
|
+
return new SpiralDrawer();
|
|
7
|
+
});
|
|
6
8
|
});
|
|
7
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/shape-spiral",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles spiral shape",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"./package.json": "./package.json"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tsparticles/engine": "4.0.0-
|
|
103
|
+
"@tsparticles/engine": "4.0.0-beta.0"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|