@tsparticles/confetti 4.0.0-alpha.8 → 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/102.min.js +1 -0
- package/1298.min.js +1 -0
- package/1368.min.js +1 -0
- package/1510.min.js +1 -0
- package/161.min.js +1 -0
- package/1624.min.js +1 -0
- package/1667.min.js +1 -0
- package/229.min.js +1 -0
- package/2317.min.js +1 -0
- package/2382.min.js +1 -0
- package/243.min.js +1 -0
- package/2616.min.js +1 -0
- package/2618.min.js +1 -0
- package/2738.min.js +1 -0
- package/2846.min.js +1 -0
- package/2926.min.js +1 -0
- package/3091.min.js +1 -0
- package/3194.min.js +1 -0
- package/3257.min.js +1 -0
- package/3296.min.js +1 -0
- package/3391.min.js +1 -0
- package/3413.min.js +1 -0
- package/3455.min.js +1 -0
- package/3464.min.js +1 -0
- package/3663.min.js +1 -0
- package/3853.min.js +1 -0
- package/4089.min.js +1 -0
- package/411.min.js +1 -0
- package/4149.min.js +1 -0
- package/4268.min.js +1 -0
- package/4292.min.js +1 -0
- package/4570.min.js +1 -0
- package/4588.min.js +1 -0
- package/465.min.js +1 -0
- package/514.min.js +1 -0
- package/5249.min.js +1 -0
- package/5478.min.js +1 -0
- package/5964.min.js +1 -0
- package/6098.min.js +1 -0
- package/6101.min.js +1 -0
- package/6179.min.js +1 -0
- package/6299.min.js +1 -0
- package/6465.min.js +1 -0
- package/6583.min.js +1 -0
- package/6638.min.js +1 -0
- package/6808.min.js +1 -0
- package/6900.min.js +1 -0
- package/6970.min.js +1 -0
- package/701.min.js +1 -0
- package/7116.min.js +1 -0
- package/7256.min.js +1 -2
- package/7258.min.js +1 -0
- package/7318.min.js +1 -0
- package/7449.min.js +1 -0
- package/7554.min.js +1 -0
- package/7646.min.js +1 -0
- package/7876.min.js +1 -0
- package/7922.min.js +1 -0
- package/8222.min.js +1 -0
- package/84.min.js +1 -0
- package/8815.min.js +1 -0
- package/9082.min.js +1 -0
- package/9202.min.js +1 -0
- package/9578.min.js +1 -0
- package/9611.min.js +1 -0
- package/9929.min.js +1 -0
- package/README.md +45 -6
- package/basic_dist_browser_index_js.js +2 -2
- package/browser/ConfettiOptions.js +18 -2
- package/browser/confetti.js +51 -31
- package/cjs/ConfettiOptions.js +18 -2
- package/cjs/confetti.js +51 -31
- package/engine_dist_browser_Core_Container_js.js +12 -12
- package/esm/ConfettiOptions.js +18 -2
- package/esm/confetti.js +51 -31
- package/package.json +17 -17
- package/plugins_colors_hex_dist_browser_HexColorManager_js.js +2 -2
- package/plugins_colors_hex_dist_browser_index_js.js +2 -2
- package/plugins_colors_hsl_dist_browser_HslColorManager_js.js +2 -2
- package/plugins_colors_hsl_dist_browser_index_js.js +2 -2
- package/plugins_colors_rgb_dist_browser_RgbColorManager_js.js +2 -2
- package/plugins_colors_rgb_dist_browser_index_js.js +2 -2
- package/plugins_emitters_dist_browser_EmitterInstance_js.js +2 -2
- package/plugins_emitters_dist_browser_EmittersInstancesManager_js.js +18 -8
- package/plugins_emitters_dist_browser_EmittersInteractor_js.js +58 -48
- package/plugins_emitters_dist_browser_EmittersPluginInstance_js.js +2 -2
- package/plugins_emitters_dist_browser_EmittersPlugin_js.js +18 -8
- package/plugins_emitters_dist_browser_ShapeManager_js.js +2 -2
- package/plugins_emitters_dist_browser_index_js.js +4 -4
- package/plugins_interactivity_dist_browser_InteractivityPluginInstance_js.js +4 -4
- package/plugins_interactivity_dist_browser_InteractivityPlugin_js.js +6 -6
- package/plugins_interactivity_dist_browser_index_js.js +40 -40
- package/plugins_motion_dist_browser_MotionPluginInstance_js.js +2 -2
- package/plugins_motion_dist_browser_MotionPlugin_js.js +4 -4
- package/plugins_motion_dist_browser_index_js.js +2 -2
- package/plugins_move_dist_browser_MovePluginInstance_js.js +40 -0
- package/plugins_move_dist_browser_MovePlugin_js.js +30 -0
- package/plugins_move_dist_browser_index_js.js +30 -0
- package/report.html +1 -1
- package/shapes_cards_dist_browser_cards_CardDrawer_js.js +3 -53
- package/shapes_cards_dist_browser_clubs_ClubDrawer_js.js +2 -52
- package/shapes_cards_dist_browser_diamonds_DiamondDrawer_js.js +2 -52
- package/shapes_cards_dist_browser_hearts_HeartDrawer_js.js +2 -52
- package/shapes_cards_dist_browser_index_js.js +7 -7
- package/shapes_cards_dist_browser_paths_js.js +70 -0
- package/shapes_cards_dist_browser_spades_SpadeDrawer_js.js +2 -52
- package/shapes_circle_dist_browser_CircleDrawer_js.js +3 -3
- package/shapes_circle_dist_browser_index_js.js +2 -2
- package/shapes_emoji_dist_browser_EmojiDrawer_js.js +17 -7
- package/shapes_emoji_dist_browser_index_js.js +12 -2
- package/shapes_heart_dist_browser_HeartDrawer_js.js +3 -3
- package/shapes_heart_dist_browser_index_js.js +2 -2
- package/shapes_image_dist_browser_GifUtils_Utils_js.js +6 -16
- package/shapes_image_dist_browser_ImageDrawer_js.js +2 -2
- package/{move_base_dist_browser_index_js.js → shapes_image_dist_browser_ImagePreloaderInstance_js.js} +7 -7
- package/shapes_image_dist_browser_ImagePreloader_js.js +3 -3
- package/shapes_image_dist_browser_index_js.js +12 -2
- package/shapes_polygon_dist_browser_PolygonDrawer_js.js +4 -4
- package/shapes_polygon_dist_browser_TriangleDrawer_js.js +4 -4
- package/shapes_polygon_dist_browser_index_js.js +2 -2
- package/shapes_square_dist_browser_SquareDrawer_js.js +3 -3
- package/shapes_square_dist_browser_index_js.js +2 -2
- package/shapes_star_dist_browser_StarDrawer_js.js +3 -3
- package/shapes_star_dist_browser_index_js.js +2 -2
- package/tsparticles.confetti.bundle.js +97 -95
- package/tsparticles.confetti.bundle.min.js +2 -2
- package/tsparticles.confetti.js +41 -41
- package/tsparticles.confetti.min.js +1 -2
- package/types/confetti.d.ts +1 -1
- package/umd/ConfettiOptions.js +18 -2
- package/umd/confetti.js +51 -31
- package/updaters_fillColor_dist_browser_FillColorUpdater_js.js +30 -0
- package/updaters_fillColor_dist_browser_index_js.js +30 -0
- package/updaters_life_dist_browser_LifeUpdater_js.js +6 -6
- package/updaters_life_dist_browser_index_js.js +2 -2
- package/updaters_opacity_dist_browser_OpacityUpdater_js.js +2 -2
- package/updaters_opacity_dist_browser_index_js.js +2 -2
- package/updaters_outModes_dist_browser_OutOfCanvasUpdater_js.js +7 -7
- package/updaters_outModes_dist_browser_index_js.js +2 -2
- package/updaters_roll_dist_browser_RollUpdater_js.js +6 -6
- package/updaters_roll_dist_browser_index_js.js +2 -2
- package/updaters_rotate_dist_browser_RotateUpdater_js.js +4 -4
- package/updaters_rotate_dist_browser_index_js.js +2 -2
- package/updaters_size_dist_browser_SizeUpdater_js.js +2 -2
- package/updaters_size_dist_browser_index_js.js +2 -2
- package/updaters_tilt_dist_browser_TiltUpdater_js.js +5 -5
- package/updaters_tilt_dist_browser_index_js.js +2 -2
- package/updaters_wobble_dist_browser_WobbleUpdater_js.js +5 -5
- package/updaters_wobble_dist_browser_index_js.js +2 -2
- package/1049.min.js +0 -2
- package/1049.min.js.LICENSE.txt +0 -1
- package/1085.min.js +0 -2
- package/1085.min.js.LICENSE.txt +0 -1
- package/1183.min.js +0 -2
- package/1183.min.js.LICENSE.txt +0 -1
- package/1446.min.js +0 -2
- package/1446.min.js.LICENSE.txt +0 -1
- package/1608.min.js +0 -2
- package/1608.min.js.LICENSE.txt +0 -1
- package/176.min.js +0 -2
- package/176.min.js.LICENSE.txt +0 -1
- package/1801.min.js +0 -2
- package/1801.min.js.LICENSE.txt +0 -1
- package/1887.min.js +0 -2
- package/1887.min.js.LICENSE.txt +0 -1
- package/2201.min.js +0 -2
- package/2201.min.js.LICENSE.txt +0 -1
- package/2615.min.js +0 -2
- package/2615.min.js.LICENSE.txt +0 -1
- package/2729.min.js +0 -2
- package/2729.min.js.LICENSE.txt +0 -1
- package/2842.min.js +0 -2
- package/2842.min.js.LICENSE.txt +0 -1
- package/2942.min.js +0 -2
- package/2942.min.js.LICENSE.txt +0 -1
- package/3003.min.js +0 -2
- package/3003.min.js.LICENSE.txt +0 -1
- package/3148.min.js +0 -2
- package/3148.min.js.LICENSE.txt +0 -1
- package/3209.min.js +0 -2
- package/3209.min.js.LICENSE.txt +0 -1
- package/3306.min.js +0 -2
- package/3306.min.js.LICENSE.txt +0 -1
- package/3380.min.js +0 -2
- package/3380.min.js.LICENSE.txt +0 -1
- package/3446.min.js +0 -2
- package/3446.min.js.LICENSE.txt +0 -1
- package/3451.min.js +0 -2
- package/3451.min.js.LICENSE.txt +0 -1
- package/346.min.js +0 -2
- package/346.min.js.LICENSE.txt +0 -1
- package/3629.min.js +0 -2
- package/3629.min.js.LICENSE.txt +0 -1
- package/3712.min.js +0 -2
- package/3712.min.js.LICENSE.txt +0 -1
- package/3743.min.js +0 -2
- package/3743.min.js.LICENSE.txt +0 -1
- package/3744.min.js +0 -2
- package/3744.min.js.LICENSE.txt +0 -1
- package/3759.min.js +0 -2
- package/3759.min.js.LICENSE.txt +0 -1
- package/3804.min.js +0 -2
- package/3804.min.js.LICENSE.txt +0 -1
- package/4340.min.js +0 -2
- package/4340.min.js.LICENSE.txt +0 -1
- package/4544.min.js +0 -2
- package/4544.min.js.LICENSE.txt +0 -1
- package/4698.min.js +0 -2
- package/4698.min.js.LICENSE.txt +0 -1
- package/5113.min.js +0 -2
- package/5113.min.js.LICENSE.txt +0 -1
- package/5166.min.js +0 -2
- package/5166.min.js.LICENSE.txt +0 -1
- package/521.min.js +0 -2
- package/521.min.js.LICENSE.txt +0 -1
- package/5221.min.js +0 -2
- package/5221.min.js.LICENSE.txt +0 -1
- package/5302.min.js +0 -2
- package/5302.min.js.LICENSE.txt +0 -1
- package/5505.min.js +0 -2
- package/5505.min.js.LICENSE.txt +0 -1
- package/5913.min.js +0 -2
- package/5913.min.js.LICENSE.txt +0 -1
- package/597.min.js +0 -2
- package/597.min.js.LICENSE.txt +0 -1
- package/620.min.js +0 -2
- package/620.min.js.LICENSE.txt +0 -1
- package/6249.min.js +0 -2
- package/6249.min.js.LICENSE.txt +0 -1
- package/6388.min.js +0 -2
- package/6388.min.js.LICENSE.txt +0 -1
- package/6441.min.js +0 -2
- package/6441.min.js.LICENSE.txt +0 -1
- package/6580.min.js +0 -2
- package/6580.min.js.LICENSE.txt +0 -1
- package/6608.min.js +0 -2
- package/6608.min.js.LICENSE.txt +0 -1
- package/671.min.js +0 -2
- package/671.min.js.LICENSE.txt +0 -1
- package/6824.min.js +0 -2
- package/6824.min.js.LICENSE.txt +0 -1
- package/7012.min.js +0 -2
- package/7012.min.js.LICENSE.txt +0 -1
- package/7056.min.js +0 -2
- package/7056.min.js.LICENSE.txt +0 -1
- package/7160.min.js +0 -2
- package/7160.min.js.LICENSE.txt +0 -1
- package/718.min.js +0 -2
- package/718.min.js.LICENSE.txt +0 -1
- package/7188.min.js +0 -2
- package/7188.min.js.LICENSE.txt +0 -1
- package/7191.min.js +0 -2
- package/7191.min.js.LICENSE.txt +0 -1
- package/7256.min.js.LICENSE.txt +0 -1
- package/7259.min.js +0 -2
- package/7259.min.js.LICENSE.txt +0 -1
- package/761.min.js +0 -2
- package/761.min.js.LICENSE.txt +0 -1
- package/7704.min.js +0 -2
- package/7704.min.js.LICENSE.txt +0 -1
- package/7749.min.js +0 -2
- package/7749.min.js.LICENSE.txt +0 -1
- package/8026.min.js +0 -2
- package/8026.min.js.LICENSE.txt +0 -1
- package/8296.min.js +0 -2
- package/8296.min.js.LICENSE.txt +0 -1
- package/8445.min.js +0 -2
- package/8445.min.js.LICENSE.txt +0 -1
- package/8526.min.js +0 -2
- package/8526.min.js.LICENSE.txt +0 -1
- package/8847.min.js +0 -2
- package/8847.min.js.LICENSE.txt +0 -1
- package/8993.min.js +0 -2
- package/8993.min.js.LICENSE.txt +0 -1
- package/9127.min.js +0 -2
- package/9127.min.js.LICENSE.txt +0 -1
- package/9216.min.js +0 -2
- package/9216.min.js.LICENSE.txt +0 -1
- package/9234.min.js +0 -2
- package/9234.min.js.LICENSE.txt +0 -1
- package/9273.min.js +0 -2
- package/9273.min.js.LICENSE.txt +0 -1
- package/9410.min.js +0 -2
- package/9410.min.js.LICENSE.txt +0 -1
- package/9467.min.js +0 -2
- package/9467.min.js.LICENSE.txt +0 -1
- package/9591.min.js +0 -2
- package/9591.min.js.LICENSE.txt +0 -1
- package/move_base_dist_browser_BaseMover_js.js +0 -40
- package/shapes_image_dist_browser_Utils_js.js +0 -30
- package/tsparticles.confetti.bundle.min.js.LICENSE.txt +0 -1
- package/tsparticles.confetti.min.js.LICENSE.txt +0 -1
- package/updaters_color_dist_browser_ColorUpdater_js.js +0 -30
- package/updaters_color_dist_browser_index_js.js +0 -30
package/9611.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9611],{9611(e,t,a){a.d(t,{WobbleUpdater:()=>o});var n=a(1989);class s{angle;move;constructor(){this.angle=50,this.move=10}load(e){(0,n.kZJ)(e)||(void 0!==e.angle&&(this.angle=(0,n.DT4)(e.angle)),void 0!==e.move&&(this.move=(0,n.DT4)(e.move)))}}class i{distance;enable;speed;constructor(){this.distance=5,this.enable=!1,this.speed=new s}load(e){if(!(0,n.kZJ)(e)&&(void 0!==e.distance&&(this.distance=(0,n.DT4)(e.distance)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.speed))if((0,n.EtT)(e.speed))this.speed.load({angle:e.speed});else{let t=e.speed;"min"in t?this.speed.load({angle:t}):this.speed.load(e.speed)}}}class o{container;constructor(e){this.container=e}init(e){let t=e.options.wobble;t?.enable?e.wobble={angle:(0,n.G0i)()*n.R1e,angleSpeed:(0,n.VGA)(t.speed.angle)/360,moveSpeed:(0,n.VGA)(t.speed.move)/10}:e.wobble={angle:0,angleSpeed:0,moveSpeed:0},e.retina.wobbleDistance=(0,n.VGA)(t?.distance??0)*this.container.retina.pixelRatio}isEnabled(e){return!e.destroyed&&!e.spawning&&!!e.options.wobble?.enable}loadOptions(e,...t){for(let a of(e.wobble??=new i,t))e.wobble.load(a?.wobble)}update(e,t){this.isEnabled(e)&&function(e,t){let{wobble:a}=e.options,{container:s,wobble:i}=e;if(!a?.enable||!i)return;let o=s.retina.reduceFactor,l=i.angleSpeed*t.factor*o,d=i.moveSpeed*t.factor*o*(e.retina.wobbleDistance??0)/(n.XuV/60),b=n.R1e,{position:c}=e;i.angle+=l,i.angle>b&&(i.angle-=b),c.x+=d*Math.cos(i.angle),c.y+=d*Math.abs(Math.sin(i.angle))}(e,t)}}}}]);
|
package/9929.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9929],{9929(e,t,a){a.d(t,{MotionPluginInstance:()=>r});var n=a(1989);class r{_container;constructor(e){this._container=e}async init(){let e=this._container,t=e.actualOptions.motion;if(!(t&&(t.disable||t.reduce.value))){e.retina.reduceFactor=1;return}let a=(0,n.lVH)("(prefers-reduced-motion: reduce)");if(!a){e.retina.reduceFactor=1;return}this._handleMotionChange(a);let r=()=>{(async()=>{this._handleMotionChange(a);try{await e.refresh()}catch{}})()};a.addEventListener("change",r),await Promise.resolve()}_handleMotionChange=e=>{let t=this._container,a=t.actualOptions.motion;a&&(e.matches?a.disable?t.retina.reduceFactor=0:t.retina.reduceFactor=a.reduce.value?1/a.reduce.factor:1:t.retina.reduceFactor=1)}}}}]);
|
package/README.md
CHANGED
|
@@ -9,28 +9,67 @@ beautiful confetti effects with ease.
|
|
|
9
9
|
|
|
10
10
|
**Included Packages**
|
|
11
11
|
|
|
12
|
+
- [@tsparticles/basic (and all its dependencies)](https://github.com/tsparticles/tsparticles/tree/main/bundles/basic)
|
|
12
13
|
- [@tsparticles/engine](https://github.com/tsparticles/tsparticles/tree/main/engine)
|
|
13
|
-
- [@tsparticles/move-base](https://github.com/tsparticles/tsparticles/tree/main/move/base)
|
|
14
14
|
- [@tsparticles/plugin-emitters](https://github.com/tsparticles/tsparticles/tree/main/plugins/emitters)
|
|
15
15
|
- [@tsparticles/plugin-motion](https://github.com/tsparticles/tsparticles/tree/main/plugins/motion)
|
|
16
16
|
- [@tsparticles/shape-cards](https://github.com/tsparticles/tsparticles/tree/main/shapes/cards)
|
|
17
|
-
- [@tsparticles/shape-circle](https://github.com/tsparticles/tsparticles/tree/main/shapes/circle)
|
|
18
17
|
- [@tsparticles/shape-emoji](https://github.com/tsparticles/tsparticles/tree/main/shapes/emoji)
|
|
19
18
|
- [@tsparticles/shape-heart](https://github.com/tsparticles/tsparticles/tree/main/shapes/heart)
|
|
20
19
|
- [@tsparticles/shape-image](https://github.com/tsparticles/tsparticles/tree/main/shapes/image)
|
|
21
20
|
- [@tsparticles/shape-polygon](https://github.com/tsparticles/tsparticles/tree/main/shapes/polygon)
|
|
22
21
|
- [@tsparticles/shape-square](https://github.com/tsparticles/tsparticles/tree/main/shapes/square)
|
|
23
22
|
- [@tsparticles/shape-star](https://github.com/tsparticles/tsparticles/tree/main/shapes/star)
|
|
24
|
-
- [@tsparticles/updater-color](https://github.com/tsparticles/tsparticles/tree/main/updaters/color)
|
|
25
23
|
- [@tsparticles/updater-life](https://github.com/tsparticles/tsparticles/tree/main/updaters/life)
|
|
26
|
-
- [@tsparticles/updater-opacity](https://github.com/tsparticles/tsparticles/tree/main/updaters/opacity)
|
|
27
|
-
- [@tsparticles/updater-out-modes](https://github.com/tsparticles/tsparticles/tree/main/updaters/outModes)
|
|
28
24
|
- [@tsparticles/updater-roll](https://github.com/tsparticles/tsparticles/tree/main/updaters/roll)
|
|
29
25
|
- [@tsparticles/updater-rotate](https://github.com/tsparticles/tsparticles/tree/main/updaters/rotate)
|
|
30
|
-
- [@tsparticles/updater-size](https://github.com/tsparticles/tsparticles/tree/main/updaters/size)
|
|
31
26
|
- [@tsparticles/updater-tilt](https://github.com/tsparticles/tsparticles/tree/main/updaters/tilt)
|
|
32
27
|
- [@tsparticles/updater-wobble](https://github.com/tsparticles/tsparticles/tree/main/updaters/wobble)
|
|
33
28
|
|
|
29
|
+
## Dependency Graph
|
|
30
|
+
|
|
31
|
+
```mermaid
|
|
32
|
+
flowchart TD
|
|
33
|
+
|
|
34
|
+
subgraph b [Bundle]
|
|
35
|
+
bc[tsparticles/confetti]
|
|
36
|
+
bb[tsparticles/basic]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
subgraph c [Core]
|
|
40
|
+
ce[tsparticles/engine]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
subgraph p [Plugins]
|
|
44
|
+
pe[tsparticles/plugin-emitters]
|
|
45
|
+
pm[tsparticles/plugin-motion]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
subgraph s [Shapes]
|
|
49
|
+
sca[tsparticles/shape-cards]
|
|
50
|
+
se[tsparticles/shape-emoji]
|
|
51
|
+
sh[tsparticles/shape-heart]
|
|
52
|
+
si[tsparticles/shape-image]
|
|
53
|
+
sp[tsparticles/shape-polygon]
|
|
54
|
+
ss[tsparticles/shape-square]
|
|
55
|
+
sst[tsparticles/shape-star]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
subgraph u [Updaters]
|
|
59
|
+
ul[tsparticles/updater-life]
|
|
60
|
+
ur[tsparticles/updater-roll]
|
|
61
|
+
uro[tsparticles/updater-rotate]
|
|
62
|
+
ut[tsparticles/updater-tilt]
|
|
63
|
+
uw[tsparticles/updater-wobble]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
bc --> bb
|
|
67
|
+
bc --> ce
|
|
68
|
+
bc --> p
|
|
69
|
+
bc --> s
|
|
70
|
+
bc --> u
|
|
71
|
+
```
|
|
72
|
+
|
|
34
73
|
## How to use it
|
|
35
74
|
|
|
36
75
|
### CDN / Vanilla JS / jQuery
|
|
@@ -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 */ loadBasic: () => (/* binding */ loadBasic)\n/* harmony export */ });\nasync function loadBasic(engine) {\n
|
|
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.0\");\n await engine.register(async (e)=>{\n const [{ loadHexColorPlugin }, { loadHslColorPlugin }, { loadRgbColorPlugin }, { loadMovePlugin }, { loadCircleShape }, { loadFillColorUpdater }, { loadOpacityUpdater }, { loadOutModesUpdater }, { loadSizeUpdater }] = await Promise.all([\n __webpack_require__.e(/*! import() */ \"plugins_colors_hex_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-hex-color */ \"../../plugins/colors/hex/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"plugins_colors_hsl_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-hsl-color */ \"../../plugins/colors/hsl/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"plugins_colors_rgb_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-rgb-color */ \"../../plugins/colors/rgb/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"plugins_move_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/plugin-move */ \"../../plugins/move/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"shapes_circle_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/shape-circle */ \"../../shapes/circle/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"updaters_fillColor_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-fill-color */ \"../../updaters/fillColor/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"updaters_opacity_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-opacity */ \"../../updaters/opacity/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"updaters_outModes_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-out-modes */ \"../../updaters/outModes/dist/browser/index.js\")),\n __webpack_require__.e(/*! import() */ \"updaters_size_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-size */ \"../../updaters/size/dist/browser/index.js\"))\n ]);\n await Promise.all([\n loadHexColorPlugin(e),\n loadHslColorPlugin(e),\n loadRgbColorPlugin(e),\n loadMovePlugin(e),\n loadCircleShape(e),\n loadFillColorUpdater(e),\n loadOpacityUpdater(e),\n loadOutModesUpdater(e),\n loadSizeUpdater(e)\n ]);\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/confetti/../basic/dist/browser/index.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { deepExtend, isArray, isNull, percentDenominator, } from "@tsparticles/engine";
|
|
2
2
|
export class ConfettiOptions {
|
|
3
|
+
angle;
|
|
4
|
+
colors;
|
|
5
|
+
count;
|
|
6
|
+
decay;
|
|
7
|
+
disableForReducedMotion;
|
|
8
|
+
drift;
|
|
9
|
+
flat;
|
|
10
|
+
gravity;
|
|
11
|
+
position;
|
|
12
|
+
scalar;
|
|
13
|
+
shapeOptions;
|
|
14
|
+
shapes;
|
|
15
|
+
spread;
|
|
16
|
+
startVelocity;
|
|
17
|
+
ticks;
|
|
18
|
+
zIndex;
|
|
3
19
|
constructor() {
|
|
4
20
|
this.angle = 90;
|
|
5
21
|
this.count = 50;
|
|
@@ -72,8 +88,8 @@ export class ConfettiOptions {
|
|
|
72
88
|
const origin = data.origin;
|
|
73
89
|
if (origin && !data.position) {
|
|
74
90
|
data.position = {
|
|
75
|
-
x: origin.x
|
|
76
|
-
y: origin.y
|
|
91
|
+
x: origin.x === undefined ? undefined : origin.x * percentDenominator,
|
|
92
|
+
y: origin.y === undefined ? undefined : origin.y * percentDenominator,
|
|
77
93
|
};
|
|
78
94
|
}
|
|
79
95
|
const position = data.position;
|
package/browser/confetti.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { isString, millisecondsToSeconds, tsParticles, } from "@tsparticles/engine";
|
|
2
2
|
import { ConfettiOptions } from "./ConfettiOptions.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let initializing = false;
|
|
6
|
-
const ids = new Map();
|
|
3
|
+
let initialized = false, initializing = false;
|
|
4
|
+
const ids = new Map(), defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
|
|
7
5
|
async function initPlugins(engine) {
|
|
8
6
|
if (initialized) {
|
|
9
7
|
return;
|
|
@@ -20,24 +18,42 @@ async function initPlugins(engine) {
|
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
20
|
initializing = true;
|
|
23
|
-
engine.checkVersion("4.0.0-
|
|
21
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
24
22
|
await engine.register(async (e) => {
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
const [{ loadBasic }, { loadEmittersPlugin }, { loadMotionPlugin }, { loadCardSuitsShape }, { loadHeartShape }, { loadImageShape }, { loadPolygonShape }, { loadSquareShape }, { loadStarShape }, { loadEmojiShape }, { loadRotateUpdater }, { loadLifeUpdater }, { loadRollUpdater }, { loadTiltUpdater }, { loadWobbleUpdater },] = await Promise.all([
|
|
24
|
+
import("@tsparticles/basic"),
|
|
25
|
+
import("@tsparticles/plugin-emitters"),
|
|
26
|
+
import("@tsparticles/plugin-motion"),
|
|
27
|
+
import("@tsparticles/shape-cards"),
|
|
28
|
+
import("@tsparticles/shape-heart"),
|
|
29
|
+
import("@tsparticles/shape-image"),
|
|
30
|
+
import("@tsparticles/shape-polygon"),
|
|
31
|
+
import("@tsparticles/shape-square"),
|
|
32
|
+
import("@tsparticles/shape-star"),
|
|
33
|
+
import("@tsparticles/shape-emoji"),
|
|
34
|
+
import("@tsparticles/updater-rotate"),
|
|
35
|
+
import("@tsparticles/updater-life"),
|
|
36
|
+
import("@tsparticles/updater-roll"),
|
|
37
|
+
import("@tsparticles/updater-tilt"),
|
|
38
|
+
import("@tsparticles/updater-wobble"),
|
|
39
|
+
]);
|
|
40
|
+
await Promise.all([
|
|
41
|
+
loadBasic(e),
|
|
42
|
+
loadMotionPlugin(e),
|
|
43
|
+
loadEmittersPlugin(e),
|
|
44
|
+
loadCardSuitsShape(e),
|
|
45
|
+
loadHeartShape(e),
|
|
46
|
+
loadImageShape(e),
|
|
47
|
+
loadPolygonShape(e),
|
|
48
|
+
loadSquareShape(e),
|
|
49
|
+
loadStarShape(e),
|
|
50
|
+
loadEmojiShape(e),
|
|
51
|
+
loadRotateUpdater(e),
|
|
52
|
+
loadLifeUpdater(e),
|
|
53
|
+
loadRollUpdater(e),
|
|
54
|
+
loadTiltUpdater(e),
|
|
55
|
+
loadWobbleUpdater(e),
|
|
56
|
+
]);
|
|
41
57
|
});
|
|
42
58
|
initializing = false;
|
|
43
59
|
initialized = true;
|
|
@@ -51,7 +67,7 @@ async function setConfetti(params) {
|
|
|
51
67
|
container = ids.get(params.id);
|
|
52
68
|
if (container && !container.destroyed) {
|
|
53
69
|
const alias = container;
|
|
54
|
-
if (
|
|
70
|
+
if ("addEmitter" in alias) {
|
|
55
71
|
await alias.addEmitter?.({
|
|
56
72
|
startCount: actualOptions.count,
|
|
57
73
|
position: actualOptions.position,
|
|
@@ -68,8 +84,11 @@ async function setConfetti(params) {
|
|
|
68
84
|
count: 1,
|
|
69
85
|
},
|
|
70
86
|
particles: {
|
|
71
|
-
|
|
72
|
-
|
|
87
|
+
fill: {
|
|
88
|
+
color: {
|
|
89
|
+
value: actualOptions.colors,
|
|
90
|
+
},
|
|
91
|
+
enable: true,
|
|
73
92
|
},
|
|
74
93
|
shape: {
|
|
75
94
|
type: actualOptions.shapes,
|
|
@@ -169,8 +188,11 @@ async function setConfetti(params) {
|
|
|
169
188
|
number: {
|
|
170
189
|
value: 0,
|
|
171
190
|
},
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
fill: {
|
|
192
|
+
color: {
|
|
193
|
+
value: actualOptions.colors,
|
|
194
|
+
},
|
|
195
|
+
enable: true,
|
|
174
196
|
},
|
|
175
197
|
shape: {
|
|
176
198
|
type: actualOptions.shapes,
|
|
@@ -293,8 +315,7 @@ async function setConfetti(params) {
|
|
|
293
315
|
}
|
|
294
316
|
export async function confetti(idOrOptions, confettiOptions) {
|
|
295
317
|
await initPlugins(tsParticles);
|
|
296
|
-
let options;
|
|
297
|
-
let id;
|
|
318
|
+
let options, id;
|
|
298
319
|
if (isString(idOrOptions)) {
|
|
299
320
|
id = idOrOptions;
|
|
300
321
|
options = confettiOptions ?? {};
|
|
@@ -313,8 +334,7 @@ confetti.create = async (canvas, options) => {
|
|
|
313
334
|
const id = canvas.getAttribute("id") ?? "confetti";
|
|
314
335
|
canvas.setAttribute("id", id);
|
|
315
336
|
return async (idOrOptions, confettiOptions) => {
|
|
316
|
-
let subOptions;
|
|
317
|
-
let subId;
|
|
337
|
+
let subOptions, subId;
|
|
318
338
|
if (isString(idOrOptions)) {
|
|
319
339
|
subId = idOrOptions;
|
|
320
340
|
subOptions = confettiOptions ?? options;
|
|
@@ -333,5 +353,5 @@ confetti.create = async (canvas, options) => {
|
|
|
333
353
|
confetti.init = async () => {
|
|
334
354
|
await initPlugins(tsParticles);
|
|
335
355
|
};
|
|
336
|
-
confetti.version = "4.0.0-
|
|
356
|
+
confetti.version = "4.0.0-beta.0";
|
|
337
357
|
globalThis.confetti = confetti;
|
package/cjs/ConfettiOptions.js
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { deepExtend, isArray, isNull, percentDenominator, } from "@tsparticles/engine";
|
|
2
2
|
export class ConfettiOptions {
|
|
3
|
+
angle;
|
|
4
|
+
colors;
|
|
5
|
+
count;
|
|
6
|
+
decay;
|
|
7
|
+
disableForReducedMotion;
|
|
8
|
+
drift;
|
|
9
|
+
flat;
|
|
10
|
+
gravity;
|
|
11
|
+
position;
|
|
12
|
+
scalar;
|
|
13
|
+
shapeOptions;
|
|
14
|
+
shapes;
|
|
15
|
+
spread;
|
|
16
|
+
startVelocity;
|
|
17
|
+
ticks;
|
|
18
|
+
zIndex;
|
|
3
19
|
constructor() {
|
|
4
20
|
this.angle = 90;
|
|
5
21
|
this.count = 50;
|
|
@@ -72,8 +88,8 @@ export class ConfettiOptions {
|
|
|
72
88
|
const origin = data.origin;
|
|
73
89
|
if (origin && !data.position) {
|
|
74
90
|
data.position = {
|
|
75
|
-
x: origin.x
|
|
76
|
-
y: origin.y
|
|
91
|
+
x: origin.x === undefined ? undefined : origin.x * percentDenominator,
|
|
92
|
+
y: origin.y === undefined ? undefined : origin.y * percentDenominator,
|
|
77
93
|
};
|
|
78
94
|
}
|
|
79
95
|
const position = data.position;
|
package/cjs/confetti.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { isString, millisecondsToSeconds, tsParticles, } from "@tsparticles/engine";
|
|
2
2
|
import { ConfettiOptions } from "./ConfettiOptions.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let initializing = false;
|
|
6
|
-
const ids = new Map();
|
|
3
|
+
let initialized = false, initializing = false;
|
|
4
|
+
const ids = new Map(), defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
|
|
7
5
|
async function initPlugins(engine) {
|
|
8
6
|
if (initialized) {
|
|
9
7
|
return;
|
|
@@ -20,24 +18,42 @@ async function initPlugins(engine) {
|
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
20
|
initializing = true;
|
|
23
|
-
engine.checkVersion("4.0.0-
|
|
21
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
24
22
|
await engine.register(async (e) => {
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
const [{ loadBasic }, { loadEmittersPlugin }, { loadMotionPlugin }, { loadCardSuitsShape }, { loadHeartShape }, { loadImageShape }, { loadPolygonShape }, { loadSquareShape }, { loadStarShape }, { loadEmojiShape }, { loadRotateUpdater }, { loadLifeUpdater }, { loadRollUpdater }, { loadTiltUpdater }, { loadWobbleUpdater },] = await Promise.all([
|
|
24
|
+
import("@tsparticles/basic"),
|
|
25
|
+
import("@tsparticles/plugin-emitters"),
|
|
26
|
+
import("@tsparticles/plugin-motion"),
|
|
27
|
+
import("@tsparticles/shape-cards"),
|
|
28
|
+
import("@tsparticles/shape-heart"),
|
|
29
|
+
import("@tsparticles/shape-image"),
|
|
30
|
+
import("@tsparticles/shape-polygon"),
|
|
31
|
+
import("@tsparticles/shape-square"),
|
|
32
|
+
import("@tsparticles/shape-star"),
|
|
33
|
+
import("@tsparticles/shape-emoji"),
|
|
34
|
+
import("@tsparticles/updater-rotate"),
|
|
35
|
+
import("@tsparticles/updater-life"),
|
|
36
|
+
import("@tsparticles/updater-roll"),
|
|
37
|
+
import("@tsparticles/updater-tilt"),
|
|
38
|
+
import("@tsparticles/updater-wobble"),
|
|
39
|
+
]);
|
|
40
|
+
await Promise.all([
|
|
41
|
+
loadBasic(e),
|
|
42
|
+
loadMotionPlugin(e),
|
|
43
|
+
loadEmittersPlugin(e),
|
|
44
|
+
loadCardSuitsShape(e),
|
|
45
|
+
loadHeartShape(e),
|
|
46
|
+
loadImageShape(e),
|
|
47
|
+
loadPolygonShape(e),
|
|
48
|
+
loadSquareShape(e),
|
|
49
|
+
loadStarShape(e),
|
|
50
|
+
loadEmojiShape(e),
|
|
51
|
+
loadRotateUpdater(e),
|
|
52
|
+
loadLifeUpdater(e),
|
|
53
|
+
loadRollUpdater(e),
|
|
54
|
+
loadTiltUpdater(e),
|
|
55
|
+
loadWobbleUpdater(e),
|
|
56
|
+
]);
|
|
41
57
|
});
|
|
42
58
|
initializing = false;
|
|
43
59
|
initialized = true;
|
|
@@ -51,7 +67,7 @@ async function setConfetti(params) {
|
|
|
51
67
|
container = ids.get(params.id);
|
|
52
68
|
if (container && !container.destroyed) {
|
|
53
69
|
const alias = container;
|
|
54
|
-
if (
|
|
70
|
+
if ("addEmitter" in alias) {
|
|
55
71
|
await alias.addEmitter?.({
|
|
56
72
|
startCount: actualOptions.count,
|
|
57
73
|
position: actualOptions.position,
|
|
@@ -68,8 +84,11 @@ async function setConfetti(params) {
|
|
|
68
84
|
count: 1,
|
|
69
85
|
},
|
|
70
86
|
particles: {
|
|
71
|
-
|
|
72
|
-
|
|
87
|
+
fill: {
|
|
88
|
+
color: {
|
|
89
|
+
value: actualOptions.colors,
|
|
90
|
+
},
|
|
91
|
+
enable: true,
|
|
73
92
|
},
|
|
74
93
|
shape: {
|
|
75
94
|
type: actualOptions.shapes,
|
|
@@ -169,8 +188,11 @@ async function setConfetti(params) {
|
|
|
169
188
|
number: {
|
|
170
189
|
value: 0,
|
|
171
190
|
},
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
fill: {
|
|
192
|
+
color: {
|
|
193
|
+
value: actualOptions.colors,
|
|
194
|
+
},
|
|
195
|
+
enable: true,
|
|
174
196
|
},
|
|
175
197
|
shape: {
|
|
176
198
|
type: actualOptions.shapes,
|
|
@@ -293,8 +315,7 @@ async function setConfetti(params) {
|
|
|
293
315
|
}
|
|
294
316
|
export async function confetti(idOrOptions, confettiOptions) {
|
|
295
317
|
await initPlugins(tsParticles);
|
|
296
|
-
let options;
|
|
297
|
-
let id;
|
|
318
|
+
let options, id;
|
|
298
319
|
if (isString(idOrOptions)) {
|
|
299
320
|
id = idOrOptions;
|
|
300
321
|
options = confettiOptions ?? {};
|
|
@@ -313,8 +334,7 @@ confetti.create = async (canvas, options) => {
|
|
|
313
334
|
const id = canvas.getAttribute("id") ?? "confetti";
|
|
314
335
|
canvas.setAttribute("id", id);
|
|
315
336
|
return async (idOrOptions, confettiOptions) => {
|
|
316
|
-
let subOptions;
|
|
317
|
-
let subId;
|
|
337
|
+
let subOptions, subId;
|
|
318
338
|
if (isString(idOrOptions)) {
|
|
319
339
|
subId = idOrOptions;
|
|
320
340
|
subOptions = confettiOptions ?? options;
|
|
@@ -333,5 +353,5 @@ confetti.create = async (canvas, options) => {
|
|
|
333
353
|
confetti.init = async () => {
|
|
334
354
|
await initPlugins(tsParticles);
|
|
335
355
|
};
|
|
336
|
-
confetti.version = "4.0.0-
|
|
356
|
+
confetti.version = "4.0.0-beta.0";
|
|
337
357
|
globalThis.confetti = confetti;
|