tsparticles 1.39.0 → 1.40.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.d.ts +1 -1
- package/Core/Canvas.js +27 -27
- package/Core/Container.d.ts +8 -6
- package/Core/Container.js +33 -18
- package/Core/Interfaces/Gradients.d.ts +2 -2
- package/Core/Interfaces/ICircleBouncer.d.ts +1 -1
- package/Core/Interfaces/IContainerPlugin.d.ts +4 -4
- package/Core/Interfaces/IExternalInteractor.d.ts +1 -1
- package/Core/Interfaces/IInteractor.d.ts +1 -1
- package/Core/Interfaces/IParticle.d.ts +8 -8
- package/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
- package/Core/Interfaces/IParticleSpin.d.ts +1 -1
- package/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
- package/Core/Interfaces/IPlugin.d.ts +1 -1
- package/Core/Loader.d.ts +13 -10
- package/Core/Loader.js +42 -26
- package/Core/Particle.d.ts +6 -4
- package/Core/Particle.js +47 -32
- package/Core/Particles.d.ts +6 -4
- package/Core/Particles.js +32 -17
- package/Core/Utils/Circle.d.ts +1 -1
- package/Core/Utils/CircleWarp.d.ts +1 -1
- package/Core/Utils/CircleWarp.js +1 -1
- package/Core/Utils/EventListeners.js +1 -1
- package/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/Core/Utils/InteractionManager.d.ts +6 -4
- package/Core/Utils/InteractionManager.js +19 -3
- package/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/Core/Utils/ParticlesMover.d.ts +1 -1
- package/Core/Utils/Plugins.d.ts +30 -16
- package/Core/Utils/Plugins.js +58 -46
- package/Core/Utils/QuadTree.d.ts +3 -3
- package/Core/Utils/QuadTree.js +1 -1
- package/Core/Utils/Rectangle.d.ts +1 -1
- package/Core/Utils/Vector3d.d.ts +1 -1
- package/Interactions/External/Attract/Attractor.d.ts +1 -1
- package/Interactions/External/Attract/Attractor.js +1 -1
- package/Interactions/External/Attract/index.d.ts +1 -1
- package/Interactions/External/Attract/index.js +2 -2
- package/Interactions/External/Bounce/Bouncer.d.ts +1 -1
- package/Interactions/External/Bounce/Bouncer.js +1 -1
- package/Interactions/External/Bounce/index.d.ts +1 -1
- package/Interactions/External/Bounce/index.js +2 -2
- package/Interactions/External/Bubble/Bubbler.d.ts +1 -1
- package/Interactions/External/Bubble/Bubbler.js +1 -1
- package/Interactions/External/Bubble/index.d.ts +1 -1
- package/Interactions/External/Bubble/index.js +2 -2
- package/Interactions/External/Connect/Connector.js +1 -1
- package/Interactions/External/Connect/index.d.ts +1 -1
- package/Interactions/External/Connect/index.js +2 -2
- package/Interactions/External/Grab/Grabber.d.ts +1 -1
- package/Interactions/External/Grab/Grabber.js +1 -1
- package/Interactions/External/Grab/index.d.ts +1 -1
- package/Interactions/External/Grab/index.js +2 -2
- package/Interactions/External/Repulse/Repulser.d.ts +1 -1
- package/Interactions/External/Repulse/Repulser.js +1 -1
- package/Interactions/External/Repulse/index.d.ts +1 -1
- package/Interactions/External/Repulse/index.js +2 -2
- package/Interactions/External/Trail/TrailMaker.js +1 -1
- package/Interactions/External/Trail/index.d.ts +1 -1
- package/Interactions/External/Trail/index.js +2 -2
- package/Interactions/Particles/Attract/Attractor.js +1 -1
- 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/LinkParticle.d.ts +1 -1
- package/Interactions/Particles/Links/Linker.d.ts +1 -1
- package/Interactions/Particles/Links/Linker.js +1 -1
- package/Interactions/Particles/Links/index.d.ts +1 -1
- package/Interactions/Particles/Links/index.js +4 -4
- package/Interactions/Particles/Links/interaction.d.ts +1 -1
- package/Interactions/Particles/Links/interaction.js +2 -2
- package/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/Interactions/Particles/Links/plugin.js +2 -2
- package/Options/Classes/AnimatableColor.d.ts +3 -3
- package/Options/Classes/AnimatableColor.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +6 -6
- package/Options/Classes/AnimationOptions.d.ts +2 -2
- package/Options/Classes/Background/Background.d.ts +2 -2
- package/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
- package/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
- package/Options/Classes/ColorAnimation.d.ts +1 -1
- package/Options/Classes/HslAnimation.d.ts +2 -2
- package/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
- package/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
- package/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
- package/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
- package/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
- package/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
- package/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
- package/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
- package/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
- package/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
- package/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
- package/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
- package/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
- package/Options/Classes/Interactivity/Modes/Modes.js +4 -4
- package/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
- package/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
- package/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
- package/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
- package/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
- package/Options/Classes/ManualParticle.d.ts +2 -2
- package/Options/Classes/Motion/Motion.d.ts +1 -1
- package/Options/Classes/Options.d.ts +9 -8
- package/Options/Classes/Options.js +20 -13
- package/Options/Classes/OptionsColor.d.ts +2 -2
- package/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
- package/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
- package/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
- package/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
- package/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
- package/Options/Classes/Particles/Life/Life.d.ts +1 -1
- package/Options/Classes/Particles/Links/Links.d.ts +2 -2
- package/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
- package/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Move.d.ts +5 -5
- package/Options/Classes/Particles/Move/Move.js +3 -3
- package/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
- package/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
- package/Options/Classes/Particles/Move/Spin.d.ts +3 -3
- package/Options/Classes/Particles/Move/Trail.d.ts +2 -2
- package/Options/Classes/Particles/Number/Density.d.ts +1 -1
- package/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
- package/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
- package/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
- package/Options/Classes/Particles/Orbit/Orbit.js +2 -2
- package/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
- package/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
- package/Options/Classes/Particles/ParticlesOptions.js +13 -13
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
- package/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
- package/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
- package/Options/Classes/Particles/Shadow.d.ts +3 -3
- package/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
- package/Options/Classes/Particles/Size/Size.d.ts +2 -2
- package/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
- package/Options/Classes/Particles/Stroke.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
- package/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
- package/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
- package/Options/Classes/Random.d.ts +1 -1
- package/Options/Classes/Responsive.d.ts +2 -2
- package/Options/Classes/Theme/Theme.d.ts +2 -2
- package/Options/Classes/Theme/Theme.js +1 -1
- package/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
- package/Options/Classes/ValueWithRandom.d.ts +2 -2
- package/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
- package/Options/Interfaces/IAnimatableColor.d.ts +1 -1
- package/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
- package/Options/Interfaces/IColorAnimation.d.ts +1 -1
- package/Options/Interfaces/IManualParticle.d.ts +1 -1
- package/Options/Interfaces/IOptions.d.ts +6 -6
- package/Options/Interfaces/IOptionsGradient.d.ts +2 -2
- package/Options/Interfaces/IResponsive.d.ts +2 -2
- package/Options/Interfaces/IValueWithRandom.d.ts +1 -1
- package/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
- package/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
- package/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
- package/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
- package/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
- package/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
- package/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
- package/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
- package/Options/Interfaces/Particles/IParticles.d.ts +14 -14
- package/Options/Interfaces/Particles/IShadow.d.ts +1 -1
- package/Options/Interfaces/Particles/IStroke.d.ts +1 -1
- package/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
- package/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
- package/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
- package/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
- package/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
- package/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
- package/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
- package/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
- package/Options/Interfaces/Theme/ITheme.d.ts +2 -2
- package/Plugins/Absorbers/AbsorberInstance.d.ts +5 -4
- package/Plugins/Absorbers/AbsorberInstance.js +18 -18
- package/Plugins/Absorbers/Absorbers.d.ts +3 -3
- package/Plugins/Absorbers/Absorbers.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
- package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
- package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
- package/Plugins/Absorbers/index.d.ts +1 -1
- package/Plugins/Absorbers/index.js +3 -3
- package/Plugins/Emitters/EmitterContainer.d.ts +2 -1
- package/Plugins/Emitters/EmitterInstance.d.ts +10 -5
- package/Plugins/Emitters/EmitterInstance.js +78 -49
- package/Plugins/Emitters/Emitters.d.ts +6 -4
- package/Plugins/Emitters/Emitters.js +27 -4
- package/{browser/Plugins/Emitters/EmittersMain.d.ts → Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +8 -7
- package/Plugins/Emitters/Options/Classes/Emitter.js +4 -3
- package/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
- package/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
- package/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +7 -6
- package/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
- package/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
- package/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/Plugins/Emitters/ShapeManager.js +16 -4
- package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/Plugins/Emitters/index.d.ts +3 -3
- package/Plugins/Emitters/index.js +33 -14
- package/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +5 -5
- package/Plugins/PolygonMask/Options/Classes/PolygonMask.js +1 -1
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskDraw.d.ts +2 -2
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskDraw.js +1 -1
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.d.ts +2 -2
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +2 -2
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +3 -3
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +2 -2
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +3 -3
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +1 -1
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.d.ts +1 -1
- package/Plugins/PolygonMask/PolygonMaskInstance.d.ts +3 -3
- package/Plugins/PolygonMask/PolygonMaskInstance.js +12 -12
- package/Plugins/PolygonMask/Types.d.ts +1 -1
- package/Plugins/PolygonMask/index.d.ts +1 -1
- package/Plugins/PolygonMask/index.js +3 -3
- package/README.md +162 -18
- 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/PolygonDrawer.d.ts +1 -1
- package/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
- 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/Types/ShapeData.d.ts +1 -1
- package/Types/ShapeDrawerFunctions.d.ts +1 -1
- 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/IBounceData.d.ts +1 -1
- package/Updaters/OutModes/OutOfCanvasUpdater.js +9 -9
- 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/CanvasUtils.d.ts +2 -3
- package/Utils/CanvasUtils.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/Utils/NumberUtils.d.ts +2 -2
- package/Utils/Utils.d.ts +3 -3
- package/browser/Core/Canvas.d.ts +1 -1
- package/browser/Core/Canvas.js +1 -1
- package/browser/Core/Container.d.ts +9 -6
- package/browser/Core/Container.js +34 -18
- package/browser/Core/Interfaces/Gradients.d.ts +2 -2
- package/browser/Core/Interfaces/ICircleBouncer.d.ts +1 -1
- package/browser/Core/Interfaces/IContainerPlugin.d.ts +4 -4
- package/browser/Core/Interfaces/IExternalInteractor.d.ts +1 -1
- package/browser/Core/Interfaces/IInteractor.d.ts +1 -1
- package/browser/Core/Interfaces/IParticle.d.ts +8 -8
- package/browser/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
- package/browser/Core/Interfaces/IParticleSpin.d.ts +1 -1
- package/browser/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
- package/browser/Core/Interfaces/IPlugin.d.ts +1 -1
- package/browser/Core/Loader.d.ts +13 -10
- package/browser/Core/Loader.js +36 -20
- package/browser/Core/Particle.d.ts +6 -4
- package/browser/Core/Particle.js +19 -4
- package/browser/Core/Particles.d.ts +6 -4
- package/browser/Core/Particles.js +22 -7
- package/browser/Core/Utils/Circle.d.ts +1 -1
- package/browser/Core/Utils/CircleWarp.d.ts +1 -1
- package/browser/Core/Utils/CircleWarp.js +1 -1
- package/browser/Core/Utils/EventListeners.js +1 -1
- package/browser/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/browser/Core/Utils/InteractionManager.d.ts +6 -4
- package/browser/Core/Utils/InteractionManager.js +19 -3
- package/browser/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/browser/Core/Utils/ParticlesMover.d.ts +1 -1
- package/browser/Core/Utils/Plugins.d.ts +30 -16
- package/browser/Core/Utils/Plugins.js +58 -46
- package/browser/Core/Utils/QuadTree.d.ts +3 -3
- package/browser/Core/Utils/QuadTree.js +1 -1
- package/browser/Core/Utils/Rectangle.d.ts +1 -1
- package/browser/Core/Utils/Vector3d.d.ts +1 -1
- package/browser/Interactions/External/Attract/Attractor.d.ts +1 -1
- package/browser/Interactions/External/Attract/Attractor.js +1 -1
- 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.d.ts +1 -1
- package/browser/Interactions/External/Bounce/Bouncer.js +1 -1
- 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 +1 -1
- package/browser/Interactions/External/Bubble/Bubbler.js +1 -1
- 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.js +1 -1
- 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 +1 -1
- package/browser/Interactions/External/Grab/Grabber.js +1 -1
- 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 +1 -1
- package/browser/Interactions/External/Repulse/Repulser.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/browser/Interactions/Particles/Attract/index.d.ts +1 -1
- package/browser/Interactions/Particles/Attract/index.js +2 -2
- package/browser/Interactions/Particles/Collisions/index.d.ts +1 -1
- package/browser/Interactions/Particles/Collisions/index.js +2 -2
- package/browser/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
- package/browser/Interactions/Particles/Links/Linker.d.ts +1 -1
- package/browser/Interactions/Particles/Links/Linker.js +1 -1
- package/browser/Interactions/Particles/Links/index.d.ts +1 -1
- package/browser/Interactions/Particles/Links/index.js +4 -4
- package/browser/Interactions/Particles/Links/interaction.d.ts +1 -1
- package/browser/Interactions/Particles/Links/interaction.js +2 -2
- package/browser/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/browser/Interactions/Particles/Links/plugin.js +2 -2
- package/browser/Options/Classes/AnimatableColor.d.ts +3 -3
- package/browser/Options/Classes/AnimatableColor.js +1 -1
- package/browser/Options/Classes/AnimatableGradient.d.ts +6 -6
- package/browser/Options/Classes/AnimationOptions.d.ts +2 -2
- package/browser/Options/Classes/Background/Background.d.ts +2 -2
- package/browser/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
- package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +1 -1
- package/browser/Options/Classes/HslAnimation.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
- package/browser/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
- package/browser/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
- package/browser/Options/Classes/Interactivity/Modes/Modes.js +4 -4
- package/browser/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
- package/browser/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
- package/browser/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
- package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
- package/browser/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
- package/browser/Options/Classes/ManualParticle.d.ts +2 -2
- package/browser/Options/Classes/Motion/Motion.d.ts +1 -1
- package/browser/Options/Classes/Options.d.ts +9 -8
- package/browser/Options/Classes/Options.js +20 -13
- package/browser/Options/Classes/OptionsColor.d.ts +2 -2
- package/browser/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
- package/browser/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
- package/browser/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
- package/browser/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
- package/browser/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
- package/browser/Options/Classes/Particles/Life/Life.d.ts +1 -1
- package/browser/Options/Classes/Particles/Links/Links.d.ts +2 -2
- package/browser/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
- package/browser/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Move.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/Move.js +3 -3
- package/browser/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/Spin.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/Trail.d.ts +2 -2
- package/browser/Options/Classes/Particles/Number/Density.d.ts +1 -1
- package/browser/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
- package/browser/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +2 -2
- package/browser/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
- package/browser/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
- package/browser/Options/Classes/Particles/ParticlesOptions.js +13 -13
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
- package/browser/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
- package/browser/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
- package/browser/Options/Classes/Particles/Shadow.d.ts +3 -3
- package/browser/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
- package/browser/Options/Classes/Particles/Size/Size.d.ts +2 -2
- package/browser/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
- package/browser/Options/Classes/Particles/Stroke.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
- package/browser/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
- package/browser/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
- package/browser/Options/Classes/Random.d.ts +1 -1
- package/browser/Options/Classes/Responsive.d.ts +2 -2
- package/browser/Options/Classes/Theme/Theme.d.ts +2 -2
- package/browser/Options/Classes/Theme/Theme.js +1 -1
- package/browser/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
- package/browser/Options/Classes/ValueWithRandom.d.ts +2 -2
- package/browser/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
- package/browser/Options/Interfaces/IAnimatableColor.d.ts +1 -1
- package/browser/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
- package/browser/Options/Interfaces/IColorAnimation.d.ts +1 -1
- package/browser/Options/Interfaces/IColorAnimation.js +0 -4
- package/browser/Options/Interfaces/IManualParticle.d.ts +1 -1
- package/browser/Options/Interfaces/IOptions.d.ts +6 -6
- package/browser/Options/Interfaces/IOptionsGradient.d.ts +2 -2
- package/browser/Options/Interfaces/IResponsive.d.ts +2 -2
- package/browser/Options/Interfaces/IValueWithRandom.d.ts +1 -1
- package/browser/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
- package/browser/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
- package/browser/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
- package/browser/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
- package/browser/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
- package/browser/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
- package/browser/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
- package/browser/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
- package/browser/Options/Interfaces/Particles/IParticles.d.ts +14 -14
- package/browser/Options/Interfaces/Particles/IShadow.d.ts +1 -1
- package/browser/Options/Interfaces/Particles/IStroke.d.ts +1 -1
- package/browser/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
- package/browser/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
- package/browser/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
- package/browser/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
- package/browser/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
- package/browser/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
- package/browser/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
- package/browser/Options/Interfaces/Theme/ITheme.d.ts +2 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +5 -4
- package/browser/Plugins/Absorbers/AbsorberInstance.js +18 -18
- package/browser/Plugins/Absorbers/Absorbers.d.ts +3 -3
- package/browser/Plugins/Absorbers/Absorbers.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
- package/browser/Plugins/Absorbers/index.d.ts +1 -1
- package/browser/Plugins/Absorbers/index.js +3 -3
- package/browser/Plugins/Emitters/EmitterContainer.d.ts +2 -1
- package/browser/Plugins/Emitters/EmitterInstance.d.ts +10 -5
- package/browser/Plugins/Emitters/EmitterInstance.js +78 -49
- package/browser/Plugins/Emitters/Emitters.d.ts +6 -4
- package/browser/Plugins/Emitters/Emitters.js +27 -4
- package/{esm/Plugins/Emitters/EmittersMain.d.ts → browser/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/browser/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/browser/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +8 -7
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +4 -3
- package/browser/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
- package/browser/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
- package/browser/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +10 -6
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
- package/browser/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/browser/Plugins/Emitters/ShapeManager.js +16 -4
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/browser/Plugins/Emitters/index.d.ts +3 -3
- package/browser/Plugins/Emitters/index.js +33 -14
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +5 -5
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.js +1 -1
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskDraw.d.ts +2 -2
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskDraw.js +1 -1
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.d.ts +2 -2
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +2 -2
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +3 -3
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +2 -2
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +3 -3
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +1 -1
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.d.ts +1 -1
- package/browser/Plugins/PolygonMask/PolygonMaskInstance.d.ts +3 -3
- package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +2 -2
- package/browser/Plugins/PolygonMask/Types.d.ts +1 -1
- package/browser/Plugins/PolygonMask/index.d.ts +1 -1
- package/browser/Plugins/PolygonMask/index.js +3 -3
- package/browser/Shapes/Circle/index.d.ts +1 -1
- package/browser/Shapes/Circle/index.js +2 -2
- package/browser/Shapes/Image/index.d.ts +1 -1
- package/browser/Shapes/Image/index.js +3 -3
- package/browser/Shapes/Line/index.d.ts +1 -1
- package/browser/Shapes/Line/index.js +2 -2
- package/browser/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
- package/browser/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
- package/browser/Shapes/Polygon/index.d.ts +3 -3
- package/browser/Shapes/Polygon/index.js +7 -7
- package/browser/Shapes/Square/index.d.ts +1 -1
- package/browser/Shapes/Square/index.js +3 -3
- package/browser/Shapes/Star/index.d.ts +1 -1
- package/browser/Shapes/Star/index.js +2 -2
- package/browser/Shapes/Text/index.d.ts +1 -1
- package/browser/Shapes/Text/index.js +3 -3
- package/browser/Types/ShapeData.d.ts +1 -1
- package/browser/Types/ShapeDrawerFunctions.d.ts +1 -1
- package/browser/Updaters/Angle/index.d.ts +1 -1
- package/browser/Updaters/Angle/index.js +2 -2
- package/browser/Updaters/Color/index.d.ts +1 -1
- package/browser/Updaters/Color/index.js +2 -2
- package/browser/Updaters/Life/index.d.ts +1 -1
- package/browser/Updaters/Life/index.js +2 -2
- package/browser/Updaters/Opacity/index.d.ts +1 -1
- package/browser/Updaters/Opacity/index.js +2 -2
- package/browser/Updaters/OutModes/IBounceData.d.ts +1 -1
- package/browser/Updaters/OutModes/OutOfCanvasUpdater.js +1 -1
- 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/index.d.ts +1 -1
- package/browser/Updaters/Size/index.js +2 -2
- 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.d.ts +2 -3
- package/browser/Utils/CanvasUtils.js +1 -1
- package/browser/Utils/ColorUtils.js +1 -1
- package/browser/Utils/NumberUtils.d.ts +2 -2
- package/browser/Utils/Utils.d.ts +3 -3
- package/browser/Utils/Utils.js +1 -1
- package/browser/engine.d.ts +7 -3
- package/browser/engine.js +22 -17
- package/browser/full.d.ts +1 -1
- package/browser/full.js +14 -14
- package/browser/index.d.ts +1 -1
- package/browser/index.engine.d.ts +1 -1
- package/browser/index.engine.js +1 -1
- package/browser/index.js +1 -1
- package/browser/index.slim.d.ts +1 -1
- package/browser/index.slim.js +1 -1
- package/browser/pjs.d.ts +1 -1
- package/browser/slim.d.ts +1 -1
- package/browser/slim.js +40 -40
- package/engine.d.ts +5 -2
- package/engine.js +20 -16
- package/esm/Core/Canvas.d.ts +1 -1
- package/esm/Core/Canvas.js +1 -1
- package/esm/Core/Container.d.ts +8 -6
- package/esm/Core/Container.js +33 -18
- package/esm/Core/Interfaces/Gradients.d.ts +2 -2
- package/esm/Core/Interfaces/ICircleBouncer.d.ts +1 -1
- package/esm/Core/Interfaces/IContainerPlugin.d.ts +4 -4
- package/esm/Core/Interfaces/IExternalInteractor.d.ts +1 -1
- package/esm/Core/Interfaces/IInteractor.d.ts +1 -1
- package/esm/Core/Interfaces/IParticle.d.ts +8 -8
- package/esm/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
- package/esm/Core/Interfaces/IParticleSpin.d.ts +1 -1
- package/esm/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
- package/esm/Core/Interfaces/IPlugin.d.ts +1 -1
- package/esm/Core/Loader.d.ts +13 -10
- package/esm/Core/Loader.js +36 -20
- package/esm/Core/Particle.d.ts +6 -4
- package/esm/Core/Particle.js +19 -4
- package/esm/Core/Particles.d.ts +6 -4
- package/esm/Core/Particles.js +22 -7
- package/esm/Core/Utils/Circle.d.ts +1 -1
- package/esm/Core/Utils/CircleWarp.d.ts +1 -1
- package/esm/Core/Utils/CircleWarp.js +1 -1
- package/esm/Core/Utils/EventListeners.js +1 -1
- package/esm/Core/Utils/ExternalInteractorBase.d.ts +1 -1
- package/esm/Core/Utils/InteractionManager.d.ts +6 -4
- package/esm/Core/Utils/InteractionManager.js +19 -3
- package/esm/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
- package/esm/Core/Utils/ParticlesMover.d.ts +1 -1
- package/esm/Core/Utils/Plugins.d.ts +30 -16
- package/esm/Core/Utils/Plugins.js +58 -46
- package/esm/Core/Utils/QuadTree.d.ts +3 -3
- package/esm/Core/Utils/QuadTree.js +1 -1
- package/esm/Core/Utils/Rectangle.d.ts +1 -1
- package/esm/Core/Utils/Vector3d.d.ts +1 -1
- package/esm/Interactions/External/Attract/Attractor.d.ts +1 -1
- package/esm/Interactions/External/Attract/Attractor.js +1 -1
- package/esm/Interactions/External/Attract/index.d.ts +1 -1
- package/esm/Interactions/External/Attract/index.js +2 -2
- package/esm/Interactions/External/Bounce/Bouncer.d.ts +1 -1
- package/esm/Interactions/External/Bounce/Bouncer.js +1 -1
- package/esm/Interactions/External/Bounce/index.d.ts +1 -1
- package/esm/Interactions/External/Bounce/index.js +2 -2
- package/esm/Interactions/External/Bubble/Bubbler.d.ts +1 -1
- package/esm/Interactions/External/Bubble/Bubbler.js +1 -1
- package/esm/Interactions/External/Bubble/index.d.ts +1 -1
- package/esm/Interactions/External/Bubble/index.js +2 -2
- package/esm/Interactions/External/Connect/Connector.js +1 -1
- package/esm/Interactions/External/Connect/index.d.ts +1 -1
- package/esm/Interactions/External/Connect/index.js +2 -2
- package/esm/Interactions/External/Grab/Grabber.d.ts +1 -1
- package/esm/Interactions/External/Grab/Grabber.js +1 -1
- package/esm/Interactions/External/Grab/index.d.ts +1 -1
- package/esm/Interactions/External/Grab/index.js +2 -2
- package/esm/Interactions/External/Repulse/Repulser.d.ts +1 -1
- package/esm/Interactions/External/Repulse/Repulser.js +1 -1
- package/esm/Interactions/External/Repulse/index.d.ts +1 -1
- package/esm/Interactions/External/Repulse/index.js +2 -2
- package/esm/Interactions/External/Trail/TrailMaker.js +1 -1
- package/esm/Interactions/External/Trail/index.d.ts +1 -1
- package/esm/Interactions/External/Trail/index.js +2 -2
- package/esm/Interactions/Particles/Attract/Attractor.js +1 -1
- 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/LinkParticle.d.ts +1 -1
- package/esm/Interactions/Particles/Links/Linker.d.ts +1 -1
- package/esm/Interactions/Particles/Links/Linker.js +1 -1
- package/esm/Interactions/Particles/Links/index.d.ts +1 -1
- package/esm/Interactions/Particles/Links/index.js +4 -4
- package/esm/Interactions/Particles/Links/interaction.d.ts +1 -1
- package/esm/Interactions/Particles/Links/interaction.js +2 -2
- package/esm/Interactions/Particles/Links/plugin.d.ts +1 -1
- package/esm/Interactions/Particles/Links/plugin.js +2 -2
- package/esm/Options/Classes/AnimatableColor.d.ts +3 -3
- package/esm/Options/Classes/AnimatableColor.js +1 -1
- package/esm/Options/Classes/AnimatableGradient.d.ts +6 -6
- package/esm/Options/Classes/AnimationOptions.d.ts +2 -2
- package/esm/Options/Classes/Background/Background.d.ts +2 -2
- package/esm/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
- package/esm/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +1 -1
- package/esm/Options/Classes/HslAnimation.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
- package/esm/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
- package/esm/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
- package/esm/Options/Classes/Interactivity/Modes/Modes.js +4 -4
- package/esm/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
- package/esm/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
- package/esm/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
- package/esm/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
- package/esm/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
- package/esm/Options/Classes/ManualParticle.d.ts +2 -2
- package/esm/Options/Classes/Motion/Motion.d.ts +1 -1
- package/esm/Options/Classes/Options.d.ts +9 -8
- package/esm/Options/Classes/Options.js +20 -13
- package/esm/Options/Classes/OptionsColor.d.ts +2 -2
- package/esm/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
- package/esm/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
- package/esm/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
- package/esm/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
- package/esm/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
- package/esm/Options/Classes/Particles/Life/Life.d.ts +1 -1
- package/esm/Options/Classes/Particles/Links/Links.d.ts +2 -2
- package/esm/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
- package/esm/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Move.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/Move.js +3 -3
- package/esm/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/Spin.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/Trail.d.ts +2 -2
- package/esm/Options/Classes/Particles/Number/Density.d.ts +1 -1
- package/esm/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
- package/esm/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
- package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +2 -2
- package/esm/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
- package/esm/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
- package/esm/Options/Classes/Particles/ParticlesOptions.js +13 -13
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
- package/esm/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
- package/esm/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
- package/esm/Options/Classes/Particles/Shadow.d.ts +3 -3
- package/esm/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
- package/esm/Options/Classes/Particles/Size/Size.d.ts +2 -2
- package/esm/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
- package/esm/Options/Classes/Particles/Stroke.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
- package/esm/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
- package/esm/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
- package/esm/Options/Classes/Random.d.ts +1 -1
- package/esm/Options/Classes/Responsive.d.ts +2 -2
- package/esm/Options/Classes/Theme/Theme.d.ts +2 -2
- package/esm/Options/Classes/Theme/Theme.js +1 -1
- package/esm/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
- package/esm/Options/Classes/ValueWithRandom.d.ts +2 -2
- package/esm/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
- package/esm/Options/Interfaces/IAnimatableColor.d.ts +1 -1
- package/esm/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
- package/esm/Options/Interfaces/IColorAnimation.d.ts +1 -1
- package/esm/Options/Interfaces/IManualParticle.d.ts +1 -1
- package/esm/Options/Interfaces/IOptions.d.ts +6 -6
- package/esm/Options/Interfaces/IOptionsGradient.d.ts +2 -2
- package/esm/Options/Interfaces/IResponsive.d.ts +2 -2
- package/esm/Options/Interfaces/IValueWithRandom.d.ts +1 -1
- package/esm/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
- package/esm/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
- package/esm/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
- package/esm/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
- package/esm/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
- package/esm/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
- package/esm/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
- package/esm/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
- package/esm/Options/Interfaces/Particles/IParticles.d.ts +14 -14
- package/esm/Options/Interfaces/Particles/IShadow.d.ts +1 -1
- package/esm/Options/Interfaces/Particles/IStroke.d.ts +1 -1
- package/esm/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
- package/esm/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
- package/esm/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
- package/esm/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
- package/esm/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
- package/esm/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
- package/esm/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
- package/esm/Options/Interfaces/Theme/ITheme.d.ts +2 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +5 -4
- package/esm/Plugins/Absorbers/AbsorberInstance.js +18 -18
- package/esm/Plugins/Absorbers/Absorbers.d.ts +3 -3
- package/esm/Plugins/Absorbers/Absorbers.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
- package/esm/Plugins/Absorbers/index.d.ts +1 -1
- package/esm/Plugins/Absorbers/index.js +3 -3
- package/esm/Plugins/Emitters/EmitterContainer.d.ts +2 -1
- package/esm/Plugins/Emitters/EmitterInstance.d.ts +10 -5
- package/esm/Plugins/Emitters/EmitterInstance.js +78 -49
- package/esm/Plugins/Emitters/Emitters.d.ts +6 -4
- package/esm/Plugins/Emitters/Emitters.js +27 -4
- package/{Plugins/Emitters/EmittersMain.d.ts → esm/Plugins/Emitters/EmittersEngine.d.ts} +3 -1
- package/esm/Plugins/Emitters/{EmittersMain.js → EmittersEngine.js} +0 -0
- package/esm/Plugins/Emitters/IEmitterShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +8 -7
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +4 -3
- package/esm/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
- package/esm/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
- package/esm/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +7 -6
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
- package/esm/Plugins/Emitters/ShapeManager.d.ts +6 -3
- package/esm/Plugins/Emitters/ShapeManager.js +16 -4
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.js +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +2 -2
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -4
- package/esm/Plugins/Emitters/index.d.ts +3 -3
- package/esm/Plugins/Emitters/index.js +33 -14
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +5 -5
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.js +1 -1
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskDraw.d.ts +2 -2
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskDraw.js +1 -1
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.d.ts +2 -2
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +2 -2
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +3 -3
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +2 -2
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +3 -3
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +1 -1
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.d.ts +1 -1
- package/esm/Plugins/PolygonMask/PolygonMaskInstance.d.ts +3 -3
- package/esm/Plugins/PolygonMask/PolygonMaskInstance.js +2 -2
- package/esm/Plugins/PolygonMask/Types.d.ts +1 -1
- package/esm/Plugins/PolygonMask/index.d.ts +1 -1
- package/esm/Plugins/PolygonMask/index.js +3 -3
- 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/PolygonDrawer.d.ts +1 -1
- package/esm/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
- 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 +3 -3
- package/esm/Types/ShapeData.d.ts +1 -1
- package/esm/Types/ShapeDrawerFunctions.d.ts +1 -1
- 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/IBounceData.d.ts +1 -1
- package/esm/Updaters/OutModes/OutOfCanvasUpdater.js +1 -1
- 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/CanvasUtils.d.ts +2 -3
- package/esm/Utils/CanvasUtils.js +1 -1
- package/esm/Utils/ColorUtils.js +1 -1
- package/esm/Utils/NumberUtils.d.ts +2 -2
- package/esm/Utils/Utils.d.ts +3 -3
- package/esm/Utils/Utils.js +1 -1
- package/esm/engine.d.ts +5 -2
- package/esm/engine.js +20 -16
- package/esm/full.d.ts +1 -1
- package/esm/full.js +14 -14
- package/esm/index.d.ts +1 -1
- package/esm/index.engine.d.ts +1 -1
- package/esm/index.engine.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.slim.d.ts +1 -1
- package/esm/index.slim.js +1 -1
- package/esm/pjs.d.ts +1 -1
- package/esm/slim.d.ts +1 -1
- package/esm/slim.js +40 -40
- package/full.d.ts +1 -1
- package/full.js +14 -14
- package/index.d.ts +1 -1
- package/index.engine.d.ts +1 -1
- package/index.engine.js +1 -1
- package/index.js +1 -1
- package/index.slim.d.ts +1 -1
- package/index.slim.js +1 -1
- package/package.json +11 -5
- package/pjs.d.ts +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/slim.d.ts +1 -1
- package/slim.js +40 -40
- package/tsparticles.engine.js +2537 -2428
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +4093 -3988
- package/tsparticles.interaction.external.attract.min.js +2 -2
- package/tsparticles.interaction.external.bounce.js +4102 -3997
- package/tsparticles.interaction.external.bounce.min.js +2 -2
- package/tsparticles.interaction.external.bubble.js +4102 -3997
- package/tsparticles.interaction.external.bubble.min.js +2 -2
- package/tsparticles.interaction.external.connect.js +4288 -4183
- package/tsparticles.interaction.external.connect.min.js +2 -2
- package/tsparticles.interaction.external.grab.js +4288 -4183
- package/tsparticles.interaction.external.grab.min.js +2 -2
- package/tsparticles.interaction.external.repulse.js +4102 -3997
- package/tsparticles.interaction.external.repulse.min.js +2 -2
- package/tsparticles.interaction.external.trail.js +4288 -4183
- package/tsparticles.interaction.external.trail.min.js +2 -2
- package/tsparticles.interaction.particles.attract.js +4288 -4183
- package/tsparticles.interaction.particles.attract.min.js +2 -2
- package/tsparticles.interaction.particles.collisions.js +1249 -1144
- package/tsparticles.interaction.particles.collisions.min.js +2 -2
- package/tsparticles.interaction.particles.links.js +4400 -4295
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +5946 -5749
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +1210 -1106
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +1875 -1681
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +2785 -2680
- package/tsparticles.plugins.polygonMask.min.js +2 -2
- package/tsparticles.shape.circle.js +2 -2
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +1237 -1132
- package/tsparticles.shape.image.min.js +2 -2
- package/tsparticles.shape.line.js +2 -2
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.js +7 -7
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.js +3 -3
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.js +2 -2
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +1249 -1144
- package/tsparticles.shape.text.min.js +2 -2
- package/tsparticles.slim.js +3710 -3601
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +1249 -1144
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +1249 -1144
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +1249 -1144
- package/tsparticles.updater.life.min.js +2 -2
- package/tsparticles.updater.opacity.js +1249 -1144
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +1249 -1144
- package/tsparticles.updater.outModes.min.js +2 -2
- package/tsparticles.updater.roll.js +1249 -1144
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +1249 -1144
- package/tsparticles.updater.size.min.js +2 -2
- package/tsparticles.updater.strokeColor.js +1249 -1144
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +1249 -1144
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +1249 -1144
- package/tsparticles.updater.wobble.min.js +2 -2
|
@@ -506,15 +506,32 @@
|
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
+
var __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
510
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
511
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
512
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
513
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
514
|
+
value;
|
|
515
|
+
};
|
|
516
|
+
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
517
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
518
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
519
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
520
|
+
};
|
|
521
|
+
var _InteractionManager_engine;
|
|
509
522
|
class InteractionManager_InteractionManager {
|
|
510
|
-
constructor(container) {
|
|
523
|
+
constructor(engine, container) {
|
|
511
524
|
this.container = container;
|
|
525
|
+
_InteractionManager_engine.set(this, void 0);
|
|
526
|
+
__classPrivateFieldSet(this, _InteractionManager_engine, engine, "f");
|
|
512
527
|
this.externalInteractors = [];
|
|
513
528
|
this.particleInteractors = [];
|
|
514
529
|
this.init();
|
|
515
530
|
}
|
|
516
531
|
init() {
|
|
517
|
-
const interactors =
|
|
532
|
+
const interactors = __classPrivateFieldGet(this, _InteractionManager_engine, "f").plugins.getInteractors(this.container, true);
|
|
533
|
+
this.externalInteractors = [];
|
|
534
|
+
this.particleInteractors = [];
|
|
518
535
|
for (const interactor of interactors) {
|
|
519
536
|
switch (interactor.type) {
|
|
520
537
|
case 0:
|
|
@@ -545,6 +562,7 @@
|
|
|
545
562
|
}
|
|
546
563
|
}
|
|
547
564
|
}
|
|
565
|
+
_InteractionManager_engine = new WeakMap;
|
|
548
566
|
class ParticlesInteractorBase {
|
|
549
567
|
constructor(container) {
|
|
550
568
|
this.container = container;
|
|
@@ -724,26 +742,38 @@
|
|
|
724
742
|
return proximityFactor / slowFactor;
|
|
725
743
|
}
|
|
726
744
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
class
|
|
736
|
-
|
|
737
|
-
|
|
745
|
+
var Plugins_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
746
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
747
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
748
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
749
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
750
|
+
value;
|
|
751
|
+
};
|
|
752
|
+
var _Plugins_engine;
|
|
753
|
+
class Plugins {
|
|
754
|
+
constructor(engine) {
|
|
755
|
+
_Plugins_engine.set(this, void 0);
|
|
756
|
+
Plugins_classPrivateFieldSet(this, _Plugins_engine, engine, "f");
|
|
757
|
+
this.plugins = [];
|
|
758
|
+
this.interactorsInitializers = new Map;
|
|
759
|
+
this.updatersInitializers = new Map;
|
|
760
|
+
this.interactors = new Map;
|
|
761
|
+
this.updaters = new Map;
|
|
762
|
+
this.presets = new Map;
|
|
763
|
+
this.drawers = new Map;
|
|
764
|
+
this.pathGenerators = new Map;
|
|
765
|
+
}
|
|
766
|
+
getPlugin(plugin) {
|
|
767
|
+
return this.plugins.find((t => t.id === plugin));
|
|
738
768
|
}
|
|
739
|
-
|
|
740
|
-
if (!
|
|
741
|
-
plugins.push(plugin);
|
|
769
|
+
addPlugin(plugin) {
|
|
770
|
+
if (!this.getPlugin(plugin.id)) {
|
|
771
|
+
this.plugins.push(plugin);
|
|
742
772
|
}
|
|
743
773
|
}
|
|
744
|
-
|
|
774
|
+
getAvailablePlugins(container) {
|
|
745
775
|
const res = new Map;
|
|
746
|
-
for (const plugin of plugins) {
|
|
776
|
+
for (const plugin of this.plugins) {
|
|
747
777
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
748
778
|
continue;
|
|
749
779
|
}
|
|
@@ -751,61 +781,62 @@
|
|
|
751
781
|
}
|
|
752
782
|
return res;
|
|
753
783
|
}
|
|
754
|
-
|
|
755
|
-
for (const plugin of plugins) {
|
|
784
|
+
loadOptions(options, sourceOptions) {
|
|
785
|
+
for (const plugin of this.plugins) {
|
|
756
786
|
plugin.loadOptions(options, sourceOptions);
|
|
757
787
|
}
|
|
758
788
|
}
|
|
759
|
-
|
|
760
|
-
return presets.get(preset);
|
|
789
|
+
getPreset(preset) {
|
|
790
|
+
return this.presets.get(preset);
|
|
761
791
|
}
|
|
762
|
-
|
|
763
|
-
if (override || !
|
|
764
|
-
presets.set(presetKey, options);
|
|
792
|
+
addPreset(presetKey, options, override = false) {
|
|
793
|
+
if (override || !this.getPreset(presetKey)) {
|
|
794
|
+
this.presets.set(presetKey, options);
|
|
765
795
|
}
|
|
766
796
|
}
|
|
767
|
-
|
|
768
|
-
if (!
|
|
769
|
-
drawers.set(type, drawer);
|
|
797
|
+
addShapeDrawer(type, drawer) {
|
|
798
|
+
if (!this.getShapeDrawer(type)) {
|
|
799
|
+
this.drawers.set(type, drawer);
|
|
770
800
|
}
|
|
771
801
|
}
|
|
772
|
-
|
|
773
|
-
return drawers.get(type);
|
|
802
|
+
getShapeDrawer(type) {
|
|
803
|
+
return this.drawers.get(type);
|
|
774
804
|
}
|
|
775
|
-
|
|
776
|
-
return drawers.keys();
|
|
805
|
+
getSupportedShapes() {
|
|
806
|
+
return this.drawers.keys();
|
|
777
807
|
}
|
|
778
|
-
|
|
779
|
-
return pathGenerators.get(type);
|
|
808
|
+
getPathGenerator(type) {
|
|
809
|
+
return this.pathGenerators.get(type);
|
|
780
810
|
}
|
|
781
|
-
|
|
782
|
-
if (!
|
|
783
|
-
pathGenerators.set(type, pathGenerator);
|
|
811
|
+
addPathGenerator(type, pathGenerator) {
|
|
812
|
+
if (!this.getPathGenerator(type)) {
|
|
813
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
784
814
|
}
|
|
785
815
|
}
|
|
786
|
-
|
|
787
|
-
let res = interactors.get(container);
|
|
816
|
+
getInteractors(container, force = false) {
|
|
817
|
+
let res = this.interactors.get(container);
|
|
788
818
|
if (!res || force) {
|
|
789
|
-
res = [ ...interactorsInitializers.values() ].map((t => t(container)));
|
|
790
|
-
interactors.set(container, res);
|
|
819
|
+
res = [ ...this.interactorsInitializers.values() ].map((t => t(container)));
|
|
820
|
+
this.interactors.set(container, res);
|
|
791
821
|
}
|
|
792
822
|
return res;
|
|
793
823
|
}
|
|
794
|
-
|
|
795
|
-
interactorsInitializers.set(name, initInteractor);
|
|
824
|
+
addInteractor(name, initInteractor) {
|
|
825
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
796
826
|
}
|
|
797
|
-
|
|
798
|
-
let res = updaters.get(container);
|
|
827
|
+
getUpdaters(container, force = false) {
|
|
828
|
+
let res = this.updaters.get(container);
|
|
799
829
|
if (!res || force) {
|
|
800
|
-
res = [ ...updatersInitializers.values() ].map((t => t(container)));
|
|
801
|
-
updaters.set(container, res);
|
|
830
|
+
res = [ ...this.updatersInitializers.values() ].map((t => t(container)));
|
|
831
|
+
this.updaters.set(container, res);
|
|
802
832
|
}
|
|
803
833
|
return res;
|
|
804
834
|
}
|
|
805
|
-
|
|
806
|
-
updatersInitializers.set(name, initUpdater);
|
|
835
|
+
addParticleUpdater(name, initUpdater) {
|
|
836
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
807
837
|
}
|
|
808
838
|
}
|
|
839
|
+
_Plugins_engine = new WeakMap;
|
|
809
840
|
class QuadTree_QuadTree {
|
|
810
841
|
constructor(rectangle, capacity) {
|
|
811
842
|
this.rectangle = rectangle;
|
|
@@ -1267,366 +1298,278 @@
|
|
|
1267
1298
|
}));
|
|
1268
1299
|
}
|
|
1269
1300
|
}
|
|
1270
|
-
class
|
|
1301
|
+
class Trail_Trail {
|
|
1271
1302
|
constructor() {
|
|
1272
|
-
this.
|
|
1273
|
-
this.
|
|
1303
|
+
this.delay = 1;
|
|
1304
|
+
this.pauseOnStop = false;
|
|
1305
|
+
this.quantity = 1;
|
|
1274
1306
|
}
|
|
1275
1307
|
load(data) {
|
|
1276
|
-
if (
|
|
1308
|
+
if (data === undefined) {
|
|
1277
1309
|
return;
|
|
1278
1310
|
}
|
|
1279
|
-
if (
|
|
1280
|
-
this.
|
|
1281
|
-
} else {
|
|
1282
|
-
this.random.load(data.random);
|
|
1311
|
+
if (data.delay !== undefined) {
|
|
1312
|
+
this.delay = data.delay;
|
|
1283
1313
|
}
|
|
1284
|
-
if (data.
|
|
1285
|
-
this.
|
|
1314
|
+
if (data.quantity !== undefined) {
|
|
1315
|
+
this.quantity = data.quantity;
|
|
1316
|
+
}
|
|
1317
|
+
if (data.particles !== undefined) {
|
|
1318
|
+
this.particles = deepExtend({}, data.particles);
|
|
1319
|
+
}
|
|
1320
|
+
if (data.pauseOnStop !== undefined) {
|
|
1321
|
+
this.pauseOnStop = data.pauseOnStop;
|
|
1286
1322
|
}
|
|
1287
1323
|
}
|
|
1288
1324
|
}
|
|
1289
|
-
class
|
|
1325
|
+
class Modes_Modes {
|
|
1290
1326
|
constructor() {
|
|
1291
|
-
|
|
1327
|
+
this.attract = new Attract;
|
|
1328
|
+
this.bounce = new Bounce;
|
|
1329
|
+
this.bubble = new Bubble;
|
|
1330
|
+
this.connect = new Connect;
|
|
1331
|
+
this.grab = new Grab;
|
|
1332
|
+
this.light = new Light;
|
|
1333
|
+
this.push = new Push;
|
|
1334
|
+
this.remove = new Remove;
|
|
1335
|
+
this.repulse = new Repulse;
|
|
1336
|
+
this.slow = new Slow;
|
|
1337
|
+
this.trail = new Trail;
|
|
1338
|
+
}
|
|
1339
|
+
load(data) {
|
|
1340
|
+
if (data === undefined) {
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
this.attract.load(data.attract);
|
|
1344
|
+
this.bubble.load(data.bubble);
|
|
1345
|
+
this.connect.load(data.connect);
|
|
1346
|
+
this.grab.load(data.grab);
|
|
1347
|
+
this.light.load(data.light);
|
|
1348
|
+
this.push.load(data.push);
|
|
1349
|
+
this.remove.load(data.remove);
|
|
1350
|
+
this.repulse.load(data.repulse);
|
|
1351
|
+
this.slow.load(data.slow);
|
|
1352
|
+
this.trail.load(data.trail);
|
|
1292
1353
|
}
|
|
1293
1354
|
}
|
|
1294
|
-
class
|
|
1355
|
+
class Interactivity_Interactivity {
|
|
1295
1356
|
constructor() {
|
|
1296
|
-
this.
|
|
1297
|
-
this.
|
|
1298
|
-
this.
|
|
1299
|
-
|
|
1357
|
+
this.detectsOn = "window";
|
|
1358
|
+
this.events = new Events;
|
|
1359
|
+
this.modes = new Modes;
|
|
1360
|
+
}
|
|
1361
|
+
get detect_on() {
|
|
1362
|
+
return this.detectsOn;
|
|
1363
|
+
}
|
|
1364
|
+
set detect_on(value) {
|
|
1365
|
+
this.detectsOn = value;
|
|
1300
1366
|
}
|
|
1301
1367
|
load(data) {
|
|
1368
|
+
var _a, _b, _c;
|
|
1302
1369
|
if (data === undefined) {
|
|
1303
1370
|
return;
|
|
1304
1371
|
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
this.delay.load(data.delay);
|
|
1309
|
-
if (data.enable !== undefined) {
|
|
1310
|
-
this.enable = data.enable;
|
|
1372
|
+
const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
|
|
1373
|
+
if (detectsOn !== undefined) {
|
|
1374
|
+
this.detectsOn = detectsOn;
|
|
1311
1375
|
}
|
|
1312
|
-
this.
|
|
1313
|
-
|
|
1314
|
-
|
|
1376
|
+
this.events.load(data.events);
|
|
1377
|
+
this.modes.load(data.modes);
|
|
1378
|
+
if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
|
|
1379
|
+
if (this.events.onHover.mode instanceof Array) {
|
|
1380
|
+
if (this.events.onHover.mode.indexOf("slow") < 0) {
|
|
1381
|
+
this.events.onHover.mode.push("slow");
|
|
1382
|
+
}
|
|
1383
|
+
} else if (this.events.onHover.mode !== "slow") {
|
|
1384
|
+
this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
|
|
1385
|
+
}
|
|
1315
1386
|
}
|
|
1316
1387
|
}
|
|
1317
1388
|
}
|
|
1318
|
-
class
|
|
1319
|
-
constructor() {
|
|
1320
|
-
this.acceleration = 0;
|
|
1321
|
-
this.enable = false;
|
|
1322
|
-
}
|
|
1389
|
+
class ManualParticle_ManualParticle {
|
|
1323
1390
|
load(data) {
|
|
1391
|
+
var _a, _b;
|
|
1324
1392
|
if (!data) {
|
|
1325
1393
|
return;
|
|
1326
1394
|
}
|
|
1327
|
-
if (data.
|
|
1328
|
-
this.
|
|
1395
|
+
if (data.position !== undefined) {
|
|
1396
|
+
this.position = {
|
|
1397
|
+
x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
|
|
1398
|
+
y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
|
|
1399
|
+
};
|
|
1329
1400
|
}
|
|
1330
|
-
if (data.
|
|
1331
|
-
this.
|
|
1401
|
+
if (data.options !== undefined) {
|
|
1402
|
+
this.options = deepExtend({}, data.options);
|
|
1332
1403
|
}
|
|
1333
|
-
this.position = data.position ? deepExtend({}, data.position) : undefined;
|
|
1334
1404
|
}
|
|
1335
1405
|
}
|
|
1336
|
-
class
|
|
1406
|
+
class ColorAnimation_ColorAnimation {
|
|
1337
1407
|
constructor() {
|
|
1338
|
-
this.
|
|
1339
|
-
this.attract = new Attract;
|
|
1340
|
-
this.decay = 0;
|
|
1341
|
-
this.distance = {};
|
|
1342
|
-
this.direction = "none";
|
|
1343
|
-
this.drift = 0;
|
|
1408
|
+
this.count = 0;
|
|
1344
1409
|
this.enable = false;
|
|
1345
|
-
this.
|
|
1346
|
-
this.
|
|
1347
|
-
this.
|
|
1348
|
-
this.random = false;
|
|
1349
|
-
this.size = false;
|
|
1350
|
-
this.speed = 2;
|
|
1351
|
-
this.spin = new Spin;
|
|
1352
|
-
this.straight = false;
|
|
1353
|
-
this.trail = new Trail;
|
|
1354
|
-
this.vibrate = false;
|
|
1355
|
-
this.warp = false;
|
|
1356
|
-
}
|
|
1357
|
-
get collisions() {
|
|
1358
|
-
return false;
|
|
1359
|
-
}
|
|
1360
|
-
set collisions(value) {}
|
|
1361
|
-
get bounce() {
|
|
1362
|
-
return this.collisions;
|
|
1363
|
-
}
|
|
1364
|
-
set bounce(value) {
|
|
1365
|
-
this.collisions = value;
|
|
1366
|
-
}
|
|
1367
|
-
get out_mode() {
|
|
1368
|
-
return this.outMode;
|
|
1369
|
-
}
|
|
1370
|
-
set out_mode(value) {
|
|
1371
|
-
this.outMode = value;
|
|
1372
|
-
}
|
|
1373
|
-
get outMode() {
|
|
1374
|
-
return this.outModes.default;
|
|
1375
|
-
}
|
|
1376
|
-
set outMode(value) {
|
|
1377
|
-
this.outModes.default = value;
|
|
1378
|
-
}
|
|
1379
|
-
get noise() {
|
|
1380
|
-
return this.path;
|
|
1381
|
-
}
|
|
1382
|
-
set noise(value) {
|
|
1383
|
-
this.path = value;
|
|
1410
|
+
this.offset = 0;
|
|
1411
|
+
this.speed = 1;
|
|
1412
|
+
this.sync = true;
|
|
1384
1413
|
}
|
|
1385
1414
|
load(data) {
|
|
1386
|
-
var _a, _b, _c;
|
|
1387
1415
|
if (data === undefined) {
|
|
1388
1416
|
return;
|
|
1389
1417
|
}
|
|
1390
|
-
if (data.
|
|
1391
|
-
|
|
1392
|
-
this.angle.value = data.angle;
|
|
1393
|
-
} else {
|
|
1394
|
-
this.angle.load(data.angle);
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
this.attract.load(data.attract);
|
|
1398
|
-
if (data.decay !== undefined) {
|
|
1399
|
-
this.decay = data.decay;
|
|
1400
|
-
}
|
|
1401
|
-
if (data.direction !== undefined) {
|
|
1402
|
-
this.direction = data.direction;
|
|
1403
|
-
}
|
|
1404
|
-
if (data.distance !== undefined) {
|
|
1405
|
-
this.distance = typeof data.distance === "number" ? {
|
|
1406
|
-
horizontal: data.distance,
|
|
1407
|
-
vertical: data.distance
|
|
1408
|
-
} : deepExtend({}, data.distance);
|
|
1409
|
-
}
|
|
1410
|
-
if (data.drift !== undefined) {
|
|
1411
|
-
this.drift = setRangeValue(data.drift);
|
|
1418
|
+
if (data.count !== undefined) {
|
|
1419
|
+
this.count = data.count;
|
|
1412
1420
|
}
|
|
1413
1421
|
if (data.enable !== undefined) {
|
|
1414
1422
|
this.enable = data.enable;
|
|
1415
1423
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
if (data.outModes !== undefined || outMode !== undefined) {
|
|
1419
|
-
if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
|
|
1420
|
-
this.outModes.load({
|
|
1421
|
-
default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
|
|
1422
|
-
});
|
|
1423
|
-
} else {
|
|
1424
|
-
this.outModes.load(data.outModes);
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
|
|
1428
|
-
if (data.random !== undefined) {
|
|
1429
|
-
this.random = data.random;
|
|
1430
|
-
}
|
|
1431
|
-
if (data.size !== undefined) {
|
|
1432
|
-
this.size = data.size;
|
|
1424
|
+
if (data.offset !== undefined) {
|
|
1425
|
+
this.offset = setRangeValue(data.offset);
|
|
1433
1426
|
}
|
|
1434
1427
|
if (data.speed !== undefined) {
|
|
1435
|
-
this.speed =
|
|
1436
|
-
}
|
|
1437
|
-
this.spin.load(data.spin);
|
|
1438
|
-
if (data.straight !== undefined) {
|
|
1439
|
-
this.straight = data.straight;
|
|
1440
|
-
}
|
|
1441
|
-
this.trail.load(data.trail);
|
|
1442
|
-
if (data.vibrate !== undefined) {
|
|
1443
|
-
this.vibrate = data.vibrate;
|
|
1428
|
+
this.speed = data.speed;
|
|
1444
1429
|
}
|
|
1445
|
-
if (data.
|
|
1446
|
-
this.
|
|
1430
|
+
if (data.sync !== undefined) {
|
|
1431
|
+
this.sync = data.sync;
|
|
1447
1432
|
}
|
|
1448
1433
|
}
|
|
1449
1434
|
}
|
|
1450
|
-
class
|
|
1435
|
+
class HslAnimation_HslAnimation {
|
|
1451
1436
|
constructor() {
|
|
1452
|
-
|
|
1453
|
-
this.
|
|
1454
|
-
this.
|
|
1455
|
-
this.value = 1;
|
|
1456
|
-
}
|
|
1457
|
-
get anim() {
|
|
1458
|
-
return this.animation;
|
|
1459
|
-
}
|
|
1460
|
-
set anim(value) {
|
|
1461
|
-
this.animation = value;
|
|
1437
|
+
this.h = new ColorAnimation;
|
|
1438
|
+
this.s = new ColorAnimation;
|
|
1439
|
+
this.l = new ColorAnimation;
|
|
1462
1440
|
}
|
|
1463
1441
|
load(data) {
|
|
1464
|
-
var _a;
|
|
1465
1442
|
if (!data) {
|
|
1466
1443
|
return;
|
|
1467
1444
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
this.animation.load(animation);
|
|
1472
|
-
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
class Shape_Shape {
|
|
1477
|
-
constructor() {
|
|
1478
|
-
this.options = {};
|
|
1479
|
-
this.type = "circle";
|
|
1480
|
-
}
|
|
1481
|
-
get image() {
|
|
1482
|
-
var _a;
|
|
1483
|
-
return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
|
|
1484
|
-
}
|
|
1485
|
-
set image(value) {
|
|
1486
|
-
this.options["image"] = value;
|
|
1487
|
-
this.options["images"] = value;
|
|
1488
|
-
}
|
|
1489
|
-
get custom() {
|
|
1490
|
-
return this.options;
|
|
1491
|
-
}
|
|
1492
|
-
set custom(value) {
|
|
1493
|
-
this.options = value;
|
|
1494
|
-
}
|
|
1495
|
-
get images() {
|
|
1496
|
-
return this.image;
|
|
1497
|
-
}
|
|
1498
|
-
set images(value) {
|
|
1499
|
-
this.image = value;
|
|
1500
|
-
}
|
|
1501
|
-
get stroke() {
|
|
1502
|
-
return [];
|
|
1445
|
+
this.h.load(data.h);
|
|
1446
|
+
this.s.load(data.s);
|
|
1447
|
+
this.l.load(data.l);
|
|
1503
1448
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1449
|
+
}
|
|
1450
|
+
class AnimatableColor_AnimatableColor extends(null && OptionsColor){
|
|
1451
|
+
constructor() {
|
|
1452
|
+
super();
|
|
1453
|
+
this.animation = new HslAnimation;
|
|
1508
1454
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1455
|
+
static create(source, data) {
|
|
1456
|
+
const color = new AnimatableColor_AnimatableColor;
|
|
1457
|
+
color.load(source);
|
|
1458
|
+
if (data !== undefined) {
|
|
1459
|
+
if (typeof data === "string" || data instanceof Array) {
|
|
1460
|
+
color.load({
|
|
1461
|
+
value: data
|
|
1462
|
+
});
|
|
1463
|
+
} else {
|
|
1464
|
+
color.load(data);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
return color;
|
|
1512
1468
|
}
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1469
|
+
load(data) {
|
|
1470
|
+
super.load(data);
|
|
1471
|
+
if (!data) {
|
|
1472
|
+
return;
|
|
1473
|
+
}
|
|
1474
|
+
const colorAnimation = data.animation;
|
|
1475
|
+
if (colorAnimation !== undefined) {
|
|
1476
|
+
if (colorAnimation.enable !== undefined) {
|
|
1477
|
+
this.animation.h.load(colorAnimation);
|
|
1478
|
+
} else {
|
|
1479
|
+
this.animation.load(data.animation);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1516
1482
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1483
|
+
}
|
|
1484
|
+
class AnimatableGradient_AnimatableGradient {
|
|
1485
|
+
constructor() {
|
|
1486
|
+
this.angle = new GradientAngle;
|
|
1487
|
+
this.colors = [];
|
|
1488
|
+
this.type = "random";
|
|
1520
1489
|
}
|
|
1521
1490
|
load(data) {
|
|
1522
|
-
|
|
1523
|
-
if (data === undefined) {
|
|
1491
|
+
if (!data) {
|
|
1524
1492
|
return;
|
|
1525
1493
|
}
|
|
1526
|
-
|
|
1527
|
-
if (
|
|
1528
|
-
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
}
|
|
1494
|
+
this.angle.load(data.angle);
|
|
1495
|
+
if (data.colors !== undefined) {
|
|
1496
|
+
this.colors = data.colors.map((s => {
|
|
1497
|
+
const tmp = new AnimatableGradientColor;
|
|
1498
|
+
tmp.load(s);
|
|
1499
|
+
return tmp;
|
|
1500
|
+
}));
|
|
1534
1501
|
}
|
|
1535
|
-
this.loadShape(data.character, "character", "char", true);
|
|
1536
|
-
this.loadShape(data.polygon, "polygon", "star", false);
|
|
1537
|
-
this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
|
|
1538
1502
|
if (data.type !== undefined) {
|
|
1539
1503
|
this.type = data.type;
|
|
1540
1504
|
}
|
|
1541
1505
|
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1506
|
+
}
|
|
1507
|
+
class GradientAngle {
|
|
1508
|
+
constructor() {
|
|
1509
|
+
this.value = 0;
|
|
1510
|
+
this.animation = new GradientAngleAnimation;
|
|
1511
|
+
this.direction = "clockwise";
|
|
1512
|
+
}
|
|
1513
|
+
load(data) {
|
|
1514
|
+
if (!data) {
|
|
1545
1515
|
return;
|
|
1546
1516
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
}
|
|
1554
|
-
this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
|
|
1555
|
-
if (!this.options[altKey] || altOverride) {
|
|
1556
|
-
this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
|
|
1557
|
-
}
|
|
1558
|
-
} else {
|
|
1559
|
-
if (this.options[mainKey] instanceof Array) {
|
|
1560
|
-
this.options[mainKey] = {};
|
|
1561
|
-
if (!this.options[altKey] || altOverride) {
|
|
1562
|
-
this.options[altKey] = {};
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
|
|
1566
|
-
if (!this.options[altKey] || altOverride) {
|
|
1567
|
-
this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
|
|
1568
|
-
}
|
|
1517
|
+
this.animation.load(data.animation);
|
|
1518
|
+
if (data.value !== undefined) {
|
|
1519
|
+
this.value = data.value;
|
|
1520
|
+
}
|
|
1521
|
+
if (data.direction !== undefined) {
|
|
1522
|
+
this.direction = data.direction;
|
|
1569
1523
|
}
|
|
1570
1524
|
}
|
|
1571
1525
|
}
|
|
1572
|
-
class
|
|
1526
|
+
class GradientColorOpacity {
|
|
1573
1527
|
constructor() {
|
|
1574
|
-
|
|
1575
|
-
this.animation = new
|
|
1576
|
-
this.random.minimumValue = 1;
|
|
1577
|
-
this.value = 3;
|
|
1578
|
-
}
|
|
1579
|
-
get anim() {
|
|
1580
|
-
return this.animation;
|
|
1581
|
-
}
|
|
1582
|
-
set anim(value) {
|
|
1583
|
-
this.animation = value;
|
|
1528
|
+
this.value = 0;
|
|
1529
|
+
this.animation = new GradientColorOpacityAnimation;
|
|
1584
1530
|
}
|
|
1585
1531
|
load(data) {
|
|
1586
|
-
var _a;
|
|
1587
1532
|
if (!data) {
|
|
1588
1533
|
return;
|
|
1589
1534
|
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
this.animation.load(animation);
|
|
1594
|
-
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
1535
|
+
this.animation.load(data.animation);
|
|
1536
|
+
if (data.value !== undefined) {
|
|
1537
|
+
this.value = setRangeValue(data.value);
|
|
1595
1538
|
}
|
|
1596
1539
|
}
|
|
1597
1540
|
}
|
|
1598
|
-
class
|
|
1541
|
+
class AnimatableGradientColor {
|
|
1599
1542
|
constructor() {
|
|
1600
|
-
|
|
1601
|
-
this.
|
|
1602
|
-
this.direction = "clockwise";
|
|
1603
|
-
this.path = false;
|
|
1604
|
-
this.value = 0;
|
|
1543
|
+
this.stop = 0;
|
|
1544
|
+
this.value = new AnimatableColor;
|
|
1605
1545
|
}
|
|
1606
1546
|
load(data) {
|
|
1607
1547
|
if (!data) {
|
|
1608
1548
|
return;
|
|
1609
1549
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
this.direction = data.direction;
|
|
1550
|
+
if (data.stop !== undefined) {
|
|
1551
|
+
this.stop = data.stop;
|
|
1613
1552
|
}
|
|
1614
|
-
this.
|
|
1615
|
-
if (data.
|
|
1616
|
-
this.
|
|
1553
|
+
this.value = AnimatableColor.create(this.value, data.value);
|
|
1554
|
+
if (data.opacity !== undefined) {
|
|
1555
|
+
this.opacity = new GradientColorOpacity;
|
|
1556
|
+
if (typeof data.opacity === "number") {
|
|
1557
|
+
this.opacity.value = data.opacity;
|
|
1558
|
+
} else {
|
|
1559
|
+
this.opacity.load(data.opacity);
|
|
1560
|
+
}
|
|
1617
1561
|
}
|
|
1618
1562
|
}
|
|
1619
1563
|
}
|
|
1620
|
-
class
|
|
1564
|
+
class GradientAngleAnimation {
|
|
1621
1565
|
constructor() {
|
|
1622
1566
|
this.count = 0;
|
|
1623
1567
|
this.enable = false;
|
|
1624
|
-
this.
|
|
1625
|
-
this.
|
|
1626
|
-
this.sync = true;
|
|
1568
|
+
this.speed = 0;
|
|
1569
|
+
this.sync = false;
|
|
1627
1570
|
}
|
|
1628
1571
|
load(data) {
|
|
1629
|
-
if (data
|
|
1572
|
+
if (!data) {
|
|
1630
1573
|
return;
|
|
1631
1574
|
}
|
|
1632
1575
|
if (data.count !== undefined) {
|
|
@@ -1635,9 +1578,6 @@
|
|
|
1635
1578
|
if (data.enable !== undefined) {
|
|
1636
1579
|
this.enable = data.enable;
|
|
1637
1580
|
}
|
|
1638
|
-
if (data.offset !== undefined) {
|
|
1639
|
-
this.offset = setRangeValue(data.offset);
|
|
1640
|
-
}
|
|
1641
1581
|
if (data.speed !== undefined) {
|
|
1642
1582
|
this.speed = data.speed;
|
|
1643
1583
|
}
|
|
@@ -1646,71 +1586,51 @@
|
|
|
1646
1586
|
}
|
|
1647
1587
|
}
|
|
1648
1588
|
}
|
|
1649
|
-
class
|
|
1589
|
+
class GradientColorOpacityAnimation {
|
|
1650
1590
|
constructor() {
|
|
1651
|
-
this.
|
|
1652
|
-
this.
|
|
1653
|
-
this.
|
|
1591
|
+
this.count = 0;
|
|
1592
|
+
this.enable = false;
|
|
1593
|
+
this.speed = 0;
|
|
1594
|
+
this.sync = false;
|
|
1595
|
+
this.startValue = "random";
|
|
1654
1596
|
}
|
|
1655
1597
|
load(data) {
|
|
1656
1598
|
if (!data) {
|
|
1657
1599
|
return;
|
|
1658
1600
|
}
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1601
|
+
if (data.count !== undefined) {
|
|
1602
|
+
this.count = data.count;
|
|
1603
|
+
}
|
|
1604
|
+
if (data.enable !== undefined) {
|
|
1605
|
+
this.enable = data.enable;
|
|
1606
|
+
}
|
|
1607
|
+
if (data.speed !== undefined) {
|
|
1608
|
+
this.speed = data.speed;
|
|
1609
|
+
}
|
|
1610
|
+
if (data.sync !== undefined) {
|
|
1611
|
+
this.sync = data.sync;
|
|
1612
|
+
}
|
|
1613
|
+
if (data.startValue !== undefined) {
|
|
1614
|
+
this.startValue = data.startValue;
|
|
1615
|
+
}
|
|
1662
1616
|
}
|
|
1663
1617
|
}
|
|
1664
|
-
class
|
|
1618
|
+
class ValueWithRandom_ValueWithRandom {
|
|
1665
1619
|
constructor() {
|
|
1666
|
-
|
|
1667
|
-
this.
|
|
1668
|
-
}
|
|
1669
|
-
static create(source, data) {
|
|
1670
|
-
const color = new AnimatableColor_AnimatableColor;
|
|
1671
|
-
color.load(source);
|
|
1672
|
-
if (data !== undefined) {
|
|
1673
|
-
if (typeof data === "string" || data instanceof Array) {
|
|
1674
|
-
color.load({
|
|
1675
|
-
value: data
|
|
1676
|
-
});
|
|
1677
|
-
} else {
|
|
1678
|
-
color.load(data);
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
return color;
|
|
1620
|
+
this.random = new Random;
|
|
1621
|
+
this.value = 0;
|
|
1682
1622
|
}
|
|
1683
1623
|
load(data) {
|
|
1684
|
-
super.load(data);
|
|
1685
1624
|
if (!data) {
|
|
1686
1625
|
return;
|
|
1687
1626
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
} else {
|
|
1693
|
-
this.animation.load(data.animation);
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
class Stroke_Stroke {
|
|
1699
|
-
constructor() {
|
|
1700
|
-
this.width = 0;
|
|
1701
|
-
}
|
|
1702
|
-
load(data) {
|
|
1703
|
-
if (data === undefined) {
|
|
1704
|
-
return;
|
|
1705
|
-
}
|
|
1706
|
-
if (data.color !== undefined) {
|
|
1707
|
-
this.color = AnimatableColor.create(this.color, data.color);
|
|
1708
|
-
}
|
|
1709
|
-
if (data.width !== undefined) {
|
|
1710
|
-
this.width = data.width;
|
|
1627
|
+
if (typeof data.random === "boolean") {
|
|
1628
|
+
this.random.enable = data.random;
|
|
1629
|
+
} else {
|
|
1630
|
+
this.random.load(data.random);
|
|
1711
1631
|
}
|
|
1712
|
-
if (data.
|
|
1713
|
-
this.
|
|
1632
|
+
if (data.value !== undefined) {
|
|
1633
|
+
this.value = setRangeValue(data.value, this.random.enable ? this.random.minimumValue : undefined);
|
|
1714
1634
|
}
|
|
1715
1635
|
}
|
|
1716
1636
|
}
|
|
@@ -1755,54 +1675,6 @@
|
|
|
1755
1675
|
this.overlap.load(data.overlap);
|
|
1756
1676
|
}
|
|
1757
1677
|
}
|
|
1758
|
-
class LifeDelay_LifeDelay extends(null && ValueWithRandom){
|
|
1759
|
-
constructor() {
|
|
1760
|
-
super();
|
|
1761
|
-
this.sync = false;
|
|
1762
|
-
}
|
|
1763
|
-
load(data) {
|
|
1764
|
-
if (!data) {
|
|
1765
|
-
return;
|
|
1766
|
-
}
|
|
1767
|
-
super.load(data);
|
|
1768
|
-
if (data.sync !== undefined) {
|
|
1769
|
-
this.sync = data.sync;
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1773
|
-
class LifeDuration_LifeDuration extends(null && ValueWithRandom){
|
|
1774
|
-
constructor() {
|
|
1775
|
-
super();
|
|
1776
|
-
this.random.minimumValue = 1e-4;
|
|
1777
|
-
this.sync = false;
|
|
1778
|
-
}
|
|
1779
|
-
load(data) {
|
|
1780
|
-
if (data === undefined) {
|
|
1781
|
-
return;
|
|
1782
|
-
}
|
|
1783
|
-
super.load(data);
|
|
1784
|
-
if (data.sync !== undefined) {
|
|
1785
|
-
this.sync = data.sync;
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
class Life_Life {
|
|
1790
|
-
constructor() {
|
|
1791
|
-
this.count = 0;
|
|
1792
|
-
this.delay = new LifeDelay;
|
|
1793
|
-
this.duration = new LifeDuration;
|
|
1794
|
-
}
|
|
1795
|
-
load(data) {
|
|
1796
|
-
if (data === undefined) {
|
|
1797
|
-
return;
|
|
1798
|
-
}
|
|
1799
|
-
if (data.count !== undefined) {
|
|
1800
|
-
this.count = data.count;
|
|
1801
|
-
}
|
|
1802
|
-
this.delay.load(data.delay);
|
|
1803
|
-
this.duration.load(data.duration);
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
1678
|
class SplitFactor_SplitFactor extends(null && ValueWithRandom){
|
|
1807
1679
|
constructor() {
|
|
1808
1680
|
super();
|
|
@@ -1857,318 +1729,582 @@
|
|
|
1857
1729
|
this.split.load(data.split);
|
|
1858
1730
|
}
|
|
1859
1731
|
}
|
|
1860
|
-
class
|
|
1861
|
-
constructor() {
|
|
1862
|
-
this.distance = 5;
|
|
1863
|
-
this.enable = false;
|
|
1864
|
-
this.speed = 50;
|
|
1865
|
-
}
|
|
1866
|
-
load(data) {
|
|
1867
|
-
if (!data) {
|
|
1868
|
-
return;
|
|
1869
|
-
}
|
|
1870
|
-
if (data.distance !== undefined) {
|
|
1871
|
-
this.distance = setRangeValue(data.distance);
|
|
1872
|
-
}
|
|
1873
|
-
if (data.enable !== undefined) {
|
|
1874
|
-
this.enable = data.enable;
|
|
1875
|
-
}
|
|
1876
|
-
if (data.speed !== undefined) {
|
|
1877
|
-
this.speed = setRangeValue(data.speed);
|
|
1878
|
-
}
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
1732
|
+
class LifeDelay_LifeDelay extends(null && ValueWithRandom){
|
|
1882
1733
|
constructor() {
|
|
1883
1734
|
super();
|
|
1884
|
-
this.
|
|
1885
|
-
this.direction = "clockwise";
|
|
1886
|
-
this.enable = false;
|
|
1887
|
-
this.value = 0;
|
|
1735
|
+
this.sync = false;
|
|
1888
1736
|
}
|
|
1889
1737
|
load(data) {
|
|
1890
1738
|
if (!data) {
|
|
1891
1739
|
return;
|
|
1892
1740
|
}
|
|
1893
1741
|
super.load(data);
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
this.direction = data.direction;
|
|
1897
|
-
}
|
|
1898
|
-
if (data.enable !== undefined) {
|
|
1899
|
-
this.enable = data.enable;
|
|
1742
|
+
if (data.sync !== undefined) {
|
|
1743
|
+
this.sync = data.sync;
|
|
1900
1744
|
}
|
|
1901
1745
|
}
|
|
1902
1746
|
}
|
|
1903
|
-
class
|
|
1747
|
+
class LifeDuration_LifeDuration extends(null && ValueWithRandom){
|
|
1904
1748
|
constructor() {
|
|
1905
|
-
|
|
1906
|
-
this.
|
|
1907
|
-
this.
|
|
1908
|
-
this.mode = "vertical";
|
|
1909
|
-
this.speed = 25;
|
|
1749
|
+
super();
|
|
1750
|
+
this.random.minimumValue = 1e-4;
|
|
1751
|
+
this.sync = false;
|
|
1910
1752
|
}
|
|
1911
1753
|
load(data) {
|
|
1912
|
-
if (
|
|
1754
|
+
if (data === undefined) {
|
|
1913
1755
|
return;
|
|
1914
1756
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
this.darken.load(data.darken);
|
|
1919
|
-
if (data.enable !== undefined) {
|
|
1920
|
-
this.enable = data.enable;
|
|
1921
|
-
}
|
|
1922
|
-
this.enlighten.load(data.enlighten);
|
|
1923
|
-
if (data.mode !== undefined) {
|
|
1924
|
-
this.mode = data.mode;
|
|
1925
|
-
}
|
|
1926
|
-
if (data.speed !== undefined) {
|
|
1927
|
-
this.speed = setRangeValue(data.speed);
|
|
1757
|
+
super.load(data);
|
|
1758
|
+
if (data.sync !== undefined) {
|
|
1759
|
+
this.sync = data.sync;
|
|
1928
1760
|
}
|
|
1929
1761
|
}
|
|
1930
1762
|
}
|
|
1931
|
-
class
|
|
1763
|
+
class Life_Life {
|
|
1932
1764
|
constructor() {
|
|
1933
|
-
|
|
1934
|
-
this.
|
|
1935
|
-
this.
|
|
1936
|
-
this.velocityRate = 1;
|
|
1765
|
+
this.count = 0;
|
|
1766
|
+
this.delay = new LifeDelay;
|
|
1767
|
+
this.duration = new LifeDuration;
|
|
1937
1768
|
}
|
|
1938
1769
|
load(data) {
|
|
1939
|
-
|
|
1940
|
-
if (!data) {
|
|
1770
|
+
if (data === undefined) {
|
|
1941
1771
|
return;
|
|
1942
1772
|
}
|
|
1943
|
-
if (data.
|
|
1944
|
-
this.
|
|
1945
|
-
}
|
|
1946
|
-
if (data.sizeRate !== undefined) {
|
|
1947
|
-
this.sizeRate = data.sizeRate;
|
|
1948
|
-
}
|
|
1949
|
-
if (data.velocityRate !== undefined) {
|
|
1950
|
-
this.velocityRate = data.velocityRate;
|
|
1773
|
+
if (data.count !== undefined) {
|
|
1774
|
+
this.count = data.count;
|
|
1951
1775
|
}
|
|
1776
|
+
this.delay.load(data.delay);
|
|
1777
|
+
this.duration.load(data.duration);
|
|
1952
1778
|
}
|
|
1953
1779
|
}
|
|
1954
|
-
class
|
|
1780
|
+
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
1955
1781
|
constructor() {
|
|
1956
1782
|
super();
|
|
1957
|
-
this.value = 45;
|
|
1958
|
-
this.random.enable = false;
|
|
1959
|
-
this.random.minimumValue = 0;
|
|
1960
|
-
}
|
|
1961
|
-
load(data) {
|
|
1962
|
-
if (data === undefined) {
|
|
1963
|
-
return;
|
|
1964
|
-
}
|
|
1965
|
-
super.load(data);
|
|
1966
1783
|
}
|
|
1967
1784
|
}
|
|
1968
|
-
class
|
|
1785
|
+
class Path_Path {
|
|
1969
1786
|
constructor() {
|
|
1970
|
-
this.
|
|
1787
|
+
this.clamp = true;
|
|
1788
|
+
this.delay = new PathDelay;
|
|
1971
1789
|
this.enable = false;
|
|
1972
|
-
this.
|
|
1973
|
-
this.rotation = new OrbitRotation;
|
|
1974
|
-
this.width = 1;
|
|
1790
|
+
this.options = {};
|
|
1975
1791
|
}
|
|
1976
1792
|
load(data) {
|
|
1977
1793
|
if (data === undefined) {
|
|
1978
1794
|
return;
|
|
1979
1795
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
1796
|
+
if (data.clamp !== undefined) {
|
|
1797
|
+
this.clamp = data.clamp;
|
|
1798
|
+
}
|
|
1799
|
+
this.delay.load(data.delay);
|
|
1982
1800
|
if (data.enable !== undefined) {
|
|
1983
1801
|
this.enable = data.enable;
|
|
1984
1802
|
}
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
if (data.width !== undefined) {
|
|
1989
|
-
this.width = data.width;
|
|
1990
|
-
}
|
|
1991
|
-
if (data.radius !== undefined) {
|
|
1992
|
-
this.radius = data.radius;
|
|
1993
|
-
}
|
|
1994
|
-
if (data.color !== undefined) {
|
|
1995
|
-
this.color = OptionsColor.create(this.color, data.color);
|
|
1803
|
+
this.generator = data.generator;
|
|
1804
|
+
if (data.options) {
|
|
1805
|
+
this.options = deepExtend(this.options, data.options);
|
|
1996
1806
|
}
|
|
1997
1807
|
}
|
|
1998
1808
|
}
|
|
1999
|
-
class
|
|
1809
|
+
class Spin_Spin {
|
|
2000
1810
|
constructor() {
|
|
2001
|
-
|
|
2002
|
-
this.
|
|
2003
|
-
this.distance = 1;
|
|
2004
|
-
this.duration = 1;
|
|
2005
|
-
this.factor = 1;
|
|
2006
|
-
this.speed = 1;
|
|
1811
|
+
this.acceleration = 0;
|
|
1812
|
+
this.enable = false;
|
|
2007
1813
|
}
|
|
2008
1814
|
load(data) {
|
|
2009
|
-
super.load(data);
|
|
2010
1815
|
if (!data) {
|
|
2011
1816
|
return;
|
|
2012
1817
|
}
|
|
2013
|
-
if (data.
|
|
2014
|
-
this.
|
|
2015
|
-
}
|
|
2016
|
-
if (data.distance !== undefined) {
|
|
2017
|
-
this.distance = data.distance;
|
|
2018
|
-
}
|
|
2019
|
-
if (data.duration !== undefined) {
|
|
2020
|
-
this.duration = data.duration;
|
|
2021
|
-
}
|
|
2022
|
-
if (data.factor !== undefined) {
|
|
2023
|
-
this.factor = data.factor;
|
|
1818
|
+
if (data.acceleration !== undefined) {
|
|
1819
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
2024
1820
|
}
|
|
2025
|
-
if (data.
|
|
2026
|
-
this.
|
|
1821
|
+
if (data.enable !== undefined) {
|
|
1822
|
+
this.enable = data.enable;
|
|
2027
1823
|
}
|
|
1824
|
+
this.position = data.position ? deepExtend({}, data.position) : undefined;
|
|
2028
1825
|
}
|
|
2029
1826
|
}
|
|
2030
|
-
class
|
|
1827
|
+
class Move_Move {
|
|
2031
1828
|
constructor() {
|
|
2032
|
-
this.angle = new
|
|
2033
|
-
this.
|
|
2034
|
-
this.
|
|
1829
|
+
this.angle = new MoveAngle;
|
|
1830
|
+
this.attract = new Attract;
|
|
1831
|
+
this.decay = 0;
|
|
1832
|
+
this.distance = {};
|
|
1833
|
+
this.direction = "none";
|
|
1834
|
+
this.drift = 0;
|
|
1835
|
+
this.enable = false;
|
|
1836
|
+
this.gravity = new MoveGravity;
|
|
1837
|
+
this.path = new Path;
|
|
1838
|
+
this.outModes = new OutModes;
|
|
1839
|
+
this.random = false;
|
|
1840
|
+
this.size = false;
|
|
1841
|
+
this.speed = 2;
|
|
1842
|
+
this.spin = new Spin;
|
|
1843
|
+
this.straight = false;
|
|
1844
|
+
this.trail = new Trail;
|
|
1845
|
+
this.vibrate = false;
|
|
1846
|
+
this.warp = false;
|
|
2035
1847
|
}
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
1848
|
+
get collisions() {
|
|
1849
|
+
return false;
|
|
1850
|
+
}
|
|
1851
|
+
set collisions(value) {}
|
|
1852
|
+
get bounce() {
|
|
1853
|
+
return this.collisions;
|
|
1854
|
+
}
|
|
1855
|
+
set bounce(value) {
|
|
1856
|
+
this.collisions = value;
|
|
1857
|
+
}
|
|
1858
|
+
get out_mode() {
|
|
1859
|
+
return this.outMode;
|
|
1860
|
+
}
|
|
1861
|
+
set out_mode(value) {
|
|
1862
|
+
this.outMode = value;
|
|
1863
|
+
}
|
|
1864
|
+
get outMode() {
|
|
1865
|
+
return this.outModes.default;
|
|
1866
|
+
}
|
|
1867
|
+
set outMode(value) {
|
|
1868
|
+
this.outModes.default = value;
|
|
1869
|
+
}
|
|
1870
|
+
get noise() {
|
|
1871
|
+
return this.path;
|
|
1872
|
+
}
|
|
1873
|
+
set noise(value) {
|
|
1874
|
+
this.path = value;
|
|
1875
|
+
}
|
|
1876
|
+
load(data) {
|
|
1877
|
+
var _a, _b, _c;
|
|
1878
|
+
if (data === undefined) {
|
|
1879
|
+
return;
|
|
2039
1880
|
}
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
}));
|
|
1881
|
+
if (data.angle !== undefined) {
|
|
1882
|
+
if (typeof data.angle === "number") {
|
|
1883
|
+
this.angle.value = data.angle;
|
|
1884
|
+
} else {
|
|
1885
|
+
this.angle.load(data.angle);
|
|
1886
|
+
}
|
|
2047
1887
|
}
|
|
2048
|
-
|
|
2049
|
-
|
|
1888
|
+
this.attract.load(data.attract);
|
|
1889
|
+
if (data.decay !== undefined) {
|
|
1890
|
+
this.decay = data.decay;
|
|
1891
|
+
}
|
|
1892
|
+
if (data.direction !== undefined) {
|
|
1893
|
+
this.direction = data.direction;
|
|
1894
|
+
}
|
|
1895
|
+
if (data.distance !== undefined) {
|
|
1896
|
+
this.distance = typeof data.distance === "number" ? {
|
|
1897
|
+
horizontal: data.distance,
|
|
1898
|
+
vertical: data.distance
|
|
1899
|
+
} : deepExtend({}, data.distance);
|
|
1900
|
+
}
|
|
1901
|
+
if (data.drift !== undefined) {
|
|
1902
|
+
this.drift = setRangeValue(data.drift);
|
|
1903
|
+
}
|
|
1904
|
+
if (data.enable !== undefined) {
|
|
1905
|
+
this.enable = data.enable;
|
|
1906
|
+
}
|
|
1907
|
+
this.gravity.load(data.gravity);
|
|
1908
|
+
const outMode = (_a = data.outMode) !== null && _a !== void 0 ? _a : data.out_mode;
|
|
1909
|
+
if (data.outModes !== undefined || outMode !== undefined) {
|
|
1910
|
+
if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
|
|
1911
|
+
this.outModes.load({
|
|
1912
|
+
default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
|
|
1913
|
+
});
|
|
1914
|
+
} else {
|
|
1915
|
+
this.outModes.load(data.outModes);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
|
|
1919
|
+
if (data.random !== undefined) {
|
|
1920
|
+
this.random = data.random;
|
|
1921
|
+
}
|
|
1922
|
+
if (data.size !== undefined) {
|
|
1923
|
+
this.size = data.size;
|
|
1924
|
+
}
|
|
1925
|
+
if (data.speed !== undefined) {
|
|
1926
|
+
this.speed = setRangeValue(data.speed);
|
|
1927
|
+
}
|
|
1928
|
+
this.spin.load(data.spin);
|
|
1929
|
+
if (data.straight !== undefined) {
|
|
1930
|
+
this.straight = data.straight;
|
|
1931
|
+
}
|
|
1932
|
+
this.trail.load(data.trail);
|
|
1933
|
+
if (data.vibrate !== undefined) {
|
|
1934
|
+
this.vibrate = data.vibrate;
|
|
1935
|
+
}
|
|
1936
|
+
if (data.warp !== undefined) {
|
|
1937
|
+
this.warp = data.warp;
|
|
2050
1938
|
}
|
|
2051
1939
|
}
|
|
2052
1940
|
}
|
|
2053
|
-
class
|
|
1941
|
+
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
2054
1942
|
constructor() {
|
|
2055
|
-
|
|
2056
|
-
this.animation = new
|
|
2057
|
-
this.
|
|
1943
|
+
super();
|
|
1944
|
+
this.animation = new OpacityAnimation;
|
|
1945
|
+
this.random.minimumValue = .1;
|
|
1946
|
+
this.value = 1;
|
|
1947
|
+
}
|
|
1948
|
+
get anim() {
|
|
1949
|
+
return this.animation;
|
|
1950
|
+
}
|
|
1951
|
+
set anim(value) {
|
|
1952
|
+
this.animation = value;
|
|
2058
1953
|
}
|
|
2059
1954
|
load(data) {
|
|
1955
|
+
var _a;
|
|
2060
1956
|
if (!data) {
|
|
2061
1957
|
return;
|
|
2062
1958
|
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
this.direction = data.direction;
|
|
1959
|
+
super.load(data);
|
|
1960
|
+
const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
|
|
1961
|
+
if (animation !== undefined) {
|
|
1962
|
+
this.animation.load(animation);
|
|
1963
|
+
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
2069
1964
|
}
|
|
2070
1965
|
}
|
|
2071
1966
|
}
|
|
2072
|
-
class
|
|
1967
|
+
class OrbitRotation_OrbitRotation extends(null && ValueWithRandom){
|
|
2073
1968
|
constructor() {
|
|
2074
|
-
|
|
2075
|
-
this.
|
|
1969
|
+
super();
|
|
1970
|
+
this.value = 45;
|
|
1971
|
+
this.random.enable = false;
|
|
1972
|
+
this.random.minimumValue = 0;
|
|
2076
1973
|
}
|
|
2077
1974
|
load(data) {
|
|
2078
|
-
if (
|
|
1975
|
+
if (data === undefined) {
|
|
2079
1976
|
return;
|
|
2080
1977
|
}
|
|
2081
|
-
|
|
2082
|
-
if (data.value !== undefined) {
|
|
2083
|
-
this.value = setRangeValue(data.value);
|
|
2084
|
-
}
|
|
1978
|
+
super.load(data);
|
|
2085
1979
|
}
|
|
2086
1980
|
}
|
|
2087
|
-
class
|
|
1981
|
+
class Orbit_Orbit {
|
|
2088
1982
|
constructor() {
|
|
2089
|
-
this.
|
|
2090
|
-
this.
|
|
1983
|
+
this.animation = new AnimationOptions;
|
|
1984
|
+
this.enable = false;
|
|
1985
|
+
this.opacity = 1;
|
|
1986
|
+
this.rotation = new OrbitRotation;
|
|
1987
|
+
this.width = 1;
|
|
2091
1988
|
}
|
|
2092
1989
|
load(data) {
|
|
2093
|
-
if (
|
|
1990
|
+
if (data === undefined) {
|
|
2094
1991
|
return;
|
|
2095
1992
|
}
|
|
2096
|
-
|
|
2097
|
-
|
|
1993
|
+
this.animation.load(data.animation);
|
|
1994
|
+
this.rotation.load(data.rotation);
|
|
1995
|
+
if (data.enable !== undefined) {
|
|
1996
|
+
this.enable = data.enable;
|
|
2098
1997
|
}
|
|
2099
|
-
this.value = AnimatableColor.create(this.value, data.value);
|
|
2100
1998
|
if (data.opacity !== undefined) {
|
|
2101
|
-
this.opacity =
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
1999
|
+
this.opacity = data.opacity;
|
|
2000
|
+
}
|
|
2001
|
+
if (data.width !== undefined) {
|
|
2002
|
+
this.width = data.width;
|
|
2003
|
+
}
|
|
2004
|
+
if (data.radius !== undefined) {
|
|
2005
|
+
this.radius = data.radius;
|
|
2006
|
+
}
|
|
2007
|
+
if (data.color !== undefined) {
|
|
2008
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
2107
2009
|
}
|
|
2108
2010
|
}
|
|
2109
2011
|
}
|
|
2110
|
-
class
|
|
2012
|
+
class Repulse_Repulse extends(null && ValueWithRandom){
|
|
2111
2013
|
constructor() {
|
|
2112
|
-
|
|
2113
|
-
this.
|
|
2114
|
-
this.
|
|
2115
|
-
this.
|
|
2014
|
+
super();
|
|
2015
|
+
this.enabled = false;
|
|
2016
|
+
this.distance = 1;
|
|
2017
|
+
this.duration = 1;
|
|
2018
|
+
this.factor = 1;
|
|
2019
|
+
this.speed = 1;
|
|
2116
2020
|
}
|
|
2117
2021
|
load(data) {
|
|
2022
|
+
super.load(data);
|
|
2118
2023
|
if (!data) {
|
|
2119
2024
|
return;
|
|
2120
2025
|
}
|
|
2121
|
-
if (data.
|
|
2122
|
-
this.
|
|
2026
|
+
if (data.enabled !== undefined) {
|
|
2027
|
+
this.enabled = data.enabled;
|
|
2123
2028
|
}
|
|
2124
|
-
if (data.
|
|
2125
|
-
this.
|
|
2029
|
+
if (data.distance !== undefined) {
|
|
2030
|
+
this.distance = data.distance;
|
|
2031
|
+
}
|
|
2032
|
+
if (data.duration !== undefined) {
|
|
2033
|
+
this.duration = data.duration;
|
|
2034
|
+
}
|
|
2035
|
+
if (data.factor !== undefined) {
|
|
2036
|
+
this.factor = data.factor;
|
|
2126
2037
|
}
|
|
2127
2038
|
if (data.speed !== undefined) {
|
|
2128
2039
|
this.speed = data.speed;
|
|
2129
2040
|
}
|
|
2130
|
-
if (data.sync !== undefined) {
|
|
2131
|
-
this.sync = data.sync;
|
|
2132
|
-
}
|
|
2133
2041
|
}
|
|
2134
2042
|
}
|
|
2135
|
-
class
|
|
2043
|
+
class Roll_Roll {
|
|
2136
2044
|
constructor() {
|
|
2137
|
-
this.
|
|
2045
|
+
this.darken = new RollLight;
|
|
2138
2046
|
this.enable = false;
|
|
2139
|
-
this.
|
|
2140
|
-
this.
|
|
2141
|
-
this.
|
|
2047
|
+
this.enlighten = new RollLight;
|
|
2048
|
+
this.mode = "vertical";
|
|
2049
|
+
this.speed = 25;
|
|
2142
2050
|
}
|
|
2143
2051
|
load(data) {
|
|
2144
2052
|
if (!data) {
|
|
2145
2053
|
return;
|
|
2146
2054
|
}
|
|
2147
|
-
if (data.
|
|
2148
|
-
this.
|
|
2055
|
+
if (data.backColor !== undefined) {
|
|
2056
|
+
this.backColor = OptionsColor.create(this.backColor, data.backColor);
|
|
2149
2057
|
}
|
|
2058
|
+
this.darken.load(data.darken);
|
|
2150
2059
|
if (data.enable !== undefined) {
|
|
2151
2060
|
this.enable = data.enable;
|
|
2152
2061
|
}
|
|
2062
|
+
this.enlighten.load(data.enlighten);
|
|
2063
|
+
if (data.mode !== undefined) {
|
|
2064
|
+
this.mode = data.mode;
|
|
2065
|
+
}
|
|
2153
2066
|
if (data.speed !== undefined) {
|
|
2154
|
-
this.speed = data.speed;
|
|
2067
|
+
this.speed = setRangeValue(data.speed);
|
|
2155
2068
|
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
2072
|
+
constructor() {
|
|
2073
|
+
super();
|
|
2074
|
+
this.animation = new RotateAnimation;
|
|
2075
|
+
this.direction = "clockwise";
|
|
2076
|
+
this.path = false;
|
|
2077
|
+
this.value = 0;
|
|
2078
|
+
}
|
|
2079
|
+
load(data) {
|
|
2080
|
+
if (!data) {
|
|
2081
|
+
return;
|
|
2158
2082
|
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2083
|
+
super.load(data);
|
|
2084
|
+
if (data.direction !== undefined) {
|
|
2085
|
+
this.direction = data.direction;
|
|
2086
|
+
}
|
|
2087
|
+
this.animation.load(data.animation);
|
|
2088
|
+
if (data.path !== undefined) {
|
|
2089
|
+
this.path = data.path;
|
|
2161
2090
|
}
|
|
2162
2091
|
}
|
|
2163
2092
|
}
|
|
2164
|
-
class
|
|
2093
|
+
class Shape_Shape {
|
|
2165
2094
|
constructor() {
|
|
2166
|
-
this.
|
|
2167
|
-
this.
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
this.
|
|
2095
|
+
this.options = {};
|
|
2096
|
+
this.type = "circle";
|
|
2097
|
+
}
|
|
2098
|
+
get image() {
|
|
2099
|
+
var _a;
|
|
2100
|
+
return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
|
|
2101
|
+
}
|
|
2102
|
+
set image(value) {
|
|
2103
|
+
this.options["image"] = value;
|
|
2104
|
+
this.options["images"] = value;
|
|
2105
|
+
}
|
|
2106
|
+
get custom() {
|
|
2107
|
+
return this.options;
|
|
2108
|
+
}
|
|
2109
|
+
set custom(value) {
|
|
2110
|
+
this.options = value;
|
|
2111
|
+
}
|
|
2112
|
+
get images() {
|
|
2113
|
+
return this.image;
|
|
2114
|
+
}
|
|
2115
|
+
set images(value) {
|
|
2116
|
+
this.image = value;
|
|
2117
|
+
}
|
|
2118
|
+
get stroke() {
|
|
2119
|
+
return [];
|
|
2120
|
+
}
|
|
2121
|
+
set stroke(_value) {}
|
|
2122
|
+
get character() {
|
|
2123
|
+
var _a;
|
|
2124
|
+
return (_a = this.options["character"]) !== null && _a !== void 0 ? _a : this.options["char"];
|
|
2125
|
+
}
|
|
2126
|
+
set character(value) {
|
|
2127
|
+
this.options["character"] = value;
|
|
2128
|
+
this.options["char"] = value;
|
|
2129
|
+
}
|
|
2130
|
+
get polygon() {
|
|
2131
|
+
var _a;
|
|
2132
|
+
return (_a = this.options["polygon"]) !== null && _a !== void 0 ? _a : this.options["star"];
|
|
2133
|
+
}
|
|
2134
|
+
set polygon(value) {
|
|
2135
|
+
this.options["polygon"] = value;
|
|
2136
|
+
this.options["star"] = value;
|
|
2137
|
+
}
|
|
2138
|
+
load(data) {
|
|
2139
|
+
var _a, _b, _c;
|
|
2140
|
+
if (data === undefined) {
|
|
2141
|
+
return;
|
|
2142
|
+
}
|
|
2143
|
+
const options = (_a = data.options) !== null && _a !== void 0 ? _a : data.custom;
|
|
2144
|
+
if (options !== undefined) {
|
|
2145
|
+
for (const shape in options) {
|
|
2146
|
+
const item = options[shape];
|
|
2147
|
+
if (item !== undefined) {
|
|
2148
|
+
this.options[shape] = deepExtend((_b = this.options[shape]) !== null && _b !== void 0 ? _b : {}, item);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
this.loadShape(data.character, "character", "char", true);
|
|
2153
|
+
this.loadShape(data.polygon, "polygon", "star", false);
|
|
2154
|
+
this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
|
|
2155
|
+
if (data.type !== undefined) {
|
|
2156
|
+
this.type = data.type;
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
loadShape(item, mainKey, altKey, altOverride) {
|
|
2160
|
+
var _a, _b, _c, _d;
|
|
2161
|
+
if (item === undefined) {
|
|
2162
|
+
return;
|
|
2163
|
+
}
|
|
2164
|
+
if (item instanceof Array) {
|
|
2165
|
+
if (!(this.options[mainKey] instanceof Array)) {
|
|
2166
|
+
this.options[mainKey] = [];
|
|
2167
|
+
if (!this.options[altKey] || altOverride) {
|
|
2168
|
+
this.options[altKey] = [];
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
|
|
2172
|
+
if (!this.options[altKey] || altOverride) {
|
|
2173
|
+
this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
|
|
2174
|
+
}
|
|
2175
|
+
} else {
|
|
2176
|
+
if (this.options[mainKey] instanceof Array) {
|
|
2177
|
+
this.options[mainKey] = {};
|
|
2178
|
+
if (!this.options[altKey] || altOverride) {
|
|
2179
|
+
this.options[altKey] = {};
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
|
|
2183
|
+
if (!this.options[altKey] || altOverride) {
|
|
2184
|
+
this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
class Size_Size extends(null && ValueWithRandom){
|
|
2190
|
+
constructor() {
|
|
2191
|
+
super();
|
|
2192
|
+
this.animation = new SizeAnimation;
|
|
2193
|
+
this.random.minimumValue = 1;
|
|
2194
|
+
this.value = 3;
|
|
2195
|
+
}
|
|
2196
|
+
get anim() {
|
|
2197
|
+
return this.animation;
|
|
2198
|
+
}
|
|
2199
|
+
set anim(value) {
|
|
2200
|
+
this.animation = value;
|
|
2201
|
+
}
|
|
2202
|
+
load(data) {
|
|
2203
|
+
var _a;
|
|
2204
|
+
if (!data) {
|
|
2205
|
+
return;
|
|
2206
|
+
}
|
|
2207
|
+
super.load(data);
|
|
2208
|
+
const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
|
|
2209
|
+
if (animation !== undefined) {
|
|
2210
|
+
this.animation.load(animation);
|
|
2211
|
+
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
class Stroke_Stroke {
|
|
2216
|
+
constructor() {
|
|
2217
|
+
this.width = 0;
|
|
2218
|
+
}
|
|
2219
|
+
load(data) {
|
|
2220
|
+
if (data === undefined) {
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2223
|
+
if (data.color !== undefined) {
|
|
2224
|
+
this.color = AnimatableColor.create(this.color, data.color);
|
|
2225
|
+
}
|
|
2226
|
+
if (data.width !== undefined) {
|
|
2227
|
+
this.width = data.width;
|
|
2228
|
+
}
|
|
2229
|
+
if (data.opacity !== undefined) {
|
|
2230
|
+
this.opacity = data.opacity;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
2235
|
+
constructor() {
|
|
2236
|
+
super();
|
|
2237
|
+
this.animation = new TiltAnimation;
|
|
2238
|
+
this.direction = "clockwise";
|
|
2239
|
+
this.enable = false;
|
|
2240
|
+
this.value = 0;
|
|
2241
|
+
}
|
|
2242
|
+
load(data) {
|
|
2243
|
+
if (!data) {
|
|
2244
|
+
return;
|
|
2245
|
+
}
|
|
2246
|
+
super.load(data);
|
|
2247
|
+
this.animation.load(data.animation);
|
|
2248
|
+
if (data.direction !== undefined) {
|
|
2249
|
+
this.direction = data.direction;
|
|
2250
|
+
}
|
|
2251
|
+
if (data.enable !== undefined) {
|
|
2252
|
+
this.enable = data.enable;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
class Wobble_Wobble {
|
|
2257
|
+
constructor() {
|
|
2258
|
+
this.distance = 5;
|
|
2259
|
+
this.enable = false;
|
|
2260
|
+
this.speed = 50;
|
|
2261
|
+
}
|
|
2262
|
+
load(data) {
|
|
2263
|
+
if (!data) {
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
if (data.distance !== undefined) {
|
|
2267
|
+
this.distance = setRangeValue(data.distance);
|
|
2268
|
+
}
|
|
2269
|
+
if (data.enable !== undefined) {
|
|
2270
|
+
this.enable = data.enable;
|
|
2271
|
+
}
|
|
2272
|
+
if (data.speed !== undefined) {
|
|
2273
|
+
this.speed = setRangeValue(data.speed);
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
class ZIndex_ZIndex extends(null && ValueWithRandom){
|
|
2278
|
+
constructor() {
|
|
2279
|
+
super();
|
|
2280
|
+
this.opacityRate = 1;
|
|
2281
|
+
this.sizeRate = 1;
|
|
2282
|
+
this.velocityRate = 1;
|
|
2283
|
+
}
|
|
2284
|
+
load(data) {
|
|
2285
|
+
super.load(data);
|
|
2286
|
+
if (!data) {
|
|
2287
|
+
return;
|
|
2288
|
+
}
|
|
2289
|
+
if (data.opacityRate !== undefined) {
|
|
2290
|
+
this.opacityRate = data.opacityRate;
|
|
2291
|
+
}
|
|
2292
|
+
if (data.sizeRate !== undefined) {
|
|
2293
|
+
this.sizeRate = data.sizeRate;
|
|
2294
|
+
}
|
|
2295
|
+
if (data.velocityRate !== undefined) {
|
|
2296
|
+
this.velocityRate = data.velocityRate;
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
class ParticlesOptions_ParticlesOptions {
|
|
2301
|
+
constructor() {
|
|
2302
|
+
this.bounce = new Bounce;
|
|
2303
|
+
this.collisions = new Collisions;
|
|
2304
|
+
this.color = new AnimatableColor;
|
|
2305
|
+
this.destroy = new Destroy;
|
|
2306
|
+
this.gradient = [];
|
|
2307
|
+
this.groups = {};
|
|
2172
2308
|
this.life = new Life;
|
|
2173
2309
|
this.links = new Links;
|
|
2174
2310
|
this.move = new Move;
|
|
@@ -2275,30 +2411,244 @@
|
|
|
2275
2411
|
}
|
|
2276
2412
|
}
|
|
2277
2413
|
}
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2414
|
+
class Responsive_Responsive {
|
|
2415
|
+
constructor() {
|
|
2416
|
+
this.maxWidth = Infinity;
|
|
2417
|
+
this.options = {};
|
|
2418
|
+
this.mode = "canvas";
|
|
2419
|
+
}
|
|
2420
|
+
load(data) {
|
|
2421
|
+
if (!data) {
|
|
2422
|
+
return;
|
|
2423
|
+
}
|
|
2424
|
+
if (data.maxWidth !== undefined) {
|
|
2425
|
+
this.maxWidth = data.maxWidth;
|
|
2426
|
+
}
|
|
2427
|
+
if (data.mode !== undefined) {
|
|
2428
|
+
if (data.mode === "screen") {
|
|
2429
|
+
this.mode = "screen";
|
|
2430
|
+
} else {
|
|
2431
|
+
this.mode = "canvas";
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
if (data.options !== undefined) {
|
|
2435
|
+
this.options = deepExtend({}, data.options);
|
|
2284
2436
|
}
|
|
2285
2437
|
}
|
|
2286
|
-
}
|
|
2287
|
-
class
|
|
2288
|
-
constructor(
|
|
2289
|
-
|
|
2290
|
-
this.
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
this.
|
|
2300
|
-
|
|
2301
|
-
|
|
2438
|
+
}
|
|
2439
|
+
class Theme_Theme {
|
|
2440
|
+
constructor() {
|
|
2441
|
+
this.name = "";
|
|
2442
|
+
this.default = new ThemeDefault;
|
|
2443
|
+
}
|
|
2444
|
+
load(data) {
|
|
2445
|
+
if (data === undefined) {
|
|
2446
|
+
return;
|
|
2447
|
+
}
|
|
2448
|
+
if (data.name !== undefined) {
|
|
2449
|
+
this.name = data.name;
|
|
2450
|
+
}
|
|
2451
|
+
this.default.load(data.default);
|
|
2452
|
+
if (data.options !== undefined) {
|
|
2453
|
+
this.options = deepExtend({}, data.options);
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
var Options_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2458
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2459
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2460
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2461
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2462
|
+
value;
|
|
2463
|
+
};
|
|
2464
|
+
var Options_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2465
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2466
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2467
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2468
|
+
};
|
|
2469
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
2470
|
+
class Options_Options {
|
|
2471
|
+
constructor(engine) {
|
|
2472
|
+
_Options_instances.add(this);
|
|
2473
|
+
_Options_engine.set(this, void 0);
|
|
2474
|
+
Options_classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
2475
|
+
this.autoPlay = true;
|
|
2476
|
+
this.background = new Background;
|
|
2477
|
+
this.backgroundMask = new BackgroundMask;
|
|
2478
|
+
this.fullScreen = new FullScreen;
|
|
2479
|
+
this.detectRetina = true;
|
|
2480
|
+
this.duration = 0;
|
|
2481
|
+
this.fpsLimit = 120;
|
|
2482
|
+
this.interactivity = new Interactivity;
|
|
2483
|
+
this.manualParticles = [];
|
|
2484
|
+
this.motion = new Motion;
|
|
2485
|
+
this.particles = new ParticlesOptions;
|
|
2486
|
+
this.pauseOnBlur = true;
|
|
2487
|
+
this.pauseOnOutsideViewport = true;
|
|
2488
|
+
this.responsive = [];
|
|
2489
|
+
this.style = {};
|
|
2490
|
+
this.themes = [];
|
|
2491
|
+
this.zLayers = 100;
|
|
2492
|
+
}
|
|
2493
|
+
get fps_limit() {
|
|
2494
|
+
return this.fpsLimit;
|
|
2495
|
+
}
|
|
2496
|
+
set fps_limit(value) {
|
|
2497
|
+
this.fpsLimit = value;
|
|
2498
|
+
}
|
|
2499
|
+
get retina_detect() {
|
|
2500
|
+
return this.detectRetina;
|
|
2501
|
+
}
|
|
2502
|
+
set retina_detect(value) {
|
|
2503
|
+
this.detectRetina = value;
|
|
2504
|
+
}
|
|
2505
|
+
get backgroundMode() {
|
|
2506
|
+
return this.fullScreen;
|
|
2507
|
+
}
|
|
2508
|
+
set backgroundMode(value) {
|
|
2509
|
+
this.fullScreen.load(value);
|
|
2510
|
+
}
|
|
2511
|
+
load(data) {
|
|
2512
|
+
var _a, _b, _c, _d, _e;
|
|
2513
|
+
if (data === undefined) {
|
|
2514
|
+
return;
|
|
2515
|
+
}
|
|
2516
|
+
if (data.preset !== undefined) {
|
|
2517
|
+
if (data.preset instanceof Array) {
|
|
2518
|
+
for (const preset of data.preset) {
|
|
2519
|
+
this.importPreset(preset);
|
|
2520
|
+
}
|
|
2521
|
+
} else {
|
|
2522
|
+
this.importPreset(data.preset);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
if (data.autoPlay !== undefined) {
|
|
2526
|
+
this.autoPlay = data.autoPlay;
|
|
2527
|
+
}
|
|
2528
|
+
const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
|
|
2529
|
+
if (detectRetina !== undefined) {
|
|
2530
|
+
this.detectRetina = detectRetina;
|
|
2531
|
+
}
|
|
2532
|
+
if (data.duration !== undefined) {
|
|
2533
|
+
this.duration = data.duration;
|
|
2534
|
+
}
|
|
2535
|
+
const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
|
|
2536
|
+
if (fpsLimit !== undefined) {
|
|
2537
|
+
this.fpsLimit = fpsLimit;
|
|
2538
|
+
}
|
|
2539
|
+
if (data.pauseOnBlur !== undefined) {
|
|
2540
|
+
this.pauseOnBlur = data.pauseOnBlur;
|
|
2541
|
+
}
|
|
2542
|
+
if (data.pauseOnOutsideViewport !== undefined) {
|
|
2543
|
+
this.pauseOnOutsideViewport = data.pauseOnOutsideViewport;
|
|
2544
|
+
}
|
|
2545
|
+
if (data.zLayers !== undefined) {
|
|
2546
|
+
this.zLayers = data.zLayers;
|
|
2547
|
+
}
|
|
2548
|
+
this.background.load(data.background);
|
|
2549
|
+
const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
|
|
2550
|
+
if (typeof fullScreen === "boolean") {
|
|
2551
|
+
this.fullScreen.enable = fullScreen;
|
|
2552
|
+
} else {
|
|
2553
|
+
this.fullScreen.load(fullScreen);
|
|
2554
|
+
}
|
|
2555
|
+
this.backgroundMask.load(data.backgroundMask);
|
|
2556
|
+
this.interactivity.load(data.interactivity);
|
|
2557
|
+
if (data.manualParticles !== undefined) {
|
|
2558
|
+
this.manualParticles = data.manualParticles.map((t => {
|
|
2559
|
+
const tmp = new ManualParticle;
|
|
2560
|
+
tmp.load(t);
|
|
2561
|
+
return tmp;
|
|
2562
|
+
}));
|
|
2563
|
+
}
|
|
2564
|
+
this.motion.load(data.motion);
|
|
2565
|
+
this.particles.load(data.particles);
|
|
2566
|
+
this.style = deepExtend(this.style, data.style);
|
|
2567
|
+
Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
2568
|
+
if (data.responsive !== undefined) {
|
|
2569
|
+
for (const responsive of data.responsive) {
|
|
2570
|
+
const optResponsive = new Responsive;
|
|
2571
|
+
optResponsive.load(responsive);
|
|
2572
|
+
this.responsive.push(optResponsive);
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
this.responsive.sort(((a, b) => a.maxWidth - b.maxWidth));
|
|
2576
|
+
if (data.themes !== undefined) {
|
|
2577
|
+
for (const theme of data.themes) {
|
|
2578
|
+
const optTheme = new Theme;
|
|
2579
|
+
optTheme.load(theme);
|
|
2580
|
+
this.themes.push(optTheme);
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
this.defaultDarkTheme = (_d = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
2584
|
+
this.defaultLightTheme = (_e = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
2585
|
+
}
|
|
2586
|
+
setTheme(name) {
|
|
2587
|
+
if (name) {
|
|
2588
|
+
const chosenTheme = this.themes.find((theme => theme.name === name));
|
|
2589
|
+
if (chosenTheme) {
|
|
2590
|
+
this.load(chosenTheme.options);
|
|
2591
|
+
}
|
|
2592
|
+
} else {
|
|
2593
|
+
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, clientDarkMode ? "dark" : "light");
|
|
2594
|
+
if (defaultTheme) {
|
|
2595
|
+
this.load(defaultTheme.options);
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
setResponsive(width, pxRatio, defaultOptions) {
|
|
2600
|
+
this.load(defaultOptions);
|
|
2601
|
+
const responsiveOptions = this.responsive.find((t => t.mode === "screen" && screen ? t.maxWidth * pxRatio > screen.availWidth : t.maxWidth * pxRatio > width));
|
|
2602
|
+
this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
|
|
2603
|
+
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
2604
|
+
}
|
|
2605
|
+
importPreset(preset) {
|
|
2606
|
+
this.load(Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
_Options_engine = new WeakMap, _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
2610
|
+
var _a;
|
|
2611
|
+
return (_a = this.themes.find((theme => theme.default.value && theme.default.mode === mode))) !== null && _a !== void 0 ? _a : this.themes.find((theme => theme.default.value && theme.default.mode === "any"));
|
|
2612
|
+
};
|
|
2613
|
+
var Particle_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2614
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2615
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2616
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2617
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2618
|
+
value;
|
|
2619
|
+
};
|
|
2620
|
+
var Particle_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2621
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2622
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2623
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2624
|
+
};
|
|
2625
|
+
var _Particle_engine;
|
|
2626
|
+
const fixOutMode = data => {
|
|
2627
|
+
if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
|
|
2628
|
+
if (data.coord > data.maxCoord - data.radius * 2) {
|
|
2629
|
+
data.setCb(-data.radius);
|
|
2630
|
+
} else if (data.coord < data.radius * 2) {
|
|
2631
|
+
data.setCb(data.radius);
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
};
|
|
2635
|
+
class Particle_Particle {
|
|
2636
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
2637
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2638
|
+
this.id = id;
|
|
2639
|
+
this.container = container;
|
|
2640
|
+
this.group = group;
|
|
2641
|
+
_Particle_engine.set(this, void 0);
|
|
2642
|
+
Particle_classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
2643
|
+
this.fill = true;
|
|
2644
|
+
this.close = true;
|
|
2645
|
+
this.lastPathTime = 0;
|
|
2646
|
+
this.destroyed = false;
|
|
2647
|
+
this.unbreakable = false;
|
|
2648
|
+
this.splitCount = 0;
|
|
2649
|
+
this.misplaced = false;
|
|
2650
|
+
this.retina = {
|
|
2651
|
+
maxDistance: {}
|
|
2302
2652
|
};
|
|
2303
2653
|
const pxRatio = container.retina.pixelRatio;
|
|
2304
2654
|
const mainOptions = container.actualOptions;
|
|
@@ -2383,7 +2733,7 @@
|
|
|
2383
2733
|
this.sides = 24;
|
|
2384
2734
|
let drawer = container.drawers.get(this.shape);
|
|
2385
2735
|
if (!drawer) {
|
|
2386
|
-
drawer =
|
|
2736
|
+
drawer = Particle_classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
2387
2737
|
if (drawer) {
|
|
2388
2738
|
container.drawers.set(this.shape, drawer);
|
|
2389
2739
|
}
|
|
@@ -2623,9 +2973,25 @@
|
|
|
2623
2973
|
return life;
|
|
2624
2974
|
}
|
|
2625
2975
|
}
|
|
2976
|
+
_Particle_engine = new WeakMap;
|
|
2977
|
+
var Particles_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2978
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2979
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2980
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2981
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2982
|
+
value;
|
|
2983
|
+
};
|
|
2984
|
+
var Particles_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2985
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2986
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2987
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2988
|
+
};
|
|
2989
|
+
var _Particles_engine;
|
|
2626
2990
|
class Particles_Particles {
|
|
2627
|
-
constructor(container) {
|
|
2991
|
+
constructor(engine, container) {
|
|
2628
2992
|
this.container = container;
|
|
2993
|
+
_Particles_engine.set(this, void 0);
|
|
2994
|
+
Particles_classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
2629
2995
|
this.nextId = 0;
|
|
2630
2996
|
this.array = [];
|
|
2631
2997
|
this.zArray = [];
|
|
@@ -2637,11 +3003,11 @@
|
|
|
2637
3003
|
links: new Map,
|
|
2638
3004
|
triangles: new Map
|
|
2639
3005
|
};
|
|
2640
|
-
this.interactionManager = new InteractionManager(container);
|
|
3006
|
+
this.interactionManager = new InteractionManager(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
2641
3007
|
const canvasSize = this.container.canvas.size;
|
|
2642
3008
|
this.linksColors = new Map;
|
|
2643
3009
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
|
|
2644
|
-
this.updaters =
|
|
3010
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
2645
3011
|
}
|
|
2646
3012
|
get count() {
|
|
2647
3013
|
return this.array.length;
|
|
@@ -2655,7 +3021,7 @@
|
|
|
2655
3021
|
this.freqs.links = new Map;
|
|
2656
3022
|
this.freqs.triangles = new Map;
|
|
2657
3023
|
let handled = false;
|
|
2658
|
-
this.updaters =
|
|
3024
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
2659
3025
|
this.interactionManager.init();
|
|
2660
3026
|
for (const [, plugin] of container.plugins) {
|
|
2661
3027
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -2807,505 +3173,226 @@
|
|
|
2807
3173
|
options.size.value.min /= factor;
|
|
2808
3174
|
options.size.value.max /= factor;
|
|
2809
3175
|
}
|
|
2810
|
-
options.load(splitOptions.particles);
|
|
2811
|
-
const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
|
|
2812
|
-
const position = {
|
|
2813
|
-
x: parent.position.x + randomInRange(offset),
|
|
2814
|
-
y: parent.position.y + randomInRange(offset)
|
|
2815
|
-
};
|
|
2816
|
-
return this.pushParticle(position, options, parent.group, (particle => {
|
|
2817
|
-
if (particle.size.value < .5) {
|
|
2818
|
-
return false;
|
|
2819
|
-
}
|
|
2820
|
-
particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
|
|
2821
|
-
particle.splitCount = parent.splitCount + 1;
|
|
2822
|
-
particle.unbreakable = true;
|
|
2823
|
-
setTimeout((() => {
|
|
2824
|
-
particle.unbreakable = false;
|
|
2825
|
-
}), 500);
|
|
2826
|
-
return true;
|
|
2827
|
-
}));
|
|
2828
|
-
}
|
|
2829
|
-
removeQuantity(quantity, group) {
|
|
2830
|
-
this.removeAt(0, quantity, group);
|
|
2831
|
-
}
|
|
2832
|
-
getLinkFrequency(p1, p2) {
|
|
2833
|
-
const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
|
|
2834
|
-
let res = this.freqs.links.get(key);
|
|
2835
|
-
if (res === undefined) {
|
|
2836
|
-
res = Math.random();
|
|
2837
|
-
this.freqs.links.set(key, res);
|
|
2838
|
-
}
|
|
2839
|
-
return res;
|
|
2840
|
-
}
|
|
2841
|
-
getTriangleFrequency(p1, p2, p3) {
|
|
2842
|
-
let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
|
|
2843
|
-
if (id1 > id2) {
|
|
2844
|
-
[id2, id1] = [ id1, id2 ];
|
|
2845
|
-
}
|
|
2846
|
-
if (id2 > id3) {
|
|
2847
|
-
[id3, id2] = [ id2, id3 ];
|
|
2848
|
-
}
|
|
2849
|
-
if (id1 > id3) {
|
|
2850
|
-
[id3, id1] = [ id1, id3 ];
|
|
2851
|
-
}
|
|
2852
|
-
const key = `${id1}_${id2}_${id3}`;
|
|
2853
|
-
let res = this.freqs.triangles.get(key);
|
|
2854
|
-
if (res === undefined) {
|
|
2855
|
-
res = Math.random();
|
|
2856
|
-
this.freqs.triangles.set(key, res);
|
|
2857
|
-
}
|
|
2858
|
-
return res;
|
|
2859
|
-
}
|
|
2860
|
-
addManualParticles() {
|
|
2861
|
-
const container = this.container, options = container.actualOptions;
|
|
2862
|
-
for (const particle of options.manualParticles) {
|
|
2863
|
-
const pos = particle.position ? {
|
|
2864
|
-
x: particle.position.x * container.canvas.size.width / 100,
|
|
2865
|
-
y: particle.position.y * container.canvas.size.height / 100
|
|
2866
|
-
} : undefined;
|
|
2867
|
-
this.addParticle(pos, particle.options);
|
|
2868
|
-
}
|
|
2869
|
-
}
|
|
2870
|
-
setDensity() {
|
|
2871
|
-
const options = this.container.actualOptions;
|
|
2872
|
-
for (const group in options.particles.groups) {
|
|
2873
|
-
this.applyDensity(options.particles.groups[group], 0, group);
|
|
2874
|
-
}
|
|
2875
|
-
this.applyDensity(options.particles, options.manualParticles.length);
|
|
2876
|
-
}
|
|
2877
|
-
applyDensity(options, manualCount, group) {
|
|
2878
|
-
var _a;
|
|
2879
|
-
if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
|
|
2880
|
-
return;
|
|
2881
|
-
}
|
|
2882
|
-
const numberOptions = options.number;
|
|
2883
|
-
const densityFactor = this.initDensityFactor(numberOptions.density);
|
|
2884
|
-
const optParticlesNumber = numberOptions.value;
|
|
2885
|
-
const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
|
|
2886
|
-
const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
|
|
2887
|
-
const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
|
|
2888
|
-
this.limit = numberOptions.limit * densityFactor;
|
|
2889
|
-
if (particlesCount < particlesNumber) {
|
|
2890
|
-
this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
|
|
2891
|
-
} else if (particlesCount > particlesNumber) {
|
|
2892
|
-
this.removeQuantity(particlesCount - particlesNumber, group);
|
|
2893
|
-
}
|
|
2894
|
-
}
|
|
2895
|
-
initDensityFactor(densityOptions) {
|
|
2896
|
-
const container = this.container;
|
|
2897
|
-
if (!container.canvas.element || !densityOptions.enable) {
|
|
2898
|
-
return 1;
|
|
2899
|
-
}
|
|
2900
|
-
const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
|
|
2901
|
-
return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
|
|
2902
|
-
}
|
|
2903
|
-
pushParticle(position, overrideOptions, group, initializer) {
|
|
2904
|
-
try {
|
|
2905
|
-
const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
|
|
2906
|
-
let canAdd = true;
|
|
2907
|
-
if (initializer) {
|
|
2908
|
-
canAdd = initializer(particle);
|
|
2909
|
-
}
|
|
2910
|
-
if (!canAdd) {
|
|
2911
|
-
return;
|
|
2912
|
-
}
|
|
2913
|
-
this.array.push(particle);
|
|
2914
|
-
this.zArray.push(particle);
|
|
2915
|
-
this.nextId++;
|
|
2916
|
-
return particle;
|
|
2917
|
-
} catch (e) {
|
|
2918
|
-
console.warn(`error adding particle: ${e}`);
|
|
2919
|
-
return;
|
|
2920
|
-
}
|
|
2921
|
-
}
|
|
2922
|
-
}
|
|
2923
|
-
class Retina_Retina {
|
|
2924
|
-
constructor(container) {
|
|
2925
|
-
this.container = container;
|
|
2926
|
-
}
|
|
2927
|
-
init() {
|
|
2928
|
-
const container = this.container;
|
|
2929
|
-
const options = container.actualOptions;
|
|
2930
|
-
this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
|
|
2931
|
-
const motionOptions = this.container.actualOptions.motion;
|
|
2932
|
-
if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
|
|
2933
|
-
if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
|
|
2934
|
-
this.reduceFactor = 1;
|
|
2935
|
-
} else {
|
|
2936
|
-
const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
|
|
2937
|
-
if (mediaQuery) {
|
|
2938
|
-
this.handleMotionChange(mediaQuery);
|
|
2939
|
-
const handleChange = () => {
|
|
2940
|
-
this.handleMotionChange(mediaQuery);
|
|
2941
|
-
container.refresh().catch((() => {}));
|
|
2942
|
-
};
|
|
2943
|
-
if (mediaQuery.addEventListener !== undefined) {
|
|
2944
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
2945
|
-
} else if (mediaQuery.addListener !== undefined) {
|
|
2946
|
-
mediaQuery.addListener(handleChange);
|
|
2947
|
-
}
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
} else {
|
|
2951
|
-
this.reduceFactor = 1;
|
|
2952
|
-
}
|
|
2953
|
-
const ratio = this.pixelRatio;
|
|
2954
|
-
if (container.canvas.element) {
|
|
2955
|
-
const element = container.canvas.element;
|
|
2956
|
-
container.canvas.size.width = element.offsetWidth * ratio;
|
|
2957
|
-
container.canvas.size.height = element.offsetHeight * ratio;
|
|
2958
|
-
}
|
|
2959
|
-
const particles = options.particles;
|
|
2960
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
2961
|
-
this.linksDistance = particles.links.distance * ratio;
|
|
2962
|
-
this.linksWidth = particles.links.width * ratio;
|
|
2963
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
2964
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
2965
|
-
if (particles.orbit.radius !== undefined) {
|
|
2966
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
2967
|
-
}
|
|
2968
|
-
const modes = options.interactivity.modes;
|
|
2969
|
-
this.connectModeDistance = modes.connect.distance * ratio;
|
|
2970
|
-
this.connectModeRadius = modes.connect.radius * ratio;
|
|
2971
|
-
this.grabModeDistance = modes.grab.distance * ratio;
|
|
2972
|
-
this.repulseModeDistance = modes.repulse.distance * ratio;
|
|
2973
|
-
this.bounceModeDistance = modes.bounce.distance * ratio;
|
|
2974
|
-
this.attractModeDistance = modes.attract.distance * ratio;
|
|
2975
|
-
this.slowModeRadius = modes.slow.radius * ratio;
|
|
2976
|
-
this.bubbleModeDistance = modes.bubble.distance * ratio;
|
|
2977
|
-
if (modes.bubble.size) {
|
|
2978
|
-
this.bubbleModeSize = modes.bubble.size * ratio;
|
|
2979
|
-
}
|
|
2980
|
-
}
|
|
2981
|
-
initParticle(particle) {
|
|
2982
|
-
const options = particle.options;
|
|
2983
|
-
const ratio = this.pixelRatio;
|
|
2984
|
-
const moveDistance = options.move.distance;
|
|
2985
|
-
const props = particle.retina;
|
|
2986
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
2987
|
-
props.linksDistance = options.links.distance * ratio;
|
|
2988
|
-
props.linksWidth = options.links.width * ratio;
|
|
2989
|
-
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
2990
|
-
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
2991
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
2992
|
-
if (particle.spin) {
|
|
2993
|
-
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
2994
|
-
}
|
|
2995
|
-
const maxDistance = props.maxDistance;
|
|
2996
|
-
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
2997
|
-
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
2998
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
2999
|
-
}
|
|
3000
|
-
handleMotionChange(mediaQuery) {
|
|
3001
|
-
const options = this.container.actualOptions;
|
|
3002
|
-
if (mediaQuery.matches) {
|
|
3003
|
-
const motion = options.motion;
|
|
3004
|
-
this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
|
|
3005
|
-
} else {
|
|
3006
|
-
this.reduceFactor = 1;
|
|
3007
|
-
}
|
|
3008
|
-
}
|
|
3009
|
-
}
|
|
3010
|
-
class Trail_Trail {
|
|
3011
|
-
constructor() {
|
|
3012
|
-
this.delay = 1;
|
|
3013
|
-
this.pauseOnStop = false;
|
|
3014
|
-
this.quantity = 1;
|
|
3015
|
-
}
|
|
3016
|
-
load(data) {
|
|
3017
|
-
if (data === undefined) {
|
|
3018
|
-
return;
|
|
3019
|
-
}
|
|
3020
|
-
if (data.delay !== undefined) {
|
|
3021
|
-
this.delay = data.delay;
|
|
3022
|
-
}
|
|
3023
|
-
if (data.quantity !== undefined) {
|
|
3024
|
-
this.quantity = data.quantity;
|
|
3025
|
-
}
|
|
3026
|
-
if (data.particles !== undefined) {
|
|
3027
|
-
this.particles = deepExtend({}, data.particles);
|
|
3028
|
-
}
|
|
3029
|
-
if (data.pauseOnStop !== undefined) {
|
|
3030
|
-
this.pauseOnStop = data.pauseOnStop;
|
|
3031
|
-
}
|
|
3032
|
-
}
|
|
3033
|
-
}
|
|
3034
|
-
class Modes_Modes {
|
|
3035
|
-
constructor() {
|
|
3036
|
-
this.attract = new Attract;
|
|
3037
|
-
this.bounce = new Bounce;
|
|
3038
|
-
this.bubble = new Bubble;
|
|
3039
|
-
this.connect = new Connect;
|
|
3040
|
-
this.grab = new Grab;
|
|
3041
|
-
this.light = new Light;
|
|
3042
|
-
this.push = new Push;
|
|
3043
|
-
this.remove = new Remove;
|
|
3044
|
-
this.repulse = new Repulse;
|
|
3045
|
-
this.slow = new Slow;
|
|
3046
|
-
this.trail = new Trail;
|
|
3047
|
-
}
|
|
3048
|
-
load(data) {
|
|
3049
|
-
if (data === undefined) {
|
|
3050
|
-
return;
|
|
3051
|
-
}
|
|
3052
|
-
this.attract.load(data.attract);
|
|
3053
|
-
this.bubble.load(data.bubble);
|
|
3054
|
-
this.connect.load(data.connect);
|
|
3055
|
-
this.grab.load(data.grab);
|
|
3056
|
-
this.light.load(data.light);
|
|
3057
|
-
this.push.load(data.push);
|
|
3058
|
-
this.remove.load(data.remove);
|
|
3059
|
-
this.repulse.load(data.repulse);
|
|
3060
|
-
this.slow.load(data.slow);
|
|
3061
|
-
this.trail.load(data.trail);
|
|
3062
|
-
}
|
|
3063
|
-
}
|
|
3064
|
-
class Interactivity_Interactivity {
|
|
3065
|
-
constructor() {
|
|
3066
|
-
this.detectsOn = "window";
|
|
3067
|
-
this.events = new Events;
|
|
3068
|
-
this.modes = new Modes;
|
|
3069
|
-
}
|
|
3070
|
-
get detect_on() {
|
|
3071
|
-
return this.detectsOn;
|
|
3072
|
-
}
|
|
3073
|
-
set detect_on(value) {
|
|
3074
|
-
this.detectsOn = value;
|
|
3075
|
-
}
|
|
3076
|
-
load(data) {
|
|
3077
|
-
var _a, _b, _c;
|
|
3078
|
-
if (data === undefined) {
|
|
3079
|
-
return;
|
|
3080
|
-
}
|
|
3081
|
-
const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
|
|
3082
|
-
if (detectsOn !== undefined) {
|
|
3083
|
-
this.detectsOn = detectsOn;
|
|
3084
|
-
}
|
|
3085
|
-
this.events.load(data.events);
|
|
3086
|
-
this.modes.load(data.modes);
|
|
3087
|
-
if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
|
|
3088
|
-
if (this.events.onHover.mode instanceof Array) {
|
|
3089
|
-
if (this.events.onHover.mode.indexOf("slow") < 0) {
|
|
3090
|
-
this.events.onHover.mode.push("slow");
|
|
3091
|
-
}
|
|
3092
|
-
} else if (this.events.onHover.mode !== "slow") {
|
|
3093
|
-
this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
}
|
|
3098
|
-
class Theme_Theme {
|
|
3099
|
-
constructor() {
|
|
3100
|
-
this.name = "";
|
|
3101
|
-
this.default = new ThemeDefault;
|
|
3102
|
-
}
|
|
3103
|
-
load(data) {
|
|
3104
|
-
if (data === undefined) {
|
|
3105
|
-
return;
|
|
3106
|
-
}
|
|
3107
|
-
if (data.name !== undefined) {
|
|
3108
|
-
this.name = data.name;
|
|
3109
|
-
}
|
|
3110
|
-
this.default.load(data.default);
|
|
3111
|
-
if (data.options !== undefined) {
|
|
3112
|
-
this.options = deepExtend({}, data.options);
|
|
3113
|
-
}
|
|
3114
|
-
}
|
|
3115
|
-
}
|
|
3116
|
-
class ManualParticle_ManualParticle {
|
|
3117
|
-
load(data) {
|
|
3118
|
-
var _a, _b;
|
|
3119
|
-
if (!data) {
|
|
3120
|
-
return;
|
|
3121
|
-
}
|
|
3122
|
-
if (data.position !== undefined) {
|
|
3123
|
-
this.position = {
|
|
3124
|
-
x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
|
|
3125
|
-
y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
|
|
3126
|
-
};
|
|
3127
|
-
}
|
|
3128
|
-
if (data.options !== undefined) {
|
|
3129
|
-
this.options = deepExtend({}, data.options);
|
|
3130
|
-
}
|
|
3131
|
-
}
|
|
3132
|
-
}
|
|
3133
|
-
class Responsive_Responsive {
|
|
3134
|
-
constructor() {
|
|
3135
|
-
this.maxWidth = Infinity;
|
|
3136
|
-
this.options = {};
|
|
3137
|
-
this.mode = "canvas";
|
|
3138
|
-
}
|
|
3139
|
-
load(data) {
|
|
3140
|
-
if (!data) {
|
|
3141
|
-
return;
|
|
3142
|
-
}
|
|
3143
|
-
if (data.maxWidth !== undefined) {
|
|
3144
|
-
this.maxWidth = data.maxWidth;
|
|
3145
|
-
}
|
|
3146
|
-
if (data.mode !== undefined) {
|
|
3147
|
-
if (data.mode === "screen") {
|
|
3148
|
-
this.mode = "screen";
|
|
3149
|
-
} else {
|
|
3150
|
-
this.mode = "canvas";
|
|
3151
|
-
}
|
|
3152
|
-
}
|
|
3153
|
-
if (data.options !== undefined) {
|
|
3154
|
-
this.options = deepExtend({}, data.options);
|
|
3155
|
-
}
|
|
3156
|
-
}
|
|
3157
|
-
}
|
|
3158
|
-
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3159
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3160
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3161
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3162
|
-
};
|
|
3163
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
3164
|
-
class Options_Options {
|
|
3165
|
-
constructor() {
|
|
3166
|
-
_Options_instances.add(this);
|
|
3167
|
-
this.autoPlay = true;
|
|
3168
|
-
this.background = new Background;
|
|
3169
|
-
this.backgroundMask = new BackgroundMask;
|
|
3170
|
-
this.fullScreen = new FullScreen;
|
|
3171
|
-
this.detectRetina = true;
|
|
3172
|
-
this.duration = 0;
|
|
3173
|
-
this.fpsLimit = 60;
|
|
3174
|
-
this.interactivity = new Interactivity;
|
|
3175
|
-
this.manualParticles = [];
|
|
3176
|
-
this.motion = new Motion;
|
|
3177
|
-
this.particles = new ParticlesOptions;
|
|
3178
|
-
this.pauseOnBlur = true;
|
|
3179
|
-
this.pauseOnOutsideViewport = true;
|
|
3180
|
-
this.responsive = [];
|
|
3181
|
-
this.style = {};
|
|
3182
|
-
this.themes = [];
|
|
3183
|
-
this.zLayers = 100;
|
|
3184
|
-
}
|
|
3185
|
-
get fps_limit() {
|
|
3186
|
-
return this.fpsLimit;
|
|
3187
|
-
}
|
|
3188
|
-
set fps_limit(value) {
|
|
3189
|
-
this.fpsLimit = value;
|
|
3190
|
-
}
|
|
3191
|
-
get retina_detect() {
|
|
3192
|
-
return this.detectRetina;
|
|
3193
|
-
}
|
|
3194
|
-
set retina_detect(value) {
|
|
3195
|
-
this.detectRetina = value;
|
|
3196
|
-
}
|
|
3197
|
-
get backgroundMode() {
|
|
3198
|
-
return this.fullScreen;
|
|
3199
|
-
}
|
|
3200
|
-
set backgroundMode(value) {
|
|
3201
|
-
this.fullScreen.load(value);
|
|
3202
|
-
}
|
|
3203
|
-
load(data) {
|
|
3204
|
-
var _a, _b, _c, _d, _e;
|
|
3205
|
-
if (data === undefined) {
|
|
3206
|
-
return;
|
|
3207
|
-
}
|
|
3208
|
-
if (data.preset !== undefined) {
|
|
3209
|
-
if (data.preset instanceof Array) {
|
|
3210
|
-
for (const preset of data.preset) {
|
|
3211
|
-
this.importPreset(preset);
|
|
3212
|
-
}
|
|
3213
|
-
} else {
|
|
3214
|
-
this.importPreset(data.preset);
|
|
3176
|
+
options.load(splitOptions.particles);
|
|
3177
|
+
const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
|
|
3178
|
+
const position = {
|
|
3179
|
+
x: parent.position.x + randomInRange(offset),
|
|
3180
|
+
y: parent.position.y + randomInRange(offset)
|
|
3181
|
+
};
|
|
3182
|
+
return this.pushParticle(position, options, parent.group, (particle => {
|
|
3183
|
+
if (particle.size.value < .5) {
|
|
3184
|
+
return false;
|
|
3215
3185
|
}
|
|
3186
|
+
particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
|
|
3187
|
+
particle.splitCount = parent.splitCount + 1;
|
|
3188
|
+
particle.unbreakable = true;
|
|
3189
|
+
setTimeout((() => {
|
|
3190
|
+
particle.unbreakable = false;
|
|
3191
|
+
}), 500);
|
|
3192
|
+
return true;
|
|
3193
|
+
}));
|
|
3194
|
+
}
|
|
3195
|
+
removeQuantity(quantity, group) {
|
|
3196
|
+
this.removeAt(0, quantity, group);
|
|
3197
|
+
}
|
|
3198
|
+
getLinkFrequency(p1, p2) {
|
|
3199
|
+
const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
|
|
3200
|
+
let res = this.freqs.links.get(key);
|
|
3201
|
+
if (res === undefined) {
|
|
3202
|
+
res = Math.random();
|
|
3203
|
+
this.freqs.links.set(key, res);
|
|
3216
3204
|
}
|
|
3217
|
-
|
|
3218
|
-
|
|
3205
|
+
return res;
|
|
3206
|
+
}
|
|
3207
|
+
getTriangleFrequency(p1, p2, p3) {
|
|
3208
|
+
let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
|
|
3209
|
+
if (id1 > id2) {
|
|
3210
|
+
[id2, id1] = [ id1, id2 ];
|
|
3219
3211
|
}
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
this.detectRetina = detectRetina;
|
|
3212
|
+
if (id2 > id3) {
|
|
3213
|
+
[id3, id2] = [ id2, id3 ];
|
|
3223
3214
|
}
|
|
3224
|
-
if (
|
|
3225
|
-
|
|
3215
|
+
if (id1 > id3) {
|
|
3216
|
+
[id3, id1] = [ id1, id3 ];
|
|
3226
3217
|
}
|
|
3227
|
-
const
|
|
3228
|
-
|
|
3229
|
-
|
|
3218
|
+
const key = `${id1}_${id2}_${id3}`;
|
|
3219
|
+
let res = this.freqs.triangles.get(key);
|
|
3220
|
+
if (res === undefined) {
|
|
3221
|
+
res = Math.random();
|
|
3222
|
+
this.freqs.triangles.set(key, res);
|
|
3230
3223
|
}
|
|
3231
|
-
|
|
3232
|
-
|
|
3224
|
+
return res;
|
|
3225
|
+
}
|
|
3226
|
+
addManualParticles() {
|
|
3227
|
+
const container = this.container, options = container.actualOptions;
|
|
3228
|
+
for (const particle of options.manualParticles) {
|
|
3229
|
+
const pos = particle.position ? {
|
|
3230
|
+
x: particle.position.x * container.canvas.size.width / 100,
|
|
3231
|
+
y: particle.position.y * container.canvas.size.height / 100
|
|
3232
|
+
} : undefined;
|
|
3233
|
+
this.addParticle(pos, particle.options);
|
|
3233
3234
|
}
|
|
3234
|
-
|
|
3235
|
-
|
|
3235
|
+
}
|
|
3236
|
+
setDensity() {
|
|
3237
|
+
const options = this.container.actualOptions;
|
|
3238
|
+
for (const group in options.particles.groups) {
|
|
3239
|
+
this.applyDensity(options.particles.groups[group], 0, group);
|
|
3236
3240
|
}
|
|
3237
|
-
|
|
3238
|
-
|
|
3241
|
+
this.applyDensity(options.particles, options.manualParticles.length);
|
|
3242
|
+
}
|
|
3243
|
+
applyDensity(options, manualCount, group) {
|
|
3244
|
+
var _a;
|
|
3245
|
+
if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
|
|
3246
|
+
return;
|
|
3239
3247
|
}
|
|
3240
|
-
|
|
3241
|
-
const
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3248
|
+
const numberOptions = options.number;
|
|
3249
|
+
const densityFactor = this.initDensityFactor(numberOptions.density);
|
|
3250
|
+
const optParticlesNumber = numberOptions.value;
|
|
3251
|
+
const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
|
|
3252
|
+
const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
|
|
3253
|
+
const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
|
|
3254
|
+
this.limit = numberOptions.limit * densityFactor;
|
|
3255
|
+
if (particlesCount < particlesNumber) {
|
|
3256
|
+
this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
|
|
3257
|
+
} else if (particlesCount > particlesNumber) {
|
|
3258
|
+
this.removeQuantity(particlesCount - particlesNumber, group);
|
|
3246
3259
|
}
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
tmp.load(t);
|
|
3253
|
-
return tmp;
|
|
3254
|
-
}));
|
|
3260
|
+
}
|
|
3261
|
+
initDensityFactor(densityOptions) {
|
|
3262
|
+
const container = this.container;
|
|
3263
|
+
if (!container.canvas.element || !densityOptions.enable) {
|
|
3264
|
+
return 1;
|
|
3255
3265
|
}
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3266
|
+
const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
|
|
3267
|
+
return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
|
|
3268
|
+
}
|
|
3269
|
+
pushParticle(position, overrideOptions, group, initializer) {
|
|
3270
|
+
try {
|
|
3271
|
+
const particle = new Particle(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), this.nextId, this.container, position, overrideOptions, group);
|
|
3272
|
+
let canAdd = true;
|
|
3273
|
+
if (initializer) {
|
|
3274
|
+
canAdd = initializer(particle);
|
|
3265
3275
|
}
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
if (data.themes !== undefined) {
|
|
3269
|
-
for (const theme of data.themes) {
|
|
3270
|
-
const optTheme = new Theme;
|
|
3271
|
-
optTheme.load(theme);
|
|
3272
|
-
this.themes.push(optTheme);
|
|
3276
|
+
if (!canAdd) {
|
|
3277
|
+
return;
|
|
3273
3278
|
}
|
|
3279
|
+
this.array.push(particle);
|
|
3280
|
+
this.zArray.push(particle);
|
|
3281
|
+
this.nextId++;
|
|
3282
|
+
return particle;
|
|
3283
|
+
} catch (e) {
|
|
3284
|
+
console.warn(`error adding particle: ${e}`);
|
|
3285
|
+
return;
|
|
3274
3286
|
}
|
|
3275
|
-
this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
3276
|
-
this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
3277
3287
|
}
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3288
|
+
}
|
|
3289
|
+
_Particles_engine = new WeakMap;
|
|
3290
|
+
class Retina_Retina {
|
|
3291
|
+
constructor(container) {
|
|
3292
|
+
this.container = container;
|
|
3293
|
+
}
|
|
3294
|
+
init() {
|
|
3295
|
+
const container = this.container;
|
|
3296
|
+
const options = container.actualOptions;
|
|
3297
|
+
this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
|
|
3298
|
+
const motionOptions = this.container.actualOptions.motion;
|
|
3299
|
+
if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
|
|
3300
|
+
if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
|
|
3301
|
+
this.reduceFactor = 1;
|
|
3302
|
+
} else {
|
|
3303
|
+
const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
|
|
3304
|
+
if (mediaQuery) {
|
|
3305
|
+
this.handleMotionChange(mediaQuery);
|
|
3306
|
+
const handleChange = () => {
|
|
3307
|
+
this.handleMotionChange(mediaQuery);
|
|
3308
|
+
container.refresh().catch((() => {}));
|
|
3309
|
+
};
|
|
3310
|
+
if (mediaQuery.addEventListener !== undefined) {
|
|
3311
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
3312
|
+
} else if (mediaQuery.addListener !== undefined) {
|
|
3313
|
+
mediaQuery.addListener(handleChange);
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3283
3316
|
}
|
|
3284
3317
|
} else {
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3318
|
+
this.reduceFactor = 1;
|
|
3319
|
+
}
|
|
3320
|
+
const ratio = this.pixelRatio;
|
|
3321
|
+
if (container.canvas.element) {
|
|
3322
|
+
const element = container.canvas.element;
|
|
3323
|
+
container.canvas.size.width = element.offsetWidth * ratio;
|
|
3324
|
+
container.canvas.size.height = element.offsetHeight * ratio;
|
|
3325
|
+
}
|
|
3326
|
+
const particles = options.particles;
|
|
3327
|
+
this.attractDistance = particles.move.attract.distance * ratio;
|
|
3328
|
+
this.linksDistance = particles.links.distance * ratio;
|
|
3329
|
+
this.linksWidth = particles.links.width * ratio;
|
|
3330
|
+
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
3331
|
+
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
3332
|
+
if (particles.orbit.radius !== undefined) {
|
|
3333
|
+
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
3334
|
+
}
|
|
3335
|
+
const modes = options.interactivity.modes;
|
|
3336
|
+
this.connectModeDistance = modes.connect.distance * ratio;
|
|
3337
|
+
this.connectModeRadius = modes.connect.radius * ratio;
|
|
3338
|
+
this.grabModeDistance = modes.grab.distance * ratio;
|
|
3339
|
+
this.repulseModeDistance = modes.repulse.distance * ratio;
|
|
3340
|
+
this.bounceModeDistance = modes.bounce.distance * ratio;
|
|
3341
|
+
this.attractModeDistance = modes.attract.distance * ratio;
|
|
3342
|
+
this.slowModeRadius = modes.slow.radius * ratio;
|
|
3343
|
+
this.bubbleModeDistance = modes.bubble.distance * ratio;
|
|
3344
|
+
if (modes.bubble.size) {
|
|
3345
|
+
this.bubbleModeSize = modes.bubble.size * ratio;
|
|
3289
3346
|
}
|
|
3290
3347
|
}
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
const
|
|
3294
|
-
|
|
3295
|
-
|
|
3348
|
+
initParticle(particle) {
|
|
3349
|
+
const options = particle.options;
|
|
3350
|
+
const ratio = this.pixelRatio;
|
|
3351
|
+
const moveDistance = options.move.distance;
|
|
3352
|
+
const props = particle.retina;
|
|
3353
|
+
props.attractDistance = options.move.attract.distance * ratio;
|
|
3354
|
+
props.linksDistance = options.links.distance * ratio;
|
|
3355
|
+
props.linksWidth = options.links.width * ratio;
|
|
3356
|
+
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
3357
|
+
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
3358
|
+
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
3359
|
+
if (particle.spin) {
|
|
3360
|
+
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
3361
|
+
}
|
|
3362
|
+
const maxDistance = props.maxDistance;
|
|
3363
|
+
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
3364
|
+
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
3365
|
+
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
3296
3366
|
}
|
|
3297
|
-
|
|
3298
|
-
this.
|
|
3367
|
+
handleMotionChange(mediaQuery) {
|
|
3368
|
+
const options = this.container.actualOptions;
|
|
3369
|
+
if (mediaQuery.matches) {
|
|
3370
|
+
const motion = options.motion;
|
|
3371
|
+
this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
|
|
3372
|
+
} else {
|
|
3373
|
+
this.reduceFactor = 1;
|
|
3374
|
+
}
|
|
3299
3375
|
}
|
|
3300
3376
|
}
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3377
|
+
var Container_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3378
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3379
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3380
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3381
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3382
|
+
value;
|
|
3383
|
+
};
|
|
3384
|
+
var Container_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3385
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3386
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3387
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3304
3388
|
};
|
|
3389
|
+
var _Container_engine;
|
|
3305
3390
|
class Container_Container {
|
|
3306
|
-
constructor(id, sourceOptions, ...presets) {
|
|
3391
|
+
constructor(engine, id, sourceOptions, ...presets) {
|
|
3307
3392
|
this.id = id;
|
|
3308
|
-
this
|
|
3393
|
+
_Container_engine.set(this, void 0);
|
|
3394
|
+
Container_classPrivateFieldSet(this, _Container_engine, engine, "f");
|
|
3395
|
+
this.fpsLimit = 120;
|
|
3309
3396
|
this.duration = 0;
|
|
3310
3397
|
this.lifeTime = 0;
|
|
3311
3398
|
this.firstStart = true;
|
|
@@ -3319,7 +3406,7 @@
|
|
|
3319
3406
|
this._initialSourceOptions = sourceOptions;
|
|
3320
3407
|
this.retina = new Retina(this);
|
|
3321
3408
|
this.canvas = new Canvas(this);
|
|
3322
|
-
this.particles = new Particles(this);
|
|
3409
|
+
this.particles = new Particles(Container_classPrivateFieldGet(this, _Container_engine, "f"), this);
|
|
3323
3410
|
this.drawer = new FrameManager(this);
|
|
3324
3411
|
this.presets = presets;
|
|
3325
3412
|
this.pathGenerator = {
|
|
@@ -3348,8 +3435,8 @@
|
|
|
3348
3435
|
this.plugins = new Map;
|
|
3349
3436
|
this.drawers = new Map;
|
|
3350
3437
|
this.density = 1;
|
|
3351
|
-
this._options = new Options;
|
|
3352
|
-
this.actualOptions = new Options;
|
|
3438
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3439
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3353
3440
|
this.eventListeners = new EventListeners(this);
|
|
3354
3441
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
3355
3442
|
this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
|
|
@@ -3464,7 +3551,7 @@
|
|
|
3464
3551
|
return this.start();
|
|
3465
3552
|
}
|
|
3466
3553
|
reset() {
|
|
3467
|
-
this._options = new Options;
|
|
3554
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3468
3555
|
return this.refresh();
|
|
3469
3556
|
}
|
|
3470
3557
|
stop() {
|
|
@@ -3478,7 +3565,7 @@
|
|
|
3478
3565
|
this.particles.clear();
|
|
3479
3566
|
this.canvas.clear();
|
|
3480
3567
|
if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
|
|
3481
|
-
this.intersectionObserver.
|
|
3568
|
+
this.intersectionObserver.unobserve(this.interactivity.element);
|
|
3482
3569
|
}
|
|
3483
3570
|
for (const [, plugin] of this.plugins) {
|
|
3484
3571
|
if (plugin.stop) {
|
|
@@ -3605,20 +3692,20 @@
|
|
|
3605
3692
|
return false;
|
|
3606
3693
|
}
|
|
3607
3694
|
async init() {
|
|
3608
|
-
this._options = new Options;
|
|
3695
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3609
3696
|
for (const preset of this.presets) {
|
|
3610
|
-
this._options.load(
|
|
3697
|
+
this._options.load(Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPreset(preset));
|
|
3611
3698
|
}
|
|
3612
|
-
const shapes =
|
|
3699
|
+
const shapes = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getSupportedShapes();
|
|
3613
3700
|
for (const type of shapes) {
|
|
3614
|
-
const drawer =
|
|
3701
|
+
const drawer = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getShapeDrawer(type);
|
|
3615
3702
|
if (drawer) {
|
|
3616
3703
|
this.drawers.set(type, drawer);
|
|
3617
3704
|
}
|
|
3618
3705
|
}
|
|
3619
3706
|
this._options.load(this._initialSourceOptions);
|
|
3620
3707
|
this._options.load(this._sourceOptions);
|
|
3621
|
-
this.actualOptions = new Options;
|
|
3708
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3622
3709
|
this.actualOptions.load(this._options);
|
|
3623
3710
|
this.retina.init();
|
|
3624
3711
|
this.canvas.init();
|
|
@@ -3628,8 +3715,8 @@
|
|
|
3628
3715
|
this.zLayers = this.actualOptions.zLayers;
|
|
3629
3716
|
this.duration = getRangeValue(this.actualOptions.duration);
|
|
3630
3717
|
this.lifeTime = 0;
|
|
3631
|
-
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit :
|
|
3632
|
-
const availablePlugins =
|
|
3718
|
+
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
3719
|
+
const availablePlugins = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getAvailablePlugins(this);
|
|
3633
3720
|
for (const [id, plugin] of availablePlugins) {
|
|
3634
3721
|
this.plugins.set(id, plugin);
|
|
3635
3722
|
}
|
|
@@ -3647,7 +3734,7 @@
|
|
|
3647
3734
|
}
|
|
3648
3735
|
const pathOptions = this.actualOptions.particles.move.path;
|
|
3649
3736
|
if (pathOptions.generator) {
|
|
3650
|
-
const customGenerator =
|
|
3737
|
+
const customGenerator = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPathGenerator(pathOptions.generator);
|
|
3651
3738
|
if (customGenerator) {
|
|
3652
3739
|
if (customGenerator.init) {
|
|
3653
3740
|
this.pathGenerator.init = customGenerator.init;
|
|
@@ -3684,24 +3771,41 @@
|
|
|
3684
3771
|
}
|
|
3685
3772
|
}
|
|
3686
3773
|
}
|
|
3687
|
-
|
|
3774
|
+
_Container_engine = new WeakMap;
|
|
3775
|
+
var Loader_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3776
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3777
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3778
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3779
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3780
|
+
value;
|
|
3781
|
+
};
|
|
3782
|
+
var Loader_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3783
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3784
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3785
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3786
|
+
};
|
|
3787
|
+
var _Loader_engine;
|
|
3688
3788
|
function fetchError(statusCode) {
|
|
3689
3789
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
3690
3790
|
console.error("Error tsParticles - File config not found");
|
|
3691
3791
|
}
|
|
3692
3792
|
class Loader {
|
|
3693
|
-
|
|
3694
|
-
|
|
3793
|
+
constructor(engine) {
|
|
3794
|
+
_Loader_engine.set(this, void 0);
|
|
3795
|
+
Loader_classPrivateFieldSet(this, _Loader_engine, engine, "f");
|
|
3796
|
+
}
|
|
3797
|
+
dom() {
|
|
3798
|
+
return Loader_classPrivateFieldGet(this, _Loader_engine, "f").domArray;
|
|
3695
3799
|
}
|
|
3696
|
-
|
|
3697
|
-
const dom =
|
|
3800
|
+
domItem(index) {
|
|
3801
|
+
const dom = this.dom();
|
|
3698
3802
|
const item = dom[index];
|
|
3699
3803
|
if (item && !item.destroyed) {
|
|
3700
3804
|
return item;
|
|
3701
3805
|
}
|
|
3702
3806
|
dom.splice(index, 1);
|
|
3703
3807
|
}
|
|
3704
|
-
|
|
3808
|
+
async loadOptions(params) {
|
|
3705
3809
|
var _a, _b, _c;
|
|
3706
3810
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
|
|
3707
3811
|
const {options: options, index: index} = params;
|
|
@@ -3712,10 +3816,10 @@
|
|
|
3712
3816
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
3713
3817
|
}
|
|
3714
3818
|
const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
|
|
3715
|
-
const dom =
|
|
3819
|
+
const dom = this.dom();
|
|
3716
3820
|
const oldIndex = dom.findIndex((v => v.id === tagId));
|
|
3717
3821
|
if (oldIndex >= 0) {
|
|
3718
|
-
const old =
|
|
3822
|
+
const old = this.domItem(oldIndex);
|
|
3719
3823
|
if (old && !old.destroyed) {
|
|
3720
3824
|
old.destroy();
|
|
3721
3825
|
dom.splice(oldIndex, 1);
|
|
@@ -3738,7 +3842,7 @@
|
|
|
3738
3842
|
domContainer.appendChild(canvasEl);
|
|
3739
3843
|
}
|
|
3740
3844
|
}
|
|
3741
|
-
const newItem = new Container(tagId, currentOptions);
|
|
3845
|
+
const newItem = new Container(Loader_classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
3742
3846
|
if (oldIndex >= 0) {
|
|
3743
3847
|
dom.splice(oldIndex, 0, newItem);
|
|
3744
3848
|
} else {
|
|
@@ -3748,7 +3852,7 @@
|
|
|
3748
3852
|
await newItem.start();
|
|
3749
3853
|
return newItem;
|
|
3750
3854
|
}
|
|
3751
|
-
|
|
3855
|
+
async loadRemoteOptions(params) {
|
|
3752
3856
|
const {url: jsonUrl, index: index} = params;
|
|
3753
3857
|
const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
|
|
3754
3858
|
if (!url) {
|
|
@@ -3760,14 +3864,14 @@
|
|
|
3760
3864
|
return;
|
|
3761
3865
|
}
|
|
3762
3866
|
const data = await response.json();
|
|
3763
|
-
return
|
|
3867
|
+
return this.loadOptions({
|
|
3764
3868
|
tagId: params.tagId,
|
|
3765
3869
|
element: params.element,
|
|
3766
3870
|
index: index,
|
|
3767
3871
|
options: data
|
|
3768
3872
|
});
|
|
3769
3873
|
}
|
|
3770
|
-
|
|
3874
|
+
load(tagId, options, index) {
|
|
3771
3875
|
const params = {
|
|
3772
3876
|
index: index
|
|
3773
3877
|
};
|
|
@@ -3783,7 +3887,7 @@
|
|
|
3783
3887
|
}
|
|
3784
3888
|
return this.loadOptions(params);
|
|
3785
3889
|
}
|
|
3786
|
-
|
|
3890
|
+
async set(id, domContainer, options, index) {
|
|
3787
3891
|
const params = {
|
|
3788
3892
|
index: index
|
|
3789
3893
|
};
|
|
@@ -3804,7 +3908,7 @@
|
|
|
3804
3908
|
}
|
|
3805
3909
|
return this.loadOptions(params);
|
|
3806
3910
|
}
|
|
3807
|
-
|
|
3911
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
3808
3912
|
let url, id;
|
|
3809
3913
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
3810
3914
|
url = tagId;
|
|
@@ -3812,13 +3916,13 @@
|
|
|
3812
3916
|
id = tagId;
|
|
3813
3917
|
url = jsonUrl;
|
|
3814
3918
|
}
|
|
3815
|
-
return
|
|
3919
|
+
return this.loadRemoteOptions({
|
|
3816
3920
|
tagId: id,
|
|
3817
3921
|
url: url,
|
|
3818
3922
|
index: index
|
|
3819
3923
|
});
|
|
3820
3924
|
}
|
|
3821
|
-
|
|
3925
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
3822
3926
|
let url, newId, newIndex, element;
|
|
3823
3927
|
if (id instanceof HTMLElement) {
|
|
3824
3928
|
element = id;
|
|
@@ -3830,15 +3934,15 @@
|
|
|
3830
3934
|
url = jsonUrl;
|
|
3831
3935
|
newIndex = index;
|
|
3832
3936
|
}
|
|
3833
|
-
return
|
|
3937
|
+
return this.loadRemoteOptions({
|
|
3834
3938
|
tagId: newId,
|
|
3835
3939
|
url: url,
|
|
3836
3940
|
index: newIndex,
|
|
3837
3941
|
element: element
|
|
3838
3942
|
});
|
|
3839
3943
|
}
|
|
3840
|
-
|
|
3841
|
-
const dom =
|
|
3944
|
+
setOnClickHandler(callback) {
|
|
3945
|
+
const dom = this.dom();
|
|
3842
3946
|
if (dom.length === 0) {
|
|
3843
3947
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
3844
3948
|
}
|
|
@@ -3847,6 +3951,7 @@
|
|
|
3847
3951
|
}
|
|
3848
3952
|
}
|
|
3849
3953
|
}
|
|
3954
|
+
_Loader_engine = new WeakMap;
|
|
3850
3955
|
function NumberUtils_clamp(num, min, max) {
|
|
3851
3956
|
return Math.min(Math.max(num, min), max);
|
|
3852
3957
|
}
|
|
@@ -4991,8 +5096,8 @@
|
|
|
4991
5096
|
}
|
|
4992
5097
|
}
|
|
4993
5098
|
}
|
|
4994
|
-
async function loadParticlesCollisionsInteraction(
|
|
4995
|
-
await
|
|
5099
|
+
async function loadParticlesCollisionsInteraction(engine) {
|
|
5100
|
+
await engine.addInteractor("particlesCollisions", (container => new Collider(container)));
|
|
4996
5101
|
}
|
|
4997
5102
|
return __webpack_exports__;
|
|
4998
5103
|
}();
|