tsparticles 1.35.4 → 1.37.2
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 +5 -2
- package/Core/Container.js +23 -12
- package/Core/InteractionManager.d.ts +1 -0
- package/Core/InteractionManager.js +4 -1
- package/Core/Particles.d.ts +1 -1
- package/Core/Particles.js +3 -1
- 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/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/Plugins.d.ts +2 -2
- package/Utils/Plugins.js +4 -4
- 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 +99 -2
- package/browser/Core/Container.js +106 -12
- package/browser/Core/FrameManager.d.ts +8 -0
- package/browser/Core/FrameManager.js +9 -0
- package/browser/Core/InteractionManager.d.ts +4 -0
- package/browser/Core/InteractionManager.js +8 -1
- 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 +45 -0
- package/browser/Core/Loader.js +51 -0
- 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 +14 -1
- package/browser/Core/Particles.js +28 -1
- 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 +10 -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 +5 -2
- package/browser/Utils/Plugins.js +7 -4
- 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 +99 -6
- 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 +5 -2
- package/esm/Core/Container.js +23 -12
- package/esm/Core/InteractionManager.d.ts +1 -0
- package/esm/Core/InteractionManager.js +4 -1
- package/esm/Core/Particles.d.ts +1 -1
- package/esm/Core/Particles.js +3 -1
- 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/Plugins.d.ts +2 -2
- package/esm/Utils/Plugins.js +4 -4
- 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 +7 -6
- 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 +7 -6
- 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 +10586 -13650
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.js +1472 -0
- package/tsparticles.slim.js +8521 -11340
- package/tsparticles.slim.min.js +2 -2
- package/167.js +0 -1779
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [[include:Container.md]]
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
1
5
|
import { Canvas } from "./Canvas";
|
|
2
6
|
import { Particles } from "./Particles";
|
|
3
7
|
import { Retina } from "./Retina";
|
|
@@ -5,7 +9,19 @@ import { FrameManager } from "./FrameManager";
|
|
|
5
9
|
import { Options } from "../Options/Classes/Options";
|
|
6
10
|
import { animate, cancelAnimation, EventListeners, getRangeValue, Plugins } from "../Utils";
|
|
7
11
|
import { Vector } from "./Particle/Vector";
|
|
12
|
+
/**
|
|
13
|
+
* The object loaded into an HTML element, it'll contain options loaded and all data to let everything working
|
|
14
|
+
* [[include:Container.md]]
|
|
15
|
+
* @category Core
|
|
16
|
+
*/
|
|
8
17
|
export class Container {
|
|
18
|
+
/**
|
|
19
|
+
* This is the core class, create an instance to have a new working particles manager
|
|
20
|
+
* @constructor
|
|
21
|
+
* @param id the id to identify this instance
|
|
22
|
+
* @param sourceOptions the options to load
|
|
23
|
+
* @param presets all the presets to load with options
|
|
24
|
+
*/
|
|
9
25
|
constructor(id, sourceOptions, ...presets) {
|
|
10
26
|
this.id = id;
|
|
11
27
|
this.fpsLimit = 60;
|
|
@@ -19,10 +35,12 @@ export class Container {
|
|
|
19
35
|
this.zLayers = 100;
|
|
20
36
|
this.pageHidden = false;
|
|
21
37
|
this._sourceOptions = sourceOptions;
|
|
38
|
+
this._initialSourceOptions = sourceOptions;
|
|
22
39
|
this.retina = new Retina(this);
|
|
23
40
|
this.canvas = new Canvas(this);
|
|
24
41
|
this.particles = new Particles(this);
|
|
25
42
|
this.drawer = new FrameManager(this);
|
|
43
|
+
this.presets = presets;
|
|
26
44
|
this.pathGenerator = {
|
|
27
45
|
generate: () => {
|
|
28
46
|
const v = Vector.create(0, 0);
|
|
@@ -31,8 +49,10 @@ export class Container {
|
|
|
31
49
|
return v;
|
|
32
50
|
},
|
|
33
51
|
init: () => {
|
|
52
|
+
// nothing required
|
|
34
53
|
},
|
|
35
54
|
update: () => {
|
|
55
|
+
// nothing required
|
|
36
56
|
},
|
|
37
57
|
};
|
|
38
58
|
this.interactivity = {
|
|
@@ -47,30 +67,28 @@ export class Container {
|
|
|
47
67
|
this.plugins = new Map();
|
|
48
68
|
this.drawers = new Map();
|
|
49
69
|
this.density = 1;
|
|
70
|
+
/* tsParticles variables with default values */
|
|
50
71
|
this._options = new Options();
|
|
51
72
|
this.actualOptions = new Options();
|
|
52
|
-
|
|
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);
|
|
73
|
+
/* ---------- tsParticles - start ------------ */
|
|
63
74
|
this.eventListeners = new EventListeners(this);
|
|
64
75
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
65
76
|
this.intersectionObserver = new IntersectionObserver((entries) => this.intersectionManager(entries));
|
|
66
77
|
}
|
|
67
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* The options used by the container, it's a full [[Options]] object
|
|
81
|
+
*/
|
|
68
82
|
get options() {
|
|
69
83
|
return this._options;
|
|
70
84
|
}
|
|
71
85
|
get sourceOptions() {
|
|
72
86
|
return this._sourceOptions;
|
|
73
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Starts animations and resume from pause
|
|
90
|
+
* @param force
|
|
91
|
+
*/
|
|
74
92
|
play(force) {
|
|
75
93
|
const needsUpdate = this.paused || force;
|
|
76
94
|
if (this.firstStart && !this.actualOptions.autoPlay) {
|
|
@@ -89,6 +107,9 @@ export class Container {
|
|
|
89
107
|
}
|
|
90
108
|
this.draw(needsUpdate || false);
|
|
91
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Pauses animations
|
|
112
|
+
*/
|
|
92
113
|
pause() {
|
|
93
114
|
if (this.drawAnimationFrame !== undefined) {
|
|
94
115
|
cancelAnimation()(this.drawAnimationFrame);
|
|
@@ -106,6 +127,9 @@ export class Container {
|
|
|
106
127
|
this.paused = true;
|
|
107
128
|
}
|
|
108
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Draws a frame
|
|
132
|
+
*/
|
|
109
133
|
draw(force) {
|
|
110
134
|
let refreshTime = force;
|
|
111
135
|
this.drawAnimationFrame = animate()((timestamp) => {
|
|
@@ -116,12 +140,29 @@ export class Container {
|
|
|
116
140
|
this.drawer.nextFrame(timestamp);
|
|
117
141
|
});
|
|
118
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Gets the animation status
|
|
145
|
+
* @returns `true` is playing, `false` is paused
|
|
146
|
+
*/
|
|
119
147
|
getAnimationStatus() {
|
|
120
148
|
return !this.paused && !this.pageHidden;
|
|
121
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Customise path generation
|
|
152
|
+
* @deprecated Use the new setPath
|
|
153
|
+
* @param noiseOrGenerator the [[IMovePathGenerator]] object or a function that generates a [[Vector]] object from [[Particle]]
|
|
154
|
+
* @param init the [[IMovePathGenerator]] init function, if the first parameter is a generator function
|
|
155
|
+
* @param update the [[IMovePathGenerator]] update function, if the first parameter is a generator function
|
|
156
|
+
*/
|
|
122
157
|
setNoise(noiseOrGenerator, init, update) {
|
|
123
158
|
this.setPath(noiseOrGenerator, init, update);
|
|
124
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Customise path generation
|
|
162
|
+
* @param pathOrGenerator the [[IMovePathGenerator]] object or a function that generates a [[Vector]] object from [[Particle]]
|
|
163
|
+
* @param init the [[IMovePathGenerator]] init function, if the first parameter is a generator function
|
|
164
|
+
* @param update the [[IMovePathGenerator]] update function, if the first parameter is a generator function
|
|
165
|
+
*/
|
|
125
166
|
setPath(pathOrGenerator, init, update) {
|
|
126
167
|
if (!pathOrGenerator) {
|
|
127
168
|
return;
|
|
@@ -147,6 +188,9 @@ export class Container {
|
|
|
147
188
|
}
|
|
148
189
|
}
|
|
149
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Destroys the current container, invalidating it
|
|
193
|
+
*/
|
|
150
194
|
destroy() {
|
|
151
195
|
this.stop();
|
|
152
196
|
this.canvas.destroy();
|
|
@@ -160,17 +204,35 @@ export class Container {
|
|
|
160
204
|
}
|
|
161
205
|
this.destroyed = true;
|
|
162
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated this method is deprecated, please use the exportImage method
|
|
209
|
+
* @param callback The callback to handle the image
|
|
210
|
+
*/
|
|
163
211
|
exportImg(callback) {
|
|
164
212
|
this.exportImage(callback);
|
|
165
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Exports the current canvas image, `background` property of `options` won't be rendered because it's css related
|
|
216
|
+
* @param callback The callback to handle the image
|
|
217
|
+
* @param type The exported image type
|
|
218
|
+
* @param quality The exported image quality
|
|
219
|
+
*/
|
|
166
220
|
exportImage(callback, type, quality) {
|
|
167
221
|
var _a;
|
|
168
222
|
return (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.toBlob(callback, type !== null && type !== void 0 ? type : "image/png", quality);
|
|
169
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Exports the current configuration using `options` property
|
|
226
|
+
* @returns a JSON string created from `options` property
|
|
227
|
+
*/
|
|
170
228
|
exportConfiguration() {
|
|
171
229
|
return JSON.stringify(this.actualOptions, undefined, 2);
|
|
172
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Restarts the container, just a [[stop]]/[[start]] alias
|
|
233
|
+
*/
|
|
173
234
|
refresh() {
|
|
235
|
+
/* restart */
|
|
174
236
|
this.stop();
|
|
175
237
|
return this.start();
|
|
176
238
|
}
|
|
@@ -178,6 +240,9 @@ export class Container {
|
|
|
178
240
|
this._options = new Options();
|
|
179
241
|
return this.refresh();
|
|
180
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Stops the container, opposite to `start`. Clears some resources and stops events.
|
|
245
|
+
*/
|
|
181
246
|
stop() {
|
|
182
247
|
if (!this.started) {
|
|
183
248
|
return;
|
|
@@ -202,11 +267,19 @@ export class Container {
|
|
|
202
267
|
this.particles.linksColors = new Map();
|
|
203
268
|
delete this.particles.grabLineColor;
|
|
204
269
|
delete this.particles.linksColor;
|
|
270
|
+
this._sourceOptions = this._options;
|
|
205
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Loads the given theme, overriding the options
|
|
274
|
+
* @param name the theme name, if `undefined` resets the default options or the default theme
|
|
275
|
+
*/
|
|
206
276
|
async loadTheme(name) {
|
|
207
277
|
this.currentTheme = name;
|
|
208
278
|
await this.refresh();
|
|
209
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Starts the container, initializes what are needed to create animations and event handling
|
|
282
|
+
*/
|
|
210
283
|
async start() {
|
|
211
284
|
if (this.started) {
|
|
212
285
|
return;
|
|
@@ -306,12 +379,33 @@ export class Container {
|
|
|
306
379
|
el.addEventListener("touchcancel", touchCancelHandler);
|
|
307
380
|
}
|
|
308
381
|
updateActualOptions() {
|
|
309
|
-
this.actualOptions.
|
|
382
|
+
this.actualOptions.responsive = [];
|
|
383
|
+
const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
|
|
310
384
|
this.actualOptions.setTheme(this.currentTheme);
|
|
385
|
+
if (this.responsiveMaxWidth != newMaxWidth) {
|
|
386
|
+
this.responsiveMaxWidth = newMaxWidth;
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
return false;
|
|
311
390
|
}
|
|
312
391
|
async init() {
|
|
392
|
+
this._options = new Options();
|
|
393
|
+
for (const preset of this.presets) {
|
|
394
|
+
this._options.load(Plugins.getPreset(preset));
|
|
395
|
+
}
|
|
396
|
+
const shapes = Plugins.getSupportedShapes();
|
|
397
|
+
for (const type of shapes) {
|
|
398
|
+
const drawer = Plugins.getShapeDrawer(type);
|
|
399
|
+
if (drawer) {
|
|
400
|
+
this.drawers.set(type, drawer);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
/* options settings */
|
|
404
|
+
this._options.load(this._initialSourceOptions);
|
|
405
|
+
this._options.load(this._sourceOptions);
|
|
313
406
|
this.actualOptions = new Options();
|
|
314
407
|
this.actualOptions.load(this._options);
|
|
408
|
+
/* init canvas + particles */
|
|
315
409
|
this.retina.init();
|
|
316
410
|
this.canvas.init();
|
|
317
411
|
this.updateActualOptions();
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { Container } from "./Container";
|
|
2
|
+
/**
|
|
3
|
+
* @category Core
|
|
4
|
+
*/
|
|
2
5
|
export declare class FrameManager {
|
|
3
6
|
private readonly container;
|
|
4
7
|
constructor(container: Container);
|
|
8
|
+
/**
|
|
9
|
+
* Handles the rAF method preparing the next animation frame to be drawn
|
|
10
|
+
* limiting it if it's needed by the current configuration
|
|
11
|
+
* @param timestamp
|
|
12
|
+
*/
|
|
5
13
|
nextFrame(timestamp: DOMHighResTimeStamp): void;
|
|
6
14
|
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Core
|
|
3
|
+
*/
|
|
1
4
|
export class FrameManager {
|
|
2
5
|
constructor(container) {
|
|
3
6
|
this.container = container;
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Handles the rAF method preparing the next animation frame to be drawn
|
|
10
|
+
* limiting it if it's needed by the current configuration
|
|
11
|
+
* @param timestamp
|
|
12
|
+
*/
|
|
5
13
|
nextFrame(timestamp) {
|
|
6
14
|
var _a;
|
|
7
15
|
try {
|
|
8
16
|
const container = this.container;
|
|
17
|
+
// FPS limit logic - if we are too fast, just draw without updating
|
|
9
18
|
if (container.lastFrameTime !== undefined &&
|
|
10
19
|
timestamp < container.lastFrameTime + 1000 / container.fpsLimit) {
|
|
11
20
|
container.draw(false);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { Container } from "./Container";
|
|
2
2
|
import type { Particle } from "./Particle";
|
|
3
3
|
import type { IDelta } from "./Interfaces";
|
|
4
|
+
/**
|
|
5
|
+
* @category Core
|
|
6
|
+
*/
|
|
4
7
|
export declare class InteractionManager {
|
|
5
8
|
private readonly container;
|
|
6
9
|
private readonly externalInteractors;
|
|
7
10
|
private readonly particleInteractors;
|
|
8
11
|
constructor(container: Container);
|
|
12
|
+
init(): void;
|
|
9
13
|
externalInteract(delta: IDelta): void;
|
|
10
14
|
particlesInteract(particle: Particle, delta: IDelta): void;
|
|
11
15
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { Plugins } from "../Utils";
|
|
2
2
|
import { InteractorType } from "../Enums";
|
|
3
|
+
/**
|
|
4
|
+
* @category Core
|
|
5
|
+
*/
|
|
3
6
|
export class InteractionManager {
|
|
4
7
|
constructor(container) {
|
|
5
8
|
this.container = container;
|
|
6
|
-
const interactors = Plugins.getInteractors(container);
|
|
7
9
|
this.externalInteractors = [];
|
|
8
10
|
this.particleInteractors = [];
|
|
11
|
+
this.init();
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
const interactors = Plugins.getInteractors(this.container, true);
|
|
9
15
|
for (const interactor of interactors) {
|
|
10
16
|
switch (interactor.type) {
|
|
11
17
|
case InteractorType.External:
|
|
@@ -28,6 +34,7 @@ export class InteractionManager {
|
|
|
28
34
|
for (const interactor of this.externalInteractors) {
|
|
29
35
|
interactor.reset(particle);
|
|
30
36
|
}
|
|
37
|
+
/* interaction auto between particles */
|
|
31
38
|
for (const interactor of this.particleInteractors) {
|
|
32
39
|
if (interactor.isEnabled(particle)) {
|
|
33
40
|
interactor.interact(particle, delta);
|
|
@@ -2,14 +2,28 @@ import type { SingleOrMultiple } from "../../Types";
|
|
|
2
2
|
export interface IAlphaColor {
|
|
3
3
|
a: number;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Color
|
|
7
|
+
* [[include:Color.md]]
|
|
8
|
+
* @category Interfaces
|
|
9
|
+
*/
|
|
5
10
|
export interface IColor {
|
|
11
|
+
/**
|
|
12
|
+
* Color value, can be a single or an array of [[IValueColor]], [[IRgb]], [[IHsl]] or string
|
|
13
|
+
*/
|
|
6
14
|
value: SingleOrMultiple<IValueColor | IRgb | IHsl | IHsv | SingleOrMultiple<string>>;
|
|
7
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* @category Interfaces
|
|
18
|
+
*/
|
|
8
19
|
export interface IHsl {
|
|
9
20
|
h: number;
|
|
10
21
|
s: number;
|
|
11
22
|
l: number;
|
|
12
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* @category Interfaces
|
|
26
|
+
*/
|
|
13
27
|
export interface IHsla extends IHsl, IAlphaColor {
|
|
14
28
|
}
|
|
15
29
|
export interface IHsv {
|
|
@@ -19,13 +33,22 @@ export interface IHsv {
|
|
|
19
33
|
}
|
|
20
34
|
export interface IHsva extends IHsv, IAlphaColor {
|
|
21
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* @category Interfaces
|
|
38
|
+
*/
|
|
22
39
|
export interface IRgb {
|
|
23
40
|
r: number;
|
|
24
41
|
g: number;
|
|
25
42
|
b: number;
|
|
26
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* @category Interfaces
|
|
46
|
+
*/
|
|
27
47
|
export interface IRgba extends IRgb, IAlphaColor {
|
|
28
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* @category Interfaces
|
|
51
|
+
*/
|
|
29
52
|
export interface IValueColor {
|
|
30
53
|
rgb?: IRgb;
|
|
31
54
|
hsl?: IHsl;
|
|
@@ -5,6 +5,9 @@ import type { RecursivePartial } from "../../Types";
|
|
|
5
5
|
import type { IOptions } from "../../Options/Interfaces/IOptions";
|
|
6
6
|
import type { IDelta } from "./IDelta";
|
|
7
7
|
import type { IColor } from "./Colors";
|
|
8
|
+
/**
|
|
9
|
+
* @category Interfaces
|
|
10
|
+
*/
|
|
8
11
|
export interface IContainerPlugin {
|
|
9
12
|
clickPositionValid?: (position: ICoordinates) => boolean;
|
|
10
13
|
draw?: (context: CanvasRenderingContext2D, delta: IDelta) => void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Container } from "../Container";
|
|
2
2
|
import type { Particle } from "../Particle";
|
|
3
3
|
import { Vector } from "../Particle/Vector";
|
|
4
|
+
/**
|
|
5
|
+
* @category Interfaces
|
|
6
|
+
*/
|
|
4
7
|
export interface IMovePathGenerator {
|
|
5
8
|
generate: (particle: Particle) => Vector;
|
|
6
9
|
init: (container: Container) => void;
|
|
@@ -12,6 +12,9 @@ import type { IParticleGradientAnimation } from "./IParticleGradientAnimation";
|
|
|
12
12
|
import type { IParticleRetinaProps } from "./IParticleRetinaProps";
|
|
13
13
|
import type { IParticleRoll } from "./IParticleRoll";
|
|
14
14
|
import type { IParticleWobble } from "./IParticleWobble";
|
|
15
|
+
/**
|
|
16
|
+
* @category Interfaces
|
|
17
|
+
*/
|
|
15
18
|
export interface IParticle {
|
|
16
19
|
misplaced: boolean;
|
|
17
20
|
randomIndexData?: number;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Particle } from "../Particle";
|
|
2
2
|
import type { IInteractor } from "./IInteractor";
|
|
3
3
|
import type { IDelta } from "./IDelta";
|
|
4
|
+
/**
|
|
5
|
+
* @category Interfaces
|
|
6
|
+
*/
|
|
4
7
|
export interface IParticlesInteractor extends IInteractor {
|
|
5
8
|
isEnabled(particle: Particle): boolean;
|
|
6
9
|
interact(particle: Particle, delta: IDelta): void;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [[include:Plugins.md]]
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
1
5
|
import type { Container } from "../Container";
|
|
2
6
|
import type { IContainerPlugin } from "./IContainerPlugin";
|
|
3
7
|
import type { IOptions } from "../../Options/Interfaces/IOptions";
|
|
4
8
|
import type { RecursivePartial } from "../../Types";
|
|
5
9
|
import type { Options } from "../../Options/Classes/Options";
|
|
10
|
+
/**
|
|
11
|
+
* [[include:Plugins.md]]
|
|
12
|
+
* @category Interfaces
|
|
13
|
+
*/
|
|
6
14
|
export interface IPlugin {
|
|
7
15
|
readonly id: string;
|
|
8
16
|
needsPlugin(options?: RecursivePartial<IOptions>): boolean;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { ShapeDrawerAfterEffectFunction, ShapeDrawerDestroyFunction, ShapeDrawerDrawFunction, ShapeDrawerInitFunction, ShapeDrawerLoadFunction, ShapeDrawerParticleInitFunction, ShapeDrawerSidesCountFunction } from "../../Types";
|
|
2
|
+
/**
|
|
3
|
+
* @category Interfaces
|
|
4
|
+
*/
|
|
2
5
|
export interface IShapeDrawer {
|
|
3
6
|
getSidesCount?: ShapeDrawerSidesCountFunction;
|
|
4
7
|
init?: ShapeDrawerInitFunction;
|
package/browser/Core/Loader.d.ts
CHANGED
|
@@ -15,15 +15,60 @@ interface RemoteLoaderParams {
|
|
|
15
15
|
tagId?: string;
|
|
16
16
|
url?: SingleOrMultiple<string>;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Main class for creating the [[Container]] objects
|
|
20
|
+
* @category Core
|
|
21
|
+
*/
|
|
18
22
|
export declare class Loader {
|
|
23
|
+
/**
|
|
24
|
+
* All the [[Container]] objects loaded
|
|
25
|
+
*/
|
|
19
26
|
static dom(): Container[];
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a [[Container]] from all the objects loaded
|
|
29
|
+
* @param index the object index
|
|
30
|
+
*/
|
|
20
31
|
static domItem(index: number): Container | undefined;
|
|
21
32
|
static loadOptions(params: LoaderParams): Promise<Container | undefined>;
|
|
22
33
|
static loadRemoteOptions(params: RemoteLoaderParams): Promise<Container | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Loads the provided options to create a [[Container]] object.
|
|
36
|
+
* @param tagId the particles container element id
|
|
37
|
+
* @param options the options object to initialize the [[Container]]
|
|
38
|
+
* @param index if an options array is provided, this will retrieve the exact index of that array
|
|
39
|
+
*/
|
|
23
40
|
static load(tagId: string | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>> | number, index?: number): Promise<Container | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Loads the provided options to create a [[Container]] object.
|
|
43
|
+
* @param id the particles container element id
|
|
44
|
+
* @param domContainer the dom container
|
|
45
|
+
* @param options the options object to initialize the [[Container]]
|
|
46
|
+
* @param index if an options array is provided, this will retrieve the exact index of that array
|
|
47
|
+
*/
|
|
24
48
|
static set(id: string | HTMLElement, domContainer: HTMLElement | SingleOrMultiple<RecursivePartial<IOptions>>, options?: SingleOrMultiple<RecursivePartial<IOptions>> | number, index?: number): Promise<Container | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Loads the provided json with a GET request. The content will be used to create a [[Container]] object.
|
|
51
|
+
* This method is async, so if you need a callback refer to JavaScript function `fetch`
|
|
52
|
+
* @param tagId the particles container element id
|
|
53
|
+
* @param jsonUrl 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
|
+
*/
|
|
25
57
|
static loadJSON(tagId: string | SingleOrMultiple<string>, jsonUrl?: SingleOrMultiple<string> | number, index?: number): Promise<Container | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* Loads the provided json with a GET request. The content will be used to create a [[Container]] object.
|
|
60
|
+
* This method is async, so if you need a callback refer to JavaScript function `fetch`
|
|
61
|
+
* @param id the particles container element id
|
|
62
|
+
* @param domContainer the container used to contains the particles
|
|
63
|
+
* @param jsonUrl the json path (or paths array) to use in the GET request
|
|
64
|
+
* @param index the index of the paths array, if a single path is passed this value is ignored
|
|
65
|
+
* @returns A Promise with the [[Container]] object created
|
|
66
|
+
*/
|
|
26
67
|
static setJSON(id: string | HTMLElement, domContainer: HTMLElement | SingleOrMultiple<string>, jsonUrl: SingleOrMultiple<string> | (number | undefined), index?: number): Promise<Container | undefined>;
|
|
68
|
+
/**
|
|
69
|
+
* Adds an additional click handler to all the loaded [[Container]] objects.
|
|
70
|
+
* @param callback the function called after the click event is fired
|
|
71
|
+
*/
|
|
27
72
|
static setOnClickHandler(callback: (evt: Event, particles?: Particle[]) => void): void;
|
|
28
73
|
}
|
|
29
74
|
export {};
|