@tsparticles/preset-fireworks 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/1200.min.js +1 -0
- package/1361.min.js +1 -0
- package/{930.min.js → 1467.min.js} +1 -1
- package/188.min.js +1 -0
- package/2086.min.js +1 -0
- package/2220.min.js +1 -0
- package/2902.min.js +1 -0
- package/2921.min.js +1 -0
- package/3010.min.js +1 -0
- package/3048.min.js +1 -0
- package/3072.min.js +1 -0
- package/311.min.js +1 -0
- package/3153.min.js +1 -0
- package/3172.min.js +1 -0
- package/3326.min.js +1 -0
- package/361.min.js +1 -0
- package/3659.min.js +1 -0
- package/3784.min.js +1 -0
- package/3805.min.js +1 -0
- package/{543.min.js → 383.min.js} +2 -2
- package/4244.min.js +1 -0
- package/4750.min.js +1 -0
- package/4925.min.js +1 -0
- package/4957.min.js +1 -0
- package/5074.min.js +1 -0
- package/5647.min.js +1 -0
- package/5824.min.js +1 -0
- package/5857.min.js +1 -0
- package/6592.min.js +1 -0
- package/6700.min.js +1 -0
- package/6714.min.js +1 -0
- package/6895.min.js +1 -0
- package/7063.min.js +1 -0
- package/7072.min.js +1 -0
- package/7260.min.js +1 -0
- package/7404.min.js +1 -0
- package/7430.min.js +1 -0
- package/7632.min.js +1 -0
- package/7856.min.js +1 -0
- package/8304.min.js +1 -0
- package/8619.min.js +1 -0
- package/8738.min.js +1 -0
- package/8778.min.js +1 -0
- package/892.min.js +1 -0
- package/8998.min.js +1 -0
- package/915.min.js +1 -0
- package/9245.min.js +1 -0
- package/9358.min.js +1 -0
- package/9392.min.js +1 -0
- package/9719.min.js +1 -0
- package/9976.min.js +1 -0
- package/README.md +38 -1
- package/browser/index.js +7 -11
- package/browser/options.js +21 -46
- package/cjs/index.js +7 -11
- package/cjs/options.js +21 -46
- package/dist_browser_options_js.js +2 -2
- package/esm/index.js +7 -11
- package/esm/options.js +21 -46
- package/node_modules_pnpm_tsparticles_basic_4_0_0-beta_11_node_modules_tsparticles_basic_browser_index_js.js +30 -0
- package/{node_modules_pnpm_tsparticles_effect-trail_4_0_0-beta_1_node_modules_tsparticles_effect-trail-8ed413.js → node_modules_pnpm_tsparticles_effect-trail_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-8a5947.js} +7 -7
- package/node_modules_pnpm_tsparticles_effect-trail_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-cb9e7e.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters-shape-square_4_0_0-beta_11__tsparticles_engine_-85b81e.js +100 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters-shape-square_4_0_0-beta_11__tsparticles_engine_-8b05f0.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-09a57e.js +100 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-65b417.js +80 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-74f6c1.js +50 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-7e9977.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-7f13fa.js +30 -0
- package/{node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-486a11.js → node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-b6bb50.js} +7 -7
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-cf6e0a.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-daf8cd.js +100 -0
- package/{node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-a0aea9.js → node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-5e0ff2.js} +7 -7
- package/{node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-8932d7.js → node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-b0d0ee.js} +7 -7
- package/node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-060416.js +30 -0
- package/{node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-1737bf.js → node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-a6d106.js} +7 -7
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_11__tsparticles_engine_4_0_0-be-47e198.js +120 -0
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_11__tsparticles_engine_4_0_0-be-710e43.js +70 -0
- package/{node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_1_node_modules_tsparticles_plugin-move_b-c23e73.js → node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_nod-3a792b.js} +7 -7
- package/node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_nod-e1bc4b.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-d9836d.js +30 -0
- package/{node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-beta_1_node_modules_tsparticles_plugin-r-ae3d6b.js → node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-f22022.js} +7 -7
- package/{node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-beta_1_node_modules_tsparticles_plugin-soun-56e0fe.js → node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_n-3d7d15.js} +7 -7
- package/node_modules_pnpm_tsparticles_shape-circle_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-7552ae.js +40 -0
- package/{node_modules_pnpm_tsparticles_shape-circle_4_0_0-beta_1_node_modules_tsparticles_shape-circle-c2187f.js → node_modules_pnpm_tsparticles_shape-circle_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-b06fc7.js} +7 -7
- package/{node_modules_pnpm_tsparticles_shape-line_4_0_0-beta_1_node_modules_tsparticles_shape-line_bro-ee8e87.js → node_modules_pnpm_tsparticles_shape-line_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_node-06caa0.js} +12 -12
- package/{node_modules_pnpm_tsparticles_shape-line_4_0_0-beta_1_node_modules_tsparticles_shape-line_bro-00ff14.js → node_modules_pnpm_tsparticles_shape-line_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_node-8f1b2c.js} +7 -7
- package/{node_modules_pnpm_tsparticles_updater-destroy_4_0_0-beta_1_node_modules_tsparticles_updater-d-1451bc.js → node_modules_pnpm_tsparticles_updater-destroy_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-7f9f4b.js} +7 -7
- package/node_modules_pnpm_tsparticles_updater-life_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-9cea59.js +70 -0
- package/{node_modules_pnpm_tsparticles_updater-life_4_0_0-beta_1_node_modules_tsparticles_updater-life-3af196.js → node_modules_pnpm_tsparticles_updater-life_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-a724a4.js} +7 -7
- package/node_modules_pnpm_tsparticles_updater-opacity_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-8f9e09.js +30 -0
- package/{node_modules_pnpm_tsparticles_updater-opacity_4_0_0-beta_1_node_modules_tsparticles_updater-o-8a311f.js → node_modules_pnpm_tsparticles_updater-opacity_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-da77ce.js} +7 -7
- package/{node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-beta_1_node_modules_tsparticles_updater-265a6a.js → node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_-df7144.js} +7 -7
- package/node_modules_pnpm_tsparticles_updater-paint_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_n-589482.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-paint_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_n-b1f330.js +30 -0
- package/{node_modules_pnpm_tsparticles_updater-rotate_4_0_0-beta_1_node_modules_tsparticles_updater-ro-82c0df.js → node_modules_pnpm_tsparticles_updater-rotate_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_-03eda6.js} +7 -7
- package/node_modules_pnpm_tsparticles_updater-rotate_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_-6626aa.js +50 -0
- package/node_modules_pnpm_tsparticles_updater-size_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-a47b81.js +30 -0
- package/{node_modules_pnpm_tsparticles_updater-size_4_0_0-beta_1_node_modules_tsparticles_updater-size-124f3f.js → node_modules_pnpm_tsparticles_updater-size_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-d2508a.js} +7 -7
- package/package.json +11 -13
- package/report.html +1 -1
- package/tsparticles.preset.fireworks.bundle.js +323 -313
- package/tsparticles.preset.fireworks.bundle.min.js +2 -2
- package/tsparticles.preset.fireworks.js +11 -31
- package/tsparticles.preset.fireworks.min.js +2 -2
- package/vendors-node_modules_pnpm_tsparticles_engine_4_0_0-beta_11_node_modules_tsparticles_engine_br-ca098e.js +100 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-6e84d5.js +30 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_11__tsparticles_engine_4_0_0-f34432.js +210 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_11__tsparticles_engine_-32e86c.js +50 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_11__tsparticles_engine_4_0_0-bet-5f2b78.js +40 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-beta_11__tsparticles_engine_4_0_0-b-2693cf.js +130 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-beta_11__tsparticles_engine_4_0_0-b-9529dd.js +40 -0
- package/vendors-node_modules_pnpm_tsparticles_updater-destroy_4_0_0-beta_11__tsparticles_engine_4_0_0-194b6c.js +100 -0
- package/vendors-node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-beta_11__tsparticles_engine_4_0-09fa1a.js +80 -0
- package/126.min.js +0 -1
- package/131.min.js +0 -1
- package/182.min.js +0 -1
- package/204.min.js +0 -1
- package/22.min.js +0 -1
- package/231.min.js +0 -1
- package/270.min.js +0 -1
- package/278.min.js +0 -1
- package/28.min.js +0 -1
- package/3.min.js +0 -1
- package/302.min.js +0 -1
- package/316.min.js +0 -1
- package/337.min.js +0 -1
- package/356.min.js +0 -1
- package/382.min.js +0 -1
- package/390.min.js +0 -1
- package/406.min.js +0 -1
- package/434.min.js +0 -1
- package/47.min.js +0 -1
- package/488.min.js +0 -1
- package/508.min.js +0 -1
- package/523.min.js +0 -1
- package/530.min.js +0 -1
- package/536.min.js +0 -1
- package/558.min.js +0 -1
- package/596.min.js +0 -1
- package/608.min.js +0 -1
- package/646.min.js +0 -1
- package/652.min.js +0 -1
- package/691.min.js +0 -1
- package/730.min.js +0 -1
- package/731.min.js +0 -1
- package/754.min.js +0 -1
- package/774.min.js +0 -1
- package/78.min.js +0 -1
- package/784.min.js +0 -1
- package/799.min.js +0 -1
- package/819.min.js +0 -1
- package/830.min.js +0 -1
- package/834.min.js +0 -1
- package/844.min.js +0 -1
- package/85.min.js +0 -1
- package/922.min.js +0 -1
- package/955.min.js +0 -1
- package/964.min.js +0 -1
- package/986.min.js +0 -1
- package/991.min.js +0 -1
- package/node_modules_pnpm_tsparticles_basic_4_0_0-beta_1_node_modules_tsparticles_basic_browser_index_js.js +0 -30
- package/node_modules_pnpm_tsparticles_effect-trail_4_0_0-beta_1_node_modules_tsparticles_effect-trail-aabdff.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-emitters-shape-square_4_0_0-beta_1_node_modules_tspartic-99f284.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-emitters-shape-square_4_0_0-beta_1_node_modules_tspartic-a8bf09.js +0 -70
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-815c1c.js +0 -100
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-9a4af1.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-c7125a.js +0 -100
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-e8ed4a.js +0 -50
- package/node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-1179c3.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_1_node_modules_tsparticles_plug-908f96.js +0 -120
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_1_node_modules_tsparticles_plug-d6e6b1.js +0 -70
- package/node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_1_node_modules_tsparticles_plugin-move_b-aa7108.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-beta_1_node_modules_tsparticles_plugin-r-0f881a.js +0 -30
- package/node_modules_pnpm_tsparticles_shape-circle_4_0_0-beta_1_node_modules_tsparticles_shape-circle-07826a.js +0 -40
- package/node_modules_pnpm_tsparticles_updater-fill-color_4_0_0-beta_1_node_modules_tsparticles_update-75868d.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-fill-color_4_0_0-beta_1_node_modules_tsparticles_update-7cca03.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-life_4_0_0-beta_1_node_modules_tsparticles_updater-life-0d5869.js +0 -70
- package/node_modules_pnpm_tsparticles_updater-opacity_4_0_0-beta_1_node_modules_tsparticles_updater-o-138fb5.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-rotate_4_0_0-beta_1_node_modules_tsparticles_updater-ro-f03001.js +0 -50
- package/node_modules_pnpm_tsparticles_updater-size_4_0_0-beta_1_node_modules_tsparticles_updater-size-cbf46f.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-stroke-color_4_0_0-beta_1_node_modules_tsparticles_upda-01fd08.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-stroke-color_4_0_0-beta_1_node_modules_tsparticles_upda-fa7131.js +0 -30
- package/umd/bundle.js +0 -17
- package/umd/index.js +0 -82
- package/umd/options.js +0 -294
- package/vendors-node_modules_pnpm_tsparticles_engine_4_0_0-beta_1_node_modules_tsparticles_engine_bro-0bb20b.js +0 -100
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_p-168eb1.js +0 -30
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_p-c5a6f7.js +0 -210
- package/vendors-node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_1_node_modules_tspartic-d557a0.js +0 -50
- package/vendors-node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_1_node_modules_tsparticles_plugi-2dea06.js +0 -40
- package/vendors-node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-beta_1_node_modules_tsparticles_plu-b8727b.js +0 -40
- package/vendors-node_modules_pnpm_tsparticles_plugin-sounds_4_0_0-beta_1_node_modules_tsparticles_plu-dcfdc3.js +0 -130
- package/vendors-node_modules_pnpm_tsparticles_updater-destroy_4_0_0-beta_1_node_modules_tsparticles_u-b77b5b.js +0 -100
- package/vendors-node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-beta_1_node_modules_tsparticles-a5ec2f.js +0 -80
package/README.md
CHANGED
|
@@ -12,7 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
## Sample
|
|
14
14
|
|
|
15
|
-
[](https://particles.js.org/samples/presets/fireworks)
|
|
16
|
+
|
|
17
|
+
## Quick checklist
|
|
18
|
+
|
|
19
|
+
1. Install `@tsparticles/engine` (or use the CDN bundle below)
|
|
20
|
+
2. Call `loadFireworksPreset(tsParticles)` **before** `tsParticles.load(...)`
|
|
21
|
+
3. Set `preset: "fireworks"` in options
|
|
16
22
|
|
|
17
23
|
## How to use it
|
|
18
24
|
|
|
@@ -66,6 +72,37 @@ Checkout the documentation in the component library repository and call the `loa
|
|
|
66
72
|
|
|
67
73
|
The options shown above are valid for all the component libraries.
|
|
68
74
|
|
|
75
|
+
## Dependencies
|
|
76
|
+
|
|
77
|
+
This preset loads and combines the following packages:
|
|
78
|
+
|
|
79
|
+
| Package | Role in this preset | README |
|
|
80
|
+
| ------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------------------- |
|
|
81
|
+
| `@tsparticles/basic` | Base runtime bundle used by the preset | <https://www.npmjs.com/package/@tsparticles/basic> |
|
|
82
|
+
| `@tsparticles/effect-trail` | Adds a fading trail effect behind particles | <https://www.npmjs.com/package/@tsparticles/effect-trail> |
|
|
83
|
+
| `@tsparticles/engine` | tsParticles engine and preset registration | <https://www.npmjs.com/package/@tsparticles/engine> |
|
|
84
|
+
| `@tsparticles/plugin-emitters` | Spawns particles from configurable emitters | <https://www.npmjs.com/package/@tsparticles/plugin-emitters> |
|
|
85
|
+
| `@tsparticles/plugin-emitters-shape-square` | Adds square emitter areas for launches/bursts | <https://www.npmjs.com/package/@tsparticles/plugin-emitters-shape-square> |
|
|
86
|
+
| `@tsparticles/plugin-sounds` | Adds synchronized sound playback | <https://www.npmjs.com/package/@tsparticles/plugin-sounds> |
|
|
87
|
+
| `@tsparticles/shape-line` | Adds line/spark particle shape | <https://www.npmjs.com/package/@tsparticles/shape-line> |
|
|
88
|
+
| `@tsparticles/updater-destroy` | Removes particles when their stage ends | <https://www.npmjs.com/package/@tsparticles/updater-destroy> |
|
|
89
|
+
| `@tsparticles/updater-life` | Controls particle life-cycle stages | <https://www.npmjs.com/package/@tsparticles/updater-life> |
|
|
90
|
+
| `@tsparticles/updater-rotate` | Adds rotation animation | <https://www.npmjs.com/package/@tsparticles/updater-rotate> |
|
|
91
|
+
|
|
92
|
+
If you want to customize one specific behavior, start from the related package README above.
|
|
93
|
+
|
|
94
|
+
## Common pitfalls
|
|
95
|
+
|
|
96
|
+
- Calling `tsParticles.load(...)` before `loadFireworksPreset(tsParticles)`
|
|
97
|
+
- Changing particle shape to one not included in the bundle without importing the shape package
|
|
98
|
+
- Forgetting that the fireworks preset requires emitter, sounds, and trail packages — use the bundle to avoid missing dependencies
|
|
99
|
+
|
|
100
|
+
## Related docs
|
|
101
|
+
|
|
102
|
+
- All presets catalog: <https://github.com/tsparticles/presets>
|
|
103
|
+
- Emitter options: <https://particles.js.org/docs/classes/Plugins_Emitters_Options_Classes_Emitter.Emitter.html>
|
|
104
|
+
- Main tsParticles docs: <https://particles.js.org/docs/>
|
|
105
|
+
|
|
69
106
|
---
|
|
70
107
|
|
|
71
108
|
```mermaid
|
package/browser/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const presetName = "fireworks";
|
|
2
2
|
export async function loadFireworksPreset(engine) {
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
|
-
const [{ loadBasic }, {
|
|
4
|
+
const [{ loadBasic }, { loadEmittersPluginSimple }, { loadTrailEffect }, { loadEmittersShapeSquare }, { loadSoundsPlugin }, { loadLineShape }, { loadRotateUpdater }, { loadDestroyUpdater }, { loadLifeUpdater }, { initOptions },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/basic"),
|
|
6
|
-
import("@tsparticles/plugin-emitters"),
|
|
7
|
-
import("@tsparticles/plugin-interactivity"),
|
|
6
|
+
import("@tsparticles/plugin-emitters/plugin"),
|
|
8
7
|
import("@tsparticles/effect-trail"),
|
|
9
8
|
import("@tsparticles/plugin-emitters-shape-square"),
|
|
10
9
|
import("@tsparticles/plugin-sounds"),
|
|
@@ -12,24 +11,21 @@ export async function loadFireworksPreset(engine) {
|
|
|
12
11
|
import("@tsparticles/updater-rotate"),
|
|
13
12
|
import("@tsparticles/updater-destroy"),
|
|
14
13
|
import("@tsparticles/updater-life"),
|
|
15
|
-
import("@tsparticles/updater-stroke-color"),
|
|
16
14
|
import("./options.js"),
|
|
17
|
-
])
|
|
15
|
+
]), loadEmittersForFireworks = async (e) => {
|
|
16
|
+
await loadEmittersPluginSimple(e);
|
|
17
|
+
await loadEmittersShapeSquare(e);
|
|
18
|
+
};
|
|
18
19
|
await Promise.all([
|
|
19
20
|
loadBasic(e),
|
|
20
|
-
(
|
|
21
|
-
await loadInteractivityPlugin(e);
|
|
22
|
-
await loadEmittersPlugin(e);
|
|
23
|
-
})(),
|
|
21
|
+
loadEmittersForFireworks(e),
|
|
24
22
|
loadTrailEffect(e),
|
|
25
23
|
loadSoundsPlugin(e),
|
|
26
24
|
loadLineShape(e),
|
|
27
25
|
loadRotateUpdater(e),
|
|
28
26
|
loadDestroyUpdater(e),
|
|
29
27
|
loadLifeUpdater(e),
|
|
30
|
-
loadStrokeColorUpdater(e),
|
|
31
28
|
]);
|
|
32
|
-
await loadEmittersShapeSquare(e);
|
|
33
29
|
e.pluginManager.addPreset(presetName, initOptions(), false);
|
|
34
30
|
});
|
|
35
31
|
}
|
package/browser/options.js
CHANGED
|
@@ -44,41 +44,12 @@ export function initOptions() {
|
|
|
44
44
|
};
|
|
45
45
|
}, fireworksOptions = [
|
|
46
46
|
"#FF0000",
|
|
47
|
-
"#FF2A00",
|
|
48
|
-
"#FF5500",
|
|
49
47
|
"#FF8000",
|
|
50
|
-
"#FFAA00",
|
|
51
|
-
"#FFD400",
|
|
52
48
|
"#FFFF00",
|
|
53
|
-
"#D4FF00",
|
|
54
|
-
"#AAFF00",
|
|
55
|
-
"#80FF00",
|
|
56
|
-
"#55FF00",
|
|
57
|
-
"#2AFF00",
|
|
58
49
|
"#00FF00",
|
|
59
|
-
"#00FF2A",
|
|
60
|
-
"#00FF55",
|
|
61
|
-
"#00FF80",
|
|
62
|
-
"#00FFAA",
|
|
63
|
-
"#00FFD4",
|
|
64
50
|
"#00FFFF",
|
|
65
|
-
"#00D4FF",
|
|
66
|
-
"#00AAFF",
|
|
67
|
-
"#0080FF",
|
|
68
|
-
"#0055FF",
|
|
69
|
-
"#002AFF",
|
|
70
51
|
"#0000FF",
|
|
71
|
-
"#2A00FF",
|
|
72
|
-
"#5500FF",
|
|
73
|
-
"#8000FF",
|
|
74
|
-
"#AA00FF",
|
|
75
|
-
"#D400FF",
|
|
76
52
|
"#FF00FF",
|
|
77
|
-
"#FF00D4",
|
|
78
|
-
"#FF00AA",
|
|
79
|
-
"#FF0080",
|
|
80
|
-
"#FF0055",
|
|
81
|
-
"#FF002A",
|
|
82
53
|
]
|
|
83
54
|
.map(color => {
|
|
84
55
|
const rgb = hexToRgba(color);
|
|
@@ -93,18 +64,20 @@ export function initOptions() {
|
|
|
93
64
|
max: 100,
|
|
94
65
|
}, 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);
|
|
95
66
|
return {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
paint: {
|
|
68
|
+
fill: {
|
|
69
|
+
color: {
|
|
70
|
+
value: {
|
|
71
|
+
h: hsl.h,
|
|
72
|
+
s: sRange,
|
|
73
|
+
l: lRange,
|
|
74
|
+
},
|
|
102
75
|
},
|
|
76
|
+
enable: true,
|
|
77
|
+
},
|
|
78
|
+
stroke: {
|
|
79
|
+
width: 0,
|
|
103
80
|
},
|
|
104
|
-
enable: true,
|
|
105
|
-
},
|
|
106
|
-
stroke: {
|
|
107
|
-
width: 0,
|
|
108
81
|
},
|
|
109
82
|
number: {
|
|
110
83
|
value: 0,
|
|
@@ -235,14 +208,16 @@ export function initOptions() {
|
|
|
235
208
|
size: {
|
|
236
209
|
value: 1,
|
|
237
210
|
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
211
|
+
paint: {
|
|
212
|
+
stroke: {
|
|
213
|
+
color: {
|
|
214
|
+
value: "#ffffff",
|
|
215
|
+
},
|
|
216
|
+
width: 1,
|
|
217
|
+
},
|
|
218
|
+
fill: {
|
|
219
|
+
enable: false,
|
|
241
220
|
},
|
|
242
|
-
width: 1,
|
|
243
|
-
},
|
|
244
|
-
fill: {
|
|
245
|
-
enable: false,
|
|
246
221
|
},
|
|
247
222
|
move: {
|
|
248
223
|
enable: true,
|
package/cjs/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const presetName = "fireworks";
|
|
2
2
|
export async function loadFireworksPreset(engine) {
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
|
-
const [{ loadBasic }, {
|
|
4
|
+
const [{ loadBasic }, { loadEmittersPluginSimple }, { loadTrailEffect }, { loadEmittersShapeSquare }, { loadSoundsPlugin }, { loadLineShape }, { loadRotateUpdater }, { loadDestroyUpdater }, { loadLifeUpdater }, { initOptions },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/basic"),
|
|
6
|
-
import("@tsparticles/plugin-emitters"),
|
|
7
|
-
import("@tsparticles/plugin-interactivity"),
|
|
6
|
+
import("@tsparticles/plugin-emitters/plugin"),
|
|
8
7
|
import("@tsparticles/effect-trail"),
|
|
9
8
|
import("@tsparticles/plugin-emitters-shape-square"),
|
|
10
9
|
import("@tsparticles/plugin-sounds"),
|
|
@@ -12,24 +11,21 @@ export async function loadFireworksPreset(engine) {
|
|
|
12
11
|
import("@tsparticles/updater-rotate"),
|
|
13
12
|
import("@tsparticles/updater-destroy"),
|
|
14
13
|
import("@tsparticles/updater-life"),
|
|
15
|
-
import("@tsparticles/updater-stroke-color"),
|
|
16
14
|
import("./options.js"),
|
|
17
|
-
])
|
|
15
|
+
]), loadEmittersForFireworks = async (e) => {
|
|
16
|
+
await loadEmittersPluginSimple(e);
|
|
17
|
+
await loadEmittersShapeSquare(e);
|
|
18
|
+
};
|
|
18
19
|
await Promise.all([
|
|
19
20
|
loadBasic(e),
|
|
20
|
-
(
|
|
21
|
-
await loadInteractivityPlugin(e);
|
|
22
|
-
await loadEmittersPlugin(e);
|
|
23
|
-
})(),
|
|
21
|
+
loadEmittersForFireworks(e),
|
|
24
22
|
loadTrailEffect(e),
|
|
25
23
|
loadSoundsPlugin(e),
|
|
26
24
|
loadLineShape(e),
|
|
27
25
|
loadRotateUpdater(e),
|
|
28
26
|
loadDestroyUpdater(e),
|
|
29
27
|
loadLifeUpdater(e),
|
|
30
|
-
loadStrokeColorUpdater(e),
|
|
31
28
|
]);
|
|
32
|
-
await loadEmittersShapeSquare(e);
|
|
33
29
|
e.pluginManager.addPreset(presetName, initOptions(), false);
|
|
34
30
|
});
|
|
35
31
|
}
|
package/cjs/options.js
CHANGED
|
@@ -44,41 +44,12 @@ export function initOptions() {
|
|
|
44
44
|
};
|
|
45
45
|
}, fireworksOptions = [
|
|
46
46
|
"#FF0000",
|
|
47
|
-
"#FF2A00",
|
|
48
|
-
"#FF5500",
|
|
49
47
|
"#FF8000",
|
|
50
|
-
"#FFAA00",
|
|
51
|
-
"#FFD400",
|
|
52
48
|
"#FFFF00",
|
|
53
|
-
"#D4FF00",
|
|
54
|
-
"#AAFF00",
|
|
55
|
-
"#80FF00",
|
|
56
|
-
"#55FF00",
|
|
57
|
-
"#2AFF00",
|
|
58
49
|
"#00FF00",
|
|
59
|
-
"#00FF2A",
|
|
60
|
-
"#00FF55",
|
|
61
|
-
"#00FF80",
|
|
62
|
-
"#00FFAA",
|
|
63
|
-
"#00FFD4",
|
|
64
50
|
"#00FFFF",
|
|
65
|
-
"#00D4FF",
|
|
66
|
-
"#00AAFF",
|
|
67
|
-
"#0080FF",
|
|
68
|
-
"#0055FF",
|
|
69
|
-
"#002AFF",
|
|
70
51
|
"#0000FF",
|
|
71
|
-
"#2A00FF",
|
|
72
|
-
"#5500FF",
|
|
73
|
-
"#8000FF",
|
|
74
|
-
"#AA00FF",
|
|
75
|
-
"#D400FF",
|
|
76
52
|
"#FF00FF",
|
|
77
|
-
"#FF00D4",
|
|
78
|
-
"#FF00AA",
|
|
79
|
-
"#FF0080",
|
|
80
|
-
"#FF0055",
|
|
81
|
-
"#FF002A",
|
|
82
53
|
]
|
|
83
54
|
.map(color => {
|
|
84
55
|
const rgb = hexToRgba(color);
|
|
@@ -93,18 +64,20 @@ export function initOptions() {
|
|
|
93
64
|
max: 100,
|
|
94
65
|
}, 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);
|
|
95
66
|
return {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
paint: {
|
|
68
|
+
fill: {
|
|
69
|
+
color: {
|
|
70
|
+
value: {
|
|
71
|
+
h: hsl.h,
|
|
72
|
+
s: sRange,
|
|
73
|
+
l: lRange,
|
|
74
|
+
},
|
|
102
75
|
},
|
|
76
|
+
enable: true,
|
|
77
|
+
},
|
|
78
|
+
stroke: {
|
|
79
|
+
width: 0,
|
|
103
80
|
},
|
|
104
|
-
enable: true,
|
|
105
|
-
},
|
|
106
|
-
stroke: {
|
|
107
|
-
width: 0,
|
|
108
81
|
},
|
|
109
82
|
number: {
|
|
110
83
|
value: 0,
|
|
@@ -235,14 +208,16 @@ export function initOptions() {
|
|
|
235
208
|
size: {
|
|
236
209
|
value: 1,
|
|
237
210
|
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
211
|
+
paint: {
|
|
212
|
+
stroke: {
|
|
213
|
+
color: {
|
|
214
|
+
value: "#ffffff",
|
|
215
|
+
},
|
|
216
|
+
width: 1,
|
|
217
|
+
},
|
|
218
|
+
fill: {
|
|
219
|
+
enable: false,
|
|
241
220
|
},
|
|
242
|
-
width: 1,
|
|
243
|
-
},
|
|
244
|
-
fill: {
|
|
245
|
-
enable: false,
|
|
246
221
|
},
|
|
247
222
|
move: {
|
|
248
223
|
enable: true,
|
|
@@ -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 */ initOptions: () => (/* binding */ initOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/index.js\");\n\nfunction initOptions() {\n const explodeSoundCheck = (args)=>{\n const data = args.data;\n return data.particle.options.move.gravity.inverse;\n }, fixRange = (value, min, max)=>{\n const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;\n let res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value);\n if (diffSMax) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value.min - diffSMax, max);\n }\n const diffSMin = value.min < min ? value.min : minValue;\n if (diffSMin) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minValue, value.max + diffSMin);\n }\n return res;\n }, hexToRgba = (hex)=>{\n let hexValue = hex;\n const shortRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])([a-f\\d])?$/i;\n if (shortRegex.test(hexValue)) {\n hexValue = hexValue.replace(shortRegex, (_m, r, g, b, a)=>r + r + g + g + b + b + (a ? a + a : \"\"));\n }\n const regex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i, result = regex.exec(hexValue);\n if (!result) {\n return undefined;\n }\n result.shift();\n const indexes = {\n a: 3,\n b: 2,\n g: 1,\n r: 0\n }, values = {\n a: result[indexes.a],\n b: result[indexes.b],\n g: result[indexes.g],\n r: result[indexes.r]\n }, hexRadix = 16;\n return {\n r: values.r ? Number.parseInt(values.r, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.none,\n g: values.g ? Number.parseInt(values.g, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.none,\n b: values.b ? Number.parseInt(values.b, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.none,\n a: values.a ? Number.parseInt(values.a, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.defaultAlpha\n };\n }, fireworksOptions = [\n \"#FF0000\",\n \"#FF2A00\",\n \"#FF5500\",\n \"#FF8000\",\n \"#FFAA00\",\n \"#FFD400\",\n \"#FFFF00\",\n \"#D4FF00\",\n \"#AAFF00\",\n \"#80FF00\",\n \"#55FF00\",\n \"#2AFF00\",\n \"#00FF00\",\n \"#00FF2A\",\n \"#00FF55\",\n \"#00FF80\",\n \"#00FFAA\",\n \"#00FFD4\",\n \"#00FFFF\",\n \"#00D4FF\",\n \"#00AAFF\",\n \"#0080FF\",\n \"#0055FF\",\n \"#002AFF\",\n \"#0000FF\",\n \"#2A00FF\",\n \"#5500FF\",\n \"#8000FF\",\n \"#AA00FF\",\n \"#D400FF\",\n \"#FF00FF\",\n \"#FF00D4\",\n \"#FF00AA\",\n \"#FF0080\",\n \"#FF0055\",\n \"#FF002A\"\n ].map((color)=>{\n const rgb = hexToRgba(color);\n if (!rgb) {\n return undefined;\n }\n const hsl = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rgbToHsl)(rgb), sOffset = 30, lOffset = 30, sBounds = {\n min: 0,\n max: 100\n }, lBounds = {\n min: 0,\n max: 100\n }, sRange = fixRange({\n min: hsl.s - sOffset,\n max: hsl.s + sOffset\n }, sBounds.min, sBounds.max), lRange = fixRange({\n min: hsl.l - lOffset,\n max: hsl.l + lOffset\n }, lBounds.min, lBounds.max);\n return {\n fill: {\n color: {\n value: {\n h: hsl.h,\n s: sRange,\n l: lRange\n }\n },\n enable: true\n },\n stroke: {\n width: 0\n },\n number: {\n value: 0\n },\n opacity: {\n value: {\n min: 0.1,\n max: 1\n },\n animation: {\n enable: true,\n speed: 0.7,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.min\n }\n },\n shape: {\n type: \"circle\"\n },\n effect: {\n type: \"trail\",\n options: {\n trail: {\n length: {\n min: 5,\n max: 10\n }\n }\n }\n },\n size: {\n value: {\n min: 1,\n max: 2\n },\n animation: {\n enable: true,\n speed: 5,\n count: 1,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.min,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.none\n }\n },\n life: {\n count: 1,\n duration: {\n value: {\n min: 1,\n max: 2\n }\n }\n },\n move: {\n decay: {\n min: 0.075,\n max: 0.1\n },\n enable: true,\n gravity: {\n enable: true,\n inverse: false,\n acceleration: 5\n },\n speed: {\n min: 5,\n max: 15\n },\n direction: \"none\",\n outModes: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy\n }\n };\n }).filter((t)=>t !== undefined);\n return {\n detectRetina: true,\n background: {\n color: \"#000\"\n },\n fpsLimit: 120,\n emitters: {\n direction: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.MoveDirection.top,\n rate: {\n delay: 0.3,\n quantity: 1\n },\n size: {\n width: 100,\n height: 0\n },\n position: {\n y: 100,\n x: 50\n }\n },\n particles: {\n number: {\n value: 0\n },\n destroy: {\n mode: \"split\",\n bounds: {\n top: {\n min: 15,\n max: 35\n }\n },\n split: {\n sizeOffset: false,\n count: 1,\n factor: {\n value: 0.333333\n },\n rate: {\n value: {\n min: 75,\n max: 150\n }\n },\n particles: fireworksOptions\n }\n },\n life: {\n count: 1\n },\n shape: {\n type: \"circle\"\n },\n effect: {\n type: \"trail\",\n options: {\n trail: {\n length: {\n min: 5,\n max: 15\n },\n minWidth: 1,\n maxWidth: 1\n }\n }\n },\n size: {\n value: 1\n },\n stroke: {\n color: {\n value: \"#ffffff\"\n },\n width: 1\n },\n fill: {\n enable: false\n },\n move: {\n enable: true,\n gravity: {\n acceleration: 15,\n enable: true,\n inverse: true,\n maxSpeed: 100\n },\n speed: {\n min: 10,\n max: 20\n },\n outModes: {\n default: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy,\n top: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.none\n }\n }\n },\n sounds: {\n enable: true,\n events: [\n {\n event: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.EventType.particleRemoved,\n filter: explodeSoundCheck,\n audio: [\n \"https://particles.js.org/audio/explosion0.mp3\",\n \"https://particles.js.org/audio/explosion1.mp3\",\n \"https://particles.js.org/audio/explosion2.mp3\"\n ]\n }\n ],\n volume: 50\n }\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/./dist/browser/options.js?\n}");
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initOptions: () => (/* binding */ initOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/engine/browser/index.js\");\n\nfunction initOptions() {\n const explodeSoundCheck = (args)=>{\n const data = args.data;\n return data.particle.options.move.gravity.inverse;\n }, fixRange = (value, min, max)=>{\n const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;\n let res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value);\n if (diffSMax) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value.min - diffSMax, max);\n }\n const diffSMin = value.min < min ? value.min : minValue;\n if (diffSMin) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minValue, value.max + diffSMin);\n }\n return res;\n }, hexToRgba = (hex)=>{\n let hexValue = hex;\n const shortRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])([a-f\\d])?$/i;\n if (shortRegex.test(hexValue)) {\n hexValue = hexValue.replace(shortRegex, (_m, r, g, b, a)=>r + r + g + g + b + b + (a ? a + a : \"\"));\n }\n const regex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i, result = regex.exec(hexValue);\n if (!result) {\n return undefined;\n }\n result.shift();\n const indexes = {\n a: 3,\n b: 2,\n g: 1,\n r: 0\n }, values = {\n a: result[indexes.a],\n b: result[indexes.b],\n g: result[indexes.g],\n r: result[indexes.r]\n }, hexRadix = 16;\n return {\n r: values.r ? Number.parseInt(values.r, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.none,\n g: values.g ? Number.parseInt(values.g, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.none,\n b: values.b ? Number.parseInt(values.b, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.none,\n a: values.a ? Number.parseInt(values.a, hexRadix) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.defaultAlpha\n };\n }, fireworksOptions = [\n \"#FF0000\",\n \"#FF8000\",\n \"#FFFF00\",\n \"#00FF00\",\n \"#00FFFF\",\n \"#0000FF\",\n \"#FF00FF\"\n ].map((color)=>{\n const rgb = hexToRgba(color);\n if (!rgb) {\n return undefined;\n }\n const hsl = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rgbToHsl)(rgb), sOffset = 30, lOffset = 30, sBounds = {\n min: 0,\n max: 100\n }, lBounds = {\n min: 0,\n max: 100\n }, sRange = fixRange({\n min: hsl.s - sOffset,\n max: hsl.s + sOffset\n }, sBounds.min, sBounds.max), lRange = fixRange({\n min: hsl.l - lOffset,\n max: hsl.l + lOffset\n }, lBounds.min, lBounds.max);\n return {\n paint: {\n fill: {\n color: {\n value: {\n h: hsl.h,\n s: sRange,\n l: lRange\n }\n },\n enable: true\n },\n stroke: {\n width: 0\n }\n },\n number: {\n value: 0\n },\n opacity: {\n value: {\n min: 0.1,\n max: 1\n },\n animation: {\n enable: true,\n speed: 0.7,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.min\n }\n },\n shape: {\n type: \"circle\"\n },\n effect: {\n type: \"trail\",\n options: {\n trail: {\n length: {\n min: 5,\n max: 10\n }\n }\n }\n },\n size: {\n value: {\n min: 1,\n max: 2\n },\n animation: {\n enable: true,\n speed: 5,\n count: 1,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.min,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.none\n }\n },\n life: {\n count: 1,\n duration: {\n value: {\n min: 1,\n max: 2\n }\n }\n },\n move: {\n decay: {\n min: 0.075,\n max: 0.1\n },\n enable: true,\n gravity: {\n enable: true,\n inverse: false,\n acceleration: 5\n },\n speed: {\n min: 5,\n max: 15\n },\n direction: \"none\",\n outModes: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy\n }\n };\n }).filter((t)=>t !== undefined);\n return {\n detectRetina: true,\n background: {\n color: \"#000\"\n },\n fpsLimit: 120,\n emitters: {\n direction: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.MoveDirection.top,\n rate: {\n delay: 0.3,\n quantity: 1\n },\n size: {\n width: 100,\n height: 0\n },\n position: {\n y: 100,\n x: 50\n }\n },\n particles: {\n number: {\n value: 0\n },\n destroy: {\n mode: \"split\",\n bounds: {\n top: {\n min: 15,\n max: 35\n }\n },\n split: {\n sizeOffset: false,\n count: 1,\n factor: {\n value: 0.333333\n },\n rate: {\n value: {\n min: 75,\n max: 150\n }\n },\n particles: fireworksOptions\n }\n },\n life: {\n count: 1\n },\n shape: {\n type: \"circle\"\n },\n effect: {\n type: \"trail\",\n options: {\n trail: {\n length: {\n min: 5,\n max: 15\n },\n minWidth: 1,\n maxWidth: 1\n }\n }\n },\n size: {\n value: 1\n },\n paint: {\n stroke: {\n color: {\n value: \"#ffffff\"\n },\n width: 1\n },\n fill: {\n enable: false\n }\n },\n move: {\n enable: true,\n gravity: {\n acceleration: 15,\n enable: true,\n inverse: true,\n maxSpeed: 100\n },\n speed: {\n min: 10,\n max: 20\n },\n outModes: {\n default: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy,\n top: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.none\n }\n }\n },\n sounds: {\n enable: true,\n events: [\n {\n event: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.EventType.particleRemoved,\n filter: explodeSoundCheck,\n audio: [\n \"https://particles.js.org/audio/explosion0.mp3\",\n \"https://particles.js.org/audio/explosion1.mp3\",\n \"https://particles.js.org/audio/explosion2.mp3\"\n ]\n }\n ],\n volume: 50\n }\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/./dist/browser/options.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const presetName = "fireworks";
|
|
2
2
|
export async function loadFireworksPreset(engine) {
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
|
-
const [{ loadBasic }, {
|
|
4
|
+
const [{ loadBasic }, { loadEmittersPluginSimple }, { loadTrailEffect }, { loadEmittersShapeSquare }, { loadSoundsPlugin }, { loadLineShape }, { loadRotateUpdater }, { loadDestroyUpdater }, { loadLifeUpdater }, { initOptions },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/basic"),
|
|
6
|
-
import("@tsparticles/plugin-emitters"),
|
|
7
|
-
import("@tsparticles/plugin-interactivity"),
|
|
6
|
+
import("@tsparticles/plugin-emitters/plugin"),
|
|
8
7
|
import("@tsparticles/effect-trail"),
|
|
9
8
|
import("@tsparticles/plugin-emitters-shape-square"),
|
|
10
9
|
import("@tsparticles/plugin-sounds"),
|
|
@@ -12,24 +11,21 @@ export async function loadFireworksPreset(engine) {
|
|
|
12
11
|
import("@tsparticles/updater-rotate"),
|
|
13
12
|
import("@tsparticles/updater-destroy"),
|
|
14
13
|
import("@tsparticles/updater-life"),
|
|
15
|
-
import("@tsparticles/updater-stroke-color"),
|
|
16
14
|
import("./options.js"),
|
|
17
|
-
])
|
|
15
|
+
]), loadEmittersForFireworks = async (e) => {
|
|
16
|
+
await loadEmittersPluginSimple(e);
|
|
17
|
+
await loadEmittersShapeSquare(e);
|
|
18
|
+
};
|
|
18
19
|
await Promise.all([
|
|
19
20
|
loadBasic(e),
|
|
20
|
-
(
|
|
21
|
-
await loadInteractivityPlugin(e);
|
|
22
|
-
await loadEmittersPlugin(e);
|
|
23
|
-
})(),
|
|
21
|
+
loadEmittersForFireworks(e),
|
|
24
22
|
loadTrailEffect(e),
|
|
25
23
|
loadSoundsPlugin(e),
|
|
26
24
|
loadLineShape(e),
|
|
27
25
|
loadRotateUpdater(e),
|
|
28
26
|
loadDestroyUpdater(e),
|
|
29
27
|
loadLifeUpdater(e),
|
|
30
|
-
loadStrokeColorUpdater(e),
|
|
31
28
|
]);
|
|
32
|
-
await loadEmittersShapeSquare(e);
|
|
33
29
|
e.pluginManager.addPreset(presetName, initOptions(), false);
|
|
34
30
|
});
|
|
35
31
|
}
|
package/esm/options.js
CHANGED
|
@@ -44,41 +44,12 @@ export function initOptions() {
|
|
|
44
44
|
};
|
|
45
45
|
}, fireworksOptions = [
|
|
46
46
|
"#FF0000",
|
|
47
|
-
"#FF2A00",
|
|
48
|
-
"#FF5500",
|
|
49
47
|
"#FF8000",
|
|
50
|
-
"#FFAA00",
|
|
51
|
-
"#FFD400",
|
|
52
48
|
"#FFFF00",
|
|
53
|
-
"#D4FF00",
|
|
54
|
-
"#AAFF00",
|
|
55
|
-
"#80FF00",
|
|
56
|
-
"#55FF00",
|
|
57
|
-
"#2AFF00",
|
|
58
49
|
"#00FF00",
|
|
59
|
-
"#00FF2A",
|
|
60
|
-
"#00FF55",
|
|
61
|
-
"#00FF80",
|
|
62
|
-
"#00FFAA",
|
|
63
|
-
"#00FFD4",
|
|
64
50
|
"#00FFFF",
|
|
65
|
-
"#00D4FF",
|
|
66
|
-
"#00AAFF",
|
|
67
|
-
"#0080FF",
|
|
68
|
-
"#0055FF",
|
|
69
|
-
"#002AFF",
|
|
70
51
|
"#0000FF",
|
|
71
|
-
"#2A00FF",
|
|
72
|
-
"#5500FF",
|
|
73
|
-
"#8000FF",
|
|
74
|
-
"#AA00FF",
|
|
75
|
-
"#D400FF",
|
|
76
52
|
"#FF00FF",
|
|
77
|
-
"#FF00D4",
|
|
78
|
-
"#FF00AA",
|
|
79
|
-
"#FF0080",
|
|
80
|
-
"#FF0055",
|
|
81
|
-
"#FF002A",
|
|
82
53
|
]
|
|
83
54
|
.map(color => {
|
|
84
55
|
const rgb = hexToRgba(color);
|
|
@@ -93,18 +64,20 @@ export function initOptions() {
|
|
|
93
64
|
max: 100,
|
|
94
65
|
}, 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);
|
|
95
66
|
return {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
paint: {
|
|
68
|
+
fill: {
|
|
69
|
+
color: {
|
|
70
|
+
value: {
|
|
71
|
+
h: hsl.h,
|
|
72
|
+
s: sRange,
|
|
73
|
+
l: lRange,
|
|
74
|
+
},
|
|
102
75
|
},
|
|
76
|
+
enable: true,
|
|
77
|
+
},
|
|
78
|
+
stroke: {
|
|
79
|
+
width: 0,
|
|
103
80
|
},
|
|
104
|
-
enable: true,
|
|
105
|
-
},
|
|
106
|
-
stroke: {
|
|
107
|
-
width: 0,
|
|
108
81
|
},
|
|
109
82
|
number: {
|
|
110
83
|
value: 0,
|
|
@@ -235,14 +208,16 @@ export function initOptions() {
|
|
|
235
208
|
size: {
|
|
236
209
|
value: 1,
|
|
237
210
|
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
211
|
+
paint: {
|
|
212
|
+
stroke: {
|
|
213
|
+
color: {
|
|
214
|
+
value: "#ffffff",
|
|
215
|
+
},
|
|
216
|
+
width: 1,
|
|
217
|
+
},
|
|
218
|
+
fill: {
|
|
219
|
+
enable: false,
|
|
241
220
|
},
|
|
242
|
-
width: 1,
|
|
243
|
-
},
|
|
244
|
-
fill: {
|
|
245
|
-
enable: false,
|
|
246
221
|
},
|
|
247
222
|
move: {
|
|
248
223
|
enable: true,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_preset_fireworks"] = this["webpackChunk_tsparticles_preset_fireworks"] || []).push([["node_modules_pnpm_tsparticles_basic_4_0_0-beta_11_node_modules_tsparticles_basic_browser_index_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+basic@4.0.0-beta.11/node_modules/@tsparticles/basic/browser/index.js"
|
|
21
|
+
/*!******************************************************************************************************************!*\
|
|
22
|
+
!*** ../../node_modules/.pnpm/@tsparticles+basic@4.0.0-beta.11/node_modules/@tsparticles/basic/browser/index.js ***!
|
|
23
|
+
\******************************************************************************************************************/
|
|
24
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
|
+
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadBasic: () => (/* binding */ loadBasic)\n/* harmony export */ });\nasync function loadBasic(engine) {\n engine.checkVersion(\"4.0.0-beta.11\");\n await engine.pluginManager.register(async (e) => {\n const [{ loadHexColorPlugin }, { loadHslColorPlugin }, { loadRgbColorPlugin }, { loadMovePlugin }, { loadCircleShape }, { loadPaintUpdater }, { loadOpacityUpdater }, { loadOutModesUpdater }, { loadSizeUpdater },] = await Promise.all([\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-b0d0ee\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-hex-color */ \"../../node_modules/.pnpm/@tsparticles+plugin-hex-color@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/plugin-hex-color/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-a6d106\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-hsl-color */ \"../../node_modules/.pnpm/@tsparticles+plugin-hsl-color@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/plugin-hsl-color/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_1-f22022\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-rgb-color */ \"../../node_modules/.pnpm/@tsparticles+plugin-rgb-color@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/plugin-rgb-color/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_nod-e1bc4b\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-move */ \"../../node_modules/.pnpm/@tsparticles+plugin-move@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/plugin-move/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_shape-circle_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-b06fc7\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/shape-circle */ \"../../node_modules/.pnpm/@tsparticles+shape-circle@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/shape-circle/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_updater-paint_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_n-b1f330\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-paint */ \"../../node_modules/.pnpm/@tsparticles+updater-paint@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/updater-paint/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_updater-opacity_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11-da77ce\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-opacity */ \"../../node_modules/.pnpm/@tsparticles+updater-opacity@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/updater-opacity/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_-df7144\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-out-modes */ \"../../node_modules/.pnpm/@tsparticles+updater-out-modes@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/updater-out-modes/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_updater-size_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-d2508a\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-size */ \"../../node_modules/.pnpm/@tsparticles+updater-size@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/updater-size/browser/index.js\")),\n ]);\n await Promise.all([\n loadHexColorPlugin(e),\n loadHslColorPlugin(e),\n loadRgbColorPlugin(e),\n loadMovePlugin(e),\n loadCircleShape(e),\n loadPaintUpdater(e),\n loadOpacityUpdater(e),\n loadOutModesUpdater(e),\n loadSizeUpdater(e),\n ]);\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/../../node_modules/.pnpm/@tsparticles+basic@4.0.0-beta.11/node_modules/@tsparticles/basic/browser/index.js?\n}");
|
|
27
|
+
|
|
28
|
+
/***/ }
|
|
29
|
+
|
|
30
|
+
}]);
|
|
@@ -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
|
/*
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
* or disable the default devtool with "devtool: false".
|
|
16
16
|
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
17
|
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_preset_fireworks"] = this["webpackChunk_tsparticles_preset_fireworks"] || []).push([["node_modules_pnpm_tsparticles_effect-trail_4_0_0-
|
|
18
|
+
(this["webpackChunk_tsparticles_preset_fireworks"] = this["webpackChunk_tsparticles_preset_fireworks"] || []).push([["node_modules_pnpm_tsparticles_effect-trail_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-8a5947"],{
|
|
19
19
|
|
|
20
|
-
/***/ "../../node_modules/.pnpm/@tsparticles+effect-trail@4.0.0-beta.
|
|
21
|
-
|
|
22
|
-
!*** ../../node_modules/.pnpm/@tsparticles+effect-trail@4.0.0-beta.
|
|
23
|
-
|
|
20
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+effect-trail@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/effect-trail/browser/index.js"
|
|
21
|
+
/*!******************************************************************************************************************************************************************!*\
|
|
22
|
+
!*** ../../node_modules/.pnpm/@tsparticles+effect-trail@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/effect-trail/browser/index.js ***!
|
|
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 */ loadTrailEffect: () => (/* binding */ loadTrailEffect)\n/* harmony export */ });\nasync function loadTrailEffect(engine) {\n engine.checkVersion(\"4.0.0-beta.
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadTrailEffect: () => (/* binding */ loadTrailEffect)\n/* harmony export */ });\nasync function loadTrailEffect(engine) {\n engine.checkVersion(\"4.0.0-beta.11\");\n await engine.pluginManager.register(e => {\n e.pluginManager.addEffect(\"trail\", async (container) => {\n const { TrailDrawer } = await __webpack_require__.e(/*! import() */ \"node_modules_pnpm_tsparticles_effect-trail_4_0_0-beta_11__tsparticles_engine_4_0_0-beta_11_no-cb9e7e\").then(__webpack_require__.bind(__webpack_require__, /*! ./TrailDrawer.js */ \"../../node_modules/.pnpm/@tsparticles+effect-trail@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/effect-trail/browser/TrailDrawer.js\"));\n return new TrailDrawer(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/../../node_modules/.pnpm/@tsparticles+effect-trail@4.0.0-beta.11_@tsparticles+engine@4.0.0-beta.11/node_modules/@tsparticles/effect-trail/browser/index.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|