@tsparticles/updater-gradient 3.0.0-beta.0 → 3.0.0-beta.2
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/README.md +1 -1
- package/browser/GradientUpdater.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.js +2 -2
- package/browser/Options/Classes/AnimatableGradientColor.js +1 -1
- package/browser/Options/Classes/GradientAngle.js +1 -1
- package/browser/Options/Classes/GradientColorOpacity.js +1 -1
- package/browser/index.js +1 -1
- package/browser/package.json +1 -0
- package/cjs/GradientUpdater.js +4 -4
- package/cjs/Options/Classes/AnimatableGradient.js +4 -4
- package/cjs/Options/Classes/AnimatableGradientColor.js +2 -2
- package/cjs/Options/Classes/GradientAngle.js +2 -2
- package/cjs/Options/Classes/GradientColorOpacity.js +2 -2
- package/cjs/index.js +2 -2
- package/cjs/package.json +1 -0
- package/esm/GradientUpdater.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.js +2 -2
- package/esm/Options/Classes/AnimatableGradientColor.js +1 -1
- package/esm/Options/Classes/GradientAngle.js +1 -1
- package/esm/Options/Classes/GradientColorOpacity.js +1 -1
- package/esm/index.js +1 -1
- package/esm/package.json +1 -0
- package/package.json +18 -6
- package/report.html +23 -5
- package/tsparticles.updater.gradient.js +1 -1
- package/tsparticles.updater.gradient.min.js.LICENSE.txt +1 -1
- package/types/GradientUpdater.d.ts +1 -1
- package/types/Options/Classes/AnimatableGradient.d.ts +3 -3
- package/types/Options/Classes/AnimatableGradientColor.d.ts +2 -2
- package/types/Options/Classes/GradientAngle.d.ts +2 -2
- package/types/Options/Classes/GradientColorOpacity.d.ts +3 -3
- package/types/Options/Classes/GradientColorOpacityAnimation.d.ts +1 -1
- package/types/Options/Interfaces/IAnimatableGradient.d.ts +2 -2
- package/types/Options/Interfaces/IOptionsGradient.d.ts +1 -1
- package/types/Types.d.ts +2 -2
- package/types/Utils.d.ts +1 -1
- package/umd/GradientUpdater.js +5 -5
- package/umd/Options/Classes/AnimatableGradient.js +5 -5
- package/umd/Options/Classes/AnimatableGradientColor.js +3 -3
- package/umd/Options/Classes/GradientAngle.js +3 -3
- package/umd/Options/Classes/GradientColorOpacity.js +3 -3
- package/umd/index.js +3 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@tsparticles/updater-gradient)
|
|
7
7
|
[](https://www.npmjs.com/package/@tsparticles/updater-gradient) [](https://github.com/sponsors/matteobruni)
|
|
8
8
|
|
|
9
|
-
[tsParticles](https://github.com/
|
|
9
|
+
[tsParticles](https://github.com/tsparticles/tsparticles) updater plugin for gradient animations.
|
|
10
10
|
|
|
11
11
|
## How to use it
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { executeOnSingleOrMultiple, getHslAnimationFromHsl, getRandom, getRangeMax, getRangeMin, getRangeValue, getStyleFromHsl, itemFromSingleOrMultiple, randomInRange, rangeColorToHsl, } from "@tsparticles/engine";
|
|
2
|
-
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient";
|
|
3
|
-
import { updateGradient } from "./Utils";
|
|
2
|
+
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
|
|
3
|
+
import { updateGradient } from "./Utils.js";
|
|
4
4
|
export class GradientUpdater {
|
|
5
5
|
getColorStyles(particle, context, radius, opacity) {
|
|
6
6
|
const gradient = particle.gradient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnimatableGradientColor } from "./AnimatableGradientColor";
|
|
2
|
-
import { GradientAngle } from "./GradientAngle";
|
|
1
|
+
import { AnimatableGradientColor } from "./AnimatableGradientColor.js";
|
|
2
|
+
import { GradientAngle } from "./GradientAngle.js";
|
|
3
3
|
export class AnimatableGradient {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.angle = new GradientAngle();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimatableColor, isNumber } from "@tsparticles/engine";
|
|
2
|
-
import { GradientColorOpacity } from "./GradientColorOpacity";
|
|
2
|
+
import { GradientColorOpacity } from "./GradientColorOpacity.js";
|
|
3
3
|
export class AnimatableGradientColor {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.stop = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation";
|
|
2
|
+
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
|
|
3
3
|
export class GradientColorOpacity {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.value = 0;
|
package/browser/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "module" }
|
package/cjs/GradientUpdater.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GradientUpdater = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const AnimatableGradient_js_1 = require("./Options/Classes/AnimatableGradient.js");
|
|
6
|
+
const Utils_js_1 = require("./Utils.js");
|
|
7
7
|
class GradientUpdater {
|
|
8
8
|
getColorStyles(particle, context, radius, opacity) {
|
|
9
9
|
const gradient = particle.gradient;
|
|
@@ -120,14 +120,14 @@ class GradientUpdater {
|
|
|
120
120
|
continue;
|
|
121
121
|
}
|
|
122
122
|
options.gradient = (0, engine_1.executeOnSingleOrMultiple)(gradientToLoad, (gradient) => {
|
|
123
|
-
const tmp = new
|
|
123
|
+
const tmp = new AnimatableGradient_js_1.AnimatableGradient();
|
|
124
124
|
tmp.load(gradient);
|
|
125
125
|
return tmp;
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
update(particle, delta) {
|
|
130
|
-
(0,
|
|
130
|
+
(0, Utils_js_1.updateGradient)(particle, delta);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
exports.GradientUpdater = GradientUpdater;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnimatableGradient = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const AnimatableGradientColor_js_1 = require("./AnimatableGradientColor.js");
|
|
5
|
+
const GradientAngle_js_1 = require("./GradientAngle.js");
|
|
6
6
|
class AnimatableGradient {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.angle = new
|
|
8
|
+
this.angle = new GradientAngle_js_1.GradientAngle();
|
|
9
9
|
this.colors = [];
|
|
10
10
|
this.type = "random";
|
|
11
11
|
}
|
|
@@ -16,7 +16,7 @@ class AnimatableGradient {
|
|
|
16
16
|
this.angle.load(data.angle);
|
|
17
17
|
if (data.colors !== undefined) {
|
|
18
18
|
this.colors = data.colors.map((s) => {
|
|
19
|
-
const tmp = new
|
|
19
|
+
const tmp = new AnimatableGradientColor_js_1.AnimatableGradientColor();
|
|
20
20
|
tmp.load(s);
|
|
21
21
|
return tmp;
|
|
22
22
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnimatableGradientColor = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
-
const
|
|
5
|
+
const GradientColorOpacity_js_1 = require("./GradientColorOpacity.js");
|
|
6
6
|
class AnimatableGradientColor {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.stop = 0;
|
|
@@ -17,7 +17,7 @@ class AnimatableGradientColor {
|
|
|
17
17
|
}
|
|
18
18
|
this.value = engine_1.AnimatableColor.create(this.value, data.value);
|
|
19
19
|
if (data.opacity !== undefined) {
|
|
20
|
-
this.opacity = new
|
|
20
|
+
this.opacity = new GradientColorOpacity_js_1.GradientColorOpacity();
|
|
21
21
|
if ((0, engine_1.isNumber)(data.opacity)) {
|
|
22
22
|
this.opacity.value = data.opacity;
|
|
23
23
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GradientAngle = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
-
const
|
|
5
|
+
const GradientAngleAnimation_js_1 = require("./GradientAngleAnimation.js");
|
|
6
6
|
class GradientAngle {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.value = 0;
|
|
9
|
-
this.animation = new
|
|
9
|
+
this.animation = new GradientAngleAnimation_js_1.GradientAngleAnimation();
|
|
10
10
|
this.direction = "clockwise";
|
|
11
11
|
}
|
|
12
12
|
load(data) {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GradientColorOpacity = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
-
const
|
|
5
|
+
const GradientColorOpacityAnimation_js_1 = require("./GradientColorOpacityAnimation.js");
|
|
6
6
|
class GradientColorOpacity {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.value = 0;
|
|
9
|
-
this.animation = new
|
|
9
|
+
this.animation = new GradientColorOpacityAnimation_js_1.GradientColorOpacityAnimation();
|
|
10
10
|
}
|
|
11
11
|
load(data) {
|
|
12
12
|
if (!data) {
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadGradientUpdater = void 0;
|
|
4
|
-
const
|
|
4
|
+
const GradientUpdater_js_1 = require("./GradientUpdater.js");
|
|
5
5
|
async function loadGradientUpdater(engine, refresh = true) {
|
|
6
|
-
await engine.addParticleUpdater("gradient", () => new
|
|
6
|
+
await engine.addParticleUpdater("gradient", () => new GradientUpdater_js_1.GradientUpdater(), refresh);
|
|
7
7
|
}
|
|
8
8
|
exports.loadGradientUpdater = loadGradientUpdater;
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
package/esm/GradientUpdater.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { executeOnSingleOrMultiple, getHslAnimationFromHsl, getRandom, getRangeMax, getRangeMin, getRangeValue, getStyleFromHsl, itemFromSingleOrMultiple, randomInRange, rangeColorToHsl, } from "@tsparticles/engine";
|
|
2
|
-
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient";
|
|
3
|
-
import { updateGradient } from "./Utils";
|
|
2
|
+
import { AnimatableGradient } from "./Options/Classes/AnimatableGradient.js";
|
|
3
|
+
import { updateGradient } from "./Utils.js";
|
|
4
4
|
export class GradientUpdater {
|
|
5
5
|
getColorStyles(particle, context, radius, opacity) {
|
|
6
6
|
const gradient = particle.gradient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnimatableGradientColor } from "./AnimatableGradientColor";
|
|
2
|
-
import { GradientAngle } from "./GradientAngle";
|
|
1
|
+
import { AnimatableGradientColor } from "./AnimatableGradientColor.js";
|
|
2
|
+
import { GradientAngle } from "./GradientAngle.js";
|
|
3
3
|
export class AnimatableGradient {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.angle = new GradientAngle();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimatableColor, isNumber } from "@tsparticles/engine";
|
|
2
|
-
import { GradientColorOpacity } from "./GradientColorOpacity";
|
|
2
|
+
import { GradientColorOpacity } from "./GradientColorOpacity.js";
|
|
3
3
|
export class AnimatableGradientColor {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.stop = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation";
|
|
2
|
+
import { GradientColorOpacityAnimation } from "./GradientColorOpacityAnimation.js";
|
|
3
3
|
export class GradientColorOpacity {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.value = 0;
|
package/esm/index.js
CHANGED
package/esm/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "module" }
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-gradient",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
4
|
"description": "tsParticles particles gradient updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/
|
|
8
|
+
"url": "git+https://github.com/tsparticles/tsparticles.git",
|
|
9
9
|
"directory": "updaters/gradient"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
|
67
67
|
"license": "MIT",
|
|
68
68
|
"bugs": {
|
|
69
|
-
"url": "https://github.com/
|
|
69
|
+
"url": "https://github.com/tsparticles/tsparticles/issues"
|
|
70
70
|
},
|
|
71
71
|
"funding": [
|
|
72
72
|
{
|
|
@@ -82,14 +82,26 @@
|
|
|
82
82
|
"url": "https://www.buymeacoffee.com/matteobruni"
|
|
83
83
|
}
|
|
84
84
|
],
|
|
85
|
-
"
|
|
85
|
+
"sideEffects": false,
|
|
86
86
|
"jsdelivr": "tsparticles.updater.gradient.min.js",
|
|
87
87
|
"unpkg": "tsparticles.updater.gradient.min.js",
|
|
88
|
+
"browser": "browser/index.js",
|
|
89
|
+
"main": "cjs/index.js",
|
|
88
90
|
"module": "esm/index.js",
|
|
89
91
|
"types": "types/index.d.ts",
|
|
90
|
-
"
|
|
92
|
+
"exports": {
|
|
93
|
+
".": {
|
|
94
|
+
"types": "./types/index.d.ts",
|
|
95
|
+
"browser": "./browser/index.js",
|
|
96
|
+
"import": "./esm/index.js",
|
|
97
|
+
"require": "./cjs/index.js",
|
|
98
|
+
"umd": "./umd/index.js",
|
|
99
|
+
"default": "./cjs/index.js"
|
|
100
|
+
},
|
|
101
|
+
"./package.json": "./package.json"
|
|
102
|
+
},
|
|
91
103
|
"dependencies": {
|
|
92
|
-
"@tsparticles/engine": "^3.0.0-beta.
|
|
104
|
+
"@tsparticles/engine": "^3.0.0-beta.2"
|
|
93
105
|
},
|
|
94
106
|
"publishConfig": {
|
|
95
107
|
"access": "public"
|