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/Core/Canvas.js
CHANGED
|
@@ -75,23 +75,21 @@ class Canvas {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
windowResize() {
|
|
78
|
-
var _a;
|
|
79
78
|
if (!this.element) {
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
81
|
const container = this.container;
|
|
83
82
|
this.resize();
|
|
84
|
-
|
|
85
|
-
delete this.resizeFactor;
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
container.updateActualOptions();
|
|
83
|
+
const needsRefresh = container.updateActualOptions();
|
|
89
84
|
container.particles.setDensity();
|
|
90
85
|
for (const [, plugin] of container.plugins) {
|
|
91
86
|
if (plugin.resize !== undefined) {
|
|
92
87
|
plugin.resize();
|
|
93
88
|
}
|
|
94
89
|
}
|
|
90
|
+
if (needsRefresh) {
|
|
91
|
+
container.refresh();
|
|
92
|
+
}
|
|
95
93
|
}
|
|
96
94
|
resize() {
|
|
97
95
|
if (!this.element) {
|
package/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/Core/Container.js
CHANGED
|
@@ -26,6 +26,7 @@ class Container {
|
|
|
26
26
|
this.canvas = new Canvas_1.Canvas(this);
|
|
27
27
|
this.particles = new Particles_1.Particles(this);
|
|
28
28
|
this.drawer = new FrameManager_1.FrameManager(this);
|
|
29
|
+
this.presets = presets;
|
|
29
30
|
this.pathGenerator = {
|
|
30
31
|
generate: () => {
|
|
31
32
|
const v = Vector_1.Vector.create(0, 0);
|
|
@@ -52,17 +53,6 @@ class Container {
|
|
|
52
53
|
this.density = 1;
|
|
53
54
|
this._options = new Options_1.Options();
|
|
54
55
|
this.actualOptions = new Options_1.Options();
|
|
55
|
-
for (const preset of presets) {
|
|
56
|
-
this._options.load(Utils_1.Plugins.getPreset(preset));
|
|
57
|
-
}
|
|
58
|
-
const shapes = Utils_1.Plugins.getSupportedShapes();
|
|
59
|
-
for (const type of shapes) {
|
|
60
|
-
const drawer = Utils_1.Plugins.getShapeDrawer(type);
|
|
61
|
-
if (drawer) {
|
|
62
|
-
this.drawers.set(type, drawer);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
this._options.load(this._sourceOptions);
|
|
66
56
|
this.eventListeners = new Utils_1.EventListeners(this);
|
|
67
57
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
68
58
|
this.intersectionObserver = new IntersectionObserver((entries) => this.intersectionManager(entries));
|
|
@@ -205,6 +195,7 @@ class Container {
|
|
|
205
195
|
this.particles.linksColors = new Map();
|
|
206
196
|
delete this.particles.grabLineColor;
|
|
207
197
|
delete this.particles.linksColor;
|
|
198
|
+
this._sourceOptions = this._options;
|
|
208
199
|
}
|
|
209
200
|
async loadTheme(name) {
|
|
210
201
|
this.currentTheme = name;
|
|
@@ -309,10 +300,28 @@ class Container {
|
|
|
309
300
|
el.addEventListener("touchcancel", touchCancelHandler);
|
|
310
301
|
}
|
|
311
302
|
updateActualOptions() {
|
|
312
|
-
this.actualOptions.
|
|
303
|
+
this.actualOptions.responsive = [];
|
|
304
|
+
const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
|
|
313
305
|
this.actualOptions.setTheme(this.currentTheme);
|
|
306
|
+
if (this.responsiveMaxWidth != newMaxWidth) {
|
|
307
|
+
this.responsiveMaxWidth = newMaxWidth;
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
return false;
|
|
314
311
|
}
|
|
315
312
|
async init() {
|
|
313
|
+
this._options = new Options_1.Options();
|
|
314
|
+
for (const preset of this.presets) {
|
|
315
|
+
this._options.load(Utils_1.Plugins.getPreset(preset));
|
|
316
|
+
}
|
|
317
|
+
const shapes = Utils_1.Plugins.getSupportedShapes();
|
|
318
|
+
for (const type of shapes) {
|
|
319
|
+
const drawer = Utils_1.Plugins.getShapeDrawer(type);
|
|
320
|
+
if (drawer) {
|
|
321
|
+
this.drawers.set(type, drawer);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
this._options.load(this._sourceOptions);
|
|
316
325
|
this.actualOptions = new Options_1.Options();
|
|
317
326
|
this.actualOptions.load(this._options);
|
|
318
327
|
this.retina.init();
|
package/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 {};
|
package/Core/Loader.js
CHANGED
|
@@ -20,19 +20,19 @@ class Loader {
|
|
|
20
20
|
}
|
|
21
21
|
dom.splice(index, 1);
|
|
22
22
|
}
|
|
23
|
-
static async
|
|
24
|
-
|
|
23
|
+
static async loadOptions(params) {
|
|
24
|
+
var _a, _b, _c;
|
|
25
|
+
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 10000)}`;
|
|
26
|
+
const { options, index } = params;
|
|
27
|
+
let domContainer = (_b = params.element) !== null && _b !== void 0 ? _b : document.getElementById(tagId);
|
|
25
28
|
if (!domContainer) {
|
|
26
29
|
domContainer = document.createElement("div");
|
|
27
30
|
domContainer.id = tagId;
|
|
28
|
-
document.append(domContainer);
|
|
31
|
+
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
29
32
|
}
|
|
30
|
-
return Loader.set(tagId, domContainer, options, index);
|
|
31
|
-
}
|
|
32
|
-
static async set(id, domContainer, options, index) {
|
|
33
33
|
const currentOptions = options instanceof Array ? (0, Utils_1.itemFromArray)(options, index) : options;
|
|
34
34
|
const dom = Loader.dom();
|
|
35
|
-
const oldIndex = dom.findIndex((v) => v.id ===
|
|
35
|
+
const oldIndex = dom.findIndex((v) => v.id === tagId);
|
|
36
36
|
if (oldIndex >= 0) {
|
|
37
37
|
const old = Loader.domItem(oldIndex);
|
|
38
38
|
if (old && !old.destroyed) {
|
|
@@ -64,7 +64,7 @@ class Loader {
|
|
|
64
64
|
domContainer.appendChild(canvasEl);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const newItem = new Container_1.Container(
|
|
67
|
+
const newItem = new Container_1.Container(tagId, currentOptions);
|
|
68
68
|
if (oldIndex >= 0) {
|
|
69
69
|
dom.splice(oldIndex, 0, newItem);
|
|
70
70
|
}
|
|
@@ -75,26 +75,88 @@ class Loader {
|
|
|
75
75
|
await newItem.start();
|
|
76
76
|
return newItem;
|
|
77
77
|
}
|
|
78
|
-
static async
|
|
78
|
+
static async loadRemoteOptions(params) {
|
|
79
|
+
const { url: jsonUrl, index } = params;
|
|
79
80
|
const url = jsonUrl instanceof Array ? (0, Utils_1.itemFromArray)(jsonUrl, index) : jsonUrl;
|
|
81
|
+
if (!url) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
80
84
|
const response = await fetch(url);
|
|
81
|
-
if (response.ok) {
|
|
82
|
-
|
|
85
|
+
if (!response.ok) {
|
|
86
|
+
fetchError(response.status);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const data = await response.json();
|
|
90
|
+
return await Loader.loadOptions({
|
|
91
|
+
tagId: params.tagId,
|
|
92
|
+
element: params.element,
|
|
93
|
+
index,
|
|
94
|
+
options: data,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
static load(tagId, options, index) {
|
|
98
|
+
const params = { index };
|
|
99
|
+
if (typeof tagId === "string") {
|
|
100
|
+
params.tagId = tagId;
|
|
83
101
|
}
|
|
84
102
|
else {
|
|
85
|
-
|
|
103
|
+
params.options = tagId;
|
|
104
|
+
}
|
|
105
|
+
if (typeof options === "number") {
|
|
106
|
+
params.index = options !== null && options !== void 0 ? options : params.index;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
params.options = options !== null && options !== void 0 ? options : params.options;
|
|
110
|
+
}
|
|
111
|
+
return this.loadOptions(params);
|
|
112
|
+
}
|
|
113
|
+
static async set(id, domContainer, options, index) {
|
|
114
|
+
const params = { index };
|
|
115
|
+
if (typeof id === "string") {
|
|
116
|
+
params.tagId = id;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
params.element = id;
|
|
120
|
+
}
|
|
121
|
+
if (domContainer instanceof HTMLElement) {
|
|
122
|
+
params.element = domContainer;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
params.options = domContainer;
|
|
86
126
|
}
|
|
127
|
+
if (typeof options === "number") {
|
|
128
|
+
params.index = options;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
params.options = options !== null && options !== void 0 ? options : params.options;
|
|
132
|
+
}
|
|
133
|
+
return this.loadOptions(params);
|
|
134
|
+
}
|
|
135
|
+
static async loadJSON(tagId, jsonUrl, index) {
|
|
136
|
+
let url, id;
|
|
137
|
+
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
138
|
+
url = tagId;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
id = tagId;
|
|
142
|
+
url = jsonUrl;
|
|
143
|
+
}
|
|
144
|
+
return await Loader.loadRemoteOptions({ tagId: id, url, index });
|
|
87
145
|
}
|
|
88
146
|
static async setJSON(id, domContainer, jsonUrl, index) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
147
|
+
let url, newId, newIndex, element;
|
|
148
|
+
if (id instanceof HTMLElement) {
|
|
149
|
+
element = id;
|
|
150
|
+
url = domContainer;
|
|
151
|
+
newIndex = jsonUrl;
|
|
94
152
|
}
|
|
95
153
|
else {
|
|
96
|
-
|
|
154
|
+
newId = id;
|
|
155
|
+
element = domContainer;
|
|
156
|
+
url = jsonUrl;
|
|
157
|
+
newIndex = index;
|
|
97
158
|
}
|
|
159
|
+
return await Loader.loadRemoteOptions({ tagId: newId, url, index: newIndex, element });
|
|
98
160
|
}
|
|
99
161
|
static setOnClickHandler(callback) {
|
|
100
162
|
const dom = Loader.dom();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResponsiveMode = void 0;
|
|
4
|
+
var ResponsiveMode;
|
|
5
|
+
(function (ResponsiveMode) {
|
|
6
|
+
ResponsiveMode["screen"] = "screen";
|
|
7
|
+
ResponsiveMode["canvas"] = "canvas";
|
|
8
|
+
})(ResponsiveMode = exports.ResponsiveMode || (exports.ResponsiveMode = {}));
|
package/Enums/Modes/index.d.ts
CHANGED
package/Enums/Modes/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadExternalAttractInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadExternalAttractInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalAttractInteraction = void 0;
|
|
4
4
|
const Attractor_1 = require("./Attractor");
|
|
5
|
-
function loadExternalAttractInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("externalAttract", (container) => new Attractor_1.Attractor(container));
|
|
5
|
+
async function loadExternalAttractInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("externalAttract", (container) => new Attractor_1.Attractor(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalAttractInteraction = loadExternalAttractInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadExternalBounceInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadExternalBounceInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalBounceInteraction = void 0;
|
|
4
4
|
const Bouncer_1 = require("./Bouncer");
|
|
5
|
-
function loadExternalBounceInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("externalBounce", (container) => new Bouncer_1.Bouncer(container));
|
|
5
|
+
async function loadExternalBounceInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("externalBounce", (container) => new Bouncer_1.Bouncer(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalBounceInteraction = loadExternalBounceInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadExternalBubbleInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadExternalBubbleInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalBubbleInteraction = void 0;
|
|
4
4
|
const Bubbler_1 = require("./Bubbler");
|
|
5
|
-
function loadExternalBubbleInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("externalBubble", (container) => new Bubbler_1.Bubbler(container));
|
|
5
|
+
async function loadExternalBubbleInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("externalBubble", (container) => new Bubbler_1.Bubbler(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalBubbleInteraction = loadExternalBubbleInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadExternalConnectInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadExternalConnectInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalConnectInteraction = void 0;
|
|
4
4
|
const Connector_1 = require("./Connector");
|
|
5
|
-
function loadExternalConnectInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("externalConnect", (container) => new Connector_1.Connector(container));
|
|
5
|
+
async function loadExternalConnectInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("externalConnect", (container) => new Connector_1.Connector(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalConnectInteraction = loadExternalConnectInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadExternalGrabInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadExternalGrabInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalGrabInteraction = void 0;
|
|
4
4
|
const Grabber_1 = require("./Grabber");
|
|
5
|
-
function loadExternalGrabInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("externalGrab", (container) => new Grabber_1.Grabber(container));
|
|
5
|
+
async function loadExternalGrabInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("externalGrab", (container) => new Grabber_1.Grabber(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalGrabInteraction = loadExternalGrabInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadExternalRepulseInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadExternalRepulseInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalRepulseInteraction = void 0;
|
|
4
4
|
const Repulser_1 = require("./Repulser");
|
|
5
|
-
function loadExternalRepulseInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("externalRepulse", (container) => new Repulser_1.Repulser(container));
|
|
5
|
+
async function loadExternalRepulseInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("externalRepulse", (container) => new Repulser_1.Repulser(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalRepulseInteraction = loadExternalRepulseInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadExternalTrailInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadExternalTrailInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadExternalTrailInteraction = void 0;
|
|
4
4
|
const TrailMaker_1 = require("./TrailMaker");
|
|
5
|
-
function loadExternalTrailInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("externalTrail", (container) => new TrailMaker_1.TrailMaker(container));
|
|
5
|
+
async function loadExternalTrailInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("externalTrail", (container) => new TrailMaker_1.TrailMaker(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadExternalTrailInteraction = loadExternalTrailInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadParticlesAttractInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadParticlesAttractInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadParticlesAttractInteraction = void 0;
|
|
4
4
|
const Attractor_1 = require("./Attractor");
|
|
5
|
-
function loadParticlesAttractInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container));
|
|
5
|
+
async function loadParticlesAttractInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadParticlesAttractInteraction = loadParticlesAttractInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadParticlesCollisionsInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadParticlesCollisionsInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadParticlesCollisionsInteraction = void 0;
|
|
4
4
|
const Collider_1 = require("./Collider");
|
|
5
|
-
function loadParticlesCollisionsInteraction(tsParticles) {
|
|
6
|
-
tsParticles.addInteractor("particlesCollisions", (container) => new Collider_1.Collider(container));
|
|
5
|
+
async function loadParticlesCollisionsInteraction(tsParticles) {
|
|
6
|
+
await tsParticles.addInteractor("particlesCollisions", (container) => new Collider_1.Collider(container));
|
|
7
7
|
}
|
|
8
8
|
exports.loadParticlesCollisionsInteraction = loadParticlesCollisionsInteraction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadInteraction(tsParticles: Main): void
|
|
3
|
-
export declare function loadParticlesLinksInteraction(tsParticles: Main): void
|
|
2
|
+
export declare function loadInteraction(tsParticles: Main): Promise<void>;
|
|
3
|
+
export declare function loadParticlesLinksInteraction(tsParticles: Main): Promise<void>;
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.loadParticlesLinksInteraction = exports.loadInteraction = void 0;
|
|
4
4
|
const Linker_1 = require("./Linker");
|
|
5
5
|
const plugin_1 = require("./plugin");
|
|
6
|
-
function loadInteraction(tsParticles) {
|
|
7
|
-
tsParticles.addInteractor("particlesLinks", (container) => new Linker_1.Linker(container));
|
|
6
|
+
async function loadInteraction(tsParticles) {
|
|
7
|
+
await tsParticles.addInteractor("particlesLinks", (container) => new Linker_1.Linker(container));
|
|
8
8
|
}
|
|
9
9
|
exports.loadInteraction = loadInteraction;
|
|
10
|
-
function loadParticlesLinksInteraction(tsParticles) {
|
|
11
|
-
loadInteraction(tsParticles);
|
|
12
|
-
(0, plugin_1.loadPlugin)(tsParticles);
|
|
10
|
+
async function loadParticlesLinksInteraction(tsParticles) {
|
|
11
|
+
await loadInteraction(tsParticles);
|
|
12
|
+
await (0, plugin_1.loadPlugin)(tsParticles);
|
|
13
13
|
}
|
|
14
14
|
exports.loadParticlesLinksInteraction = loadParticlesLinksInteraction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../../main";
|
|
2
|
-
export declare function loadPlugin(tsParticles: Main): void
|
|
2
|
+
export declare function loadPlugin(tsParticles: Main): Promise<void>;
|
|
@@ -15,8 +15,8 @@ class Plugin {
|
|
|
15
15
|
loadOptions() {
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function loadPlugin(tsParticles) {
|
|
18
|
+
async function loadPlugin(tsParticles) {
|
|
19
19
|
const plugin = new Plugin();
|
|
20
|
-
tsParticles.addPlugin(plugin);
|
|
20
|
+
await tsParticles.addPlugin(plugin);
|
|
21
21
|
}
|
|
22
22
|
exports.loadPlugin = loadPlugin;
|
|
@@ -6,7 +6,7 @@ const Events_1 = require("./Events/Events");
|
|
|
6
6
|
const Modes_1 = require("./Modes/Modes");
|
|
7
7
|
class Interactivity {
|
|
8
8
|
constructor() {
|
|
9
|
-
this.detectsOn = Enums_1.InteractivityDetect.
|
|
9
|
+
this.detectsOn = Enums_1.InteractivityDetect.window;
|
|
10
10
|
this.events = new Events_1.Events();
|
|
11
11
|
this.modes = new Modes_1.Modes();
|
|
12
12
|
}
|
|
@@ -41,6 +41,6 @@ export declare class Options implements IOptions, IOptionLoader<IOptions> {
|
|
|
41
41
|
constructor();
|
|
42
42
|
load(data?: RecursivePartial<IOptions>): void;
|
|
43
43
|
setTheme(name?: string): void;
|
|
44
|
-
setResponsive(width: number, pxRatio: number, defaultOptions: IOptions):
|
|
44
|
+
setResponsive(width: number, pxRatio: number, defaultOptions: IOptions): number | undefined;
|
|
45
45
|
private importPreset;
|
|
46
46
|
}
|
|
@@ -147,9 +147,12 @@ class Options {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
setResponsive(width, pxRatio, defaultOptions) {
|
|
150
|
-
var _a;
|
|
151
150
|
this.load(defaultOptions);
|
|
152
|
-
|
|
151
|
+
const responsiveOptions = this.responsive.find((t) => t.mode === Enums_1.ResponsiveMode.screen && screen
|
|
152
|
+
? t.maxWidth * pxRatio > screen.availWidth
|
|
153
|
+
: t.maxWidth * pxRatio > width);
|
|
154
|
+
this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
|
|
155
|
+
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
153
156
|
}
|
|
154
157
|
importPreset(preset) {
|
|
155
158
|
this.load(Utils_1.Plugins.getPreset(preset));
|
|
@@ -2,9 +2,11 @@ import type { IResponsive } from "../Interfaces/IResponsive";
|
|
|
2
2
|
import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
3
3
|
import type { RecursivePartial } from "../../Types";
|
|
4
4
|
import type { IOptions } from "../Interfaces/IOptions";
|
|
5
|
+
import { ResponsiveMode } from "../../Enums";
|
|
5
6
|
export declare class Responsive implements IResponsive, IOptionLoader<IResponsive> {
|
|
6
7
|
maxWidth: number;
|
|
7
8
|
options: RecursivePartial<IOptions>;
|
|
9
|
+
mode: ResponsiveMode;
|
|
8
10
|
constructor();
|
|
9
11
|
load(data?: RecursivePartial<IResponsive>): void;
|
|
10
12
|
}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Responsive = void 0;
|
|
4
4
|
const Utils_1 = require("../../Utils");
|
|
5
|
+
const Enums_1 = require("../../Enums");
|
|
5
6
|
class Responsive {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.maxWidth = Infinity;
|
|
8
9
|
this.options = {};
|
|
10
|
+
this.mode = Enums_1.ResponsiveMode.canvas;
|
|
9
11
|
}
|
|
10
12
|
load(data) {
|
|
11
13
|
if (!data) {
|
|
@@ -14,6 +16,14 @@ class Responsive {
|
|
|
14
16
|
if (data.maxWidth !== undefined) {
|
|
15
17
|
this.maxWidth = data.maxWidth;
|
|
16
18
|
}
|
|
19
|
+
if (data.mode !== undefined) {
|
|
20
|
+
if (data.mode === Enums_1.ResponsiveMode.screen) {
|
|
21
|
+
this.mode = Enums_1.ResponsiveMode.screen;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this.mode = Enums_1.ResponsiveMode.canvas;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
17
27
|
if (data.options !== undefined) {
|
|
18
28
|
this.options = (0, Utils_1.deepExtend)({}, data.options);
|
|
19
29
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ResponsiveMode } from "../../Enums";
|
|
1
2
|
import type { RecursivePartial } from "../../Types";
|
|
2
3
|
import type { IOptions } from "./IOptions";
|
|
3
4
|
export interface IResponsive {
|
|
4
5
|
maxWidth: number;
|
|
5
6
|
options: RecursivePartial<IOptions>;
|
|
7
|
+
mode: ResponsiveMode;
|
|
6
8
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Main } from "../../main";
|
|
2
|
-
export declare function loadAbsorbersPlugin(tsParticles: Main): void
|
|
2
|
+
export declare function loadAbsorbersPlugin(tsParticles: Main): Promise<void>;
|
|
@@ -74,8 +74,8 @@ class Plugin {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function loadAbsorbersPlugin(tsParticles) {
|
|
77
|
+
async function loadAbsorbersPlugin(tsParticles) {
|
|
78
78
|
const plugin = new Plugin();
|
|
79
|
-
tsParticles.addPlugin(plugin);
|
|
79
|
+
await tsParticles.addPlugin(plugin);
|
|
80
80
|
}
|
|
81
81
|
exports.loadAbsorbersPlugin = loadAbsorbersPlugin;
|