@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.
- package/67.min.js +1 -0
- package/README.md +53 -965
- package/browser/Core/CanvasManager.js +303 -0
- package/browser/Core/Container.js +61 -34
- package/browser/Core/Engine.js +26 -138
- package/browser/Core/Particle.js +29 -28
- package/{cjs/Core/Particles.js → browser/Core/ParticlesManager.js} +27 -57
- package/browser/Core/RenderManager.js +303 -0
- package/browser/Core/Retina.js +3 -8
- package/browser/Core/Utils/PluginManager.js +145 -0
- package/browser/Options/Classes/Options.js +8 -21
- package/browser/Options/Classes/Particles/Paint.js +20 -0
- package/browser/Options/Classes/Particles/ParticlesOptions.js +65 -27
- package/browser/Options/Interfaces/Particles/IPaint.js +1 -0
- package/browser/Types/CanvasContextType.js +1 -0
- package/browser/Utils/CanvasUtils.js +4 -4
- package/browser/Utils/ColorUtils.js +21 -21
- package/browser/Utils/LogUtils.js +1 -0
- package/browser/Utils/OptionsUtils.js +2 -2
- package/browser/Utils/Utils.js +16 -10
- package/browser/exports.js +1 -0
- package/cjs/Core/CanvasManager.js +303 -0
- package/cjs/Core/Container.js +61 -34
- package/cjs/Core/Engine.js +26 -138
- package/cjs/Core/Particle.js +29 -28
- package/{esm/Core/Particles.js → cjs/Core/ParticlesManager.js} +27 -57
- package/cjs/Core/RenderManager.js +303 -0
- package/cjs/Core/Retina.js +3 -8
- package/cjs/Core/Utils/PluginManager.js +145 -0
- package/cjs/Options/Classes/Options.js +8 -21
- package/cjs/Options/Classes/Particles/Paint.js +20 -0
- package/cjs/Options/Classes/Particles/ParticlesOptions.js +65 -27
- package/cjs/Options/Interfaces/Particles/IPaint.js +1 -0
- package/cjs/Types/CanvasContextType.js +1 -0
- package/cjs/Utils/CanvasUtils.js +4 -4
- package/cjs/Utils/ColorUtils.js +21 -21
- package/cjs/Utils/LogUtils.js +1 -0
- package/cjs/Utils/OptionsUtils.js +2 -2
- package/cjs/Utils/Utils.js +16 -10
- package/cjs/exports.js +1 -0
- package/dist_browser_Core_Container_js.js +24 -14
- package/esm/Core/CanvasManager.js +303 -0
- package/esm/Core/Container.js +61 -34
- package/esm/Core/Engine.js +26 -138
- package/esm/Core/Particle.js +29 -28
- package/{browser/Core/Particles.js → esm/Core/ParticlesManager.js} +27 -57
- package/esm/Core/RenderManager.js +303 -0
- package/esm/Core/Retina.js +3 -8
- package/esm/Core/Utils/PluginManager.js +145 -0
- package/esm/Options/Classes/Options.js +8 -21
- package/esm/Options/Classes/Particles/Paint.js +20 -0
- package/esm/Options/Classes/Particles/ParticlesOptions.js +65 -27
- package/esm/Options/Interfaces/Particles/IPaint.js +1 -0
- package/esm/Types/CanvasContextType.js +1 -0
- package/esm/Utils/CanvasUtils.js +4 -4
- package/esm/Utils/ColorUtils.js +21 -21
- package/esm/Utils/LogUtils.js +1 -0
- package/esm/Utils/OptionsUtils.js +2 -2
- package/esm/Utils/Utils.js +16 -10
- package/esm/exports.js +1 -0
- package/package.json +2 -3
- package/report.html +84 -29
- package/tsparticles.engine.js +31 -11
- package/tsparticles.engine.min.js +2 -2
- package/types/Core/CanvasManager.d.ts +39 -0
- package/types/Core/Container.d.ts +26 -7
- package/types/Core/Engine.d.ts +2 -54
- package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -7
- package/types/Core/Interfaces/IDrawParticleParams.d.ts +2 -1
- package/types/Core/Interfaces/IPalette.d.ts +15 -2
- package/types/Core/Interfaces/IParticleRetinaProps.d.ts +4 -4
- package/types/Core/Interfaces/IParticleUpdater.d.ts +2 -1
- package/types/Core/Interfaces/IShapeDrawData.d.ts +2 -1
- package/types/Core/Particle.d.ts +4 -4
- package/types/Core/{Particles.d.ts → ParticlesManager.d.ts} +4 -11
- package/types/Core/{Canvas.d.ts → RenderManager.d.ts} +12 -33
- package/types/Core/Retina.d.ts +0 -2
- package/types/Core/Utils/PluginManager.d.ts +62 -0
- package/types/Options/Classes/Options.d.ts +3 -3
- package/types/Options/Classes/Particles/Paint.d.ts +10 -0
- package/types/Options/Classes/Particles/ParticlesOptions.d.ts +7 -7
- package/types/Options/Interfaces/Particles/IPaint.d.ts +6 -0
- package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +3 -4
- package/types/Types/CanvasContextType.d.ts +1 -0
- package/types/Utils/CanvasUtils.d.ts +8 -5
- package/types/Utils/ColorUtils.d.ts +8 -8
- package/types/Utils/LogUtils.d.ts +1 -0
- package/types/Utils/OptionsUtils.d.ts +2 -2
- package/types/export-types.d.ts +5 -2
- package/types/exports.d.ts +1 -0
- package/164.min.js +0 -1
- package/browser/Core/Canvas.js +0 -570
- package/cjs/Core/Canvas.js +0 -570
- package/esm/Core/Canvas.js +0 -570
- package/umd/Core/Canvas.js +0 -584
- package/umd/Core/Container.js +0 -356
- package/umd/Core/Engine.js +0 -295
- package/umd/Core/Interfaces/Colors.js +0 -12
- package/umd/Core/Interfaces/IBounds.js +0 -12
- package/umd/Core/Interfaces/IBubbleParticleData.js +0 -12
- package/umd/Core/Interfaces/ICircleBouncer.js +0 -12
- package/umd/Core/Interfaces/IColorManager.js +0 -12
- package/umd/Core/Interfaces/IContainerPlugin.js +0 -12
- package/umd/Core/Interfaces/ICoordinates.js +0 -12
- package/umd/Core/Interfaces/IDelta.js +0 -12
- package/umd/Core/Interfaces/IDimension.js +0 -12
- package/umd/Core/Interfaces/IDistance.js +0 -12
- package/umd/Core/Interfaces/IDrawParticleParams.js +0 -12
- package/umd/Core/Interfaces/IEffectDrawer.js +0 -12
- package/umd/Core/Interfaces/ILoadParams.js +0 -12
- package/umd/Core/Interfaces/IPalette.js +0 -12
- package/umd/Core/Interfaces/IParticleColorStyle.js +0 -12
- package/umd/Core/Interfaces/IParticleHslAnimation.js +0 -12
- package/umd/Core/Interfaces/IParticleLife.js +0 -12
- package/umd/Core/Interfaces/IParticleOpacityData.js +0 -12
- package/umd/Core/Interfaces/IParticleRetinaProps.js +0 -12
- package/umd/Core/Interfaces/IParticleRoll.js +0 -12
- package/umd/Core/Interfaces/IParticleRotateData.js +0 -12
- package/umd/Core/Interfaces/IParticleTransformValues.js +0 -12
- package/umd/Core/Interfaces/IParticleUpdater.js +0 -12
- package/umd/Core/Interfaces/IParticleValueAnimation.js +0 -12
- package/umd/Core/Interfaces/IPlugin.js +0 -12
- package/umd/Core/Interfaces/IPositionFromSizeParams.js +0 -12
- package/umd/Core/Interfaces/IRangeValue.js +0 -12
- package/umd/Core/Interfaces/IShapeDrawData.js +0 -12
- package/umd/Core/Interfaces/IShapeDrawer.js +0 -12
- package/umd/Core/Interfaces/IShapeValues.js +0 -12
- package/umd/Core/Interfaces/ISlowParticleData.js +0 -12
- package/umd/Core/Particle.js +0 -432
- package/umd/Core/Particles.js +0 -407
- package/umd/Core/Retina.js +0 -52
- package/umd/Core/Utils/Constants.js +0 -23
- package/umd/Core/Utils/EventListeners.js +0 -102
- package/umd/Core/Utils/Ranges.js +0 -91
- package/umd/Core/Utils/SpatialHashGrid.js +0 -116
- package/umd/Core/Utils/Vectors.js +0 -126
- package/umd/Enums/AnimationStatus.js +0 -18
- package/umd/Enums/Directions/MoveDirection.js +0 -27
- package/umd/Enums/Directions/OutModeDirection.js +0 -20
- package/umd/Enums/Directions/RotateDirection.js +0 -19
- package/umd/Enums/Modes/AnimationMode.js +0 -20
- package/umd/Enums/Modes/LimitMode.js +0 -18
- package/umd/Enums/Modes/OutMode.js +0 -21
- package/umd/Enums/Modes/PixelMode.js +0 -18
- package/umd/Enums/RangeType.js +0 -18
- package/umd/Enums/Types/AlterType.js +0 -18
- package/umd/Enums/Types/DestroyType.js +0 -19
- package/umd/Enums/Types/EasingType.js +0 -58
- package/umd/Enums/Types/EventType.js +0 -28
- package/umd/Enums/Types/GradientType.js +0 -19
- package/umd/Enums/Types/ParticleOutType.js +0 -19
- package/umd/Enums/Types/StartValueType.js +0 -19
- package/umd/Options/Classes/AnimatableColor.js +0 -52
- package/umd/Options/Classes/AnimationOptions.js +0 -79
- package/umd/Options/Classes/Background/Background.js +0 -56
- package/umd/Options/Classes/ColorAnimation.js +0 -44
- package/umd/Options/Classes/FullScreen/FullScreen.js +0 -34
- package/umd/Options/Classes/HslAnimation.js +0 -30
- package/umd/Options/Classes/Options.js +0 -171
- package/umd/Options/Classes/OptionsColor.js +0 -42
- package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +0 -31
- package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -21
- package/umd/Options/Classes/Particles/Effect/Effect.js +0 -46
- package/umd/Options/Classes/Particles/Fill.js +0 -42
- package/umd/Options/Classes/Particles/Move/Move.js +0 -120
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +0 -35
- package/umd/Options/Classes/Particles/Move/MoveCenter.js +0 -45
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +0 -45
- package/umd/Options/Classes/Particles/Move/OutModes.js +0 -38
- package/umd/Options/Classes/Particles/Move/Path/MovePath.js +0 -46
- package/umd/Options/Classes/Particles/Move/Spin.js +0 -40
- package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +0 -41
- package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +0 -37
- package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +0 -35
- package/umd/Options/Classes/Particles/Opacity/Opacity.js +0 -35
- package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -34
- package/umd/Options/Classes/Particles/ParticlesOptions.js +0 -116
- package/umd/Options/Classes/Particles/Shape/Shape.js +0 -46
- package/umd/Options/Classes/Particles/Size/Size.js +0 -35
- package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -34
- package/umd/Options/Classes/Particles/Stroke.js +0 -39
- package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +0 -42
- package/umd/Options/Classes/ResizeEvent.js +0 -34
- package/umd/Options/Classes/ValueWithRandom.js +0 -56
- package/umd/Options/Interfaces/Background/IBackground.js +0 -12
- package/umd/Options/Interfaces/FullScreen/IFullScreen.js +0 -12
- package/umd/Options/Interfaces/IAnimatable.js +0 -12
- package/umd/Options/Interfaces/IAnimatableColor.js +0 -12
- package/umd/Options/Interfaces/IAnimation.js +0 -12
- package/umd/Options/Interfaces/IColorAnimation.js +0 -12
- package/umd/Options/Interfaces/IHslAnimation.js +0 -12
- package/umd/Options/Interfaces/IOptionLoader.js +0 -12
- package/umd/Options/Interfaces/IOptions.js +0 -12
- package/umd/Options/Interfaces/IOptionsColor.js +0 -12
- package/umd/Options/Interfaces/IResizeEvent.js +0 -12
- package/umd/Options/Interfaces/IValueWithRandom.js +0 -12
- package/umd/Options/Interfaces/Particles/Bounce/IParticlesBounce.js +0 -12
- package/umd/Options/Interfaces/Particles/Effect/IEffect.js +0 -12
- package/umd/Options/Interfaces/Particles/IFill.js +0 -12
- package/umd/Options/Interfaces/Particles/IParticlesOptions.js +0 -12
- package/umd/Options/Interfaces/Particles/IStroke.js +0 -12
- package/umd/Options/Interfaces/Particles/Move/IMove.js +0 -12
- package/umd/Options/Interfaces/Particles/Move/IMoveAngle.js +0 -12
- package/umd/Options/Interfaces/Particles/Move/IMoveCenter.js +0 -12
- package/umd/Options/Interfaces/Particles/Move/IMoveGravity.js +0 -12
- package/umd/Options/Interfaces/Particles/Move/IOutModes.js +0 -12
- package/umd/Options/Interfaces/Particles/Move/ISpin.js +0 -12
- package/umd/Options/Interfaces/Particles/Move/Path/IMovePath.js +0 -12
- package/umd/Options/Interfaces/Particles/Number/IParticlesDensity.js +0 -12
- package/umd/Options/Interfaces/Particles/Number/IParticlesNumber.js +0 -12
- package/umd/Options/Interfaces/Particles/Number/IParticlesNumberLimit.js +0 -12
- package/umd/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -12
- package/umd/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -12
- package/umd/Options/Interfaces/Particles/Shape/IShape.js +0 -12
- package/umd/Options/Interfaces/Particles/Size/ISize.js +0 -12
- package/umd/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -12
- package/umd/Options/Interfaces/Particles/ZIndex/IZIndex.js +0 -12
- package/umd/Types/CustomEventArgs.js +0 -12
- package/umd/Types/CustomEventListener.js +0 -12
- package/umd/Types/EasingFunction.js +0 -12
- package/umd/Types/EngineInitializers.js +0 -12
- package/umd/Types/ExportResult.js +0 -12
- package/umd/Types/ISourceOptions.js +0 -12
- package/umd/Types/ParticlesGroups.js +0 -12
- package/umd/Types/PathOptions.js +0 -12
- package/umd/Types/RangeValue.js +0 -12
- package/umd/Types/RecursivePartial.js +0 -12
- package/umd/Types/ShapeData.js +0 -12
- package/umd/Types/SingleOrMultiple.js +0 -12
- package/umd/Utils/CanvasUtils.js +0 -145
- package/umd/Utils/ColorUtils.js +0 -395
- package/umd/Utils/EventDispatcher.js +0 -63
- package/umd/Utils/LogUtils.js +0 -36
- package/umd/Utils/MathUtils.js +0 -203
- package/umd/Utils/OptionsUtils.js +0 -25
- package/umd/Utils/TypeUtils.js +0 -40
- package/umd/Utils/Utils.js +0 -484
- package/umd/bundle.js +0 -32
- package/umd/export-types.js +0 -12
- package/umd/exports.js +0 -82
- package/umd/index.js +0 -32
- package/umd/initEngine.js +0 -17
package/README.md
CHANGED
|
@@ -1,1010 +1,98 @@
|
|
|
1
|
-
[](https://particles.js.org)
|
|
2
2
|
|
|
3
|
-
# tsParticles
|
|
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
|
-
[](https://github.com/sponsors/matteobruni)
|
|
9
|
-
[](https://www.jsdelivr.com/package/npm/tsparticles)
|
|
10
|
-
[](https://cdnjs.com/libraries/tsparticles)
|
|
11
|
-
[](https://www.npmjs.com/package/tsparticles)
|
|
12
|
-
[](https://www.npmjs.com/package/tsparticles)
|
|
13
|
-
[](https://lerna.js.org/)
|
|
14
|
-
[](https://www.codefactor.io/repository/github/tsparticles/tsparticles)
|
|
15
|
-
[](https://www.codacy.com/manual/ar3s/tsparticles?utm_source=github.com&utm_medium=referral&utm_content=tsparticles/tsparticles&utm_campaign=Badge_Grade)
|
|
16
|
-
[](https://openbase.com/js/tsparticles?utm_source=embedded&utm_medium=badge&utm_campaign=rating-badge&utm_term=js/tsparticles)
|
|
17
|
-
[](https://gitpod.io/#https://github.com/tsparticles/tsparticles)
|
|
18
|
-
[](https://repl.it/github/tsparticles/tsparticles)
|
|
19
|
-
|
|
20
|
-
[](https://discord.gg/hACwv45Hme)
|
|
21
|
-
[](https://t.me/tsparticles)
|
|
22
|
-
[](https://www.reddit.com/r/tsParticles/)
|
|
23
|
-
|
|
24
|
-
[](https://www.producthunt.com/posts/tsparticles?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-tsparticles")
|
|
25
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/confetti)
|
|
137
5
|
[](https://www.jsdelivr.com/package/npm/@tsparticles/engine)
|
|
138
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/slim)
|
|
141
|
-
[](https://www.jsdelivr.com/package/npm/tsparticles)
|
|
142
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/all)
|
|
143
|
-
|
|
144
|
-
#### cdnjs
|
|
6
|
+
[](https://www.npmjs.com/package/@tsparticles/engine)
|
|
7
|
+
[](https://www.npmjs.com/package/@tsparticles/engine) [](https://github.com/sponsors/matteobruni)
|
|
145
8
|
|
|
146
|
-
[
|
|
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
|
-
|
|
11
|
+
**This is the core engine package that all other features depend on.**
|
|
149
12
|
|
|
150
|
-
|
|
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
|
-
|
|
20
|
+
## How to use it
|
|
155
21
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
[](https://www.npmjs.com/package/@tsparticles/confetti) [](https://www.npmjs.com/package/@tsparticles/confetti)
|
|
159
|
-
|
|
160
|
-
_tsParticles Engine_
|
|
161
|
-
|
|
162
|
-
[](https://www.npmjs.com/package/@tsparticles/engine) [](https://www.npmjs.com/package/@tsparticles/engine)
|
|
163
|
-
|
|
164
|
-
_tsParticles Fireworks_
|
|
165
|
-
|
|
166
|
-
[](https://www.npmjs.com/package/@tsparticles/fireworks) [](https://www.npmjs.com/package/@tsparticles/fireworks)
|
|
167
|
-
|
|
168
|
-
_tsParticles Basic_
|
|
169
|
-
|
|
170
|
-
[](https://www.npmjs.com/package/@tsparticles/basic) [](https://www.npmjs.com/package/@tsparticles/basic)
|
|
171
|
-
|
|
172
|
-
_tsParticles Slim_
|
|
173
|
-
|
|
174
|
-
[](https://www.npmjs.com/package/@tsparticles/slim) [](https://www.npmjs.com/package/@tsparticles/slim)
|
|
175
|
-
|
|
176
|
-
_tsParticles_
|
|
177
|
-
|
|
178
|
-
[](https://www.npmjs.com/package/tsparticles) [](https://www.npmjs.com/package/tsparticles)
|
|
179
|
-
|
|
180
|
-
_tsParticles All_
|
|
181
|
-
|
|
182
|
-
[](https://www.npmjs.com/package/@tsparticles/all) [](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
|
-
|
|
28
|
+
or
|
|
189
29
|
|
|
190
30
|
```shell
|
|
191
31
|
yarn add @tsparticles/engine
|
|
192
32
|
```
|
|
193
33
|
|
|
194
|
-
|
|
34
|
+
or
|
|
195
35
|
|
|
196
36
|
```shell
|
|
197
37
|
pnpm install @tsparticles/engine
|
|
198
38
|
```
|
|
199
39
|
|
|
200
|
-
|
|
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
|
-
|
|
219
|
-
[](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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
[](https://www.npmjs.com/package/@tsparticles/angular) [](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
|
-
[](https://www.npmjs.com/package/astro-particles) [](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
|
-
[](https://www.npmjs.com/package/ember-tsparticles) [](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
|
-
[](https://www.npmjs.com/package/inferno-particles) [](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
|
-
[](https://www.npmjs.com/package/jquery-particles) [](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
|
-
[](https://www.npmjs.com/package/preact-particles) [](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
|
-
[](https://www.npmjs.com/package/@tsparticles/react) [](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
|
-
[](https://www.npmjs.com/package/riot-particles) [](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
|
-
[](https://www.npmjs.com/package/solid-particles) [](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
|
-
[](https://www.npmjs.com/package/@tsparticles/svelte) [](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
|
-
[](https://www.npmjs.com/package/@tsparticles/vue2) [](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
|
-
[](https://www.npmjs.com/package/@tsparticles/vue3) [](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
|
-
[](https://www.npmjs.com/package/web-particles) [](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
|
-
[](https://www.npmjs.com/package/@tsparticles/wordpress) [](https://www.npmjs.com/package/@tsparticles/wordpress) [](https://wordpress.org/plugins/tsparticles-block/) [](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-big-circles) [](https://www.npmjs.com/package/@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
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/tsparticles) [](https://www.npmjs.com/package/@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
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-confetti) [](https://www.npmjs.com/package/@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
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-fire) [](https://www.npmjs.com/package/@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
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-firefly) [](https://www.npmjs.com/package/@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
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-fireworks) [](https://www.npmjs.com/package/@tsparticles/preset-fireworks) [](https://www.npmjs.com/package/@tsparticles/preset-fireworks)
|
|
498
|
-
|
|
499
|
-
This preset loads a beautiful fireworks effect.
|
|
500
|
-
|
|
501
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-fountain) [](https://www.npmjs.com/package/@tsparticles/preset-fountain) [](https://www.npmjs.com/package/@tsparticles/preset-fountain)
|
|
508
|
-
|
|
509
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-links) [](https://www.npmjs.com/package/@tsparticles/preset-links) [](https://www.npmjs.com/package/@tsparticles/preset-links)
|
|
516
|
-
|
|
517
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-sea-anemone) [](https://www.npmjs.com/package/@tsparticles/preset-sea-anemone) [](https://www.npmjs.com/package/@tsparticles/preset-sea-anemone)
|
|
524
|
-
|
|
525
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-snow) [](https://www.npmjs.com/package/@tsparticles/preset-snow) [](https://www.npmjs.com/package/@tsparticles/preset-snow)
|
|
532
|
-
|
|
533
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-stars) [](https://www.npmjs.com/package/@tsparticles/preset-stars) [](https://www.npmjs.com/package/@tsparticles/preset-stars)
|
|
540
|
-
|
|
541
|
-
[](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
|
-
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-triangles) [](https://www.npmjs.com/package/@tsparticles/preset-triangles) [](https://www.npmjs.com/package/@tsparticles/preset-triangles)
|
|
548
|
-
|
|
549
|
-
[](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
|
-
[](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
|
-
[](https://particles.js.org/samples/#chars)
|
|
589
|
-
|
|
590
|
-
---
|
|
591
|
-
|
|
592
|
-
### Polygon mask
|
|
593
|
-
|
|
594
|
-
[](https://particles.js.org/samples/#polygonMask)
|
|
595
|
-
|
|
596
|
-
---
|
|
597
|
-
|
|
598
|
-
### Animated stars
|
|
599
|
-
|
|
600
|
-
[](https://particles.js.org/samples/#nasa)
|
|
601
|
-
|
|
602
|
-
---
|
|
603
|
-
|
|
604
|
-
### Nyan cat flying on scrolling stars
|
|
605
|
-
|
|
606
|
-
[](https://particles.js.org/samples/#nyancat2)
|
|
607
|
-
|
|
608
|
-
---
|
|
609
|
-
|
|
610
|
-
### Snow particles
|
|
611
|
-
|
|
612
|
-
[](https://particles.js.org/samples/#snow)
|
|
613
|
-
|
|
614
|
-
---
|
|
615
|
-
|
|
616
|
-
### Background Mask particles
|
|
617
|
-
|
|
618
|
-
[](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
|
-
[](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
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
69
|
+
## Loading Additional Features
|
|
663
70
|
|
|
664
|
-
|
|
665
|
-
ready** 🧙!
|
|
71
|
+
To extend the engine with more capabilities, load additional packages:
|
|
666
72
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
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
|
-
|
|
77
|
+
await loadSlim(tsParticles); // Load preset features
|
|
989
78
|
|
|
990
|
-
|
|
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
|
-
|
|
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
|
-
|
|
93
|
+
## Related docs
|
|
1009
94
|
|
|
1010
|
-
|
|
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>
|