@tsparticles/engine 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -163
- package/browser/Core/Canvas.js +19 -19
- package/browser/Core/Container.js +45 -34
- package/browser/Core/Engine.js +36 -20
- package/browser/Core/Particle.js +35 -36
- package/browser/Core/Particles.js +30 -24
- package/browser/Core/Retina.js +5 -4
- package/browser/Core/Utils/Circle.js +4 -3
- package/browser/Core/Utils/Constants.js +3 -0
- package/browser/Core/Utils/EventListeners.js +18 -15
- package/browser/Core/Utils/ExternalInteractorBase.js +1 -1
- package/browser/Core/Utils/InteractionManager.js +14 -6
- package/browser/Core/Utils/ParticlesInteractorBase.js +1 -1
- package/browser/Core/Utils/QuadTree.js +5 -3
- package/browser/Core/Utils/Vector.js +7 -2
- package/browser/Core/Utils/Vector3d.js +14 -9
- package/browser/Options/Classes/ManualParticle.js +3 -2
- package/browser/Options/Classes/Options.js +3 -0
- package/browser/Utils/CanvasUtils.js +36 -26
- package/browser/Utils/ColorUtils.js +124 -45
- package/browser/Utils/EventDispatcher.js +6 -5
- package/browser/Utils/HslColorManager.js +5 -5
- package/browser/Utils/NumberUtils.js +35 -23
- package/browser/Utils/RgbColorManager.js +5 -5
- package/browser/Utils/Utils.js +102 -19
- package/cjs/Core/Canvas.js +19 -19
- package/cjs/Core/Container.js +45 -34
- package/cjs/Core/Engine.js +36 -20
- package/cjs/Core/Particle.js +34 -35
- package/cjs/Core/Particles.js +30 -24
- package/cjs/Core/Retina.js +5 -4
- package/cjs/Core/Utils/Circle.js +4 -3
- package/cjs/Core/Utils/Constants.js +4 -1
- package/cjs/Core/Utils/EventListeners.js +17 -14
- package/cjs/Core/Utils/ExternalInteractorBase.js +1 -1
- package/cjs/Core/Utils/InteractionManager.js +14 -6
- package/cjs/Core/Utils/ParticlesInteractorBase.js +1 -1
- package/cjs/Core/Utils/QuadTree.js +5 -3
- package/cjs/Core/Utils/Vector.js +7 -2
- package/cjs/Core/Utils/Vector3d.js +14 -9
- package/cjs/Options/Classes/ManualParticle.js +3 -2
- package/cjs/Options/Classes/Options.js +3 -0
- package/cjs/Utils/CanvasUtils.js +36 -26
- package/cjs/Utils/ColorUtils.js +126 -45
- package/cjs/Utils/EventDispatcher.js +6 -5
- package/cjs/Utils/HslColorManager.js +5 -5
- package/cjs/Utils/NumberUtils.js +37 -24
- package/cjs/Utils/RgbColorManager.js +5 -5
- package/cjs/Utils/Utils.js +103 -19
- package/esm/Core/Canvas.js +19 -19
- package/esm/Core/Container.js +45 -34
- package/esm/Core/Engine.js +36 -20
- package/esm/Core/Particle.js +35 -36
- package/esm/Core/Particles.js +30 -24
- package/esm/Core/Retina.js +5 -4
- package/esm/Core/Utils/Circle.js +4 -3
- package/esm/Core/Utils/Constants.js +3 -0
- package/esm/Core/Utils/EventListeners.js +18 -15
- package/esm/Core/Utils/ExternalInteractorBase.js +1 -1
- package/esm/Core/Utils/InteractionManager.js +14 -6
- package/esm/Core/Utils/ParticlesInteractorBase.js +1 -1
- package/esm/Core/Utils/QuadTree.js +5 -3
- package/esm/Core/Utils/Vector.js +7 -2
- package/esm/Core/Utils/Vector3d.js +14 -9
- package/esm/Options/Classes/ManualParticle.js +3 -2
- package/esm/Options/Classes/Options.js +3 -0
- package/esm/Utils/CanvasUtils.js +36 -26
- package/esm/Utils/ColorUtils.js +124 -45
- package/esm/Utils/EventDispatcher.js +6 -5
- package/esm/Utils/HslColorManager.js +5 -5
- package/esm/Utils/NumberUtils.js +35 -23
- package/esm/Utils/RgbColorManager.js +5 -5
- package/esm/Utils/Utils.js +102 -19
- package/package.json +1 -1
- package/report.html +2 -2
- package/tsparticles.engine.js +693 -334
- package/tsparticles.engine.min.js +1 -1
- package/tsparticles.engine.min.js.LICENSE.txt +1 -1
- package/types/Core/Interfaces/IParticleHslAnimation.d.ts +4 -4
- package/types/Core/Interfaces/IParticleValueAnimation.d.ts +4 -0
- package/types/Core/Interfaces/IShapeDrawData.d.ts +2 -2
- package/types/Core/Utils/Constants.d.ts +3 -0
- package/types/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/types/Core/Utils/InteractionManager.d.ts +1 -1
- package/types/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/types/Core/Utils/Point.d.ts +1 -1
- package/types/Options/Classes/Options.d.ts +1 -0
- package/types/Options/Classes/Particles/Move/Move.d.ts +1 -2
- package/types/Options/Classes/Particles/Move/OutModes.d.ts +1 -2
- package/types/Options/Interfaces/IOptions.d.ts +1 -0
- package/types/Options/Interfaces/Interactivity/Modes/IModes.d.ts +1 -3
- package/types/Types/CustomEventArgs.d.ts +2 -2
- package/types/Types/ExportResult.d.ts +2 -2
- package/types/Types/ParticlesGroups.d.ts +1 -3
- package/types/Types/PathOptions.d.ts +1 -3
- package/types/Types/ShapeData.d.ts +1 -3
- package/types/Utils/CanvasUtils.d.ts +3 -2
- package/types/Utils/ColorUtils.d.ts +5 -0
- package/types/Utils/NumberUtils.d.ts +2 -2
- package/types/Utils/Utils.d.ts +9 -6
- package/umd/Core/Canvas.js +19 -19
- package/umd/Core/Container.js +46 -35
- package/umd/Core/Engine.js +36 -20
- package/umd/Core/Particle.js +35 -36
- package/umd/Core/Particles.js +30 -24
- package/umd/Core/Retina.js +5 -4
- package/umd/Core/Utils/Circle.js +4 -3
- package/umd/Core/Utils/Constants.js +4 -1
- package/umd/Core/Utils/EventListeners.js +17 -14
- package/umd/Core/Utils/ExternalInteractorBase.js +1 -1
- package/umd/Core/Utils/InteractionManager.js +14 -6
- package/umd/Core/Utils/ParticlesInteractorBase.js +1 -1
- package/umd/Core/Utils/QuadTree.js +5 -3
- package/umd/Core/Utils/Vector.js +7 -2
- package/umd/Core/Utils/Vector3d.js +14 -9
- package/umd/Options/Classes/ManualParticle.js +3 -2
- package/umd/Options/Classes/Options.js +3 -0
- package/umd/Utils/CanvasUtils.js +36 -26
- package/umd/Utils/ColorUtils.js +127 -46
- package/umd/Utils/EventDispatcher.js +6 -5
- package/umd/Utils/HslColorManager.js +5 -5
- package/umd/Utils/NumberUtils.js +38 -25
- package/umd/Utils/RgbColorManager.js +5 -5
- package/umd/Utils/Utils.js +104 -20
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.j
|
|
|
45
45
|
- [**_Usage_**](#usage)
|
|
46
46
|
- [Official components for some of the most used frameworks](#official-components-for-some-of-the-most-used-frameworks)
|
|
47
47
|
- [Angular](#angular)
|
|
48
|
-
- [`
|
|
48
|
+
- [`@tsparticles/angular`](#@tsparticles/angular)
|
|
49
49
|
- [Astro](#astro)
|
|
50
50
|
- [`astro-particles`](#astro-particles)
|
|
51
51
|
- [Ember.js](#emberjs)
|
|
@@ -57,21 +57,21 @@ React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.j
|
|
|
57
57
|
- [Preact](#preact)
|
|
58
58
|
- [`preact-particles`](#preact-particles)
|
|
59
59
|
- [ReactJS](#reactjs)
|
|
60
|
-
- [
|
|
60
|
+
- [`@tsparticles/react`](#tsparticlesreact)
|
|
61
61
|
- [RiotJS](#riotjs)
|
|
62
62
|
- [`riot-particles`](#riot-particles)
|
|
63
63
|
- [SolidJS](#solidjs)
|
|
64
64
|
- [`solid-particles`](#solid-particles)
|
|
65
65
|
- [Svelte](#svelte)
|
|
66
|
-
- [
|
|
66
|
+
- [`@tsparticles/svelte`](#@tsparticles/svelte)
|
|
67
67
|
- [VueJS 2.x](#vuejs-2x)
|
|
68
|
-
- [
|
|
68
|
+
- [`@tsparticles/vue2`](#tsparticlesvue2)
|
|
69
69
|
- [VueJS 3.x](#vuejs-3x)
|
|
70
|
-
- [
|
|
70
|
+
- [`@tsparticles/vue3`](#tsparticlesvue3)
|
|
71
71
|
- [Web Components](#web-components)
|
|
72
72
|
- [`web-particles`](#web-particles)
|
|
73
73
|
- [WordPress](#wordpress)
|
|
74
|
-
- [
|
|
74
|
+
- [`@tsparticles/wordpress`](#@tsparticles/wordpress)
|
|
75
75
|
- [Elementor](#elementor)
|
|
76
76
|
- [Presets](#presets)
|
|
77
77
|
- [Big Circles](#big-circles)
|
|
@@ -312,9 +312,9 @@ particles.pause();
|
|
|
312
312
|
|
|
313
313
|
### Angular
|
|
314
314
|
|
|
315
|
-
#### `
|
|
315
|
+
#### `@tsparticles/angular`
|
|
316
316
|
|
|
317
|
-
[](https://www.npmjs.com/package/@tsparticles/angular) [](https://www.npmjs.com/package/@tsparticles/angular)
|
|
318
318
|
|
|
319
319
|
Instructions available [here](https://github.com/tsparticles/angular/#readme)
|
|
320
320
|
|
|
@@ -360,9 +360,9 @@ Instructions available [here](https://github.com/tsparticles/preact/#readme)
|
|
|
360
360
|
|
|
361
361
|
### ReactJS
|
|
362
362
|
|
|
363
|
-
####
|
|
363
|
+
#### `@tsparticles/react`
|
|
364
364
|
|
|
365
|
-
[](https://www.npmjs.com/package/@tsparticles/react) [](https://www.npmjs.com/package/@tsparticles/react)
|
|
366
366
|
|
|
367
367
|
Instructions available [here](https://github.com/tsparticles/react/#readme)
|
|
368
368
|
|
|
@@ -384,25 +384,25 @@ You can find the instructions [here](https://github.com/tsparticles/solid/#readm
|
|
|
384
384
|
|
|
385
385
|
### Svelte
|
|
386
386
|
|
|
387
|
-
####
|
|
387
|
+
#### `@tsparticles/svelte`
|
|
388
388
|
|
|
389
|
-
[](https://www.npmjs.com/package/@tsparticles/svelte) [](https://www.npmjs.com/package/@tsparticles/svelte)
|
|
390
390
|
|
|
391
391
|
Instructions available [here](https://github.com/tsparticles/svelte/#readme)
|
|
392
392
|
|
|
393
393
|
### VueJS 2.x
|
|
394
394
|
|
|
395
|
-
####
|
|
395
|
+
#### `@tsparticles/vue2`
|
|
396
396
|
|
|
397
|
-
[](https://www.npmjs.com/package/@tsparticles/vue2) [](https://www.npmjs.com/package/@tsparticles/vue2)
|
|
398
398
|
|
|
399
399
|
Instructions available [here](https://github.com/tsparticles/vue2/#readme)
|
|
400
400
|
|
|
401
401
|
### VueJS 3.x
|
|
402
402
|
|
|
403
|
-
####
|
|
403
|
+
#### `@tsparticles/vue3`
|
|
404
404
|
|
|
405
|
-
[](https://www.npmjs.com/package/@tsparticles/vue3) [](https://www.npmjs.com/package/@tsparticles/vue3)
|
|
406
406
|
|
|
407
407
|
Instruction available [here](https://github.com/tsparticles/vue3/#readme)
|
|
408
408
|
|
|
@@ -416,9 +416,9 @@ You can find the instructions [here](https://github.com/tsparticles/webcomponent
|
|
|
416
416
|
|
|
417
417
|
### WordPress
|
|
418
418
|
|
|
419
|
-
####
|
|
419
|
+
#### `@tsparticles/wordpress`
|
|
420
420
|
|
|
421
|
-
[](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/)
|
|
422
422
|
|
|
423
423
|
The plugin page hosted on WordPress.org can be
|
|
424
424
|
found [here](https://wordpress.org/plugins/tsparticles-block/#description)
|
|
@@ -688,151 +688,271 @@ _Read more [here](https://particles.js.org/docs/modules/Core_Interfaces_IPlugin.
|
|
|
688
688
|
## Dependency Graph
|
|
689
689
|
|
|
690
690
|
```mermaid
|
|
691
|
-
flowchart
|
|
692
|
-
|
|
693
|
-
subgraph
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
subgraph
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
end
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
691
|
+
flowchart TD
|
|
692
|
+
|
|
693
|
+
subgraph core [Core]
|
|
694
|
+
engine[tsParticles Engine]
|
|
695
|
+
perlin-noise[Perlin Noise Lib]
|
|
696
|
+
simplex-noise[Simplex Noise Lib]
|
|
697
|
+
configs[tsParticles Configs]
|
|
698
|
+
end
|
|
699
|
+
|
|
700
|
+
subgraph bundle-basic [tsParticles Basic]
|
|
701
|
+
|
|
702
|
+
subgraph basic-movers [Movers]
|
|
703
|
+
move-base[Base]
|
|
704
|
+
end
|
|
705
|
+
|
|
706
|
+
subgraph basic-shapes [Shapes]
|
|
707
|
+
shape-circle[Circle]
|
|
708
|
+
end
|
|
709
|
+
|
|
710
|
+
subgraph basic-updates [Updaters]
|
|
711
|
+
updater-color[Color]
|
|
712
|
+
updater-opacity[Opacity]
|
|
713
|
+
updater-out-modes[Out Modes]
|
|
714
|
+
updater-size[Size]
|
|
715
|
+
end
|
|
716
|
+
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
engine --> bundle-basic
|
|
720
|
+
|
|
721
|
+
subgraph bundle-confetti [tsParticles Confetti]
|
|
722
|
+
|
|
723
|
+
subgraph confetti-plugins [Plugins]
|
|
724
|
+
plugin-emitters
|
|
725
|
+
plugin-motion
|
|
726
|
+
end
|
|
727
|
+
|
|
728
|
+
subgraph confetti-shapes [Shapes]
|
|
729
|
+
shape-cards
|
|
730
|
+
shape-emoji
|
|
731
|
+
shape-heart
|
|
732
|
+
shape-image
|
|
733
|
+
shape-polygon
|
|
734
|
+
shape-square
|
|
735
|
+
shape-star
|
|
736
|
+
end
|
|
737
|
+
|
|
738
|
+
subgraph confetti-updaters [Updaters]
|
|
739
|
+
updater-life
|
|
740
|
+
updater-roll
|
|
741
|
+
updater-rotate
|
|
742
|
+
updater-tilt
|
|
743
|
+
updater-wobble
|
|
744
|
+
end
|
|
745
|
+
|
|
746
|
+
end
|
|
747
|
+
|
|
748
|
+
bundle-basic --> bundle-confetti
|
|
749
|
+
|
|
750
|
+
subgraph bundle-slim [tsParticles Slim]
|
|
751
|
+
|
|
752
|
+
subgraph slim-interactions [Interactions]
|
|
753
|
+
|
|
754
|
+
subgraph slim-interactions-external [Externals]
|
|
755
|
+
interaction-external-attract[Attract]
|
|
756
|
+
interaction-external-bounce[Bounce]
|
|
757
|
+
interaction-external-bubble[Bubble]
|
|
758
|
+
interaction-external-connect[Connect]
|
|
759
|
+
interaction-external-grab[Grab]
|
|
760
|
+
interaction-external-pause[Pause]
|
|
761
|
+
interaction-external-push[Push]
|
|
762
|
+
interaction-external-remove[Remove]
|
|
763
|
+
interaction-external-repulse[Repulse]
|
|
764
|
+
interaction-external-slow[Slow]
|
|
765
|
+
end
|
|
766
|
+
|
|
767
|
+
subgraph slim-interactions-particles [Particles]
|
|
768
|
+
interaction-particles-attract[Attract]
|
|
769
|
+
interaction-particles-collisions[Collisions]
|
|
770
|
+
interaction-particles-links[Links]
|
|
771
|
+
end
|
|
772
|
+
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
subgraph slim-movers [Movers]
|
|
776
|
+
move-parallax[Parallax]
|
|
777
|
+
end
|
|
778
|
+
|
|
779
|
+
subgraph slim-plugins [Plugins]
|
|
780
|
+
|
|
781
|
+
subgraph slim-plugins-easings [Easings]
|
|
782
|
+
plugin-easing-quad[Quad]
|
|
783
|
+
end
|
|
784
|
+
|
|
785
|
+
end
|
|
786
|
+
|
|
787
|
+
subgraph slim-shapes [Shapes]
|
|
788
|
+
shape-emoji[Emoji]
|
|
789
|
+
shape-image[Image]
|
|
790
|
+
shape-line[Line]
|
|
791
|
+
shape-polygon[Polygon]
|
|
792
|
+
shape-square[Square]
|
|
793
|
+
shape-star[Star]
|
|
794
|
+
end
|
|
795
|
+
|
|
796
|
+
subgraph slim-updaters [Updaters]
|
|
797
|
+
updater-life[Life]
|
|
798
|
+
updater-rotate[Rotate]
|
|
799
|
+
updater-stroke-color[Stroke Color]
|
|
800
|
+
end
|
|
801
|
+
|
|
802
|
+
end
|
|
803
|
+
|
|
804
|
+
bundle-basic --> bundle-slim
|
|
805
|
+
|
|
806
|
+
subgraph bundle-fireworks [tsParticles Fireworks]
|
|
807
|
+
|
|
808
|
+
subgraph fireworks-effects [Effects]
|
|
809
|
+
effect-trail
|
|
810
|
+
end
|
|
811
|
+
|
|
812
|
+
subgraph fireworks-plugins [Plugins]
|
|
813
|
+
plugin-emitters
|
|
814
|
+
|
|
815
|
+
subgraph fireworks-plugin-emitters-shapes [Emitters Shapes]
|
|
816
|
+
plugin-emitters-shape-square
|
|
817
|
+
end
|
|
818
|
+
|
|
819
|
+
plugin-sounds
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
subgraph fireworks-updaters [Updaters]
|
|
823
|
+
updater-destroy
|
|
824
|
+
updater-life
|
|
825
|
+
updater-rotate
|
|
826
|
+
end
|
|
827
|
+
|
|
828
|
+
end
|
|
829
|
+
|
|
830
|
+
bundle-basic --> bundle-fireworks
|
|
831
|
+
|
|
832
|
+
subgraph bundle-full [tsParticles]
|
|
833
|
+
|
|
834
|
+
subgraph full-interactions [Interactions]
|
|
835
|
+
|
|
836
|
+
subgraph full-interactions-external [Externals]
|
|
837
|
+
interaction-external-trail[Trail]
|
|
838
|
+
end
|
|
839
|
+
|
|
840
|
+
end
|
|
841
|
+
|
|
842
|
+
subgraph full-plugins [Plugins]
|
|
843
|
+
plugin-absorbers[Absorbers]
|
|
844
|
+
plugin-emitters[Emitters]
|
|
845
|
+
|
|
846
|
+
subgraph full-plugin-emitters-shapes [Emitters Shapes]
|
|
847
|
+
plugin-emitters-shape-circle[Circle]
|
|
848
|
+
plugin-emitters-shape-square[Square]
|
|
849
|
+
end
|
|
850
|
+
|
|
851
|
+
end
|
|
852
|
+
|
|
853
|
+
subgraph full-shapes [Shapes]
|
|
854
|
+
shape-text[Text]
|
|
855
|
+
end
|
|
856
|
+
|
|
857
|
+
subgraph full-updaters [Updaters]
|
|
858
|
+
updater-destroy[Destroy]
|
|
859
|
+
updater-roll[Roll]
|
|
860
|
+
updater-tilt[Tilt]
|
|
861
|
+
updater-twinkle[Twinkle]
|
|
862
|
+
updater-wobble[Wobble]
|
|
863
|
+
end
|
|
864
|
+
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
bundle-slim --> bundle-full
|
|
868
|
+
|
|
869
|
+
subgraph bundle-all [tsParticles All]
|
|
870
|
+
|
|
871
|
+
bundle-pjs[tsParticles Particles.js Compatibility]
|
|
872
|
+
|
|
873
|
+
subgraph all-effects [Effects]
|
|
874
|
+
effect-bubble[Bubble]
|
|
875
|
+
effect-trail[Trail]
|
|
876
|
+
end
|
|
877
|
+
|
|
878
|
+
subgraph all-interactions [Interactions]
|
|
879
|
+
subgraph all-interactions-external [External]
|
|
880
|
+
interaction-external-pop[Pop]
|
|
881
|
+
end
|
|
882
|
+
|
|
883
|
+
interaction-light[Light]
|
|
884
|
+
|
|
885
|
+
subgraph all-interactions-particles [Particles]
|
|
886
|
+
interaction-particles-repulse[Repulse]
|
|
887
|
+
end
|
|
888
|
+
end
|
|
889
|
+
|
|
890
|
+
subgraph all-paths [Paths]
|
|
891
|
+
path-curl-noise[Curl Noise]
|
|
892
|
+
path-curves[Curves]
|
|
893
|
+
path-perlin-noise[Perlin Noise]
|
|
894
|
+
path-polygon[Polygon]
|
|
895
|
+
path-simplex-noise[Simplex Noise]
|
|
896
|
+
path-svg[SVG]
|
|
897
|
+
end
|
|
898
|
+
|
|
899
|
+
subgraph all-plugins [Plugins]
|
|
900
|
+
plugin-canvas-mask[Canvas Mask]
|
|
901
|
+
|
|
902
|
+
subgraph all-plugins-easings [Easings]
|
|
903
|
+
plugin-easing-back[Back]
|
|
904
|
+
plugin-easing-circ[Circ]
|
|
905
|
+
plugin-easing-cubic[Cubic]
|
|
906
|
+
plugin-easing-expo[Expo]
|
|
907
|
+
plugin-easing-linear[Linear]
|
|
908
|
+
plugin-easing-quart[Quart]
|
|
909
|
+
plugin-easing-quint[Quint]
|
|
910
|
+
plugin-easing-sine[Sine]
|
|
911
|
+
end
|
|
912
|
+
|
|
913
|
+
subgraph all-plugin-emitters-shapes [Emitters Shapes]
|
|
914
|
+
plugin-emitters-shape-canvas[Canvas]
|
|
915
|
+
plugin-emitters-shape-path[Path]
|
|
916
|
+
plugin-emitters-shape-polygon[Polygon]
|
|
917
|
+
end
|
|
918
|
+
|
|
919
|
+
subgraph all-plugins-exports [Exports]
|
|
920
|
+
plugin-export-image[Image]
|
|
921
|
+
plugin-export-json[JSON]
|
|
922
|
+
plugin-export-video[Video]
|
|
923
|
+
end
|
|
924
|
+
|
|
925
|
+
plugin-hsv-color[HSV Color]
|
|
926
|
+
plugin-infection[Infection]
|
|
927
|
+
plugin-motion[Motion]
|
|
928
|
+
plugin-poisson-disc[Poisson Disc]
|
|
929
|
+
plugin-polygon-mask[Polygon Mask]
|
|
930
|
+
plugin-sounds[Sounds]
|
|
931
|
+
end
|
|
932
|
+
|
|
933
|
+
subgraph all-shapes [Shapes]
|
|
934
|
+
shape-arrow[Arrow]
|
|
935
|
+
shape-cards[Cards]
|
|
936
|
+
shape-cog[Cog]
|
|
937
|
+
shape-heart[Heart]
|
|
938
|
+
shape-path[Path]
|
|
939
|
+
shape-rounded-polygon[Rounded Polygon]
|
|
940
|
+
shape-rounded-rect[Rounded Rect]
|
|
941
|
+
shape-spiral[Spiral]
|
|
942
|
+
end
|
|
943
|
+
|
|
944
|
+
subgraph all-updaters [Updaters]
|
|
945
|
+
updater-gradient[Gradient]
|
|
946
|
+
updater-orbit[Orbit]
|
|
947
|
+
end
|
|
948
|
+
|
|
949
|
+
simplex-noise --> path-curl-noise
|
|
950
|
+
perlin-noise --> path-perlin-noise
|
|
951
|
+
simplex-noise --> path-simplex-noise
|
|
952
|
+
|
|
953
|
+
end
|
|
954
|
+
|
|
955
|
+
bundle-full --> bundle-all
|
|
836
956
|
```
|
|
837
957
|
|
|
838
958
|
---
|
package/browser/Core/Canvas.js
CHANGED
|
@@ -3,9 +3,9 @@ import { deepExtend, getLogger, safeMutationObserver } from "../Utils/Utils.js";
|
|
|
3
3
|
import { getStyleFromHsl, getStyleFromRgb, rangeColorToHsl, rangeColorToRgb } from "../Utils/ColorUtils.js";
|
|
4
4
|
import { generatedAttribute } from "./Utils/Constants.js";
|
|
5
5
|
function setTransformValue(factor, newFactor, key) {
|
|
6
|
-
const newValue = newFactor[key];
|
|
6
|
+
const newValue = newFactor[key], defaultValue = 1;
|
|
7
7
|
if (newValue !== undefined) {
|
|
8
|
-
factor[key] = (factor[key] ??
|
|
8
|
+
factor[key] = (factor[key] ?? defaultValue) * newValue;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export class Canvas {
|
|
@@ -13,7 +13,7 @@ export class Canvas {
|
|
|
13
13
|
this.container = container;
|
|
14
14
|
this._applyPostDrawUpdaters = (particle) => {
|
|
15
15
|
for (const updater of this._postDrawUpdaters) {
|
|
16
|
-
updater.afterDraw
|
|
16
|
+
updater.afterDraw?.(particle);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
this._applyPreDrawUpdaters = (ctx, particle, radius, zOpacity, colorStyles, transform) => {
|
|
@@ -33,12 +33,12 @@ export class Canvas {
|
|
|
33
33
|
setTransformValue(transform, updaterTransform, key);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
updater.beforeDraw
|
|
36
|
+
updater.beforeDraw?.(particle);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
this._applyResizePlugins = () => {
|
|
40
40
|
for (const plugin of this._resizePlugins) {
|
|
41
|
-
plugin.resize
|
|
41
|
+
plugin.resize?.();
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
this._getPluginParticleColors = (particle) => {
|
|
@@ -94,17 +94,17 @@ export class Canvas {
|
|
|
94
94
|
if (!trail.enable) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
+
const factorNumerator = 1, opacity = factorNumerator / trail.length;
|
|
97
98
|
if (trailFill.color) {
|
|
98
99
|
const fillColor = rangeColorToRgb(trailFill.color);
|
|
99
100
|
if (!fillColor) {
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
|
-
const trail = options.particles.move.trail;
|
|
103
103
|
this._trailFill = {
|
|
104
104
|
color: {
|
|
105
105
|
...fillColor,
|
|
106
106
|
},
|
|
107
|
-
opacity
|
|
107
|
+
opacity,
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
else {
|
|
@@ -116,7 +116,7 @@ export class Canvas {
|
|
|
116
116
|
img.addEventListener("load", () => {
|
|
117
117
|
this._trailFill = {
|
|
118
118
|
image: img,
|
|
119
|
-
opacity
|
|
119
|
+
opacity,
|
|
120
120
|
};
|
|
121
121
|
resolve();
|
|
122
122
|
});
|
|
@@ -167,9 +167,9 @@ export class Canvas {
|
|
|
167
167
|
if (!element) {
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const priority = "important", style = element.style;
|
|
170
|
+
const priority = "important", style = element.style, radix = 10;
|
|
171
171
|
style.setProperty("position", "fixed", priority);
|
|
172
|
-
style.setProperty("z-index", this.container.actualOptions.fullScreen.zIndex.toString(
|
|
172
|
+
style.setProperty("z-index", this.container.actualOptions.fullScreen.zIndex.toString(radix), priority);
|
|
173
173
|
style.setProperty("top", "0", priority);
|
|
174
174
|
style.setProperty("left", "0", priority);
|
|
175
175
|
style.setProperty("width", "100%", priority);
|
|
@@ -190,11 +190,11 @@ export class Canvas {
|
|
|
190
190
|
return this.container.actualOptions.fullScreen.enable;
|
|
191
191
|
}
|
|
192
192
|
clear() {
|
|
193
|
-
const options = this.container.actualOptions, trail = options.particles.move.trail, trailFill = this._trailFill;
|
|
193
|
+
const options = this.container.actualOptions, trail = options.particles.move.trail, trailFill = this._trailFill, minimumLength = 0;
|
|
194
194
|
if (options.backgroundMask.enable) {
|
|
195
195
|
this.paint();
|
|
196
196
|
}
|
|
197
|
-
else if (trail.enable && trail.length >
|
|
197
|
+
else if (trail.enable && trail.length > minimumLength && trailFill) {
|
|
198
198
|
if (trailFill.color) {
|
|
199
199
|
this._paintBase(getStyleFromRgb(trailFill.color, trailFill.opacity));
|
|
200
200
|
}
|
|
@@ -212,7 +212,7 @@ export class Canvas {
|
|
|
212
212
|
this.stop();
|
|
213
213
|
if (this._generated) {
|
|
214
214
|
const element = this.element;
|
|
215
|
-
element
|
|
215
|
+
element?.remove();
|
|
216
216
|
}
|
|
217
217
|
else {
|
|
218
218
|
this._resetOriginalStyle();
|
|
@@ -233,8 +233,8 @@ export class Canvas {
|
|
|
233
233
|
if (particle.spawning || particle.destroyed) {
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
const radius = particle.getRadius();
|
|
237
|
-
if (radius <=
|
|
236
|
+
const radius = particle.getRadius(), minimumSize = 0;
|
|
237
|
+
if (radius <= minimumSize) {
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
const pfColor = particle.getFillColor(), psColor = particle.getStrokeColor() ?? pfColor;
|
|
@@ -249,7 +249,7 @@ export class Canvas {
|
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
this.draw((ctx) => {
|
|
252
|
-
const container = this.container, options = container.actualOptions, zIndexOptions = particle.options.zIndex,
|
|
252
|
+
const container = this.container, options = container.actualOptions, zIndexOptions = particle.options.zIndex, zIndexFactorOffset = 1, zIndexFactor = zIndexFactorOffset - particle.zIndexFactor, zOpacityFactor = zIndexFactor ** zIndexOptions.opacityRate, defaultOpacity = 1, opacity = particle.bubble.opacity ?? particle.opacity?.value ?? defaultOpacity, strokeOpacity = particle.strokeOpacity ?? opacity, zOpacity = opacity * zOpacityFactor, zStrokeOpacity = strokeOpacity * zOpacityFactor, transform = {}, colorStyles = {
|
|
253
253
|
fill: fColor ? getStyleFromHsl(fColor, zOpacity) : undefined,
|
|
254
254
|
};
|
|
255
255
|
colorStyles.stroke = sColor ? getStyleFromHsl(sColor, zStrokeOpacity) : colorStyles.fill;
|
|
@@ -262,7 +262,7 @@ export class Canvas {
|
|
|
262
262
|
colorStyles,
|
|
263
263
|
backgroundMask: options.backgroundMask.enable,
|
|
264
264
|
composite: options.backgroundMask.composite,
|
|
265
|
-
radius: radius *
|
|
265
|
+
radius: radius * zIndexFactor ** zIndexOptions.sizeRate,
|
|
266
266
|
opacity: zOpacity,
|
|
267
267
|
shadow: particle.options.shadow,
|
|
268
268
|
transform,
|
|
@@ -332,7 +332,7 @@ export class Canvas {
|
|
|
332
332
|
if (plugin.resize) {
|
|
333
333
|
this._resizePlugins.push(plugin);
|
|
334
334
|
}
|
|
335
|
-
if (plugin.particleFillColor
|
|
335
|
+
if (plugin.particleFillColor ?? plugin.particleStrokeColor) {
|
|
336
336
|
this._colorPlugins.push(plugin);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
@@ -344,7 +344,7 @@ export class Canvas {
|
|
|
344
344
|
if (updater.afterDraw) {
|
|
345
345
|
this._postDrawUpdaters.push(updater);
|
|
346
346
|
}
|
|
347
|
-
if (updater.getColorStyles
|
|
347
|
+
if (updater.getColorStyles ?? updater.getTransformValues ?? updater.beforeDraw) {
|
|
348
348
|
this._preDrawUpdaters.push(updater);
|
|
349
349
|
}
|
|
350
350
|
}
|