tsparticles 1.35.2 → 1.37.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/Core/Canvas.js +4 -6
- package/Core/Container.d.ts +4 -2
- package/Core/Container.js +21 -12
- package/Core/Loader.d.ts +19 -4
- package/Core/Loader.js +80 -18
- package/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/Enums/Modes/ResponsiveMode.js +8 -0
- package/Enums/Modes/index.d.ts +1 -0
- package/Enums/Modes/index.js +1 -0
- package/Interactions/External/Attract/index.d.ts +1 -1
- package/Interactions/External/Attract/index.js +2 -2
- package/Interactions/External/Bounce/index.d.ts +1 -1
- package/Interactions/External/Bounce/index.js +2 -2
- package/Interactions/External/Bubble/index.d.ts +1 -1
- package/Interactions/External/Bubble/index.js +2 -2
- package/Interactions/External/Connect/index.d.ts +1 -1
- package/Interactions/External/Connect/index.js +2 -2
- package/Interactions/External/Grab/index.d.ts +1 -1
- package/Interactions/External/Grab/index.js +2 -2
- package/Interactions/External/Repulse/index.d.ts +1 -1
- package/Interactions/External/Repulse/index.js +2 -2
- package/Interactions/External/Trail/index.d.ts +1 -1
- package/Interactions/External/Trail/index.js +2 -2
- package/Interactions/Particles/Attract/index.d.ts +1 -1
- package/Interactions/Particles/Attract/index.js +2 -2
- package/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/Interactions/Particles/Collisions/index.js +2 -2
- package/Interactions/Particles/Links/index.d.ts +2 -2
- package/Interactions/Particles/Links/index.js +5 -5
- package/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/Interactions/Particles/Links/plugin.js +2 -2
- package/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/Options/Classes/Options.d.ts +1 -1
- package/Options/Classes/Options.js +5 -2
- package/Options/Classes/Responsive.d.ts +2 -0
- package/Options/Classes/Responsive.js +10 -0
- package/Options/Interfaces/IResponsive.d.ts +2 -0
- package/Plugins/Absorbers/plugin.d.ts +1 -1
- package/Plugins/Absorbers/plugin.js +2 -2
- package/Plugins/Emitters/plugin.d.ts +1 -1
- package/Plugins/Emitters/plugin.js +2 -2
- package/Plugins/PolygonMask/plugin.js +1 -1
- package/README.md +1 -1
- package/Shapes/Circle/index.d.ts +1 -1
- package/Shapes/Circle/index.js +2 -2
- package/Shapes/Image/index.d.ts +1 -1
- package/Shapes/Image/index.js +3 -3
- package/Shapes/Line/index.d.ts +1 -1
- package/Shapes/Line/index.js +2 -2
- package/Shapes/Polygon/index.d.ts +3 -3
- package/Shapes/Polygon/index.js +7 -7
- package/Shapes/Square/index.d.ts +1 -1
- package/Shapes/Square/index.js +3 -3
- package/Shapes/Star/index.d.ts +1 -1
- package/Shapes/Star/index.js +2 -2
- package/Shapes/Text/index.d.ts +1 -1
- package/Shapes/Text/index.js +2 -2
- package/Updaters/Angle/index.d.ts +1 -1
- package/Updaters/Angle/index.js +2 -2
- package/Updaters/Color/index.d.ts +1 -1
- package/Updaters/Color/index.js +2 -2
- package/Updaters/Life/index.d.ts +1 -1
- package/Updaters/Life/index.js +2 -2
- package/Updaters/Opacity/index.d.ts +1 -1
- package/Updaters/Opacity/index.js +2 -2
- package/Updaters/OutModes/index.d.ts +1 -1
- package/Updaters/OutModes/index.js +2 -2
- package/Updaters/Roll/index.d.ts +1 -1
- package/Updaters/Roll/index.js +2 -2
- package/Updaters/Size/index.d.ts +1 -1
- package/Updaters/Size/index.js +2 -2
- package/Updaters/StrokeColor/index.d.ts +1 -1
- package/Updaters/StrokeColor/index.js +2 -2
- package/Updaters/Tilt/index.d.ts +1 -1
- package/Updaters/Tilt/index.js +2 -2
- package/Updaters/Wobble/index.d.ts +1 -1
- package/Updaters/Wobble/index.js +2 -2
- package/Utils/Utils.d.ts +1 -2
- package/browser/Core/Canvas.d.ts +29 -0
- package/browser/Core/Canvas.js +26 -6
- package/browser/Core/Container.d.ts +98 -2
- package/browser/Core/Container.js +104 -12
- package/browser/Core/FrameManager.d.ts +8 -0
- package/browser/Core/FrameManager.js +9 -0
- package/browser/Core/InteractionManager.d.ts +3 -0
- package/browser/Core/InteractionManager.js +4 -0
- package/browser/Core/Interfaces/Colors.d.ts +23 -0
- package/browser/Core/Interfaces/IAttract.d.ts +3 -0
- package/browser/Core/Interfaces/IBounds.d.ts +3 -0
- package/browser/Core/Interfaces/IBubble.d.ts +3 -0
- package/browser/Core/Interfaces/IBubbleParticleData.d.ts +3 -0
- package/browser/Core/Interfaces/IContainerInteractivity.d.ts +3 -0
- package/browser/Core/Interfaces/IContainerPlugin.d.ts +3 -0
- package/browser/Core/Interfaces/ICoordinates.d.ts +3 -0
- package/browser/Core/Interfaces/IDelta.d.ts +3 -0
- package/browser/Core/Interfaces/IDimension.d.ts +3 -0
- package/browser/Core/Interfaces/IExternalInteractor.d.ts +3 -0
- package/browser/Core/Interfaces/IInteractor.d.ts +3 -0
- package/browser/Core/Interfaces/IMouseData.d.ts +3 -0
- package/browser/Core/Interfaces/IMovePathGenerator.d.ts +3 -0
- package/browser/Core/Interfaces/IParticle.d.ts +3 -0
- package/browser/Core/Interfaces/IParticleValueAnimation.d.ts +3 -0
- package/browser/Core/Interfaces/IParticlesInteractor.d.ts +3 -0
- package/browser/Core/Interfaces/IPlugin.d.ts +8 -0
- package/browser/Core/Interfaces/IRepulse.d.ts +3 -0
- package/browser/Core/Interfaces/IShapeDrawer.d.ts +3 -0
- package/browser/Core/Interfaces/IShapeValues.d.ts +3 -0
- package/browser/Core/Loader.d.ts +64 -4
- package/browser/Core/Loader.js +131 -18
- package/browser/Core/Particle/Mover.d.ts +3 -0
- package/browser/Core/Particle/Mover.js +7 -2
- package/browser/Core/Particle.d.ts +7 -0
- package/browser/Core/Particle.js +13 -0
- package/browser/Core/Particles.d.ts +13 -0
- package/browser/Core/Particles.js +25 -0
- package/browser/Core/Retina.d.ts +6 -0
- package/browser/Core/Retina.js +9 -0
- package/browser/Enums/Directions/MoveDirection.d.ts +3 -0
- package/browser/Enums/Directions/MoveDirection.js +3 -0
- package/browser/Enums/Directions/RotateDirection.d.ts +3 -0
- package/browser/Enums/Directions/RotateDirection.js +3 -0
- package/browser/Enums/Directions/TiltDirection.d.ts +3 -0
- package/browser/Enums/Directions/TiltDirection.js +3 -0
- package/browser/Enums/InteractivityDetect.d.ts +3 -0
- package/browser/Enums/InteractivityDetect.js +3 -0
- package/browser/Enums/Modes/ClickMode.d.ts +3 -0
- package/browser/Enums/Modes/ClickMode.js +3 -0
- package/browser/Enums/Modes/CollisionMode.d.ts +3 -0
- package/browser/Enums/Modes/CollisionMode.js +3 -0
- package/browser/Enums/Modes/DivMode.d.ts +3 -0
- package/browser/Enums/Modes/DivMode.js +3 -0
- package/browser/Enums/Modes/HoverMode.d.ts +3 -0
- package/browser/Enums/Modes/HoverMode.js +3 -0
- package/browser/Enums/Modes/OutMode.d.ts +3 -0
- package/browser/Enums/Modes/OutMode.js +3 -0
- package/browser/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/browser/Enums/Modes/ResponsiveMode.js +5 -0
- package/browser/Enums/Modes/SizeMode.d.ts +3 -0
- package/browser/Enums/Modes/SizeMode.js +3 -0
- package/browser/Enums/Modes/index.d.ts +1 -0
- package/browser/Enums/Modes/index.js +1 -0
- package/browser/Enums/Types/DestroyType.d.ts +3 -0
- package/browser/Enums/Types/DestroyType.js +3 -0
- package/browser/Enums/Types/DivType.d.ts +3 -0
- package/browser/Enums/Types/DivType.js +3 -0
- package/browser/Enums/Types/OrbitType.d.ts +3 -0
- package/browser/Enums/Types/OrbitType.js +3 -0
- package/browser/Enums/Types/ShapeType.d.ts +3 -0
- package/browser/Enums/Types/ShapeType.js +3 -0
- package/browser/Enums/Types/StartValueType.d.ts +3 -0
- package/browser/Enums/Types/StartValueType.js +3 -0
- package/browser/Interactions/External/Attract/Attractor.d.ts +4 -0
- package/browser/Interactions/External/Attract/Attractor.js +5 -0
- package/browser/Interactions/External/Attract/index.d.ts +1 -1
- package/browser/Interactions/External/Attract/index.js +2 -2
- package/browser/Interactions/External/Bounce/Bouncer.js +1 -0
- package/browser/Interactions/External/Bounce/index.d.ts +1 -1
- package/browser/Interactions/External/Bounce/index.js +2 -2
- package/browser/Interactions/External/Bubble/Bubbler.d.ts +4 -0
- package/browser/Interactions/External/Bubble/Bubbler.js +14 -0
- package/browser/Interactions/External/Bubble/IBubblerProcessParam.d.ts +6 -0
- package/browser/Interactions/External/Bubble/ProcessBubbleType.d.ts +3 -0
- package/browser/Interactions/External/Bubble/ProcessBubbleType.js +3 -0
- package/browser/Interactions/External/Bubble/index.d.ts +1 -1
- package/browser/Interactions/External/Bubble/index.js +2 -2
- package/browser/Interactions/External/Connect/Connector.d.ts +7 -0
- package/browser/Interactions/External/Connect/Connector.js +8 -0
- package/browser/Interactions/External/Connect/index.d.ts +1 -1
- package/browser/Interactions/External/Connect/index.js +2 -2
- package/browser/Interactions/External/Grab/Grabber.d.ts +4 -0
- package/browser/Interactions/External/Grab/Grabber.js +9 -0
- package/browser/Interactions/External/Grab/index.d.ts +1 -1
- package/browser/Interactions/External/Grab/index.js +2 -2
- package/browser/Interactions/External/Repulse/Repulser.d.ts +4 -0
- package/browser/Interactions/External/Repulse/Repulser.js +162 -0
- package/browser/Interactions/External/Repulse/index.d.ts +1 -1
- package/browser/Interactions/External/Repulse/index.js +2 -2
- package/browser/Interactions/External/Trail/TrailMaker.d.ts +3 -0
- package/browser/Interactions/External/Trail/TrailMaker.js +4 -0
- package/browser/Interactions/External/Trail/index.d.ts +1 -1
- package/browser/Interactions/External/Trail/index.js +2 -2
- package/browser/Interactions/Particles/Attract/Attractor.d.ts +3 -0
- package/browser/Interactions/Particles/Attract/Attractor.js +4 -0
- package/browser/Interactions/Particles/Attract/index.d.ts +1 -1
- package/browser/Interactions/Particles/Attract/index.js +2 -2
- package/browser/Interactions/Particles/Collisions/Collider.d.ts +3 -0
- package/browser/Interactions/Particles/Collisions/Collider.js +4 -0
- package/browser/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/browser/Interactions/Particles/Collisions/index.js +2 -2
- package/browser/Interactions/Particles/Links/ILink.d.ts +6 -0
- package/browser/Interactions/Particles/Links/LinkInstance.js +8 -0
- package/browser/Interactions/Particles/Links/Linker.js +2 -0
- package/browser/Interactions/Particles/Links/index.d.ts +2 -2
- package/browser/Interactions/Particles/Links/index.js +5 -5
- package/browser/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/browser/Interactions/Particles/Links/plugin.js +3 -2
- package/browser/Options/Classes/AnimatableColor.d.ts +4 -0
- package/browser/Options/Classes/AnimatableColor.js +4 -0
- package/browser/Options/Classes/Background/Background.d.ts +4 -0
- package/browser/Options/Classes/Background/Background.js +4 -0
- package/browser/Options/Classes/BackgroundMask/BackgroundMask.d.ts +14 -0
- package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +4 -0
- package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +3 -0
- package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.js +3 -0
- package/browser/Options/Classes/ColorAnimation.d.ts +3 -0
- package/browser/Options/Classes/ColorAnimation.js +3 -0
- package/browser/Options/Classes/FullScreen/FullScreen.d.ts +16 -0
- package/browser/Options/Classes/FullScreen/FullScreen.js +8 -2
- package/browser/Options/Classes/Interactivity/Events/ClickEvent.d.ts +10 -0
- package/browser/Options/Classes/Interactivity/Events/ClickEvent.js +4 -0
- package/browser/Options/Classes/Interactivity/Events/DivEvent.d.ts +37 -0
- package/browser/Options/Classes/Interactivity/Events/DivEvent.js +33 -0
- package/browser/Options/Classes/Interactivity/Events/Events.d.ts +31 -0
- package/browser/Options/Classes/Interactivity/Events/Events.js +31 -0
- package/browser/Options/Classes/Interactivity/Events/HoverEvent.d.ts +4 -0
- package/browser/Options/Classes/Interactivity/Events/HoverEvent.js +4 -0
- package/browser/Options/Classes/Interactivity/Events/Parallax.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Events/Parallax.js +3 -0
- package/browser/Options/Classes/Interactivity/Interactivity.d.ts +13 -0
- package/browser/Options/Classes/Interactivity/Interactivity.js +14 -1
- package/browser/Options/Classes/Interactivity/Modes/Attract.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/Attract.js +3 -0
- package/browser/Options/Classes/Interactivity/Modes/Bubble.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/Bubble.js +3 -0
- package/browser/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/BubbleBase.js +3 -0
- package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +9 -0
- package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.js +9 -0
- package/browser/Options/Classes/Interactivity/Modes/Connect.d.ts +21 -0
- package/browser/Options/Classes/Interactivity/Modes/Connect.js +21 -0
- package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.js +3 -0
- package/browser/Options/Classes/Interactivity/Modes/Grab.d.ts +21 -0
- package/browser/Options/Classes/Interactivity/Modes/Grab.js +21 -0
- package/browser/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/GrabLinks.js +3 -0
- package/browser/Options/Classes/Interactivity/Modes/Modes.d.ts +4 -0
- package/browser/Options/Classes/Interactivity/Modes/Modes.js +4 -0
- package/browser/Options/Classes/Interactivity/Modes/Push.d.ts +12 -0
- package/browser/Options/Classes/Interactivity/Modes/Push.js +12 -0
- package/browser/Options/Classes/Interactivity/Modes/Remove.d.ts +12 -0
- package/browser/Options/Classes/Interactivity/Modes/Remove.js +12 -0
- package/browser/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/Repulse.js +3 -0
- package/browser/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/RepulseBase.js +3 -0
- package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +9 -0
- package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.js +11 -0
- package/browser/Options/Classes/Interactivity/Modes/Slow.d.ts +9 -0
- package/browser/Options/Classes/Interactivity/Modes/Slow.js +10 -0
- package/browser/Options/Classes/Interactivity/Modes/Trail.d.ts +3 -0
- package/browser/Options/Classes/Interactivity/Modes/Trail.js +3 -0
- package/browser/Options/Classes/Motion/Motion.d.ts +11 -0
- package/browser/Options/Classes/Motion/Motion.js +4 -0
- package/browser/Options/Classes/Motion/MotionReduce.d.ts +9 -0
- package/browser/Options/Classes/Motion/MotionReduce.js +3 -0
- package/browser/Options/Classes/Options.d.ts +31 -1
- package/browser/Options/Classes/Options.js +36 -3
- package/browser/Options/Classes/OptionsColor.d.ts +4 -0
- package/browser/Options/Classes/OptionsColor.js +4 -0
- package/browser/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -0
- package/browser/Options/Classes/Particles/Collisions/Collisions.js +4 -0
- package/browser/Options/Classes/Particles/Links/Links.d.ts +4 -0
- package/browser/Options/Classes/Particles/Links/Links.js +4 -0
- package/browser/Options/Classes/Particles/Links/LinksShadow.d.ts +3 -0
- package/browser/Options/Classes/Particles/Links/LinksShadow.js +3 -0
- package/browser/Options/Classes/Particles/Links/LinksTriangle.d.ts +3 -0
- package/browser/Options/Classes/Particles/Links/LinksTriangle.js +3 -0
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +21 -0
- package/browser/Options/Classes/Particles/Move/Attract.js +21 -0
- package/browser/Options/Classes/Particles/Move/Move.d.ts +42 -0
- package/browser/Options/Classes/Particles/Move/Move.js +43 -0
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -0
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +4 -1
- package/browser/Options/Classes/Particles/Move/Path/Path.d.ts +3 -0
- package/browser/Options/Classes/Particles/Move/Path/Path.js +3 -0
- package/browser/Options/Classes/Particles/Move/Trail.d.ts +3 -0
- package/browser/Options/Classes/Particles/Move/Trail.js +3 -0
- package/browser/Options/Classes/Particles/Number/Density.d.ts +12 -0
- package/browser/Options/Classes/Particles/Number/Density.js +12 -0
- package/browser/Options/Classes/Particles/Number/ParticlesNumber.d.ts +10 -0
- package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +10 -0
- package/browser/Options/Classes/Particles/Opacity/Opacity.d.ts +13 -0
- package/browser/Options/Classes/Particles/Opacity/Opacity.js +13 -0
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +15 -0
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +12 -0
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -0
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -0
- package/browser/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +3 -0
- package/browser/Options/Classes/Particles/Orbit/OrbitRotation.js +3 -0
- package/browser/Options/Classes/Particles/ParticlesOptions.d.ts +22 -0
- package/browser/Options/Classes/Particles/ParticlesOptions.js +22 -0
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +3 -0
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +3 -0
- package/browser/Options/Classes/Particles/Rotate/Rotate.d.ts +4 -0
- package/browser/Options/Classes/Particles/Rotate/Rotate.js +4 -0
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +3 -0
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -0
- package/browser/Options/Classes/Particles/Shadow.d.ts +4 -0
- package/browser/Options/Classes/Particles/Shadow.js +4 -0
- package/browser/Options/Classes/Particles/Shape/Shape.d.ts +42 -0
- package/browser/Options/Classes/Particles/Shape/Shape.js +43 -0
- package/browser/Options/Classes/Particles/Size/Size.d.ts +13 -0
- package/browser/Options/Classes/Particles/Size/Size.js +13 -0
- package/browser/Options/Classes/Particles/Size/SizeAnimation.d.ts +15 -0
- package/browser/Options/Classes/Particles/Size/SizeAnimation.js +12 -0
- package/browser/Options/Classes/Particles/Stroke.d.ts +4 -0
- package/browser/Options/Classes/Particles/Stroke.js +4 -0
- package/browser/Options/Classes/Particles/Tilt/Tilt.d.ts +4 -0
- package/browser/Options/Classes/Particles/Tilt/Tilt.js +4 -0
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +3 -0
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -0
- package/browser/Options/Classes/Particles/Twinkle/Twinkle.d.ts +4 -0
- package/browser/Options/Classes/Particles/Twinkle/Twinkle.js +4 -0
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +3 -0
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -0
- package/browser/Options/Classes/Particles/ZIndex/ZIndex.d.ts +3 -0
- package/browser/Options/Classes/Particles/ZIndex/ZIndex.js +3 -0
- package/browser/Options/Classes/Responsive.d.ts +2 -0
- package/browser/Options/Classes/Responsive.js +11 -0
- package/browser/Options/Classes/ValueWithRandom.d.ts +3 -0
- package/browser/Options/Interfaces/Background/IBackground.d.ts +35 -0
- package/browser/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +21 -0
- package/browser/Options/Interfaces/BackgroundMask/IBackgroundMaskCover.d.ts +10 -0
- package/browser/Options/Interfaces/FullScreen/IFullScreen.d.ts +16 -0
- package/browser/Options/Interfaces/IAnimatableColor.d.ts +8 -0
- package/browser/Options/Interfaces/IAnimation.d.ts +10 -0
- package/browser/Options/Interfaces/IColorAnimation.d.ts +7 -0
- package/browser/Options/Interfaces/IColorAnimation.js +4 -0
- package/browser/Options/Interfaces/IManualParticle.d.ts +11 -0
- package/browser/Options/Interfaces/IOptionLoader.d.ts +9 -0
- package/browser/Options/Interfaces/IOptions.d.ts +71 -0
- package/browser/Options/Interfaces/IOptionsColor.d.ts +5 -0
- package/browser/Options/Interfaces/IResponsive.d.ts +2 -0
- package/browser/Options/Interfaces/IValueWithRandom.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Events/IClickEvent.d.ts +12 -0
- package/browser/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +13 -0
- package/browser/Options/Interfaces/Interactivity/Events/IEvents.d.ts +13 -0
- package/browser/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +4 -0
- package/browser/Options/Interfaces/Interactivity/Events/IParallax.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/IInteractivity.d.ts +20 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IAttract.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IBubbleDiv.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IConnect.d.ts +9 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IConnectLinks.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IGrab.d.ts +9 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IGrabLinks.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +6 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IModes.d.ts +4 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IPush.d.ts +6 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IRemove.d.ts +6 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IRepulseBase.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +3 -0
- package/browser/Options/Interfaces/Interactivity/Modes/ISlow.d.ts +6 -0
- package/browser/Options/Interfaces/Interactivity/Modes/ITrail.d.ts +3 -0
- package/browser/Options/Interfaces/Motion/IMotion.d.ts +11 -0
- package/browser/Options/Interfaces/Motion/IMotionReduce.d.ts +9 -0
- package/browser/Options/Interfaces/Particles/Collisions/ICollisions.d.ts +4 -0
- package/browser/Options/Interfaces/Particles/Destroy/IDestroy.d.ts +4 -0
- package/browser/Options/Interfaces/Particles/IParticles.d.ts +10 -0
- package/browser/Options/Interfaces/Particles/IShadow.d.ts +4 -0
- package/browser/Options/Interfaces/Particles/IStroke.d.ts +14 -0
- package/browser/Options/Interfaces/Particles/Links/ILinks.d.ts +43 -0
- package/browser/Options/Interfaces/Particles/Links/ILinksShadow.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Links/ILinksTriangle.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +9 -0
- package/browser/Options/Interfaces/Particles/Move/IMove.d.ts +19 -0
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Move/ITrail.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Move/Path/iPath.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Number/IDensity.d.ts +6 -0
- package/browser/Options/Interfaces/Particles/Number/IParticlesNumber.d.ts +7 -0
- package/browser/Options/Interfaces/Particles/Opacity/IOpacity.d.ts +7 -0
- package/browser/Options/Interfaces/Particles/Opacity/IOpacityAnimation.d.ts +9 -0
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +7 -0
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +4 -0
- package/browser/Options/Interfaces/Particles/Rotate/IRotate.d.ts +4 -0
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Shape/ICharacterShape.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Shape/IImageShape.d.ts +6 -0
- package/browser/Options/Interfaces/Particles/Shape/IPolygonShape.d.ts +6 -0
- package/browser/Options/Interfaces/Particles/Shape/IShape.d.ts +22 -0
- package/browser/Options/Interfaces/Particles/Shape/IStarShape.d.ts +6 -0
- package/browser/Options/Interfaces/Particles/Size/ISize.d.ts +7 -0
- package/browser/Options/Interfaces/Particles/Size/ISizeAnimation.d.ts +9 -0
- package/browser/Options/Interfaces/Particles/Tilt/ITilt.d.ts +4 -0
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkle.d.ts +4 -0
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -0
- package/browser/Options/Interfaces/Particles/ZIndex/IZIndex.d.ts +4 -0
- package/browser/Options/Interfaces/Theme/ITheme.d.ts +14 -0
- package/browser/Options/Interfaces/Theme/IThemeDefault.d.ts +16 -0
- package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +3 -0
- package/browser/Plugins/Absorbers/AbsorberInstance.js +3 -0
- package/browser/Plugins/Absorbers/Absorbers.d.ts +3 -0
- package/browser/Plugins/Absorbers/Absorbers.js +3 -0
- package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +3 -0
- package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.js +3 -0
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -0
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +4 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +29 -0
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +3 -0
- package/browser/Plugins/Absorbers/plugin.d.ts +1 -1
- package/browser/Plugins/Absorbers/plugin.js +5 -2
- package/browser/Plugins/Emitters/EmitterInstance.d.ts +3 -0
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -0
- package/browser/Plugins/Emitters/Emitters.d.ts +3 -0
- package/browser/Plugins/Emitters/Emitters.js +3 -0
- package/browser/Plugins/Emitters/Enums/EmitterClickMode.d.ts +3 -0
- package/browser/Plugins/Emitters/Enums/EmitterClickMode.js +3 -0
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +4 -0
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +4 -0
- package/browser/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +3 -0
- package/browser/Plugins/Emitters/Options/Classes/EmitterLife.js +3 -0
- package/browser/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +3 -0
- package/browser/Plugins/Emitters/Options/Classes/EmitterRate.js +3 -0
- package/browser/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +3 -0
- package/browser/Plugins/Emitters/Options/Classes/EmitterSize.js +3 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +44 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitterLife.d.ts +19 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +3 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitterRate.d.ts +11 -0
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +3 -0
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -0
- package/browser/Plugins/Emitters/plugin.d.ts +1 -1
- package/browser/Plugins/Emitters/plugin.js +5 -2
- package/browser/Plugins/PolygonMask/Options/Classes/Draw.d.ts +15 -0
- package/browser/Plugins/PolygonMask/Options/Classes/Draw.js +15 -0
- package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.js +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/Inline.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/Inline.js +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.js +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/Move.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/Move.js +3 -0
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +10 -0
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.js +10 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +9 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/ILocalSvg.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +3 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +7 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskOptions.d.ts +3 -0
- package/browser/Plugins/PolygonMask/PolygonMaskInstance.d.ts +12 -0
- package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +22 -0
- package/browser/Plugins/PolygonMask/pathseg.js +55 -1
- package/browser/Plugins/PolygonMask/plugin.js +8 -2
- package/browser/Plugins/PolygonMask/utils.js +14 -2
- package/browser/Shapes/Circle/CircleDrawer.d.ts +3 -0
- package/browser/Shapes/Circle/CircleDrawer.js +3 -0
- package/browser/Shapes/Circle/index.d.ts +1 -1
- package/browser/Shapes/Circle/index.js +2 -2
- package/browser/Shapes/Image/ImageDrawer.d.ts +3 -0
- package/browser/Shapes/Image/ImageDrawer.js +6 -0
- package/browser/Shapes/Image/Utils.d.ts +3 -0
- package/browser/Shapes/Image/Utils.js +1 -0
- package/browser/Shapes/Image/index.d.ts +1 -1
- package/browser/Shapes/Image/index.js +3 -3
- package/browser/Shapes/Line/LineDrawer.d.ts +3 -0
- package/browser/Shapes/Line/LineDrawer.js +3 -0
- package/browser/Shapes/Line/index.d.ts +1 -1
- package/browser/Shapes/Line/index.js +2 -2
- package/browser/Shapes/Polygon/PolygonDrawer.d.ts +3 -0
- package/browser/Shapes/Polygon/PolygonDrawer.js +3 -0
- package/browser/Shapes/Polygon/PolygonDrawerBase.d.ts +3 -0
- package/browser/Shapes/Polygon/PolygonDrawerBase.js +5 -1
- package/browser/Shapes/Polygon/TriangleDrawer.d.ts +3 -0
- package/browser/Shapes/Polygon/TriangleDrawer.js +3 -0
- package/browser/Shapes/Polygon/index.d.ts +3 -3
- package/browser/Shapes/Polygon/index.js +7 -7
- package/browser/Shapes/Square/SquareDrawer.d.ts +3 -0
- package/browser/Shapes/Square/SquareDrawer.js +3 -0
- package/browser/Shapes/Square/index.d.ts +1 -1
- package/browser/Shapes/Square/index.js +3 -3
- package/browser/Shapes/Star/StarDrawer.d.ts +3 -0
- package/browser/Shapes/Star/StarDrawer.js +3 -0
- package/browser/Shapes/Star/index.d.ts +1 -1
- package/browser/Shapes/Star/index.js +2 -2
- package/browser/Shapes/Text/TextDrawer.d.ts +3 -0
- package/browser/Shapes/Text/TextDrawer.js +3 -0
- package/browser/Shapes/Text/index.d.ts +1 -1
- package/browser/Shapes/Text/index.js +2 -2
- package/browser/Types/ParticlesGroups.d.ts +4 -0
- package/browser/Types/RecursivePartial.d.ts +3 -0
- package/browser/Types/ShapeData.d.ts +3 -0
- package/browser/Types/ShapeDrawerFunctions.d.ts +21 -0
- package/browser/Types/SingleOrMultiple.d.ts +3 -0
- package/browser/Updaters/Angle/index.d.ts +1 -1
- package/browser/Updaters/Angle/index.js +2 -2
- package/browser/Updaters/Color/ColorUpdater.js +1 -0
- package/browser/Updaters/Color/index.d.ts +1 -1
- package/browser/Updaters/Color/index.js +2 -2
- package/browser/Updaters/Life/LifeUpdater.js +1 -0
- package/browser/Updaters/Life/index.d.ts +1 -1
- package/browser/Updaters/Life/index.js +2 -2
- package/browser/Updaters/Opacity/OpacityUpdater.js +1 -0
- package/browser/Updaters/Opacity/index.d.ts +1 -1
- package/browser/Updaters/Opacity/index.js +2 -2
- package/browser/Updaters/OutModes/OutOfCanvasUpdater.js +1 -0
- package/browser/Updaters/OutModes/index.d.ts +1 -1
- package/browser/Updaters/OutModes/index.js +2 -2
- package/browser/Updaters/Roll/index.d.ts +1 -1
- package/browser/Updaters/Roll/index.js +2 -2
- package/browser/Updaters/Size/SizeUpdater.js +1 -0
- package/browser/Updaters/Size/index.d.ts +1 -1
- package/browser/Updaters/Size/index.js +2 -2
- package/browser/Updaters/StrokeColor/StrokeColorUpdater.js +1 -0
- package/browser/Updaters/StrokeColor/index.d.ts +1 -1
- package/browser/Updaters/StrokeColor/index.js +2 -2
- package/browser/Updaters/Tilt/index.d.ts +1 -1
- package/browser/Updaters/Tilt/index.js +2 -2
- package/browser/Updaters/Wobble/index.d.ts +1 -1
- package/browser/Updaters/Wobble/index.js +2 -2
- package/browser/Utils/CanvasUtils.js +4 -0
- package/browser/Utils/Circle.d.ts +3 -0
- package/browser/Utils/Circle.js +3 -0
- package/browser/Utils/CircleWarp.d.ts +3 -0
- package/browser/Utils/CircleWarp.js +3 -0
- package/browser/Utils/ColorUtils.d.ts +20 -0
- package/browser/Utils/ColorUtils.js +33 -1
- package/browser/Utils/Constants.d.ts +7 -0
- package/browser/Utils/Constants.js +7 -0
- package/browser/Utils/EventListeners.d.ts +32 -0
- package/browser/Utils/EventListeners.js +40 -0
- package/browser/Utils/NumberUtils.d.ts +27 -0
- package/browser/Utils/NumberUtils.js +27 -0
- package/browser/Utils/Plugins.d.ts +3 -0
- package/browser/Utils/Plugins.js +3 -0
- package/browser/Utils/Point.d.ts +3 -0
- package/browser/Utils/Point.js +3 -0
- package/browser/Utils/QuadTree.d.ts +3 -0
- package/browser/Utils/QuadTree.js +3 -0
- package/browser/Utils/Range.d.ts +3 -0
- package/browser/Utils/Range.js +3 -0
- package/browser/Utils/Rectangle.d.ts +3 -0
- package/browser/Utils/Rectangle.js +3 -0
- package/browser/Utils/Utils.d.ts +6 -2
- package/browser/Utils/Utils.js +14 -0
- package/browser/full.d.ts +1 -1
- package/browser/full.js +14 -6
- package/browser/index.d.ts +1 -2
- package/browser/index.js +2 -2
- package/browser/index.slim.d.ts +1 -2
- package/browser/index.slim.js +3 -2
- package/browser/main.d.ts +103 -10
- package/browser/main.js +114 -11
- package/browser/pjs.d.ts +27 -0
- package/browser/pjs.js +23 -0
- package/browser/slim.d.ts +1 -1
- package/browser/slim.js +39 -47
- package/esm/Core/Canvas.js +4 -6
- package/esm/Core/Container.d.ts +4 -2
- package/esm/Core/Container.js +21 -12
- package/esm/Core/Loader.d.ts +19 -4
- package/esm/Core/Loader.js +80 -18
- package/esm/Enums/Modes/ResponsiveMode.d.ts +4 -0
- package/esm/Enums/Modes/ResponsiveMode.js +5 -0
- package/esm/Enums/Modes/index.d.ts +1 -0
- package/esm/Enums/Modes/index.js +1 -0
- package/esm/Interactions/External/Attract/index.d.ts +1 -1
- package/esm/Interactions/External/Attract/index.js +2 -2
- package/esm/Interactions/External/Bounce/index.d.ts +1 -1
- package/esm/Interactions/External/Bounce/index.js +2 -2
- package/esm/Interactions/External/Bubble/index.d.ts +1 -1
- package/esm/Interactions/External/Bubble/index.js +2 -2
- package/esm/Interactions/External/Connect/index.d.ts +1 -1
- package/esm/Interactions/External/Connect/index.js +2 -2
- package/esm/Interactions/External/Grab/index.d.ts +1 -1
- package/esm/Interactions/External/Grab/index.js +2 -2
- package/esm/Interactions/External/Repulse/index.d.ts +1 -1
- package/esm/Interactions/External/Repulse/index.js +2 -2
- package/esm/Interactions/External/Trail/index.d.ts +1 -1
- package/esm/Interactions/External/Trail/index.js +2 -2
- package/esm/Interactions/Particles/Attract/index.d.ts +1 -1
- package/esm/Interactions/Particles/Attract/index.js +2 -2
- package/esm/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/esm/Interactions/Particles/Collisions/index.js +2 -2
- package/esm/Interactions/Particles/Links/index.d.ts +2 -2
- package/esm/Interactions/Particles/Links/index.js +5 -5
- package/esm/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/esm/Interactions/Particles/Links/plugin.js +2 -2
- package/esm/Options/Classes/FullScreen/FullScreen.js +2 -2
- package/esm/Options/Classes/Interactivity/Interactivity.js +1 -1
- package/esm/Options/Classes/Options.d.ts +1 -1
- package/esm/Options/Classes/Options.js +6 -3
- package/esm/Options/Classes/Responsive.d.ts +2 -0
- package/esm/Options/Classes/Responsive.js +10 -0
- package/esm/Options/Interfaces/IResponsive.d.ts +2 -0
- package/esm/Plugins/Absorbers/plugin.d.ts +1 -1
- package/esm/Plugins/Absorbers/plugin.js +2 -2
- package/esm/Plugins/Emitters/plugin.d.ts +1 -1
- package/esm/Plugins/Emitters/plugin.js +2 -2
- package/esm/Plugins/PolygonMask/plugin.js +1 -1
- package/esm/Shapes/Circle/index.d.ts +1 -1
- package/esm/Shapes/Circle/index.js +2 -2
- package/esm/Shapes/Image/index.d.ts +1 -1
- package/esm/Shapes/Image/index.js +3 -3
- package/esm/Shapes/Line/index.d.ts +1 -1
- package/esm/Shapes/Line/index.js +2 -2
- package/esm/Shapes/Polygon/index.d.ts +3 -3
- package/esm/Shapes/Polygon/index.js +7 -7
- package/esm/Shapes/Square/index.d.ts +1 -1
- package/esm/Shapes/Square/index.js +3 -3
- package/esm/Shapes/Star/index.d.ts +1 -1
- package/esm/Shapes/Star/index.js +2 -2
- package/esm/Shapes/Text/index.d.ts +1 -1
- package/esm/Shapes/Text/index.js +2 -2
- package/esm/Updaters/Angle/index.d.ts +1 -1
- package/esm/Updaters/Angle/index.js +2 -2
- package/esm/Updaters/Color/index.d.ts +1 -1
- package/esm/Updaters/Color/index.js +2 -2
- package/esm/Updaters/Life/index.d.ts +1 -1
- package/esm/Updaters/Life/index.js +2 -2
- package/esm/Updaters/Opacity/index.d.ts +1 -1
- package/esm/Updaters/Opacity/index.js +2 -2
- package/esm/Updaters/OutModes/index.d.ts +1 -1
- package/esm/Updaters/OutModes/index.js +2 -2
- package/esm/Updaters/Roll/index.d.ts +1 -1
- package/esm/Updaters/Roll/index.js +2 -2
- package/esm/Updaters/Size/index.d.ts +1 -1
- package/esm/Updaters/Size/index.js +2 -2
- package/esm/Updaters/StrokeColor/index.d.ts +1 -1
- package/esm/Updaters/StrokeColor/index.js +2 -2
- package/esm/Updaters/Tilt/index.d.ts +1 -1
- package/esm/Updaters/Tilt/index.js +2 -2
- package/esm/Updaters/Wobble/index.d.ts +1 -1
- package/esm/Updaters/Wobble/index.js +2 -2
- package/esm/Utils/Utils.d.ts +1 -2
- package/esm/full.d.ts +1 -1
- package/esm/full.js +14 -6
- package/esm/index.d.ts +1 -2
- package/esm/index.js +2 -2
- package/esm/index.slim.d.ts +1 -2
- package/esm/index.slim.js +2 -2
- package/esm/main.d.ts +11 -10
- package/esm/main.js +18 -7
- package/esm/slim.d.ts +1 -1
- package/esm/slim.js +39 -47
- package/full.d.ts +1 -1
- package/full.js +14 -6
- package/index.d.ts +1 -2
- package/index.js +2 -3
- package/index.slim.d.ts +1 -2
- package/index.slim.js +2 -3
- package/main.d.ts +11 -10
- package/main.js +18 -7
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/slim.d.ts +1 -1
- package/slim.js +39 -47
- package/tsparticles.js +10262 -13560
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.js +1472 -0
- package/tsparticles.slim.js +8305 -11259
- package/tsparticles.slim.min.js +2 -2
- package/167.js +0 -1779
package/browser/index.slim.js
CHANGED
|
@@ -2,14 +2,15 @@ import { initPjs } from "./pjs";
|
|
|
2
2
|
import { Circle, CircleWarp, Constants, Point, Rectangle } from "./Utils";
|
|
3
3
|
import { Main } from "./main";
|
|
4
4
|
import { loadSlim } from "./slim";
|
|
5
|
+
/* ---------- tsParticles functions - start ------------ */
|
|
5
6
|
const tsParticles = new Main();
|
|
6
7
|
tsParticles.init();
|
|
7
|
-
loadSlim(tsParticles);
|
|
8
8
|
const { particlesJS, pJSDom } = initPjs(tsParticles);
|
|
9
|
+
loadSlim(tsParticles);
|
|
9
10
|
export * from "./Core/Particle/Vector";
|
|
10
11
|
export * from "./Core/Container";
|
|
11
12
|
export * from "./Enums";
|
|
12
|
-
export { Circle, CircleWarp, Constants, Point, Rectangle, Main
|
|
13
|
+
export { Circle, CircleWarp, Constants, Point, Rectangle, Main };
|
|
13
14
|
export * from "./Utils/CanvasUtils";
|
|
14
15
|
export * from "./Utils/ColorUtils";
|
|
15
16
|
export * from "./Utils/NumberUtils";
|
package/browser/main.d.ts
CHANGED
|
@@ -3,22 +3,115 @@ import type { Container } from "./Core/Container";
|
|
|
3
3
|
import type { ShapeDrawerAfterEffectFunction, ShapeDrawerDestroyFunction, ShapeDrawerDrawFunction, ShapeDrawerInitFunction, RecursivePartial, SingleOrMultiple } from "./Types";
|
|
4
4
|
import type { Particle } from "./Core/Particle";
|
|
5
5
|
import type { IInteractor, IMovePathGenerator, IParticleUpdater, IPlugin, IShapeDrawer } from "./Core/Interfaces";
|
|
6
|
+
/**
|
|
7
|
+
* Main class for creating the singleton on window.
|
|
8
|
+
* It's a singleton proxy to the static [[Loader]] class for initializing [[Container]] instances
|
|
9
|
+
* @category Main
|
|
10
|
+
*/
|
|
6
11
|
export declare class Main {
|
|
7
12
|
#private;
|
|
8
13
|
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* init method, used by imports
|
|
16
|
+
*/
|
|
9
17
|
init(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Loads an options object from the provided array to create a [[Container]] object.
|
|
20
|
+
* @param tagId The particles container element id
|
|
21
|
+
* @param options The options array to get the item from
|
|
22
|
+
* @param index If provided gets the corresponding item from the array
|
|
23
|
+
* @returns A Promise with the [[Container]] object created
|
|
24
|
+
*/
|
|
10
25
|
loadFromArray(tagId: string, options: RecursivePartial<IOptions>[], index?: number): Promise<Container | undefined>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Loads the provided options to create a [[Container]] object.
|
|
28
|
+
* @param tagId The particles container element id
|
|
29
|
+
* @param options The options object to initialize the [[Container]]
|
|
30
|
+
* @returns A Promise with the [[Container]] object created
|
|
31
|
+
*/
|
|
32
|
+
load(tagId: string | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>>): Promise<Container | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* Loads the provided option to create a [[Container]] object using the element parameter as a container
|
|
35
|
+
* @param id The particles container id
|
|
36
|
+
* @param element The dom element used to contain the particles
|
|
37
|
+
* @param options The options object to initialize the [[Container]]
|
|
38
|
+
*/
|
|
39
|
+
set(id: string | HTMLElement, element: HTMLElement | RecursivePartial<IOptions>, options?: RecursivePartial<IOptions>): Promise<Container | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* Loads the provided json with a GET request. The content will be used to create a [[Container]] object.
|
|
42
|
+
* This method is async, so if you need a callback refer to JavaScript function `fetch`
|
|
43
|
+
* @param tagId the particles container element id
|
|
44
|
+
* @param pathConfigJson the json path (or paths array) to use in the GET request
|
|
45
|
+
* @param index the index of the paths array, if a single path is passed this value is ignored
|
|
46
|
+
* @returns A Promise with the [[Container]] object created
|
|
47
|
+
*/
|
|
48
|
+
loadJSON(tagId: string | SingleOrMultiple<string>, pathConfigJson?: SingleOrMultiple<string> | number, index?: number): Promise<Container | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Loads the provided option to create a [[Container]] object using the element parameter as a container
|
|
51
|
+
* @param id The particles container id
|
|
52
|
+
* @param element The dom element used to contain the particles
|
|
53
|
+
* @param pathConfigJson the json path (or paths array) to use in the GET request
|
|
54
|
+
* @param index the index of the paths array, if a single path is passed this value is ignored
|
|
55
|
+
* @returns A Promise with the [[Container]] object created
|
|
56
|
+
*/
|
|
57
|
+
setJSON(id: string | HTMLElement, element: HTMLElement | SingleOrMultiple<string>, pathConfigJson?: SingleOrMultiple<string> | number, index?: number): Promise<Container | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* Adds an additional click handler to all the loaded [[Container]] objects.
|
|
60
|
+
* @param callback The function called after the click event is fired
|
|
61
|
+
*/
|
|
15
62
|
setOnClickHandler(callback: (e: Event, particles?: Particle[]) => void): void;
|
|
63
|
+
/**
|
|
64
|
+
* All the [[Container]] objects loaded
|
|
65
|
+
* @returns All the [[Container]] objects loaded
|
|
66
|
+
*/
|
|
16
67
|
dom(): Container[];
|
|
68
|
+
/**
|
|
69
|
+
* Retrieves a [[Container]] from all the objects loaded
|
|
70
|
+
* @param index The object index
|
|
71
|
+
* @returns The [[Container]] object at specified index, if present or not destroyed, otherwise undefined
|
|
72
|
+
*/
|
|
17
73
|
domItem(index: number): Container | undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Reloads all existing tsParticles loaded instances
|
|
76
|
+
*/
|
|
77
|
+
refresh(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* addShape adds shape to tsParticles, it will be available to all future instances created
|
|
80
|
+
* @param shape the shape name
|
|
81
|
+
* @param drawer the shape drawer function or class instance that draws the shape in the canvas
|
|
82
|
+
* @param init Optional: the shape drawer init function, used only if the drawer parameter is a function
|
|
83
|
+
* @param afterEffect Optional: the shape drawer after effect function, used only if the drawer parameter is a function
|
|
84
|
+
* @param destroy Optional: the shape drawer destroy function, used only if the drawer parameter is a function
|
|
85
|
+
*/
|
|
86
|
+
addShape(shape: string, drawer: IShapeDrawer | ShapeDrawerDrawFunction, init?: ShapeDrawerInitFunction, afterEffect?: ShapeDrawerAfterEffectFunction, destroy?: ShapeDrawerDestroyFunction): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* addPreset adds preset to tsParticles, it will be available to all future instances created
|
|
89
|
+
* @param preset the preset name
|
|
90
|
+
* @param options the options to add to the preset
|
|
91
|
+
* @param override if true, the preset will override any existing with the same name
|
|
92
|
+
*/
|
|
93
|
+
addPreset(preset: string, options: RecursivePartial<IOptions>, override?: boolean): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* addPlugin adds plugin to tsParticles, if an instance needs it it will be loaded
|
|
96
|
+
* @param plugin the plugin implementation of [[IPlugin]]
|
|
97
|
+
*/
|
|
98
|
+
addPlugin(plugin: IPlugin): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* addPathGenerator adds a named path generator to tsParticles, this can be called by options
|
|
101
|
+
* @param name the path generator name
|
|
102
|
+
* @param generator the path generator object
|
|
103
|
+
*/
|
|
104
|
+
addPathGenerator(name: string, generator: IMovePathGenerator): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
* @param name
|
|
108
|
+
* @param interactorInitializer
|
|
109
|
+
*/
|
|
110
|
+
addInteractor(name: string, interactorInitializer: (container: Container) => IInteractor): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* @param name
|
|
114
|
+
* @param updaterInitializer
|
|
115
|
+
*/
|
|
116
|
+
addParticleUpdater(name: string, updaterInitializer: (container: Container) => IParticleUpdater): Promise<void>;
|
|
24
117
|
}
|
package/browser/main.js
CHANGED
|
@@ -12,41 +12,113 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
var _Main_initialized;
|
|
13
13
|
import { Plugins } from "./Utils";
|
|
14
14
|
import { Loader } from "./Core/Loader";
|
|
15
|
+
/**
|
|
16
|
+
* Main class for creating the singleton on window.
|
|
17
|
+
* It's a singleton proxy to the static [[Loader]] class for initializing [[Container]] instances
|
|
18
|
+
* @category Main
|
|
19
|
+
*/
|
|
15
20
|
export class Main {
|
|
16
21
|
constructor() {
|
|
17
22
|
_Main_initialized.set(this, void 0);
|
|
18
23
|
__classPrivateFieldSet(this, _Main_initialized, false, "f");
|
|
19
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* init method, used by imports
|
|
27
|
+
*/
|
|
20
28
|
init() {
|
|
21
29
|
if (!__classPrivateFieldGet(this, _Main_initialized, "f")) {
|
|
22
30
|
__classPrivateFieldSet(this, _Main_initialized, true, "f");
|
|
23
31
|
}
|
|
24
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Loads an options object from the provided array to create a [[Container]] object.
|
|
35
|
+
* @param tagId The particles container element id
|
|
36
|
+
* @param options The options array to get the item from
|
|
37
|
+
* @param index If provided gets the corresponding item from the array
|
|
38
|
+
* @returns A Promise with the [[Container]] object created
|
|
39
|
+
*/
|
|
25
40
|
async loadFromArray(tagId, options, index) {
|
|
26
41
|
return Loader.load(tagId, options, index);
|
|
27
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Loads the provided options to create a [[Container]] object.
|
|
45
|
+
* @param tagId The particles container element id
|
|
46
|
+
* @param options The options object to initialize the [[Container]]
|
|
47
|
+
* @returns A Promise with the [[Container]] object created
|
|
48
|
+
*/
|
|
28
49
|
async load(tagId, options) {
|
|
29
50
|
return Loader.load(tagId, options);
|
|
30
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Loads the provided option to create a [[Container]] object using the element parameter as a container
|
|
54
|
+
* @param id The particles container id
|
|
55
|
+
* @param element The dom element used to contain the particles
|
|
56
|
+
* @param options The options object to initialize the [[Container]]
|
|
57
|
+
*/
|
|
31
58
|
async set(id, element, options) {
|
|
32
59
|
return Loader.set(id, element, options);
|
|
33
60
|
}
|
|
34
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Loads the provided json with a GET request. The content will be used to create a [[Container]] object.
|
|
63
|
+
* This method is async, so if you need a callback refer to JavaScript function `fetch`
|
|
64
|
+
* @param tagId the particles container element id
|
|
65
|
+
* @param pathConfigJson the json path (or paths array) to use in the GET request
|
|
66
|
+
* @param index the index of the paths array, if a single path is passed this value is ignored
|
|
67
|
+
* @returns A Promise with the [[Container]] object created
|
|
68
|
+
*/
|
|
69
|
+
async loadJSON(tagId, pathConfigJson, index) {
|
|
35
70
|
return Loader.loadJSON(tagId, pathConfigJson, index);
|
|
36
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Loads the provided option to create a [[Container]] object using the element parameter as a container
|
|
74
|
+
* @param id The particles container id
|
|
75
|
+
* @param element The dom element used to contain the particles
|
|
76
|
+
* @param pathConfigJson the json path (or paths array) to use in the GET request
|
|
77
|
+
* @param index the index of the paths array, if a single path is passed this value is ignored
|
|
78
|
+
* @returns A Promise with the [[Container]] object created
|
|
79
|
+
*/
|
|
37
80
|
async setJSON(id, element, pathConfigJson, index) {
|
|
38
81
|
return Loader.setJSON(id, element, pathConfigJson, index);
|
|
39
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Adds an additional click handler to all the loaded [[Container]] objects.
|
|
85
|
+
* @param callback The function called after the click event is fired
|
|
86
|
+
*/
|
|
40
87
|
setOnClickHandler(callback) {
|
|
41
88
|
Loader.setOnClickHandler(callback);
|
|
42
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* All the [[Container]] objects loaded
|
|
92
|
+
* @returns All the [[Container]] objects loaded
|
|
93
|
+
*/
|
|
43
94
|
dom() {
|
|
44
95
|
return Loader.dom();
|
|
45
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Retrieves a [[Container]] from all the objects loaded
|
|
99
|
+
* @param index The object index
|
|
100
|
+
* @returns The [[Container]] object at specified index, if present or not destroyed, otherwise undefined
|
|
101
|
+
*/
|
|
46
102
|
domItem(index) {
|
|
47
103
|
return Loader.domItem(index);
|
|
48
104
|
}
|
|
49
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Reloads all existing tsParticles loaded instances
|
|
107
|
+
*/
|
|
108
|
+
async refresh() {
|
|
109
|
+
for (const instance of this.dom()) {
|
|
110
|
+
await instance.refresh();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* addShape adds shape to tsParticles, it will be available to all future instances created
|
|
115
|
+
* @param shape the shape name
|
|
116
|
+
* @param drawer the shape drawer function or class instance that draws the shape in the canvas
|
|
117
|
+
* @param init Optional: the shape drawer init function, used only if the drawer parameter is a function
|
|
118
|
+
* @param afterEffect Optional: the shape drawer after effect function, used only if the drawer parameter is a function
|
|
119
|
+
* @param destroy Optional: the shape drawer destroy function, used only if the drawer parameter is a function
|
|
120
|
+
*/
|
|
121
|
+
async addShape(shape, drawer, init, afterEffect, destroy) {
|
|
50
122
|
let customDrawer;
|
|
51
123
|
if (typeof drawer === "function") {
|
|
52
124
|
customDrawer = {
|
|
@@ -60,21 +132,52 @@ export class Main {
|
|
|
60
132
|
customDrawer = drawer;
|
|
61
133
|
}
|
|
62
134
|
Plugins.addShapeDrawer(shape, customDrawer);
|
|
63
|
-
|
|
64
|
-
|
|
135
|
+
await this.refresh();
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* addPreset adds preset to tsParticles, it will be available to all future instances created
|
|
139
|
+
* @param preset the preset name
|
|
140
|
+
* @param options the options to add to the preset
|
|
141
|
+
* @param override if true, the preset will override any existing with the same name
|
|
142
|
+
*/
|
|
143
|
+
async addPreset(preset, options, override = false) {
|
|
65
144
|
Plugins.addPreset(preset, options, override);
|
|
145
|
+
await this.refresh();
|
|
66
146
|
}
|
|
67
|
-
|
|
147
|
+
/**
|
|
148
|
+
* addPlugin adds plugin to tsParticles, if an instance needs it it will be loaded
|
|
149
|
+
* @param plugin the plugin implementation of [[IPlugin]]
|
|
150
|
+
*/
|
|
151
|
+
async addPlugin(plugin) {
|
|
68
152
|
Plugins.addPlugin(plugin);
|
|
69
|
-
|
|
70
|
-
|
|
153
|
+
await this.refresh();
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* addPathGenerator adds a named path generator to tsParticles, this can be called by options
|
|
157
|
+
* @param name the path generator name
|
|
158
|
+
* @param generator the path generator object
|
|
159
|
+
*/
|
|
160
|
+
async addPathGenerator(name, generator) {
|
|
71
161
|
Plugins.addPathGenerator(name, generator);
|
|
72
|
-
|
|
73
|
-
|
|
162
|
+
await this.refresh();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
*
|
|
166
|
+
* @param name
|
|
167
|
+
* @param interactorInitializer
|
|
168
|
+
*/
|
|
169
|
+
async addInteractor(name, interactorInitializer) {
|
|
74
170
|
Plugins.addInteractor(name, interactorInitializer);
|
|
75
|
-
|
|
76
|
-
|
|
171
|
+
await this.refresh();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
*
|
|
175
|
+
* @param name
|
|
176
|
+
* @param updaterInitializer
|
|
177
|
+
*/
|
|
178
|
+
async addParticleUpdater(name, updaterInitializer) {
|
|
77
179
|
Plugins.addParticleUpdater(name, updaterInitializer);
|
|
180
|
+
await this.refresh();
|
|
78
181
|
}
|
|
79
182
|
}
|
|
80
183
|
_Main_initialized = new WeakMap();
|
package/browser/pjs.d.ts
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [[include:pjsMigration.md]]
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
1
5
|
import type { IOptions } from "./Options/Interfaces/IOptions";
|
|
2
6
|
import type { Container } from "./Core/Container";
|
|
3
7
|
import type { Main } from "./main";
|
|
4
8
|
import type { RecursivePartial } from "./Types";
|
|
9
|
+
/**
|
|
10
|
+
* [[include:pjsMigration.md]]
|
|
11
|
+
* @category Particles.js
|
|
12
|
+
*/
|
|
5
13
|
export interface IParticlesJS {
|
|
14
|
+
/**
|
|
15
|
+
* Loads the provided options to create a [[Container]] object.
|
|
16
|
+
* @deprecated this method is obsolete, please use the new tsParticles.load
|
|
17
|
+
* @param tagId the particles container element id
|
|
18
|
+
* @param options the options object to initialize the [[Container]]
|
|
19
|
+
*/
|
|
6
20
|
(tagId: string, options: RecursivePartial<IOptions>): Promise<Container | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* Loads the provided json with a GET request.
|
|
23
|
+
* The content will be used to create a [[Container]] object.
|
|
24
|
+
* @deprecated this method is obsolete, please use the new tsParticles.loadJSON
|
|
25
|
+
* @param tagId the particles container element id
|
|
26
|
+
* @param pathConfigJson the json path to use in the GET request
|
|
27
|
+
* @param callback called after the [[Container]] is loaded and it will be passed as a parameter
|
|
28
|
+
*/
|
|
7
29
|
load(tagId: string, pathConfigJson: string, callback: (container?: Container) => void): void;
|
|
30
|
+
/**
|
|
31
|
+
* Adds an additional click handler to all the loaded [[Container]] objects.
|
|
32
|
+
* @deprecated this method is obsolete, please use the new tsParticles.setOnClickHandler
|
|
33
|
+
* @param callback the function called after the click event is fired
|
|
34
|
+
*/
|
|
8
35
|
setOnClickHandler(callback: EventListenerOrEventListenerObject): void;
|
|
9
36
|
}
|
|
10
37
|
declare const initPjs: (main: Main) => {
|
package/browser/pjs.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
const initPjs = (main) => {
|
|
2
|
+
/**
|
|
3
|
+
* Loads the provided options to create a [[Container]] object.
|
|
4
|
+
* @deprecated this method is obsolete, please use the new tsParticles.load
|
|
5
|
+
* @param tagId the particles container element id
|
|
6
|
+
* @param options the options object to initialize the [[Container]]
|
|
7
|
+
*/
|
|
2
8
|
const particlesJS = (tagId, options) => {
|
|
3
9
|
return main.load(tagId, options);
|
|
4
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Loads the provided json with a GET request.
|
|
13
|
+
* The content will be used to create a [[Container]] object.
|
|
14
|
+
* @deprecated this method is obsolete, please use the new tsParticles.loadJSON
|
|
15
|
+
* @param tagId the particles container element id
|
|
16
|
+
* @param pathConfigJson the json path to use in the GET request
|
|
17
|
+
* @param callback called after the [[Container]] is loaded and it will be passed as a parameter
|
|
18
|
+
*/
|
|
5
19
|
particlesJS.load = (tagId, pathConfigJson, callback) => {
|
|
6
20
|
main.loadJSON(tagId, pathConfigJson)
|
|
7
21
|
.then((container) => {
|
|
@@ -13,9 +27,18 @@ const initPjs = (main) => {
|
|
|
13
27
|
callback(undefined);
|
|
14
28
|
});
|
|
15
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Adds an additional click handler to all the loaded [[Container]] objects.
|
|
32
|
+
* @deprecated this method is obsolete, please use the new tsParticles.setOnClickHandler
|
|
33
|
+
* @param callback the function called after the click event is fired
|
|
34
|
+
*/
|
|
16
35
|
particlesJS.setOnClickHandler = (callback) => {
|
|
17
36
|
main.setOnClickHandler(callback);
|
|
18
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* All the [[Container]] objects loaded
|
|
40
|
+
* @deprecated this method is obsolete, please use the new tsParticles.dom
|
|
41
|
+
*/
|
|
19
42
|
const pJSDom = main.dom();
|
|
20
43
|
return { particlesJS, pJSDom };
|
|
21
44
|
};
|
package/browser/slim.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "./main";
|
|
2
|
-
export declare function loadSlim(tsParticles: Main): void
|
|
2
|
+
export declare function loadSlim(tsParticles: Main): Promise<void>;
|
package/browser/slim.js
CHANGED
|
@@ -1,56 +1,48 @@
|
|
|
1
1
|
import { loadCircleShape } from "./Shapes/Circle";
|
|
2
|
-
import { loadImageShape } from "./Shapes/Image";
|
|
3
|
-
import { loadLineShape } from "./Shapes/Line";
|
|
4
|
-
import { loadPolygonShape } from "./Shapes/Polygon";
|
|
5
|
-
import { loadSquareShape } from "./Shapes/Square";
|
|
6
|
-
import { loadStarShape } from "./Shapes/Star";
|
|
7
|
-
import { loadTextShape } from "./Shapes/Text";
|
|
8
|
-
import { loadAngleUpdater } from "./Updaters/Angle";
|
|
9
|
-
import { loadColorUpdater } from "./Updaters/Color";
|
|
10
2
|
import { loadLifeUpdater } from "./Updaters/Life";
|
|
3
|
+
import { loadExternalConnectInteraction } from "./Interactions/External/Connect";
|
|
11
4
|
import { loadOpacityUpdater } from "./Updaters/Opacity";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { loadOutModesUpdater } from "./Updaters/OutModes";
|
|
15
|
-
import { loadRollUpdater } from "./Updaters/Roll";
|
|
16
|
-
import { loadTiltUpdater } from "./Updaters/Tilt";
|
|
17
|
-
import { loadWobbleUpdater } from "./Updaters/Wobble";
|
|
18
|
-
import { loadExternalAttractInteraction } from "./Interactions/External/Attract";
|
|
19
|
-
import { loadExternalBounceInteraction } from "./Interactions/External/Bounce";
|
|
5
|
+
import { loadImageShape } from "./Shapes/Image";
|
|
6
|
+
import { loadPolygonShape } from "./Shapes/Polygon";
|
|
20
7
|
import { loadExternalBubbleInteraction } from "./Interactions/External/Bubble";
|
|
21
|
-
import {
|
|
8
|
+
import { loadExternalAttractInteraction } from "./Interactions/External/Attract";
|
|
22
9
|
import { loadExternalGrabInteraction } from "./Interactions/External/Grab";
|
|
23
|
-
import {
|
|
24
|
-
import { loadExternalTrailInteraction } from "./Interactions/External/Trail";
|
|
10
|
+
import { loadStarShape } from "./Shapes/Star";
|
|
25
11
|
import { loadParticlesAttractInteraction } from "./Interactions/Particles/Attract";
|
|
12
|
+
import { loadSquareShape } from "./Shapes/Square";
|
|
13
|
+
import { loadStrokeColorUpdater } from "./Updaters/StrokeColor";
|
|
14
|
+
import { loadColorUpdater } from "./Updaters/Color";
|
|
26
15
|
import { loadParticlesCollisionsInteraction } from "./Interactions/Particles/Collisions";
|
|
16
|
+
import { loadAngleUpdater } from "./Updaters/Angle";
|
|
17
|
+
import { loadOutModesUpdater } from "./Updaters/OutModes";
|
|
18
|
+
import { loadExternalRepulseInteraction } from "./Interactions/External/Repulse";
|
|
19
|
+
import { loadLineShape } from "./Shapes/Line";
|
|
20
|
+
import { loadExternalBounceInteraction } from "./Interactions/External/Bounce";
|
|
21
|
+
import { loadTextShape } from "./Shapes/Text";
|
|
27
22
|
import { loadParticlesLinksInteraction } from "./Interactions/Particles/Links";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
loadParticlesAttractInteraction(tsParticles);
|
|
37
|
-
loadParticlesCollisionsInteraction(tsParticles);
|
|
38
|
-
loadParticlesLinksInteraction(tsParticles);
|
|
39
|
-
loadCircleShape(tsParticles);
|
|
40
|
-
loadImageShape(tsParticles);
|
|
41
|
-
loadLineShape(tsParticles);
|
|
42
|
-
loadPolygonShape(tsParticles);
|
|
43
|
-
loadSquareShape(tsParticles);
|
|
44
|
-
loadStarShape(tsParticles);
|
|
45
|
-
loadTextShape(tsParticles);
|
|
46
|
-
loadLifeUpdater(tsParticles);
|
|
47
|
-
loadOpacityUpdater(tsParticles);
|
|
48
|
-
loadSizeUpdater(tsParticles);
|
|
49
|
-
loadAngleUpdater(tsParticles);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
loadColorUpdater(tsParticles);
|
|
54
|
-
loadStrokeColorUpdater(tsParticles);
|
|
55
|
-
loadOutModesUpdater(tsParticles);
|
|
23
|
+
import { loadSizeUpdater } from "./Updaters/Size";
|
|
24
|
+
export async function loadSlim(tsParticles) {
|
|
25
|
+
await loadExternalAttractInteraction(tsParticles);
|
|
26
|
+
await loadExternalBounceInteraction(tsParticles);
|
|
27
|
+
await loadExternalBubbleInteraction(tsParticles);
|
|
28
|
+
await loadExternalConnectInteraction(tsParticles);
|
|
29
|
+
await loadExternalGrabInteraction(tsParticles);
|
|
30
|
+
await loadExternalRepulseInteraction(tsParticles);
|
|
31
|
+
await loadParticlesAttractInteraction(tsParticles);
|
|
32
|
+
await loadParticlesCollisionsInteraction(tsParticles);
|
|
33
|
+
await loadParticlesLinksInteraction(tsParticles);
|
|
34
|
+
await loadCircleShape(tsParticles);
|
|
35
|
+
await loadImageShape(tsParticles);
|
|
36
|
+
await loadLineShape(tsParticles);
|
|
37
|
+
await loadPolygonShape(tsParticles);
|
|
38
|
+
await loadSquareShape(tsParticles);
|
|
39
|
+
await loadStarShape(tsParticles);
|
|
40
|
+
await loadTextShape(tsParticles);
|
|
41
|
+
await loadLifeUpdater(tsParticles);
|
|
42
|
+
await loadOpacityUpdater(tsParticles);
|
|
43
|
+
await loadSizeUpdater(tsParticles);
|
|
44
|
+
await loadAngleUpdater(tsParticles);
|
|
45
|
+
await loadColorUpdater(tsParticles);
|
|
46
|
+
await loadStrokeColorUpdater(tsParticles);
|
|
47
|
+
await loadOutModesUpdater(tsParticles);
|
|
56
48
|
}
|
package/esm/Core/Canvas.js
CHANGED
|
@@ -72,23 +72,21 @@ export class Canvas {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
windowResize() {
|
|
75
|
-
var _a;
|
|
76
75
|
if (!this.element) {
|
|
77
76
|
return;
|
|
78
77
|
}
|
|
79
78
|
const container = this.container;
|
|
80
79
|
this.resize();
|
|
81
|
-
|
|
82
|
-
delete this.resizeFactor;
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
container.updateActualOptions();
|
|
80
|
+
const needsRefresh = container.updateActualOptions();
|
|
86
81
|
container.particles.setDensity();
|
|
87
82
|
for (const [, plugin] of container.plugins) {
|
|
88
83
|
if (plugin.resize !== undefined) {
|
|
89
84
|
plugin.resize();
|
|
90
85
|
}
|
|
91
86
|
}
|
|
87
|
+
if (needsRefresh) {
|
|
88
|
+
container.refresh();
|
|
89
|
+
}
|
|
92
90
|
}
|
|
93
91
|
resize() {
|
|
94
92
|
if (!this.element) {
|
package/esm/Core/Container.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare class Container {
|
|
|
23
23
|
repulse: IRepulse;
|
|
24
24
|
attract: IAttract;
|
|
25
25
|
zLayers: number;
|
|
26
|
+
responsiveMaxWidth?: number;
|
|
26
27
|
get options(): Options;
|
|
27
28
|
get sourceOptions(): RecursivePartial<IOptions> | undefined;
|
|
28
29
|
actualOptions: Options;
|
|
@@ -39,6 +40,7 @@ export declare class Container {
|
|
|
39
40
|
private firstStart;
|
|
40
41
|
private currentTheme?;
|
|
41
42
|
private drawAnimationFrame?;
|
|
43
|
+
private readonly presets;
|
|
42
44
|
private readonly eventListeners;
|
|
43
45
|
private readonly intersectionObserver?;
|
|
44
46
|
constructor(id: string, sourceOptions?: RecursivePartial<IOptions>, ...presets: string[]);
|
|
@@ -58,7 +60,7 @@ export declare class Container {
|
|
|
58
60
|
loadTheme(name?: string): Promise<void>;
|
|
59
61
|
start(): Promise<void>;
|
|
60
62
|
addClickHandler(callback: (evt: Event, particles?: Particle[]) => void): void;
|
|
61
|
-
updateActualOptions():
|
|
62
|
-
|
|
63
|
+
updateActualOptions(): boolean;
|
|
64
|
+
init(): Promise<void>;
|
|
63
65
|
private intersectionManager;
|
|
64
66
|
}
|
package/esm/Core/Container.js
CHANGED
|
@@ -23,6 +23,7 @@ export class Container {
|
|
|
23
23
|
this.canvas = new Canvas(this);
|
|
24
24
|
this.particles = new Particles(this);
|
|
25
25
|
this.drawer = new FrameManager(this);
|
|
26
|
+
this.presets = presets;
|
|
26
27
|
this.pathGenerator = {
|
|
27
28
|
generate: () => {
|
|
28
29
|
const v = Vector.create(0, 0);
|
|
@@ -49,17 +50,6 @@ export class Container {
|
|
|
49
50
|
this.density = 1;
|
|
50
51
|
this._options = new Options();
|
|
51
52
|
this.actualOptions = new Options();
|
|
52
|
-
for (const preset of presets) {
|
|
53
|
-
this._options.load(Plugins.getPreset(preset));
|
|
54
|
-
}
|
|
55
|
-
const shapes = Plugins.getSupportedShapes();
|
|
56
|
-
for (const type of shapes) {
|
|
57
|
-
const drawer = Plugins.getShapeDrawer(type);
|
|
58
|
-
if (drawer) {
|
|
59
|
-
this.drawers.set(type, drawer);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
this._options.load(this._sourceOptions);
|
|
63
53
|
this.eventListeners = new EventListeners(this);
|
|
64
54
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
65
55
|
this.intersectionObserver = new IntersectionObserver((entries) => this.intersectionManager(entries));
|
|
@@ -202,6 +192,7 @@ export class Container {
|
|
|
202
192
|
this.particles.linksColors = new Map();
|
|
203
193
|
delete this.particles.grabLineColor;
|
|
204
194
|
delete this.particles.linksColor;
|
|
195
|
+
this._sourceOptions = this._options;
|
|
205
196
|
}
|
|
206
197
|
async loadTheme(name) {
|
|
207
198
|
this.currentTheme = name;
|
|
@@ -306,10 +297,28 @@ export class Container {
|
|
|
306
297
|
el.addEventListener("touchcancel", touchCancelHandler);
|
|
307
298
|
}
|
|
308
299
|
updateActualOptions() {
|
|
309
|
-
this.actualOptions.
|
|
300
|
+
this.actualOptions.responsive = [];
|
|
301
|
+
const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
|
|
310
302
|
this.actualOptions.setTheme(this.currentTheme);
|
|
303
|
+
if (this.responsiveMaxWidth != newMaxWidth) {
|
|
304
|
+
this.responsiveMaxWidth = newMaxWidth;
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
return false;
|
|
311
308
|
}
|
|
312
309
|
async init() {
|
|
310
|
+
this._options = new Options();
|
|
311
|
+
for (const preset of this.presets) {
|
|
312
|
+
this._options.load(Plugins.getPreset(preset));
|
|
313
|
+
}
|
|
314
|
+
const shapes = Plugins.getSupportedShapes();
|
|
315
|
+
for (const type of shapes) {
|
|
316
|
+
const drawer = Plugins.getShapeDrawer(type);
|
|
317
|
+
if (drawer) {
|
|
318
|
+
this.drawers.set(type, drawer);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
this._options.load(this._sourceOptions);
|
|
313
322
|
this.actualOptions = new Options();
|
|
314
323
|
this.actualOptions.load(this._options);
|
|
315
324
|
this.retina.init();
|
package/esm/Core/Loader.d.ts
CHANGED
|
@@ -3,12 +3,27 @@ import type { IOptions } from "../Options/Interfaces/IOptions";
|
|
|
3
3
|
import type { RecursivePartial } from "../Types";
|
|
4
4
|
import type { Particle } from "./Particle";
|
|
5
5
|
import type { SingleOrMultiple } from "../Types";
|
|
6
|
+
interface LoaderParams {
|
|
7
|
+
element?: HTMLElement;
|
|
8
|
+
index?: number;
|
|
9
|
+
options?: SingleOrMultiple<RecursivePartial<IOptions>>;
|
|
10
|
+
tagId?: string;
|
|
11
|
+
}
|
|
12
|
+
interface RemoteLoaderParams {
|
|
13
|
+
element?: HTMLElement;
|
|
14
|
+
index?: number;
|
|
15
|
+
tagId?: string;
|
|
16
|
+
url?: SingleOrMultiple<string>;
|
|
17
|
+
}
|
|
6
18
|
export declare class Loader {
|
|
7
19
|
static dom(): Container[];
|
|
8
20
|
static domItem(index: number): Container | undefined;
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
21
|
+
static loadOptions(params: LoaderParams): Promise<Container | undefined>;
|
|
22
|
+
static loadRemoteOptions(params: RemoteLoaderParams): Promise<Container | undefined>;
|
|
23
|
+
static load(tagId: string | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>> | number, index?: number): Promise<Container | undefined>;
|
|
24
|
+
static set(id: string | HTMLElement, domContainer: HTMLElement | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>> | number, index?: number): Promise<Container | undefined>;
|
|
25
|
+
static loadJSON(tagId: string | SingleOrMultiple<string>, jsonUrl?: SingleOrMultiple<string> | number, index?: number): Promise<Container | undefined>;
|
|
26
|
+
static setJSON(id: string | HTMLElement, domContainer: HTMLElement | SingleOrMultiple<string>, jsonUrl: SingleOrMultiple<string> | (number | undefined), index?: number): Promise<Container | undefined>;
|
|
13
27
|
static setOnClickHandler(callback: (evt: Event, particles?: Particle[]) => void): void;
|
|
14
28
|
}
|
|
29
|
+
export {};
|