@tsparticles/engine 4.0.0-beta.0 → 4.0.0-beta.10

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.
Files changed (242) hide show
  1. package/67.min.js +1 -0
  2. package/README.md +53 -965
  3. package/browser/Core/CanvasManager.js +303 -0
  4. package/browser/Core/Container.js +61 -34
  5. package/browser/Core/Engine.js +26 -138
  6. package/browser/Core/Particle.js +29 -28
  7. package/{cjs/Core/Particles.js → browser/Core/ParticlesManager.js} +27 -57
  8. package/browser/Core/RenderManager.js +303 -0
  9. package/browser/Core/Retina.js +3 -8
  10. package/browser/Core/Utils/PluginManager.js +145 -0
  11. package/browser/Options/Classes/Options.js +8 -21
  12. package/browser/Options/Classes/Particles/Paint.js +20 -0
  13. package/browser/Options/Classes/Particles/ParticlesOptions.js +65 -27
  14. package/browser/Options/Interfaces/Particles/IPaint.js +1 -0
  15. package/browser/Types/CanvasContextType.js +1 -0
  16. package/browser/Utils/CanvasUtils.js +4 -4
  17. package/browser/Utils/ColorUtils.js +21 -21
  18. package/browser/Utils/LogUtils.js +1 -0
  19. package/browser/Utils/OptionsUtils.js +2 -2
  20. package/browser/Utils/Utils.js +16 -10
  21. package/browser/exports.js +1 -0
  22. package/cjs/Core/CanvasManager.js +303 -0
  23. package/cjs/Core/Container.js +61 -34
  24. package/cjs/Core/Engine.js +26 -138
  25. package/cjs/Core/Particle.js +29 -28
  26. package/{esm/Core/Particles.js → cjs/Core/ParticlesManager.js} +27 -57
  27. package/cjs/Core/RenderManager.js +303 -0
  28. package/cjs/Core/Retina.js +3 -8
  29. package/cjs/Core/Utils/PluginManager.js +145 -0
  30. package/cjs/Options/Classes/Options.js +8 -21
  31. package/cjs/Options/Classes/Particles/Paint.js +20 -0
  32. package/cjs/Options/Classes/Particles/ParticlesOptions.js +65 -27
  33. package/cjs/Options/Interfaces/Particles/IPaint.js +1 -0
  34. package/cjs/Types/CanvasContextType.js +1 -0
  35. package/cjs/Utils/CanvasUtils.js +4 -4
  36. package/cjs/Utils/ColorUtils.js +21 -21
  37. package/cjs/Utils/LogUtils.js +1 -0
  38. package/cjs/Utils/OptionsUtils.js +2 -2
  39. package/cjs/Utils/Utils.js +16 -10
  40. package/cjs/exports.js +1 -0
  41. package/dist_browser_Core_Container_js.js +24 -14
  42. package/esm/Core/CanvasManager.js +303 -0
  43. package/esm/Core/Container.js +61 -34
  44. package/esm/Core/Engine.js +26 -138
  45. package/esm/Core/Particle.js +29 -28
  46. package/{browser/Core/Particles.js → esm/Core/ParticlesManager.js} +27 -57
  47. package/esm/Core/RenderManager.js +303 -0
  48. package/esm/Core/Retina.js +3 -8
  49. package/esm/Core/Utils/PluginManager.js +145 -0
  50. package/esm/Options/Classes/Options.js +8 -21
  51. package/esm/Options/Classes/Particles/Paint.js +20 -0
  52. package/esm/Options/Classes/Particles/ParticlesOptions.js +65 -27
  53. package/esm/Options/Interfaces/Particles/IPaint.js +1 -0
  54. package/esm/Types/CanvasContextType.js +1 -0
  55. package/esm/Utils/CanvasUtils.js +4 -4
  56. package/esm/Utils/ColorUtils.js +21 -21
  57. package/esm/Utils/LogUtils.js +1 -0
  58. package/esm/Utils/OptionsUtils.js +2 -2
  59. package/esm/Utils/Utils.js +16 -10
  60. package/esm/exports.js +1 -0
  61. package/package.json +2 -3
  62. package/report.html +84 -29
  63. package/tsparticles.engine.js +31 -11
  64. package/tsparticles.engine.min.js +2 -2
  65. package/types/Core/CanvasManager.d.ts +39 -0
  66. package/types/Core/Container.d.ts +26 -7
  67. package/types/Core/Engine.d.ts +2 -54
  68. package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -7
  69. package/types/Core/Interfaces/IDrawParticleParams.d.ts +2 -1
  70. package/types/Core/Interfaces/IPalette.d.ts +15 -2
  71. package/types/Core/Interfaces/IParticleRetinaProps.d.ts +4 -4
  72. package/types/Core/Interfaces/IParticleUpdater.d.ts +2 -1
  73. package/types/Core/Interfaces/IShapeDrawData.d.ts +2 -1
  74. package/types/Core/Particle.d.ts +4 -4
  75. package/types/Core/{Particles.d.ts → ParticlesManager.d.ts} +4 -11
  76. package/types/Core/{Canvas.d.ts → RenderManager.d.ts} +12 -33
  77. package/types/Core/Retina.d.ts +0 -2
  78. package/types/Core/Utils/PluginManager.d.ts +62 -0
  79. package/types/Options/Classes/Options.d.ts +3 -3
  80. package/types/Options/Classes/Particles/Paint.d.ts +10 -0
  81. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +7 -7
  82. package/types/Options/Interfaces/Particles/IPaint.d.ts +6 -0
  83. package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +3 -4
  84. package/types/Types/CanvasContextType.d.ts +1 -0
  85. package/types/Utils/CanvasUtils.d.ts +8 -5
  86. package/types/Utils/ColorUtils.d.ts +8 -8
  87. package/types/Utils/LogUtils.d.ts +1 -0
  88. package/types/Utils/OptionsUtils.d.ts +2 -2
  89. package/types/export-types.d.ts +5 -2
  90. package/types/exports.d.ts +1 -0
  91. package/164.min.js +0 -1
  92. package/browser/Core/Canvas.js +0 -570
  93. package/cjs/Core/Canvas.js +0 -570
  94. package/esm/Core/Canvas.js +0 -570
  95. package/umd/Core/Canvas.js +0 -584
  96. package/umd/Core/Container.js +0 -356
  97. package/umd/Core/Engine.js +0 -295
  98. package/umd/Core/Interfaces/Colors.js +0 -12
  99. package/umd/Core/Interfaces/IBounds.js +0 -12
  100. package/umd/Core/Interfaces/IBubbleParticleData.js +0 -12
  101. package/umd/Core/Interfaces/ICircleBouncer.js +0 -12
  102. package/umd/Core/Interfaces/IColorManager.js +0 -12
  103. package/umd/Core/Interfaces/IContainerPlugin.js +0 -12
  104. package/umd/Core/Interfaces/ICoordinates.js +0 -12
  105. package/umd/Core/Interfaces/IDelta.js +0 -12
  106. package/umd/Core/Interfaces/IDimension.js +0 -12
  107. package/umd/Core/Interfaces/IDistance.js +0 -12
  108. package/umd/Core/Interfaces/IDrawParticleParams.js +0 -12
  109. package/umd/Core/Interfaces/IEffectDrawer.js +0 -12
  110. package/umd/Core/Interfaces/ILoadParams.js +0 -12
  111. package/umd/Core/Interfaces/IPalette.js +0 -12
  112. package/umd/Core/Interfaces/IParticleColorStyle.js +0 -12
  113. package/umd/Core/Interfaces/IParticleHslAnimation.js +0 -12
  114. package/umd/Core/Interfaces/IParticleLife.js +0 -12
  115. package/umd/Core/Interfaces/IParticleOpacityData.js +0 -12
  116. package/umd/Core/Interfaces/IParticleRetinaProps.js +0 -12
  117. package/umd/Core/Interfaces/IParticleRoll.js +0 -12
  118. package/umd/Core/Interfaces/IParticleRotateData.js +0 -12
  119. package/umd/Core/Interfaces/IParticleTransformValues.js +0 -12
  120. package/umd/Core/Interfaces/IParticleUpdater.js +0 -12
  121. package/umd/Core/Interfaces/IParticleValueAnimation.js +0 -12
  122. package/umd/Core/Interfaces/IPlugin.js +0 -12
  123. package/umd/Core/Interfaces/IPositionFromSizeParams.js +0 -12
  124. package/umd/Core/Interfaces/IRangeValue.js +0 -12
  125. package/umd/Core/Interfaces/IShapeDrawData.js +0 -12
  126. package/umd/Core/Interfaces/IShapeDrawer.js +0 -12
  127. package/umd/Core/Interfaces/IShapeValues.js +0 -12
  128. package/umd/Core/Interfaces/ISlowParticleData.js +0 -12
  129. package/umd/Core/Particle.js +0 -432
  130. package/umd/Core/Particles.js +0 -407
  131. package/umd/Core/Retina.js +0 -52
  132. package/umd/Core/Utils/Constants.js +0 -23
  133. package/umd/Core/Utils/EventListeners.js +0 -102
  134. package/umd/Core/Utils/Ranges.js +0 -91
  135. package/umd/Core/Utils/SpatialHashGrid.js +0 -116
  136. package/umd/Core/Utils/Vectors.js +0 -126
  137. package/umd/Enums/AnimationStatus.js +0 -18
  138. package/umd/Enums/Directions/MoveDirection.js +0 -27
  139. package/umd/Enums/Directions/OutModeDirection.js +0 -20
  140. package/umd/Enums/Directions/RotateDirection.js +0 -19
  141. package/umd/Enums/Modes/AnimationMode.js +0 -20
  142. package/umd/Enums/Modes/LimitMode.js +0 -18
  143. package/umd/Enums/Modes/OutMode.js +0 -21
  144. package/umd/Enums/Modes/PixelMode.js +0 -18
  145. package/umd/Enums/RangeType.js +0 -18
  146. package/umd/Enums/Types/AlterType.js +0 -18
  147. package/umd/Enums/Types/DestroyType.js +0 -19
  148. package/umd/Enums/Types/EasingType.js +0 -58
  149. package/umd/Enums/Types/EventType.js +0 -28
  150. package/umd/Enums/Types/GradientType.js +0 -19
  151. package/umd/Enums/Types/ParticleOutType.js +0 -19
  152. package/umd/Enums/Types/StartValueType.js +0 -19
  153. package/umd/Options/Classes/AnimatableColor.js +0 -52
  154. package/umd/Options/Classes/AnimationOptions.js +0 -79
  155. package/umd/Options/Classes/Background/Background.js +0 -56
  156. package/umd/Options/Classes/ColorAnimation.js +0 -44
  157. package/umd/Options/Classes/FullScreen/FullScreen.js +0 -34
  158. package/umd/Options/Classes/HslAnimation.js +0 -30
  159. package/umd/Options/Classes/Options.js +0 -171
  160. package/umd/Options/Classes/OptionsColor.js +0 -42
  161. package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +0 -31
  162. package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -21
  163. package/umd/Options/Classes/Particles/Effect/Effect.js +0 -46
  164. package/umd/Options/Classes/Particles/Fill.js +0 -42
  165. package/umd/Options/Classes/Particles/Move/Move.js +0 -120
  166. package/umd/Options/Classes/Particles/Move/MoveAngle.js +0 -35
  167. package/umd/Options/Classes/Particles/Move/MoveCenter.js +0 -45
  168. package/umd/Options/Classes/Particles/Move/MoveGravity.js +0 -45
  169. package/umd/Options/Classes/Particles/Move/OutModes.js +0 -38
  170. package/umd/Options/Classes/Particles/Move/Path/MovePath.js +0 -46
  171. package/umd/Options/Classes/Particles/Move/Spin.js +0 -40
  172. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +0 -41
  173. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +0 -37
  174. package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +0 -35
  175. package/umd/Options/Classes/Particles/Opacity/Opacity.js +0 -35
  176. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -34
  177. package/umd/Options/Classes/Particles/ParticlesOptions.js +0 -116
  178. package/umd/Options/Classes/Particles/Shape/Shape.js +0 -46
  179. package/umd/Options/Classes/Particles/Size/Size.js +0 -35
  180. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -34
  181. package/umd/Options/Classes/Particles/Stroke.js +0 -39
  182. package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +0 -42
  183. package/umd/Options/Classes/ResizeEvent.js +0 -34
  184. package/umd/Options/Classes/ValueWithRandom.js +0 -56
  185. package/umd/Options/Interfaces/Background/IBackground.js +0 -12
  186. package/umd/Options/Interfaces/FullScreen/IFullScreen.js +0 -12
  187. package/umd/Options/Interfaces/IAnimatable.js +0 -12
  188. package/umd/Options/Interfaces/IAnimatableColor.js +0 -12
  189. package/umd/Options/Interfaces/IAnimation.js +0 -12
  190. package/umd/Options/Interfaces/IColorAnimation.js +0 -12
  191. package/umd/Options/Interfaces/IHslAnimation.js +0 -12
  192. package/umd/Options/Interfaces/IOptionLoader.js +0 -12
  193. package/umd/Options/Interfaces/IOptions.js +0 -12
  194. package/umd/Options/Interfaces/IOptionsColor.js +0 -12
  195. package/umd/Options/Interfaces/IResizeEvent.js +0 -12
  196. package/umd/Options/Interfaces/IValueWithRandom.js +0 -12
  197. package/umd/Options/Interfaces/Particles/Bounce/IParticlesBounce.js +0 -12
  198. package/umd/Options/Interfaces/Particles/Effect/IEffect.js +0 -12
  199. package/umd/Options/Interfaces/Particles/IFill.js +0 -12
  200. package/umd/Options/Interfaces/Particles/IParticlesOptions.js +0 -12
  201. package/umd/Options/Interfaces/Particles/IStroke.js +0 -12
  202. package/umd/Options/Interfaces/Particles/Move/IMove.js +0 -12
  203. package/umd/Options/Interfaces/Particles/Move/IMoveAngle.js +0 -12
  204. package/umd/Options/Interfaces/Particles/Move/IMoveCenter.js +0 -12
  205. package/umd/Options/Interfaces/Particles/Move/IMoveGravity.js +0 -12
  206. package/umd/Options/Interfaces/Particles/Move/IOutModes.js +0 -12
  207. package/umd/Options/Interfaces/Particles/Move/ISpin.js +0 -12
  208. package/umd/Options/Interfaces/Particles/Move/Path/IMovePath.js +0 -12
  209. package/umd/Options/Interfaces/Particles/Number/IParticlesDensity.js +0 -12
  210. package/umd/Options/Interfaces/Particles/Number/IParticlesNumber.js +0 -12
  211. package/umd/Options/Interfaces/Particles/Number/IParticlesNumberLimit.js +0 -12
  212. package/umd/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -12
  213. package/umd/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -12
  214. package/umd/Options/Interfaces/Particles/Shape/IShape.js +0 -12
  215. package/umd/Options/Interfaces/Particles/Size/ISize.js +0 -12
  216. package/umd/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -12
  217. package/umd/Options/Interfaces/Particles/ZIndex/IZIndex.js +0 -12
  218. package/umd/Types/CustomEventArgs.js +0 -12
  219. package/umd/Types/CustomEventListener.js +0 -12
  220. package/umd/Types/EasingFunction.js +0 -12
  221. package/umd/Types/EngineInitializers.js +0 -12
  222. package/umd/Types/ExportResult.js +0 -12
  223. package/umd/Types/ISourceOptions.js +0 -12
  224. package/umd/Types/ParticlesGroups.js +0 -12
  225. package/umd/Types/PathOptions.js +0 -12
  226. package/umd/Types/RangeValue.js +0 -12
  227. package/umd/Types/RecursivePartial.js +0 -12
  228. package/umd/Types/ShapeData.js +0 -12
  229. package/umd/Types/SingleOrMultiple.js +0 -12
  230. package/umd/Utils/CanvasUtils.js +0 -145
  231. package/umd/Utils/ColorUtils.js +0 -395
  232. package/umd/Utils/EventDispatcher.js +0 -63
  233. package/umd/Utils/LogUtils.js +0 -36
  234. package/umd/Utils/MathUtils.js +0 -203
  235. package/umd/Utils/OptionsUtils.js +0 -25
  236. package/umd/Utils/TypeUtils.js +0 -40
  237. package/umd/Utils/Utils.js +0 -484
  238. package/umd/bundle.js +0 -32
  239. package/umd/export-types.js +0 -12
  240. package/umd/exports.js +0 -82
  241. package/umd/index.js +0 -32
  242. package/umd/initEngine.js +0 -17
