@tsparticles/preset-fireworks 3.0.0-beta.4 → 3.0.1
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/bundle.js +2 -2
- package/browser/index.js +3 -1
- package/browser/options.js +10 -4
- package/cjs/bundle.js +3 -3
- package/cjs/index.js +4 -2
- package/cjs/options.js +10 -4
- package/esm/bundle.js +2 -2
- package/esm/index.js +3 -1
- package/esm/options.js +10 -4
- package/package.json +11 -10
- package/report.html +2 -2
- package/tsparticles.preset.fireworks.bundle.js +315 -182
- package/tsparticles.preset.fireworks.bundle.min.js +1 -1
- package/tsparticles.preset.fireworks.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.preset.fireworks.js +36 -14
- package/tsparticles.preset.fireworks.min.js +1 -1
- package/tsparticles.preset.fireworks.min.js.LICENSE.txt +1 -1
- package/types/bundle.d.ts +1 -1
- package/umd/bundle.js +4 -4
- package/umd/index.js +5 -3
- package/umd/options.js +10 -4
package/browser/bundle.js
CHANGED
package/browser/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { loadBasic } from "@tsparticles/basic";
|
|
2
2
|
import { loadDestroyUpdater } from "@tsparticles/updater-destroy";
|
|
3
3
|
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
|
|
4
|
+
import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
|
|
4
5
|
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
5
6
|
import { loadLineShape } from "@tsparticles/shape-line";
|
|
6
7
|
import { loadRotateUpdater } from "@tsparticles/updater-rotate";
|
|
7
8
|
import { loadSoundsPlugin } from "@tsparticles/plugin-sounds";
|
|
8
9
|
import { loadStrokeColorUpdater } from "@tsparticles/updater-stroke-color";
|
|
9
|
-
import { options } from "./options";
|
|
10
|
+
import { options } from "./options.js";
|
|
10
11
|
export async function loadFireworksPreset(engine, refresh = true) {
|
|
11
12
|
await loadBasic(engine, false);
|
|
12
13
|
await loadEmittersPlugin(engine, false);
|
|
14
|
+
await loadEmittersShapeSquare(engine, false);
|
|
13
15
|
await loadSoundsPlugin(engine, false);
|
|
14
16
|
await loadLineShape(engine, false);
|
|
15
17
|
await loadRotateUpdater(engine, false);
|
package/browser/options.js
CHANGED
|
@@ -4,14 +4,14 @@ const explodeSoundCheck = (args) => {
|
|
|
4
4
|
return data.particle.shape === "line";
|
|
5
5
|
};
|
|
6
6
|
const fixRange = (value, min, max) => {
|
|
7
|
-
const diffSMax = value.max > max ? value.max - max :
|
|
7
|
+
const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;
|
|
8
8
|
let res = setRangeValue(value);
|
|
9
9
|
if (diffSMax) {
|
|
10
10
|
res = setRangeValue(value.min - diffSMax, max);
|
|
11
11
|
}
|
|
12
|
-
const diffSMin = value.min < min ? value.min :
|
|
12
|
+
const diffSMin = value.min < min ? value.min : minValue;
|
|
13
13
|
if (diffSMin) {
|
|
14
|
-
res = setRangeValue(
|
|
14
|
+
res = setRangeValue(minValue, value.max + diffSMin);
|
|
15
15
|
}
|
|
16
16
|
return res;
|
|
17
17
|
};
|
|
@@ -21,7 +21,13 @@ const fireworksOptions = ["#ff595e", "#ffca3a", "#8ac926", "#1982c4", "#6a4c93"]
|
|
|
21
21
|
if (!rgb) {
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
24
|
-
const hsl = rgbToHsl(rgb),
|
|
24
|
+
const hsl = rgbToHsl(rgb), sOffset = 30, lOffset = 30, sBounds = {
|
|
25
|
+
min: 0,
|
|
26
|
+
max: 100,
|
|
27
|
+
}, lBounds = {
|
|
28
|
+
min: 0,
|
|
29
|
+
max: 100,
|
|
30
|
+
}, sRange = fixRange({ min: hsl.s - sOffset, max: hsl.s + sOffset }, sBounds.min, sBounds.max), lRange = fixRange({ min: hsl.l - lOffset, max: hsl.l + lOffset }, lBounds.min, lBounds.max);
|
|
25
31
|
return {
|
|
26
32
|
color: {
|
|
27
33
|
value: {
|
package/cjs/bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tsParticles = exports.loadFireworksPreset = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "loadFireworksPreset", { enumerable: true, get: function () { return
|
|
4
|
+
const index_js_1 = require("./index.js");
|
|
5
|
+
Object.defineProperty(exports, "loadFireworksPreset", { enumerable: true, get: function () { return index_js_1.loadFireworksPreset; } });
|
|
6
6
|
const engine_1 = require("@tsparticles/engine");
|
|
7
7
|
Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
|
|
8
|
-
(0,
|
|
8
|
+
void (0, index_js_1.loadFireworksPreset)(engine_1.tsParticles);
|
package/cjs/index.js
CHANGED
|
@@ -4,21 +4,23 @@ exports.loadFireworksPreset = void 0;
|
|
|
4
4
|
const basic_1 = require("@tsparticles/basic");
|
|
5
5
|
const updater_destroy_1 = require("@tsparticles/updater-destroy");
|
|
6
6
|
const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
|
|
7
|
+
const plugin_emitters_shape_square_1 = require("@tsparticles/plugin-emitters-shape-square");
|
|
7
8
|
const updater_life_1 = require("@tsparticles/updater-life");
|
|
8
9
|
const shape_line_1 = require("@tsparticles/shape-line");
|
|
9
10
|
const updater_rotate_1 = require("@tsparticles/updater-rotate");
|
|
10
11
|
const plugin_sounds_1 = require("@tsparticles/plugin-sounds");
|
|
11
12
|
const updater_stroke_color_1 = require("@tsparticles/updater-stroke-color");
|
|
12
|
-
const
|
|
13
|
+
const options_js_1 = require("./options.js");
|
|
13
14
|
async function loadFireworksPreset(engine, refresh = true) {
|
|
14
15
|
await (0, basic_1.loadBasic)(engine, false);
|
|
15
16
|
await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
|
|
17
|
+
await (0, plugin_emitters_shape_square_1.loadEmittersShapeSquare)(engine, false);
|
|
16
18
|
await (0, plugin_sounds_1.loadSoundsPlugin)(engine, false);
|
|
17
19
|
await (0, shape_line_1.loadLineShape)(engine, false);
|
|
18
20
|
await (0, updater_rotate_1.loadRotateUpdater)(engine, false);
|
|
19
21
|
await (0, updater_destroy_1.loadDestroyUpdater)(engine, false);
|
|
20
22
|
await (0, updater_life_1.loadLifeUpdater)(engine, false);
|
|
21
23
|
await (0, updater_stroke_color_1.loadStrokeColorUpdater)(engine, false);
|
|
22
|
-
await engine.addPreset("fireworks",
|
|
24
|
+
await engine.addPreset("fireworks", options_js_1.options, refresh);
|
|
23
25
|
}
|
|
24
26
|
exports.loadFireworksPreset = loadFireworksPreset;
|
package/cjs/options.js
CHANGED
|
@@ -7,14 +7,14 @@ const explodeSoundCheck = (args) => {
|
|
|
7
7
|
return data.particle.shape === "line";
|
|
8
8
|
};
|
|
9
9
|
const fixRange = (value, min, max) => {
|
|
10
|
-
const diffSMax = value.max > max ? value.max - max :
|
|
10
|
+
const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;
|
|
11
11
|
let res = (0, engine_1.setRangeValue)(value);
|
|
12
12
|
if (diffSMax) {
|
|
13
13
|
res = (0, engine_1.setRangeValue)(value.min - diffSMax, max);
|
|
14
14
|
}
|
|
15
|
-
const diffSMin = value.min < min ? value.min :
|
|
15
|
+
const diffSMin = value.min < min ? value.min : minValue;
|
|
16
16
|
if (diffSMin) {
|
|
17
|
-
res = (0, engine_1.setRangeValue)(
|
|
17
|
+
res = (0, engine_1.setRangeValue)(minValue, value.max + diffSMin);
|
|
18
18
|
}
|
|
19
19
|
return res;
|
|
20
20
|
};
|
|
@@ -24,7 +24,13 @@ const fireworksOptions = ["#ff595e", "#ffca3a", "#8ac926", "#1982c4", "#6a4c93"]
|
|
|
24
24
|
if (!rgb) {
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
27
|
-
const hsl = (0, engine_1.rgbToHsl)(rgb),
|
|
27
|
+
const hsl = (0, engine_1.rgbToHsl)(rgb), sOffset = 30, lOffset = 30, sBounds = {
|
|
28
|
+
min: 0,
|
|
29
|
+
max: 100,
|
|
30
|
+
}, lBounds = {
|
|
31
|
+
min: 0,
|
|
32
|
+
max: 100,
|
|
33
|
+
}, sRange = fixRange({ min: hsl.s - sOffset, max: hsl.s + sOffset }, sBounds.min, sBounds.max), lRange = fixRange({ min: hsl.l - lOffset, max: hsl.l + lOffset }, lBounds.min, lBounds.max);
|
|
28
34
|
return {
|
|
29
35
|
color: {
|
|
30
36
|
value: {
|
package/esm/bundle.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { loadBasic } from "@tsparticles/basic";
|
|
2
2
|
import { loadDestroyUpdater } from "@tsparticles/updater-destroy";
|
|
3
3
|
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
|
|
4
|
+
import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
|
|
4
5
|
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
5
6
|
import { loadLineShape } from "@tsparticles/shape-line";
|
|
6
7
|
import { loadRotateUpdater } from "@tsparticles/updater-rotate";
|
|
7
8
|
import { loadSoundsPlugin } from "@tsparticles/plugin-sounds";
|
|
8
9
|
import { loadStrokeColorUpdater } from "@tsparticles/updater-stroke-color";
|
|
9
|
-
import { options } from "./options";
|
|
10
|
+
import { options } from "./options.js";
|
|
10
11
|
export async function loadFireworksPreset(engine, refresh = true) {
|
|
11
12
|
await loadBasic(engine, false);
|
|
12
13
|
await loadEmittersPlugin(engine, false);
|
|
14
|
+
await loadEmittersShapeSquare(engine, false);
|
|
13
15
|
await loadSoundsPlugin(engine, false);
|
|
14
16
|
await loadLineShape(engine, false);
|
|
15
17
|
await loadRotateUpdater(engine, false);
|
package/esm/options.js
CHANGED
|
@@ -4,14 +4,14 @@ const explodeSoundCheck = (args) => {
|
|
|
4
4
|
return data.particle.shape === "line";
|
|
5
5
|
};
|
|
6
6
|
const fixRange = (value, min, max) => {
|
|
7
|
-
const diffSMax = value.max > max ? value.max - max :
|
|
7
|
+
const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;
|
|
8
8
|
let res = setRangeValue(value);
|
|
9
9
|
if (diffSMax) {
|
|
10
10
|
res = setRangeValue(value.min - diffSMax, max);
|
|
11
11
|
}
|
|
12
|
-
const diffSMin = value.min < min ? value.min :
|
|
12
|
+
const diffSMin = value.min < min ? value.min : minValue;
|
|
13
13
|
if (diffSMin) {
|
|
14
|
-
res = setRangeValue(
|
|
14
|
+
res = setRangeValue(minValue, value.max + diffSMin);
|
|
15
15
|
}
|
|
16
16
|
return res;
|
|
17
17
|
};
|
|
@@ -21,7 +21,13 @@ const fireworksOptions = ["#ff595e", "#ffca3a", "#8ac926", "#1982c4", "#6a4c93"]
|
|
|
21
21
|
if (!rgb) {
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
24
|
-
const hsl = rgbToHsl(rgb),
|
|
24
|
+
const hsl = rgbToHsl(rgb), sOffset = 30, lOffset = 30, sBounds = {
|
|
25
|
+
min: 0,
|
|
26
|
+
max: 100,
|
|
27
|
+
}, lBounds = {
|
|
28
|
+
min: 0,
|
|
29
|
+
max: 100,
|
|
30
|
+
}, sRange = fixRange({ min: hsl.s - sOffset, max: hsl.s + sOffset }, sBounds.min, sBounds.max), lRange = fixRange({ min: hsl.l - lOffset, max: hsl.l + lOffset }, lBounds.min, lBounds.max);
|
|
25
31
|
return {
|
|
26
32
|
color: {
|
|
27
33
|
value: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/preset-fireworks",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "tsParticles fireworks preset",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,15 +87,16 @@
|
|
|
87
87
|
"module": "esm/index.js",
|
|
88
88
|
"types": "types/index.d.ts",
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/basic": "^3.0.0
|
|
91
|
-
"@tsparticles/engine": "^3.0.0
|
|
92
|
-
"@tsparticles/plugin-emitters": "^3.0.0
|
|
93
|
-
"@tsparticles/plugin-
|
|
94
|
-
"@tsparticles/
|
|
95
|
-
"@tsparticles/
|
|
96
|
-
"@tsparticles/updater-
|
|
97
|
-
"@tsparticles/updater-
|
|
98
|
-
"@tsparticles/updater-
|
|
90
|
+
"@tsparticles/basic": "^3.0.0",
|
|
91
|
+
"@tsparticles/engine": "^3.0.0",
|
|
92
|
+
"@tsparticles/plugin-emitters": "^3.0.0",
|
|
93
|
+
"@tsparticles/plugin-emitters-shape-square": "^3.0.0",
|
|
94
|
+
"@tsparticles/plugin-sounds": "^3.0.0",
|
|
95
|
+
"@tsparticles/shape-line": "^3.0.0",
|
|
96
|
+
"@tsparticles/updater-destroy": "^3.0.0",
|
|
97
|
+
"@tsparticles/updater-life": "^3.0.0",
|
|
98
|
+
"@tsparticles/updater-rotate": "^3.0.0",
|
|
99
|
+
"@tsparticles/updater-stroke-color": "^3.0.0"
|
|
99
100
|
},
|
|
100
101
|
"publishConfig": {
|
|
101
102
|
"access": "public"
|