package/README.md CHANGED
@@ -1,1010 +1,98 @@
1
- [![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)
1
+ [![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org)
2
2
 
3
- # tsParticles - TypeScript Particles
3
+ # tsParticles Engine
4
4
 
5
- **A lightweight TypeScript library for creating particles. Dependency free (\*), browser ready and compatible with
6
- React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, Solid.js, and Web Components**
7
-
8
- [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni?style=for-the-badge)](https://github.com/sponsors/matteobruni)
9
- [![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/tsparticles?style=for-the-badge)](https://www.jsdelivr.com/package/npm/tsparticles)
10
- [![Cdnjs](https://img.shields.io/cdnjs/v/@tsparticles/engine?style=for-the-badge)](https://cdnjs.com/libraries/tsparticles)
11
- [![npm](https://img.shields.io/npm/v/@tsparticles/engine?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
12
- [![npm](https://img.shields.io/npm/dm/tsparticles?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
13
- [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff?style=for-the-badge)](https://lerna.js.org/)
14
- [![CodeFactor](https://www.codefactor.io/repository/github/tsparticles/tsparticles/badge)](https://www.codefactor.io/repository/github/tsparticles/tsparticles)
15
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b983aaf3461a4c48b1e2eecce1ff1d74)](https://www.codacy.com/manual/ar3s/tsparticles?utm_source=github.com&utm_medium=referral&utm_content=tsparticles/tsparticles&utm_campaign=Badge_Grade)
16
- [![Rate this package](https://badges.openbase.com/js/rating/tsparticles.svg?style=openbase&token=A9jHQ1nkb6fnCndKM7O2w4hx3OD8PVCuqHtSpw8mMOg=)](https://openbase.com/js/tsparticles?utm_source=embedded&utm_medium=badge&utm_campaign=rating-badge&utm_term=js/tsparticles)
17
- [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/tsparticles/tsparticles)
18
- [![Run on Repl.it](https://repl.it/badge/github/tsparticles/tsparticles)](https://repl.it/github/tsparticles/tsparticles)
19
-
20
- [![Discord](https://img.shields.io/discord/872061157379301416?label=discord&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/hACwv45Hme)
21
- [![Telegram](https://particles.js.org/images/telegram.png)](https://t.me/tsparticles)
22
- [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/tsParticles?style=for-the-badge)](https://www.reddit.com/r/tsParticles/)
23
-
24
- [![tsParticles Product Hunt](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=186113&theme=light)](https://www.producthunt.com/posts/tsparticles?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-tsparticles")
25
- [![Buy Me A Coffee](https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20beer&emoji=🍺&slug=matteobruni&button_colour=5F7FFF&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00")](https://www.buymeacoffee.com/matteobruni)
26
-
27
- ---
28
-
29
- ## Table of Contents
30
-
31
- - [tsParticles - TypeScript Particles](#tsparticles---typescript-particles)
32
- - [Table of Contents](#table-of-contents)
33
- - [Do you want to use it on your website?](#do-you-want-to-use-it-on-your-website)
34
- - [**_Library installation_**](#library-installation)
35
- - [**_Hosting / CDN_**](#hosting--cdn)
36
- - [jsDelivr](#jsdelivr)
37
- - [cdnjs](#cdnjs)
38
- - [unpkg](#unpkg)
39
- - [**_npm_**](#npm)
40
- - [**_yarn_**](#yarn)
41
- - [**_pnpm_**](#pnpm)
42
- - [Import and require](#import-and-require)
43
- - [**_Usage_**](#usage)
44
- - [Official components for some of the most used frameworks](#official-components-for-some-of-the-most-used-frameworks)
45
- - [Angular](#angular)
46
- - [`@tsparticles/angular`](#@tsparticles/angular)
47
- - [Astro](#astro)
48
- - [`astro-particles`](#astro-particles)
49
- - [Ember.js](#emberjs)
50
- - [`ember-tsparticles`](#ember-tsparticles)
51
- - [Inferno](#inferno)
52
- - [`inferno-particles`](#inferno-particles)
53
- - [jQuery](#jquery)
54
- - [`jquery-particles`](#jquery-particles)
55
- - [Preact](#preact)
56
- - [`preact-particles`](#preact-particles)
57
- - [ReactJS](#reactjs)
58
- - [`@tsparticles/react`](#tsparticlesreact)
59
- - [RiotJS](#riotjs)
60
- - [`riot-particles`](#riot-particles)
61
- - [SolidJS](#solidjs)
62
- - [`solid-particles`](#solid-particles)
63
- - [Svelte](#svelte)
64
- - [`@tsparticles/svelte`](#@tsparticles/svelte)
65
- - [VueJS 2.x](#vuejs-2x)
66
- - [`@tsparticles/vue2`](#tsparticlesvue2)
67
- - [VueJS 3.x](#vuejs-3x)
68
- - [`@tsparticles/vue3`](#tsparticlesvue3)
69
- - [Web Components](#web-components)
70
- - [`web-particles`](#web-particles)
71
- - [WordPress](#wordpress)
72
- - [`@tsparticles/wordpress`](#@tsparticles/wordpress)
73
- - [Elementor](#elementor)
74
- - [Presets](#presets)
75
- - [Big Circles](#big-circles)
76
- - [Bubbles](#bubbles)
77
- - [Confetti](#confetti)
78
- - [Fire](#fire)
79
- - [Firefly](#firefly)
80
- - [Fireworks](#fireworks)
81
- - [Fountain](#fountain)
82
- - [Links](#links)
83
- - [Sea Anemone](#sea-anemone)
84
- - [Snow](#snow)
85
- - [Stars](#stars)
86
- - [Triangles](#triangles)
87
- - [Templates and Resources](#templates-and-resources)
88
- - [**_Demo / Generator_**](#demo--generator)
89
- - [**_Video Tutorials_**](#video-tutorials)
90
- - [Characters as particles](#characters-as-particles)
91
- - [Polygon mask](#polygon-mask)
92
- - [Animated stars](#animated-stars)
93
- - [Nyan cat flying on scrolling stars](#nyan-cat-flying-on-scrolling-stars)
94
- - [Snow particles](#snow-particles)
95
- - [Background Mask particles](#background-mask-particles)
96
- - [**_Options_**](#options)
97
- - [Want to see it in action and try it?](#want-to-see-it-in-action-and-try-it)
98
- - [Migrating from Particles.js](#migrating-from-particlesjs)
99
- - [Plugins/Customizations](#pluginscustomizations)
100
- - [Dependency Graph](#dependency-graph)
101
- - [Sponsors](#sponsors)
102
- - [Huge thanks to JetBrains for the 2020-2022 Open Source Licenses!](#huge-thanks-to-jetbrains-for-the-2020-2022-open-source-licenses)
103
-
104
- ---
105
-
106
- ## Do you want to use it on your website?
107
-
108
- _Documentation and Development references [here](https://particles.js.org/docs/) 📖_
109
-
110
- **This library is available on two of the most popular CDNs and it's easy and ready to use, if you were using
111
- particles.js
112
- it's even easier**.
113
-
114
- You'll find the
115
- instructions [below](https://github.com/tsparticles/tsparticles/blob/main/README.md#library-installation), with all the
116
- links you need, and _don't be scared by **TypeScript**, it's just the source language_.
117
-
118
- **The output files are just JavaScript**. 🤩
119
-
120
- CDNs and `npm` have all the sources you need in **Javascript**, a bundle browser ready (tsparticles.engine.min.js), and
121
- all
122
- files splitted for `import` syntax.
123
-
124
- **If you are interested** there are some _simple instructions_
125
- just [below](https://github.com/tsparticles/tsparticles/blob/main/README.md#library-installation) to guide you to
126
- migrate from the old particles.js library.
127
-
128
- ## **_Library installation_**
129
-
130
- ### **_Hosting / CDN_**
131
-
132
- **_Please use these hosts or your own to load tsParticles on your projects_**
133
-
134
- #### jsDelivr
135
-
136
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/confetti/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/confetti)
137
5
  [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/engine/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/engine)
138
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/fireworks/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/fireworks)
139
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/basic/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/basic)
140
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/slim/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/slim)
141
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles/badge)](https://www.jsdelivr.com/package/npm/tsparticles)
142
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/all/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/all)
143
-
144
- #### cdnjs
6
+ [![npmjs](https://badge.fury.io/js/@tsparticles/engine.svg)](https://www.npmjs.com/package/@tsparticles/engine)
7
+ [![npmjs](https://img.shields.io/npm/dt/@tsparticles/engine)](https://www.npmjs.com/package/@tsparticles/engine) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
145
8
 
146
- [![Cdnjs](https://img.shields.io/cdnjs/v/tsparticles)](https://cdnjs.com/libraries/tsparticles)
9
+ [tsParticles](https://github.com/tsparticles/tsparticles) is a lightweight TypeScript library for creating particles. Dependency free (\*), browser ready and compatible with React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js, Solid.js, and Web Components.
147
10
 
148
- #### unpkg
11
+ **This is the core engine package that all other features depend on.**
149
12
 
150
- <https://unpkg.com/@tsparticles/confetti/> <https://unpkg.com/@tsparticles/engine/> <https://unpkg.com/@tsparticles/fireworks/> <https://unpkg.com/@tsparticles/basic/> <https://unpkg.com/@tsparticles/slim/> <https://unpkg.com/tsparticles/> <https://unpkg.com/@tsparticles/all/>
13
+ ## Quick checklist
151
14
 
152
- ---
15
+ 1. Install `@tsparticles/engine`
16
+ 2. Initialize the engine instance in your code
17
+ 3. Load additional plugins/shapes/updaters as needed
18
+ 4. Use `tsParticles.load()` to apply particle configurations
153
19
 
154
- ### **_npm_**
20
+ ## How to use it
155
21
 
156
- _tsParticles Confetti_
157
-
158
- [![npm](https://img.shields.io/npm/v/@tsparticles/confetti?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/confetti) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/confetti?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/confetti)
159
-
160
- _tsParticles Engine_
161
-
162
- [![npm](https://img.shields.io/npm/v/@tsparticles/engine?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/engine) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/engine?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/engine)
163
-
164
- _tsParticles Fireworks_
165
-
166
- [![npm](https://img.shields.io/npm/v/@tsparticles/fireworks?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/fireworks) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/fireworks?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/fireworks)
167
-
168
- _tsParticles Basic_
169
-
170
- [![npm](https://img.shields.io/npm/v/@tsparticles/basic?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/basic) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/basic?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/basic)
171
-
172
- _tsParticles Slim_
173
-
174
- [![npm](https://img.shields.io/npm/v/@tsparticles/slim?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/slim) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/slim?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/slim)
175
-
176
- _tsParticles_
177
-
178
- [![npm](https://img.shields.io/npm/v/tsparticles?style=for-the-badge)](https://www.npmjs.com/package/tsparticles) [![npmjs](https://img.shields.io/npm/dt/tsparticles?style=for-the-badge)](https://www.npmjs.com/package/tsparticles)
179
-
180
- _tsParticles All_
181
-
182
- [![npm](https://img.shields.io/npm/v/@tsparticles/all?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/all) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/all?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/all)
22
+ ### Installation
183
23
 
184
24
  ```shell
185
25
  npm install @tsparticles/engine
186
26
  ```
187
27
 
188
- ### **_yarn_**
28
+ or
189
29
 
190
30
  ```shell
191
31
  yarn add @tsparticles/engine
192
32
  ```
193
33
 
194
- ### **_pnpm_**
34
+ or
195
35
 
196
36
  ```shell
197
37
  pnpm install @tsparticles/engine
198
38
  ```
199
39
 
200
- #### Import and require
40
+ ### Basic Usage
201
41
 
202
42
  ```javascript
203
- const tsParticles = require("@tsparticles/engine");
204
-
205
- // or
206
-
207
43
  import { tsParticles } from "@tsparticles/engine";
208
- ```
209
-
210
- The imported `tsParticles` is the same instance you have when including the script in the page using the `<script>` tag.
211
-
212
- ---
213
-
214
- ### **_Usage_**
215
-
216
- Load tsParticles and configure the particles:
217
44
 
218
- [![tsParticles demo](https://media.giphy.com/media/ftHwBpp3b0qNyCXRuu/giphy.gif)](https://particles.js.org)
219
- [![tsParticles Confetti demo](https://media.giphy.com/media/ftHwBpp3b0qNyCXRuu/giphy.gif)](https://confetti.js.org)
220
-
221
- **index.html**
222
-
223
- ```html
224
- <div id="tsparticles"></div>
225
-
226
- <script src="tsparticles.engine.min.js"></script>
227
- ```
228
-
229
- **app.js**
230
-
231
- ```javascript
232
- // @path-json can be an object or an array, the first will be loaded directly, and the object from the array will be randomly selected
233
- /* tsParticles.load(@params); */
234
-
235
- tsParticles
236
- .load({
237
- id: "tsparticles",
238
- url: "presets/default.json",
239
- })
240
- .then(container => {
241
- console.log("callback - tsparticles config loaded");
242
- })
243
- .catch(error => {
244
- console.error(error);
245
- });
246
-
247
- //or
248
-
249
- tsParticles.load({
45
+ await tsParticles.load({
250
46
  id: "tsparticles",
251
47
  options: {
252
- /* options here */
253
- },
254
- });
255
-
256
- //or
257
-
258
- tsParticles.load({
259
- id: "tsparticles",
260
- options: [
261
- {
262
- /* options here */
263
- },
264
- {
265
- /* other options here */
266
- },
267
- ],
268
- });
269
- //random object
270
-
271
- tsParticles.load({
272
- id: "tsparticles",
273
- options: [
274
- {
275
- /* options here */
48
+ particles: {
49
+ number: {
50
+ value: 80,
51
+ },
52
+ move: {
53
+ enable: true,
54
+ speed: 2,
55
+ },
276
56
  },
277
- {
278
- /* other options here */
279
- },
280
- ],
281
- index: 1,
282
- }); //the second one
283
- // Important! If the index is not in range 0...<array.length, the index will be ignored.
284
-
285
- // after initialization this can be used.
286
-
287
- /* tsParticles.setOnClickHandler(@callback); */
288
-
289
- /* this will be fired from all particles loaded */
290
-
291
- tsParticles.setOnClickHandler((event, particles) => {
292
- /* custom on click handler */
57
+ },
293
58
  });
294
-
295
- // now you can control the animations too, it's possible to pause and resume the animations
296
- // these methods don't change the config so you're safe with all your configurations
297
- // domItem(0) returns the first tsParticles instance loaded in the dom
298
- const particles = tsParticles.item(0);
299
-
300
- // play will start the animations, if the move is not enabled it won't enable it, it just updates the frame
301
- particles.play();
302
-
303
- // pause will stop the animations
304
- particles.pause();
305
- ```
306
-
307
- ---
308
-
309
- ## Official components for some of the most used frameworks
310
-
311
- ### Angular
312
-
313
- #### `@tsparticles/angular`
314
-
315
- [![npm](https://img.shields.io/npm/v/@tsparticles/angular?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/angular) [![npm](https://img.shields.io/npm/dm/@tsparticles/angular?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/angular)
316
-
317
- Instructions available [here](https://github.com/tsparticles/angular/#readme)
318
-
319
- ### Astro
320
-
321
- #### `astro-particles`
322
-
323
- [![npm](https://img.shields.io/npm/v/astro-particles?style=for-the-badge)](https://www.npmjs.com/package/astro-particles) [![npm](https://img.shields.io/npm/dm/astro-particles?style=for-the-badge)](https://www.npmjs.com/package/astro-particles)
324
-
325
- Instructions available [here](https://github.com/tsparticles/astro/#readme)
326
-
327
- ### Ember.js
328
-
329
- #### `ember-tsparticles`
330
-
331
- [![npm](https://img.shields.io/npm/v/ember-tsparticles?style=for-the-badge)](https://www.npmjs.com/package/ember-tsparticles) [![npm](https://img.shields.io/npm/dm/ember-tsparticles?style=for-the-badge)](https://www.npmjs.com/package/ember-tsparticles)
332
-
333
- Instructions available [here](https://github.com/tsparticles/ember/#readme)
334
-
335
- ### Inferno
336
-
337
- #### `inferno-particles`
338
-
339
- [![npm](https://img.shields.io/npm/v/inferno-particles?style=for-the-badge)](https://www.npmjs.com/package/inferno-particles) [![npm](https://img.shields.io/npm/dm/inferno-particles?style=for-the-badge)](https://www.npmjs.com/package/inferno-particles)
340
-
341
- Instructions available [here](https://github.com/tsparticles/inferno/#readme)
342
-
343
- ### jQuery
344
-
345
- #### `jquery-particles`
346
-
347
- [![npm](https://img.shields.io/npm/v/jquery-particles?style=for-the-badge)](https://www.npmjs.com/package/jquery-particles) [![npm](https://img.shields.io/npm/dm/jquery-particles?style=for-the-badge)](https://www.npmjs.com/package/jquery-particles)
348
-
349
- Instructions available [here](https://github.com/tsparticles/jquery/#readme)
350
-
351
- ### Preact
352
-
353
- #### `preact-particles`
354
-
355
- [![npm](https://img.shields.io/npm/v/preact-particles?style=for-the-badge)](https://www.npmjs.com/package/preact-particles) [![npm](https://img.shields.io/npm/dm/preact-particles?style=for-the-badge)](https://www.npmjs.com/package/preact-particles)
356
-
357
- Instructions available [here](https://github.com/tsparticles/preact/#readme)
358
-
359
- ### ReactJS
360
-
361
- #### `@tsparticles/react`
362
-
363
- [![npm](https://img.shields.io/npm/v/@tsparticles/react?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/react) [![npm](https://img.shields.io/npm/dm/@tsparticles/react?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/react)
364
-
365
- Instructions available [here](https://github.com/tsparticles/react/#readme)
366
-
367
- ### RiotJS
368
-
369
- #### `riot-particles`
370
-
371
- [![npm](https://img.shields.io/npm/v/riot-particles?style=for-the-badge)](https://www.npmjs.com/package/riot-particles) [![npm](https://img.shields.io/npm/dm/riot-particles?style=for-the-badge)](https://www.npmjs.com/package/riot-particles)
372
-
373
- You can find the instructions [here](https://github.com/tsparticles/riot/#readme)
374
-
375
- ### SolidJS
376
-
377
- #### `solid-particles`
378
-
379
- [![npm](https://img.shields.io/npm/v/solid-particles?style=for-the-badge)](https://www.npmjs.com/package/solid-particles) [![npm](https://img.shields.io/npm/dm/solid-particles?style=for-the-badge)](https://www.npmjs.com/package/solid-particles)
380
-
381
- You can find the instructions [here](https://github.com/tsparticles/solid/#readme)
382
-
383
- ### Svelte
384
-
385
- #### `@tsparticles/svelte`
386
-
387
- [![npm](https://img.shields.io/npm/v/@tsparticles/svelte?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/svelte) [![npm downloads](https://img.shields.io/npm/dm/@tsparticles/svelte?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/svelte)
388
-
389
- Instructions available [here](https://github.com/tsparticles/svelte/#readme)
390
-
391
- ### VueJS 2.x
392
-
393
- #### `@tsparticles/vue2`
394
-
395
- [![npm](https://img.shields.io/npm/v/@tsparticles/vue2?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/vue2) [![npm](https://img.shields.io/npm/dm/@tsparticles/vue2?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/vue2)
396
-
397
- Instructions available [here](https://github.com/tsparticles/vue2/#readme)
398
-
399
- ### VueJS 3.x
400
-
401
- #### `@tsparticles/vue3`
402
-
403
- [![npm](https://img.shields.io/npm/v/@tsparticles/vue3?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/vue3) [![npm](https://img.shields.io/npm/dm/@tsparticles/vue3?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/vue3)
404
-
405
- Instruction available [here](https://github.com/tsparticles/vue3/#readme)
406
-
407
- ### Web Components
408
-
409
- #### `web-particles`
410
-
411
- [![npm](https://img.shields.io/npm/v/web-particles?style=for-the-badge)](https://www.npmjs.com/package/web-particles) [![npm](https://img.shields.io/npm/dm/web-particles?style=for-the-badge)](https://www.npmjs.com/package/web-particles)
412
-
413
- You can find the instructions [here](https://github.com/tsparticles/webcomponents/#readme)
414
-
415
- ### WordPress
416
-
417
- #### `@tsparticles/wordpress`
418
-
419
- [![npm](https://img.shields.io/npm/v/@tsparticles/wordpress?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/wordpress) [![npm](https://img.shields.io/npm/dm/@tsparticles/wordpress?style=for-the-badge)](https://www.npmjs.com/package/@tsparticles/wordpress) [![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dw/@tsparticles/block?style=for-the-badge)](https://wordpress.org/plugins/tsparticles-block/) [![WordPress Plugin Active Installs](https://img.shields.io/wordpress/plugin/installs/tsparticles-block?style=for-the-badge)](https://wordpress.org/plugins/tsparticles-block/)
420
-
421
- The plugin page hosted on WordPress.org can be
422
- found [here](https://wordpress.org/plugins/tsparticles-block/#description)
423
-
424
- ### Elementor
425
-
426
- Actually, an official tsParticles plugin isn't existing, but I have a collaboration with
427
- the `Premium Addons for Elementor` plugin collection.
428
-
429
- <div style="float: left; margin-right: 10px;">
430
- <img width="64" alt="Premium Addons for Elementor" src="https://particles.js.org/images/premium-addons-wordpress-plugin.png" />
431
- </div>
432
- <div>
433
- Premium Addons for Elementor is one of the most common plugins for Elementor that offers more than 55 highly customizable Elementor Widgets and Section Add-ons. tsParticles is exclusively included in Premium Particles Section Add-on for Elementor Page Builder. <a href="https://premiumaddons.com/particles-section-addon-for-elementor-page-builder/" target="_blank">Check It Now</a>.<br />
434
- Use Premium Addons for Elementor Page Builder and get the chance to include tsParticles in your next WordPress website without the need to write a single line of code. <a href="https://premiumaddons.com/particles-section-addon-for-elementor-page-builder/" target="_blank">See a Live Example</a>.
435
- </div>
436
- <div style="clear: both;"></div>
437
-
438
- ---
439
-
440
- ## Presets
441
-
442
- There are some presets ready to be used in [this repository](https://github.com/tsparticles/presets), and they also have a bundle file that contains everything
443
- needed to run.
444
-
445
- ### Big Circles
446
-
447
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-big-circles/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-big-circles) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-big-circles.svg)](https://www.npmjs.com/package/@tsparticles/preset-big-circles) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-big-circles)](https://www.npmjs.com/package/@tsparticles/preset-big-circles)
448
-
449
- This preset loads big colored circles moving upwards on a white background.
450
-
451
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/bigCircles/images/sample.png)](https://particles.js.org/samples/presets/bigCircles)
452
-
453
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/bigCircles#readme)
454
-
455
- ### Bubbles
456
-
457
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-bubbles/badge)](https://www.jsdelivr.com/package/npm/tsparticles) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-bubbles.svg)](https://www.npmjs.com/package/@tsparticles/preset-bubbles) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-bubbles)](https://www.npmjs.com/package/@tsparticles/preset-bubbles)
458
-
459
- This preset loads colored bubbles coming from the bottom of the screen on a white background.
460
-
461
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/bubbles/images/sample.png)](https://particles.js.org/samples/presets/bubbles)
462
-
463
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/bubbles#readme)
464
-
465
- ### Confetti
466
-
467
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-confetti/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-confetti) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-confetti.svg)](https://www.npmjs.com/package/@tsparticles/preset-confetti) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-confetti)](https://www.npmjs.com/package/@tsparticles/preset-confetti)
468
-
469
- This preset loads white and red confetti launched from the screen center on a transparent background.
470
-
471
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/confetti/images/sample.png)](https://particles.js.org/samples/presets/confetti)
472
-
473
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/confetti#readme)
474
-
475
- ### Fire
476
-
477
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-fire/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-fire) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-fire.svg)](https://www.npmjs.com/package/@tsparticles/preset-fire) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-fire)](https://www.npmjs.com/package/@tsparticles/preset-fire)
478
-
479
- This preset loads a faded red to a black background with particles colored like fire and ash sparks.
480
-
481
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/fire/images/sample.png)](https://particles.js.org/samples/presets/fire)
482
-
483
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/fire#readme)
484
-
485
- ### Firefly
486
-
487
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-firefly/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-firefly) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-firefly.svg)](https://www.npmjs.com/package/@tsparticles/preset-firefly) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-firefly)](https://www.npmjs.com/package/@tsparticles/preset-firefly)
488
-
489
- This preset loads a mouse trail made with small fading particles like little fireflies.
490
-
491
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/firefly/images/sample.png)](https://particles.js.org/samples/presets/firefly)
492
-
493
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/firefly#readme)
494
-
495
- ### Fireworks
496
-
497
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-fireworks/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-fireworks) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-fireworks.svg)](https://www.npmjs.com/package/@tsparticles/preset-fireworks) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-fireworks)](https://www.npmjs.com/package/@tsparticles/preset-fireworks)
498
-
499
- This preset loads a beautiful fireworks effect.
500
-
501
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/fireworks/images/sample.png)](https://particles.js.org/samples/presets/fireworks)
502
-
503
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/fireworks#readme)
504
-
505
- ### Fountain
506
-
507
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-fountain/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-fountain) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-fountain.svg)](https://www.npmjs.com/package/@tsparticles/preset-fountain) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-fountain)](https://www.npmjs.com/package/@tsparticles/preset-fountain)
508
-
509
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/fountain/images/sample.png)](https://particles.js.org/samples/presets/fountain)
510
-
511
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/fountain#readme)
512
-
513
- ### Links
514
-
515
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-links/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-links) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-links.svg)](https://www.npmjs.com/package/@tsparticles/preset-links) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-links)](https://www.npmjs.com/package/@tsparticles/preset-links)
516
-
517
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/links/images/sample.png)](https://particles.js.org/samples/presets/links)
518
-
519
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/links#readme)
520
-
521
- ### Sea Anemone
522
-
523
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-sea-anemone/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-sea-anemone) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-sea-anemone.svg)](https://www.npmjs.com/package/@tsparticles/preset-sea-anemone) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-sea-anemone)](https://www.npmjs.com/package/@tsparticles/preset-sea-anemone)
524
-
525
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/seaAnemone/images/sample.png)](https://particles.js.org/samples/presets/seaAnemone)
526
-
527
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/seaAnemone#readme)
528
-
529
- ### Snow
530
-
531
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-snow/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-snow) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-snow.svg)](https://www.npmjs.com/package/@tsparticles/preset-snow) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-snow)](https://www.npmjs.com/package/@tsparticles/preset-snow)
532
-
533
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/snow/images/sample.png)](https://particles.js.org/samples/presets/snow)
534
-
535
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/snow#readme)
536
-
537
- ### Stars
538
-
539
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-stars/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-stars) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-stars.svg)](https://www.npmjs.com/package/@tsparticles/preset-stars) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-stars)](https://www.npmjs.com/package/@tsparticles/preset-stars)
540
-
541
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/stars/images/sample.png)](https://particles.js.org/samples/presets/stars)
542
-
543
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/stars#readme)
544
-
545
- ### Triangles
546
-
547
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-triangles/badge?style=for-the-badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-triangles) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-triangles.svg)](https://www.npmjs.com/package/@tsparticles/preset-triangles) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-triangles)](https://www.npmjs.com/package/@tsparticles/preset-triangles)
548
-
549
- [![demo](https://github.com/tsparticles/presets/raw/main/presets/triangles/images/sample.png)](https://particles.js.org/samples/presets/triangles)
550
-
551
- You can find the instructions [here](https://github.com/tsparticles/presets/tree/main/presets/triangles#readme)
552
-
553
- ---
554
-
555
- ## Templates and Resources
556
-
557
- You can find some tsParticles related templates [here](https://github.com/tsparticles/templates). The templates are
558
- created for _Vanilla Javascript_, _ReactJS_, _VueJS_, _Angular_, _SvelteJS_, and other frameworks.
559
-
560
- The templates will vary, new ones can be created or older ones updated with the latest features or changed to a better
561
- style. Check them out once in a while.
562
-
563
- If you created some good design with _tsParticles_ feel free to submit a pull request with your cool template, you'll be
564
- credited as the template author!
565
-
566
- <https://github.com/tsparticles/templates>
567
-
568
- ---
569
-
570
- ## **_Demo / Generator_**
571
-
572
- <https://particles.js.org/samples>
573
-
574
- [![Particles demo](https://particles.js.org/images/demo2.png?v=1.39.1)](https://particles.js.org/samples)
575
-
576
- ---
577
-
578
- ## **_Video Tutorials_**
579
-
580
- You can find all video tutorials on the website here: <https://particles.js.org/video.html>
581
-
582
- _More videos are coming soon! Check every day if there are some new contents._
583
-
584
- ---
585
-
586
- ### Characters as particles
587
-
588
- [![Particles chars demo](https://media.giphy.com/media/JsssOXz72bM6jGEZ0s/giphy.gif)](https://particles.js.org/samples/#chars)
589
-
590
- ---
591
-
592
- ### Polygon mask
593
-
594
- [![tsParticles Polygon Mask demo](https://media.giphy.com/media/lNRfiSgaMFbL4FMhW6/giphy.gif)](https://particles.js.org/samples/#polygonMask)
595
-
596
- ---
597
-
598
- ### Animated stars
599
-
600
- [![Particles NASA demo](https://media.giphy.com/media/cLqGsnh7FKRVMgPIWE/giphy.gif)](https://particles.js.org/samples/#nasa)
601
-
602
- ---
603
-
604
- ### Nyan cat flying on scrolling stars
605
-
606
- [![Particles Nyan Cat demo](https://media.giphy.com/media/LpX2oNc9ZMgIhIXQL9/giphy.gif)](https://particles.js.org/samples/#nyancat2)
607
-
608
- ---
609
-
610
- ### Snow particles
611
-
612
- [![tsParticles Snow demo](https://media.giphy.com/media/gihwUFbmiubbkdzEMX/giphy.gif)](https://particles.js.org/samples/#snow)
613
-
614
- ---
615
-
616
- ### Background Mask particles
617
-
618
- [![tsParticles Background Mask demo](https://media.giphy.com/media/dWraWgqInWFGWiOyRu/giphy.gif)](https://particles.js.org/samples/#background)
619
-
620
- ---
621
-
622
- **particles.json**
623
-
624
- You can find some config samples [here](https://github.com/tsparticles/website/tree/main/presets) 📖
625
-
626
- ---
627
-
628
- ## **_Options_**
629
-
630
- You can find all options
631
- available [here](https://particles.js.org/docs/interfaces/tsParticles_Engine.Options_Interfaces_IOptions.IOptions.html)
632
- 📖
633
-
634
- ## Want to see it in action and try it?
635
-
636
- I've created a tsParticles collection on [CodePen](https://codepen.io/collection/DPOage) 😮 or you can check out
637
- my [profile](https://codepen.io/matteobruni)
638
-
639
- Otherwise, there's the demo page link below.
640
-
641
- [![tsParticles demo](https://media.giphy.com/media/fsVN1ZHksgBIXNIbr1/giphy.gif)](https://particles.js.org/samples/)
642
-
643
- Want to see even more demos? Clone the repository on your computer and follow these instructions
644
-
645
- ```shell
646
- $ pnpm i
647
- $ pnpm run build
648
- $ cd demo/vanilla
649
- $ pnpm start
650
59
  ```
651
60
 
652
- **Boom! 💥** <http://localhost:3000> and you can check out other demos.
653
-
654
- _If you are brave enough_ you can switch to the `dev` branch for trying the features under development.
655
-
656
- ---
657
-
658
- ## Migrating from Particles.js
61
+ ## Features
659
62
 
660
- **tsParticles** has a package that makes this library 100% compatible with the _particles.js_ configuration.
63
+ - **Lightweight**: Core engine without unnecessary dependencies
64
+ - **Modular**: Load only the features you need (plugins, shapes, updaters)
65
+ - **Framework agnostic**: Works with vanilla JS, React, Vue, Angular, Svelte, and more
66
+ - **Browser ready**: CDN bundles available for immediate use
67
+ - **Highly customizable**: Rich configuration options for particle behavior
661
68
 
662
- [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/particles.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@tsparticles/particles.js) [![npmjs](https://badge.fury.io/js/@tsparticles/particles.js.svg)](https://www.npmjs.com/package/@tsparticles/particles.js) [![npm](https://img.shields.io/npm/dm/@tsparticles/particles.js)](https://www.npmjs.com/package/@tsparticles/particles.js)
69
+ ## Loading Additional Features
663
70
 
664
- Seriously, you just need to change the script from particles.js to the bundled compatibility package, et-voilà, **you're
665
- ready** 🧙!
71
+ To extend the engine with more capabilities, load additional packages:
666
72
 
667
- You can read more **[here](https://dev.to/matteobruni/migrating-from-particles-js-to-tsparticles-2a6m)**
668
-
669
- Want to know 5 reasons to do the
670
- switch? [Read here](https://dev.to/matteobruni/5-reasons-to-use-tsparticles-and-not-particles-js-1gbe)
671
-
672
- _Below you can find all the information you need to install tsParticles and its new syntax._
673
-
674
- ---
675
-
676
- ## Plugins/Customizations
677
-
678
- tsParticles now supports some customizations 🥳.
679
-
680
- **You can create your own plugins**
681
-
682
- _Read more [here](https://particles.js.org/docs/modules/Core_Interfaces_IPlugin.html)..._
683
-
684
- ---
685
-
686
- ## Dependency Graph
687
-
688
- ```mermaid
689
- flowchart TD
690
-
691
- subgraph core [Core]
692
- engine[tsParticles Engine]
693
- perlin-noise[Perlin Noise Lib]
694
- simplex-noise[Simplex Noise Lib]
695
- configs[tsParticles Configs]
696
- end
697
-
698
- subgraph bundle-basic [tsParticles Basic]
699
-
700
- subgraph basic-plugins [Plugins]
701
- plugin-move[Move]
702
-
703
- subgraph basic-plugins-colors [Colors]
704
- plugin-hex-color[Hex Color]
705
- plugin-hsl-color[HSL Color]
706
- plugin-rgb-color[RGB Color]
707
- end
708
- end
709
-
710
- subgraph basic-shapes [Shapes]
711
- shape-circle[Circle]
712
- end
713
-
714
- subgraph basic-updates [Updaters]
715
- updater-fill-color[Color]
716
- updater-opacity[Opacity]
717
- updater-out-modes[Out Modes]
718
- updater-size[Size]
719
- end
720
-
721
- end
722
-
723
- engine --> bundle-basic
724
-
725
- subgraph bundle-confetti [tsParticles Confetti]
726
-
727
- subgraph confetti-plugins [Plugins]
728
- plugin-emitters
729
- plugin-motion
730
- end
731
-
732
- subgraph confetti-shapes [Shapes]
733
- shape-cards
734
- shape-emoji
735
- shape-heart
736
- shape-image
737
- shape-polygon
738
- shape-square
739
- shape-star
740
- end
741
-
742
- subgraph confetti-updaters [Updaters]
743
- updater-life
744
- updater-roll
745
- updater-rotate
746
- updater-tilt
747
- updater-wobble
748
- end
749
-
750
- end
751
-
752
- bundle-basic --> bundle-confetti
753
-
754
- subgraph bundle-slim [tsParticles Slim]
755
-
756
- subgraph slim-interactions [Interactions]
757
-
758
- subgraph slim-interactions-external [Externals]
759
- interaction-external-attract[Attract]
760
- interaction-external-bounce[Bounce]
761
- interaction-external-bubble[Bubble]
762
- interaction-external-connect[Connect]
763
- interaction-external-grab[Grab]
764
- interaction-external-parallax[Parallax]
765
- interaction-external-pause[Pause]
766
- interaction-external-push[Push]
767
- interaction-external-remove[Remove]
768
- interaction-external-repulse[Repulse]
769
- interaction-external-slow[Slow]
770
- end
771
-
772
- subgraph slim-interactions-particles [Particles]
773
- interaction-particles-attract[Attract]
774
- interaction-particles-collisions[Collisions]
775
- interaction-particles-links[Links]
776
- end
777
-
778
- end
779
-
780
- subgraph slim-plugins [Plugins]
781
- plugin-interactivity[Interactivity]
782
-
783
- subgraph slim-plugins-easings [Easings]
784
- plugin-easing-quad[Quad]
785
- end
786
-
787
- end
788
-
789
- subgraph slim-shapes [Shapes]
790
- shape-emoji[Emoji]
791
- shape-image[Image]
792
- shape-line[Line]
793
- shape-polygon[Polygon]
794
- shape-square[Square]
795
- shape-star[Star]
796
- end
797
-
798
- subgraph slim-updaters [Updaters]
799
- updater-life[Life]
800
- updater-rotate[Rotate]
801
- updater-stroke-color[Stroke Color]
802
- end
803
-
804
- end
805
-
806
- bundle-basic --> bundle-slim
807
-
808
- subgraph bundle-fireworks [tsParticles Fireworks]
809
-
810
- subgraph fireworks-effects [Effects]
811
- effect-trail
812
- end
813
-
814
- subgraph fireworks-plugins [Plugins]
815
- plugin-emitters
816
-
817
- subgraph fireworks-plugin-emitters-shapes [Emitters Shapes]
818
- plugin-emitters-shape-square
819
- end
820
-
821
- plugin-sounds
822
- end
823
-
824
- subgraph fireworks-updaters [Updaters]
825
- updater-destroy
826
- updater-life
827
- updater-rotate
828
- end
829
-
830
- end
831
-
832
- bundle-basic --> bundle-fireworks
833
-
834
- subgraph bundle-full [tsParticles]
835
-
836
- subgraph full-interactions [Interactions]
837
-
838
- subgraph full-interactions-external [Externals]
839
- interaction-external-trail[Trail]
840
- end
841
-
842
- end
843
-
844
- subgraph full-plugins [Plugins]
845
- plugin-absorbers[Absorbers]
846
- plugin-emitters[Emitters]
847
-
848
- subgraph full-plugin-emitters-shapes [Emitters Shapes]
849
- plugin-emitters-shape-circle[Circle]
850
- plugin-emitters-shape-square[Square]
851
- end
852
-
853
- end
854
-
855
- subgraph full-shapes [Shapes]
856
- shape-text[Text]
857
- end
858
-
859
- subgraph full-updaters [Updaters]
860
- updater-destroy[Destroy]
861
- updater-roll[Roll]
862
- updater-tilt[Tilt]
863
- updater-twinkle[Twinkle]
864
- updater-wobble[Wobble]
865
- end
866
-
867
- end
868
-
869
- bundle-slim --> bundle-full
870
-
871
- subgraph bundle-all [tsParticles All]
872
-
873
- subgraph all-effects [Effects]
874
- effect-bubble[Bubble]
875
- effect-particles[Particles]
876
- effect-shadow[Shadow]
877
- effect-trail[Trail]
878
- end
879
-
880
- subgraph all-interactions [Interactions]
881
- subgraph all-interactions-external [External]
882
- interaction-external-particle[Particle]
883
- interaction-external-pop[Pop]
884
- end
885
-
886
- interaction-light[Light]
887
-
888
- subgraph all-interactions-particles [Particles]
889
- interaction-particles-repulse[Repulse]
890
- end
891
- end
892
-
893
- subgraph all-paths [Paths]
894
- path-branches[Branches]
895
- path-brownian[Brownian]
896
- path-curl-noise[Curl Noise]
897
- path-curves[Curves]
898
- path-fractal-noise[Fractal Noise]
899
- path-grid[Grid]
900
- path-levy[Levy]
901
- path-perlin-noise[Perlin Noise]
902
- path-polygon[Polygon]
903
- path-random[Random]
904
- path-simplex-noise[Simplex Noise]
905
- path-spiral[Spiral]
906
- path-svg[SVG]
907
- path-zig-zag[Zig Zag]
908
- end
909
-
910
- subgraph all-plugins [Plugins]
911
- plugin-background-mask[Background Mask]
912
- plugin-blend[Blend]
913
- plugin-canvas-mask[Canvas Mask]
914
-
915
- subgraph all-plugins-colors [Colors]
916
- plugin-hsv-color[HSV Color]
917
- plugin-hwb-color[HWB Color]
918
- plugin-lab-color[Lab Color]
919
- plugin-lch-color[Lch Color]
920
- plugin-named-color[Named Color]
921
- plugin-oklab-color[Oklab Color]
922
- plugin-oklch-color[Oklch Color]
923
- end
924
-
925
- subgraph all-plugins-easings [Easings]
926
- plugin-easing-back[Back]
927
- plugin-easing-bounce[Bounce]
928
- plugin-easing-circ[Circ]
929
- plugin-easing-cubic[Cubic]
930
- plugin-easing-elastic[Elastic]
931
- plugin-easing-expo[Expo]
932
- plugin-easing-gaussian[Gaussian]
933
- plugin-easing-linear[Linear]
934
- plugin-easing-quart[Quart]
935
- plugin-easing-quint[Quint]
936
- plugin-easing-sigmoid[Sigmoid]
937
- plugin-easing-sine[Sine]
938
- plugin-easing-smoothstep[Smoothstep]
939
- end
940
-
941
- subgraph all-plugin-emitters-shapes [Emitters Shapes]
942
- plugin-emitters-shape-canvas[Canvas]
943
- plugin-emitters-shape-path[Path]
944
- plugin-emitters-shape-polygon[Polygon]
945
- end
946
-
947
- subgraph all-plugins-exports [Exports]
948
- plugin-export-image[Image]
949
- plugin-export-json[JSON]
950
- plugin-export-video[Video]
951
- end
952
-
953
- plugin-infection[Infection]
954
- plugin-manual-particles[Manual Particles]
955
- plugin-motion[Motion]
956
- plugin-poisson-disc[Poisson Disc]
957
- plugin-polygon-mask[Polygon Mask]
958
- plugin-responsive[Responsive]
959
- plugin-sounds[Sounds]
960
- plugin-themes[Themes]
961
- plugin-trail[Trail]
962
- plugin-zoom[Zoom]
963
- end
964
-
965
- subgraph all-shapes [Shapes]
966
- shape-arrow[Arrow]
967
- shape-cards[Cards]
968
- shape-cog[Cog]
969
- shape-heart[Heart]
970
- shape-infinity[Infinity]
971
- shape-matrix[Matrix]
972
- shape-path[Path]
973
- shape-rounded-polygon[Rounded Polygon]
974
- shape-rounded-rect[Rounded Rect]
975
- shape-spiral[Spiral]
976
- shape-squircle[Squircle]
977
- end
978
-
979
- subgraph all-updaters [Updaters]
980
- updater-gradient[Gradient]
981
- updater-orbit[Orbit]
982
- end
983
-
984
- simplex-noise --> path-curl-noise
985
- perlin-noise --> path-perlin-noise
986
- simplex-noise --> path-simplex-noise
73
+ ```javascript
74
+ import { tsParticles } from "@tsparticles/engine";
75
+ import { loadSlim } from "@tsparticles/slim"; // or other bundles
987
76
 
988
- end
77
+ await loadSlim(tsParticles); // Load preset features
989
78
 
990
- bundle-full --> bundle-all
79
+ await tsParticles.load({
80
+ id: "tsparticles",
81
+ options: {
82
+ // Your configuration here
83
+ },
84
+ });
991
85
  ```
992
86
 
993
- ---
994
-
995
- <p>
996
- <a href="https://www.jetbrains.com/?from=tsParticles">
997
- <img src="https://raw.githubusercontent.com/tsparticles/tsparticles/gh-pages/images/jetbrains-logos/jetbrains-variant-4.png" height="150" alt="JetBrains" />
998
- </a>
999
- <a href="https://www.jetbrains.com/webstorm/?from=tsParticles">
1000
- <img src="https://raw.githubusercontent.com/tsparticles/tsparticles/gh-pages/images/jetbrains-logos/logo.png" height="150" alt="JetBrains" />
1001
- </a>
1002
- </p>
1003
-
1004
- ## Sponsors
87
+ ## Common pitfalls
1005
88
 
1006
- ### JetBrains
89
+ - Loading plugins after calling `tsParticles.load(...)` may not work as expected
90
+ - Ensure all required peer packages are loaded before using their features
91
+ - Some shapes or updaters need their specific packages to be loaded
1007
92
 
1008
- Huge thanks to [JetBrains](https://www.jetbrains.com/?from=tsParticles) for the 2020-2022 Open Source Licenses!
93
+ ## Related docs
1009
94
 
1010
- [JetBrains WebStorm](https://www.jetbrains.com/webstorm/?from=tsParticles) is used to maintain this project.
95
+ - Main documentation: <https://particles.js.org/docs/>
96
+ - Main repository: <https://github.com/tsparticles/tsparticles>
97
+ - Available bundles: <https://github.com/tsparticles/tsparticles#bundles>
98
+ - All options: <https://particles.js.org/docs/interfaces/tsParticles_Engine.Options_Interfaces_IOptions.IOptions.html>