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
|
function applyDistance(particle) {
|
|
549
567
|
const initialPosition = particle.initialPosition;
|
|
550
568
|
const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
|
|
@@ -718,26 +736,38 @@
|
|
|
718
736
|
return proximityFactor / slowFactor;
|
|
719
737
|
}
|
|
720
738
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
class
|
|
730
|
-
|
|
731
|
-
|
|
739
|
+
var Plugins_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
740
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
741
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
742
|
+
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");
|
|
743
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
744
|
+
value;
|
|
745
|
+
};
|
|
746
|
+
var _Plugins_engine;
|
|
747
|
+
class Plugins {
|
|
748
|
+
constructor(engine) {
|
|
749
|
+
_Plugins_engine.set(this, void 0);
|
|
750
|
+
Plugins_classPrivateFieldSet(this, _Plugins_engine, engine, "f");
|
|
751
|
+
this.plugins = [];
|
|
752
|
+
this.interactorsInitializers = new Map;
|
|
753
|
+
this.updatersInitializers = new Map;
|
|
754
|
+
this.interactors = new Map;
|
|
755
|
+
this.updaters = new Map;
|
|
756
|
+
this.presets = new Map;
|
|
757
|
+
this.drawers = new Map;
|
|
758
|
+
this.pathGenerators = new Map;
|
|
759
|
+
}
|
|
760
|
+
getPlugin(plugin) {
|
|
761
|
+
return this.plugins.find((t => t.id === plugin));
|
|
732
762
|
}
|
|
733
|
-
|
|
734
|
-
if (!
|
|
735
|
-
plugins.push(plugin);
|
|
763
|
+
addPlugin(plugin) {
|
|
764
|
+
if (!this.getPlugin(plugin.id)) {
|
|
765
|
+
this.plugins.push(plugin);
|
|
736
766
|
}
|
|
737
767
|
}
|
|
738
|
-
|
|
768
|
+
getAvailablePlugins(container) {
|
|
739
769
|
const res = new Map;
|
|
740
|
-
for (const plugin of plugins) {
|
|
770
|
+
for (const plugin of this.plugins) {
|
|
741
771
|
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
742
772
|
continue;
|
|
743
773
|
}
|
|
@@ -745,61 +775,62 @@
|
|
|
745
775
|
}
|
|
746
776
|
return res;
|
|
747
777
|
}
|
|
748
|
-
|
|
749
|
-
for (const plugin of plugins) {
|
|
778
|
+
loadOptions(options, sourceOptions) {
|
|
779
|
+
for (const plugin of this.plugins) {
|
|
750
780
|
plugin.loadOptions(options, sourceOptions);
|
|
751
781
|
}
|
|
752
782
|
}
|
|
753
|
-
|
|
754
|
-
return presets.get(preset);
|
|
783
|
+
getPreset(preset) {
|
|
784
|
+
return this.presets.get(preset);
|
|
755
785
|
}
|
|
756
|
-
|
|
757
|
-
if (override || !
|
|
758
|
-
presets.set(presetKey, options);
|
|
786
|
+
addPreset(presetKey, options, override = false) {
|
|
787
|
+
if (override || !this.getPreset(presetKey)) {
|
|
788
|
+
this.presets.set(presetKey, options);
|
|
759
789
|
}
|
|
760
790
|
}
|
|
761
|
-
|
|
762
|
-
if (!
|
|
763
|
-
drawers.set(type, drawer);
|
|
791
|
+
addShapeDrawer(type, drawer) {
|
|
792
|
+
if (!this.getShapeDrawer(type)) {
|
|
793
|
+
this.drawers.set(type, drawer);
|
|
764
794
|
}
|
|
765
795
|
}
|
|
766
|
-
|
|
767
|
-
return drawers.get(type);
|
|
796
|
+
getShapeDrawer(type) {
|
|
797
|
+
return this.drawers.get(type);
|
|
768
798
|
}
|
|
769
|
-
|
|
770
|
-
return drawers.keys();
|
|
799
|
+
getSupportedShapes() {
|
|
800
|
+
return this.drawers.keys();
|
|
771
801
|
}
|
|
772
|
-
|
|
773
|
-
return pathGenerators.get(type);
|
|
802
|
+
getPathGenerator(type) {
|
|
803
|
+
return this.pathGenerators.get(type);
|
|
774
804
|
}
|
|
775
|
-
|
|
776
|
-
if (!
|
|
777
|
-
pathGenerators.set(type, pathGenerator);
|
|
805
|
+
addPathGenerator(type, pathGenerator) {
|
|
806
|
+
if (!this.getPathGenerator(type)) {
|
|
807
|
+
this.pathGenerators.set(type, pathGenerator);
|
|
778
808
|
}
|
|
779
809
|
}
|
|
780
|
-
|
|
781
|
-
let res = interactors.get(container);
|
|
810
|
+
getInteractors(container, force = false) {
|
|
811
|
+
let res = this.interactors.get(container);
|
|
782
812
|
if (!res || force) {
|
|
783
|
-
res = [ ...interactorsInitializers.values() ].map((t => t(container)));
|
|
784
|
-
interactors.set(container, res);
|
|
813
|
+
res = [ ...this.interactorsInitializers.values() ].map((t => t(container)));
|
|
814
|
+
this.interactors.set(container, res);
|
|
785
815
|
}
|
|
786
816
|
return res;
|
|
787
817
|
}
|
|
788
|
-
|
|
789
|
-
interactorsInitializers.set(name, initInteractor);
|
|
818
|
+
addInteractor(name, initInteractor) {
|
|
819
|
+
this.interactorsInitializers.set(name, initInteractor);
|
|
790
820
|
}
|
|
791
|
-
|
|
792
|
-
let res = updaters.get(container);
|
|
821
|
+
getUpdaters(container, force = false) {
|
|
822
|
+
let res = this.updaters.get(container);
|
|
793
823
|
if (!res || force) {
|
|
794
|
-
res = [ ...updatersInitializers.values() ].map((t => t(container)));
|
|
795
|
-
updaters.set(container, res);
|
|
824
|
+
res = [ ...this.updatersInitializers.values() ].map((t => t(container)));
|
|
825
|
+
this.updaters.set(container, res);
|
|
796
826
|
}
|
|
797
827
|
return res;
|
|
798
828
|
}
|
|
799
|
-
|
|
800
|
-
updatersInitializers.set(name, initUpdater);
|
|
829
|
+
addParticleUpdater(name, initUpdater) {
|
|
830
|
+
this.updatersInitializers.set(name, initUpdater);
|
|
801
831
|
}
|
|
802
832
|
}
|
|
833
|
+
_Plugins_engine = new WeakMap;
|
|
803
834
|
class QuadTree_QuadTree {
|
|
804
835
|
constructor(rectangle, capacity) {
|
|
805
836
|
this.rectangle = rectangle;
|
|
@@ -1170,366 +1201,278 @@
|
|
|
1170
1201
|
}));
|
|
1171
1202
|
}
|
|
1172
1203
|
}
|
|
1173
|
-
class
|
|
1204
|
+
class Trail_Trail {
|
|
1174
1205
|
constructor() {
|
|
1175
|
-
this.
|
|
1176
|
-
this.
|
|
1206
|
+
this.delay = 1;
|
|
1207
|
+
this.pauseOnStop = false;
|
|
1208
|
+
this.quantity = 1;
|
|
1177
1209
|
}
|
|
1178
1210
|
load(data) {
|
|
1179
|
-
if (
|
|
1211
|
+
if (data === undefined) {
|
|
1180
1212
|
return;
|
|
1181
1213
|
}
|
|
1182
|
-
if (
|
|
1183
|
-
this.
|
|
1184
|
-
} else {
|
|
1185
|
-
this.random.load(data.random);
|
|
1214
|
+
if (data.delay !== undefined) {
|
|
1215
|
+
this.delay = data.delay;
|
|
1186
1216
|
}
|
|
1187
|
-
if (data.
|
|
1188
|
-
this.
|
|
1217
|
+
if (data.quantity !== undefined) {
|
|
1218
|
+
this.quantity = data.quantity;
|
|
1219
|
+
}
|
|
1220
|
+
if (data.particles !== undefined) {
|
|
1221
|
+
this.particles = deepExtend({}, data.particles);
|
|
1222
|
+
}
|
|
1223
|
+
if (data.pauseOnStop !== undefined) {
|
|
1224
|
+
this.pauseOnStop = data.pauseOnStop;
|
|
1189
1225
|
}
|
|
1190
1226
|
}
|
|
1191
1227
|
}
|
|
1192
|
-
class
|
|
1228
|
+
class Modes_Modes {
|
|
1193
1229
|
constructor() {
|
|
1194
|
-
|
|
1230
|
+
this.attract = new Attract;
|
|
1231
|
+
this.bounce = new Bounce;
|
|
1232
|
+
this.bubble = new Bubble;
|
|
1233
|
+
this.connect = new Connect;
|
|
1234
|
+
this.grab = new Grab;
|
|
1235
|
+
this.light = new Light;
|
|
1236
|
+
this.push = new Push;
|
|
1237
|
+
this.remove = new Remove;
|
|
1238
|
+
this.repulse = new Repulse;
|
|
1239
|
+
this.slow = new Slow;
|
|
1240
|
+
this.trail = new Trail;
|
|
1241
|
+
}
|
|
1242
|
+
load(data) {
|
|
1243
|
+
if (data === undefined) {
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
this.attract.load(data.attract);
|
|
1247
|
+
this.bubble.load(data.bubble);
|
|
1248
|
+
this.connect.load(data.connect);
|
|
1249
|
+
this.grab.load(data.grab);
|
|
1250
|
+
this.light.load(data.light);
|
|
1251
|
+
this.push.load(data.push);
|
|
1252
|
+
this.remove.load(data.remove);
|
|
1253
|
+
this.repulse.load(data.repulse);
|
|
1254
|
+
this.slow.load(data.slow);
|
|
1255
|
+
this.trail.load(data.trail);
|
|
1195
1256
|
}
|
|
1196
1257
|
}
|
|
1197
|
-
class
|
|
1258
|
+
class Interactivity_Interactivity {
|
|
1198
1259
|
constructor() {
|
|
1199
|
-
this.
|
|
1200
|
-
this.
|
|
1201
|
-
this.
|
|
1202
|
-
|
|
1260
|
+
this.detectsOn = "window";
|
|
1261
|
+
this.events = new Events;
|
|
1262
|
+
this.modes = new Modes;
|
|
1263
|
+
}
|
|
1264
|
+
get detect_on() {
|
|
1265
|
+
return this.detectsOn;
|
|
1266
|
+
}
|
|
1267
|
+
set detect_on(value) {
|
|
1268
|
+
this.detectsOn = value;
|
|
1203
1269
|
}
|
|
1204
1270
|
load(data) {
|
|
1271
|
+
var _a, _b, _c;
|
|
1205
1272
|
if (data === undefined) {
|
|
1206
1273
|
return;
|
|
1207
1274
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
this.delay.load(data.delay);
|
|
1212
|
-
if (data.enable !== undefined) {
|
|
1213
|
-
this.enable = data.enable;
|
|
1275
|
+
const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
|
|
1276
|
+
if (detectsOn !== undefined) {
|
|
1277
|
+
this.detectsOn = detectsOn;
|
|
1214
1278
|
}
|
|
1215
|
-
this.
|
|
1216
|
-
|
|
1217
|
-
|
|
1279
|
+
this.events.load(data.events);
|
|
1280
|
+
this.modes.load(data.modes);
|
|
1281
|
+
if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
|
|
1282
|
+
if (this.events.onHover.mode instanceof Array) {
|
|
1283
|
+
if (this.events.onHover.mode.indexOf("slow") < 0) {
|
|
1284
|
+
this.events.onHover.mode.push("slow");
|
|
1285
|
+
}
|
|
1286
|
+
} else if (this.events.onHover.mode !== "slow") {
|
|
1287
|
+
this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
|
|
1288
|
+
}
|
|
1218
1289
|
}
|
|
1219
1290
|
}
|
|
1220
1291
|
}
|
|
1221
|
-
class
|
|
1222
|
-
constructor() {
|
|
1223
|
-
this.acceleration = 0;
|
|
1224
|
-
this.enable = false;
|
|
1225
|
-
}
|
|
1292
|
+
class ManualParticle_ManualParticle {
|
|
1226
1293
|
load(data) {
|
|
1294
|
+
var _a, _b;
|
|
1227
1295
|
if (!data) {
|
|
1228
1296
|
return;
|
|
1229
1297
|
}
|
|
1230
|
-
if (data.
|
|
1231
|
-
this.
|
|
1298
|
+
if (data.position !== undefined) {
|
|
1299
|
+
this.position = {
|
|
1300
|
+
x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
|
|
1301
|
+
y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
|
|
1302
|
+
};
|
|
1232
1303
|
}
|
|
1233
|
-
if (data.
|
|
1234
|
-
this.
|
|
1304
|
+
if (data.options !== undefined) {
|
|
1305
|
+
this.options = deepExtend({}, data.options);
|
|
1235
1306
|
}
|
|
1236
|
-
this.position = data.position ? deepExtend({}, data.position) : undefined;
|
|
1237
1307
|
}
|
|
1238
1308
|
}
|
|
1239
|
-
class
|
|
1309
|
+
class ColorAnimation_ColorAnimation {
|
|
1240
1310
|
constructor() {
|
|
1241
|
-
this.
|
|
1242
|
-
this.attract = new Attract;
|
|
1243
|
-
this.decay = 0;
|
|
1244
|
-
this.distance = {};
|
|
1245
|
-
this.direction = "none";
|
|
1246
|
-
this.drift = 0;
|
|
1311
|
+
this.count = 0;
|
|
1247
1312
|
this.enable = false;
|
|
1248
|
-
this.
|
|
1249
|
-
this.
|
|
1250
|
-
this.
|
|
1251
|
-
this.random = false;
|
|
1252
|
-
this.size = false;
|
|
1253
|
-
this.speed = 2;
|
|
1254
|
-
this.spin = new Spin;
|
|
1255
|
-
this.straight = false;
|
|
1256
|
-
this.trail = new Trail;
|
|
1257
|
-
this.vibrate = false;
|
|
1258
|
-
this.warp = false;
|
|
1259
|
-
}
|
|
1260
|
-
get collisions() {
|
|
1261
|
-
return false;
|
|
1262
|
-
}
|
|
1263
|
-
set collisions(value) {}
|
|
1264
|
-
get bounce() {
|
|
1265
|
-
return this.collisions;
|
|
1266
|
-
}
|
|
1267
|
-
set bounce(value) {
|
|
1268
|
-
this.collisions = value;
|
|
1269
|
-
}
|
|
1270
|
-
get out_mode() {
|
|
1271
|
-
return this.outMode;
|
|
1272
|
-
}
|
|
1273
|
-
set out_mode(value) {
|
|
1274
|
-
this.outMode = value;
|
|
1275
|
-
}
|
|
1276
|
-
get outMode() {
|
|
1277
|
-
return this.outModes.default;
|
|
1278
|
-
}
|
|
1279
|
-
set outMode(value) {
|
|
1280
|
-
this.outModes.default = value;
|
|
1281
|
-
}
|
|
1282
|
-
get noise() {
|
|
1283
|
-
return this.path;
|
|
1284
|
-
}
|
|
1285
|
-
set noise(value) {
|
|
1286
|
-
this.path = value;
|
|
1313
|
+
this.offset = 0;
|
|
1314
|
+
this.speed = 1;
|
|
1315
|
+
this.sync = true;
|
|
1287
1316
|
}
|
|
1288
1317
|
load(data) {
|
|
1289
|
-
var _a, _b, _c;
|
|
1290
1318
|
if (data === undefined) {
|
|
1291
1319
|
return;
|
|
1292
1320
|
}
|
|
1293
|
-
if (data.
|
|
1294
|
-
|
|
1295
|
-
this.angle.value = data.angle;
|
|
1296
|
-
} else {
|
|
1297
|
-
this.angle.load(data.angle);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
this.attract.load(data.attract);
|
|
1301
|
-
if (data.decay !== undefined) {
|
|
1302
|
-
this.decay = data.decay;
|
|
1303
|
-
}
|
|
1304
|
-
if (data.direction !== undefined) {
|
|
1305
|
-
this.direction = data.direction;
|
|
1306
|
-
}
|
|
1307
|
-
if (data.distance !== undefined) {
|
|
1308
|
-
this.distance = typeof data.distance === "number" ? {
|
|
1309
|
-
horizontal: data.distance,
|
|
1310
|
-
vertical: data.distance
|
|
1311
|
-
} : deepExtend({}, data.distance);
|
|
1312
|
-
}
|
|
1313
|
-
if (data.drift !== undefined) {
|
|
1314
|
-
this.drift = setRangeValue(data.drift);
|
|
1321
|
+
if (data.count !== undefined) {
|
|
1322
|
+
this.count = data.count;
|
|
1315
1323
|
}
|
|
1316
1324
|
if (data.enable !== undefined) {
|
|
1317
1325
|
this.enable = data.enable;
|
|
1318
1326
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
if (data.outModes !== undefined || outMode !== undefined) {
|
|
1322
|
-
if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
|
|
1323
|
-
this.outModes.load({
|
|
1324
|
-
default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
|
|
1325
|
-
});
|
|
1326
|
-
} else {
|
|
1327
|
-
this.outModes.load(data.outModes);
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
|
|
1331
|
-
if (data.random !== undefined) {
|
|
1332
|
-
this.random = data.random;
|
|
1333
|
-
}
|
|
1334
|
-
if (data.size !== undefined) {
|
|
1335
|
-
this.size = data.size;
|
|
1327
|
+
if (data.offset !== undefined) {
|
|
1328
|
+
this.offset = setRangeValue(data.offset);
|
|
1336
1329
|
}
|
|
1337
1330
|
if (data.speed !== undefined) {
|
|
1338
|
-
this.speed =
|
|
1339
|
-
}
|
|
1340
|
-
this.spin.load(data.spin);
|
|
1341
|
-
if (data.straight !== undefined) {
|
|
1342
|
-
this.straight = data.straight;
|
|
1343
|
-
}
|
|
1344
|
-
this.trail.load(data.trail);
|
|
1345
|
-
if (data.vibrate !== undefined) {
|
|
1346
|
-
this.vibrate = data.vibrate;
|
|
1331
|
+
this.speed = data.speed;
|
|
1347
1332
|
}
|
|
1348
|
-
if (data.
|
|
1349
|
-
this.
|
|
1333
|
+
if (data.sync !== undefined) {
|
|
1334
|
+
this.sync = data.sync;
|
|
1350
1335
|
}
|
|
1351
1336
|
}
|
|
1352
1337
|
}
|
|
1353
|
-
class
|
|
1338
|
+
class HslAnimation_HslAnimation {
|
|
1354
1339
|
constructor() {
|
|
1355
|
-
|
|
1356
|
-
this.
|
|
1357
|
-
this.
|
|
1358
|
-
this.value = 1;
|
|
1359
|
-
}
|
|
1360
|
-
get anim() {
|
|
1361
|
-
return this.animation;
|
|
1362
|
-
}
|
|
1363
|
-
set anim(value) {
|
|
1364
|
-
this.animation = value;
|
|
1340
|
+
this.h = new ColorAnimation;
|
|
1341
|
+
this.s = new ColorAnimation;
|
|
1342
|
+
this.l = new ColorAnimation;
|
|
1365
1343
|
}
|
|
1366
1344
|
load(data) {
|
|
1367
|
-
var _a;
|
|
1368
1345
|
if (!data) {
|
|
1369
1346
|
return;
|
|
1370
1347
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
this.animation.load(animation);
|
|
1375
|
-
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
class Shape_Shape {
|
|
1380
|
-
constructor() {
|
|
1381
|
-
this.options = {};
|
|
1382
|
-
this.type = "circle";
|
|
1383
|
-
}
|
|
1384
|
-
get image() {
|
|
1385
|
-
var _a;
|
|
1386
|
-
return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
|
|
1387
|
-
}
|
|
1388
|
-
set image(value) {
|
|
1389
|
-
this.options["image"] = value;
|
|
1390
|
-
this.options["images"] = value;
|
|
1391
|
-
}
|
|
1392
|
-
get custom() {
|
|
1393
|
-
return this.options;
|
|
1394
|
-
}
|
|
1395
|
-
set custom(value) {
|
|
1396
|
-
this.options = value;
|
|
1397
|
-
}
|
|
1398
|
-
get images() {
|
|
1399
|
-
return this.image;
|
|
1400
|
-
}
|
|
1401
|
-
set images(value) {
|
|
1402
|
-
this.image = value;
|
|
1403
|
-
}
|
|
1404
|
-
get stroke() {
|
|
1405
|
-
return [];
|
|
1348
|
+
this.h.load(data.h);
|
|
1349
|
+
this.s.load(data.s);
|
|
1350
|
+
this.l.load(data.l);
|
|
1406
1351
|
}
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1352
|
+
}
|
|
1353
|
+
class AnimatableColor_AnimatableColor extends(null && OptionsColor){
|
|
1354
|
+
constructor() {
|
|
1355
|
+
super();
|
|
1356
|
+
this.animation = new HslAnimation;
|
|
1411
1357
|
}
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1358
|
+
static create(source, data) {
|
|
1359
|
+
const color = new AnimatableColor_AnimatableColor;
|
|
1360
|
+
color.load(source);
|
|
1361
|
+
if (data !== undefined) {
|
|
1362
|
+
if (typeof data === "string" || data instanceof Array) {
|
|
1363
|
+
color.load({
|
|
1364
|
+
value: data
|
|
1365
|
+
});
|
|
1366
|
+
} else {
|
|
1367
|
+
color.load(data);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
return color;
|
|
1415
1371
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1372
|
+
load(data) {
|
|
1373
|
+
super.load(data);
|
|
1374
|
+
if (!data) {
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1377
|
+
const colorAnimation = data.animation;
|
|
1378
|
+
if (colorAnimation !== undefined) {
|
|
1379
|
+
if (colorAnimation.enable !== undefined) {
|
|
1380
|
+
this.animation.h.load(colorAnimation);
|
|
1381
|
+
} else {
|
|
1382
|
+
this.animation.load(data.animation);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1419
1385
|
}
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1386
|
+
}
|
|
1387
|
+
class AnimatableGradient_AnimatableGradient {
|
|
1388
|
+
constructor() {
|
|
1389
|
+
this.angle = new GradientAngle;
|
|
1390
|
+
this.colors = [];
|
|
1391
|
+
this.type = "random";
|
|
1423
1392
|
}
|
|
1424
1393
|
load(data) {
|
|
1425
|
-
|
|
1426
|
-
if (data === undefined) {
|
|
1394
|
+
if (!data) {
|
|
1427
1395
|
return;
|
|
1428
1396
|
}
|
|
1429
|
-
|
|
1430
|
-
if (
|
|
1431
|
-
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
}
|
|
1397
|
+
this.angle.load(data.angle);
|
|
1398
|
+
if (data.colors !== undefined) {
|
|
1399
|
+
this.colors = data.colors.map((s => {
|
|
1400
|
+
const tmp = new AnimatableGradientColor;
|
|
1401
|
+
tmp.load(s);
|
|
1402
|
+
return tmp;
|
|
1403
|
+
}));
|
|
1437
1404
|
}
|
|
1438
|
-
this.loadShape(data.character, "character", "char", true);
|
|
1439
|
-
this.loadShape(data.polygon, "polygon", "star", false);
|
|
1440
|
-
this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
|
|
1441
1405
|
if (data.type !== undefined) {
|
|
1442
1406
|
this.type = data.type;
|
|
1443
1407
|
}
|
|
1444
1408
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1409
|
+
}
|
|
1410
|
+
class GradientAngle {
|
|
1411
|
+
constructor() {
|
|
1412
|
+
this.value = 0;
|
|
1413
|
+
this.animation = new GradientAngleAnimation;
|
|
1414
|
+
this.direction = "clockwise";
|
|
1415
|
+
}
|
|
1416
|
+
load(data) {
|
|
1417
|
+
if (!data) {
|
|
1448
1418
|
return;
|
|
1449
1419
|
}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
}
|
|
1457
|
-
this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
|
|
1458
|
-
if (!this.options[altKey] || altOverride) {
|
|
1459
|
-
this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
|
|
1460
|
-
}
|
|
1461
|
-
} else {
|
|
1462
|
-
if (this.options[mainKey] instanceof Array) {
|
|
1463
|
-
this.options[mainKey] = {};
|
|
1464
|
-
if (!this.options[altKey] || altOverride) {
|
|
1465
|
-
this.options[altKey] = {};
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
|
|
1469
|
-
if (!this.options[altKey] || altOverride) {
|
|
1470
|
-
this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
|
|
1471
|
-
}
|
|
1420
|
+
this.animation.load(data.animation);
|
|
1421
|
+
if (data.value !== undefined) {
|
|
1422
|
+
this.value = data.value;
|
|
1423
|
+
}
|
|
1424
|
+
if (data.direction !== undefined) {
|
|
1425
|
+
this.direction = data.direction;
|
|
1472
1426
|
}
|
|
1473
1427
|
}
|
|
1474
1428
|
}
|
|
1475
|
-
class
|
|
1429
|
+
class GradientColorOpacity {
|
|
1476
1430
|
constructor() {
|
|
1477
|
-
|
|
1478
|
-
this.animation = new
|
|
1479
|
-
this.random.minimumValue = 1;
|
|
1480
|
-
this.value = 3;
|
|
1481
|
-
}
|
|
1482
|
-
get anim() {
|
|
1483
|
-
return this.animation;
|
|
1484
|
-
}
|
|
1485
|
-
set anim(value) {
|
|
1486
|
-
this.animation = value;
|
|
1431
|
+
this.value = 0;
|
|
1432
|
+
this.animation = new GradientColorOpacityAnimation;
|
|
1487
1433
|
}
|
|
1488
1434
|
load(data) {
|
|
1489
|
-
var _a;
|
|
1490
1435
|
if (!data) {
|
|
1491
1436
|
return;
|
|
1492
1437
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
this.animation.load(animation);
|
|
1497
|
-
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
1438
|
+
this.animation.load(data.animation);
|
|
1439
|
+
if (data.value !== undefined) {
|
|
1440
|
+
this.value = setRangeValue(data.value);
|
|
1498
1441
|
}
|
|
1499
1442
|
}
|
|
1500
1443
|
}
|
|
1501
|
-
class
|
|
1444
|
+
class AnimatableGradientColor {
|
|
1502
1445
|
constructor() {
|
|
1503
|
-
|
|
1504
|
-
this.
|
|
1505
|
-
this.direction = "clockwise";
|
|
1506
|
-
this.path = false;
|
|
1507
|
-
this.value = 0;
|
|
1446
|
+
this.stop = 0;
|
|
1447
|
+
this.value = new AnimatableColor;
|
|
1508
1448
|
}
|
|
1509
1449
|
load(data) {
|
|
1510
1450
|
if (!data) {
|
|
1511
1451
|
return;
|
|
1512
1452
|
}
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
this.direction = data.direction;
|
|
1453
|
+
if (data.stop !== undefined) {
|
|
1454
|
+
this.stop = data.stop;
|
|
1516
1455
|
}
|
|
1517
|
-
this.
|
|
1518
|
-
if (data.
|
|
1519
|
-
this.
|
|
1456
|
+
this.value = AnimatableColor.create(this.value, data.value);
|
|
1457
|
+
if (data.opacity !== undefined) {
|
|
1458
|
+
this.opacity = new GradientColorOpacity;
|
|
1459
|
+
if (typeof data.opacity === "number") {
|
|
1460
|
+
this.opacity.value = data.opacity;
|
|
1461
|
+
} else {
|
|
1462
|
+
this.opacity.load(data.opacity);
|
|
1463
|
+
}
|
|
1520
1464
|
}
|
|
1521
1465
|
}
|
|
1522
1466
|
}
|
|
1523
|
-
class
|
|
1467
|
+
class GradientAngleAnimation {
|
|
1524
1468
|
constructor() {
|
|
1525
1469
|
this.count = 0;
|
|
1526
1470
|
this.enable = false;
|
|
1527
|
-
this.
|
|
1528
|
-
this.
|
|
1529
|
-
this.sync = true;
|
|
1471
|
+
this.speed = 0;
|
|
1472
|
+
this.sync = false;
|
|
1530
1473
|
}
|
|
1531
1474
|
load(data) {
|
|
1532
|
-
if (data
|
|
1475
|
+
if (!data) {
|
|
1533
1476
|
return;
|
|
1534
1477
|
}
|
|
1535
1478
|
if (data.count !== undefined) {
|
|
@@ -1538,9 +1481,6 @@
|
|
|
1538
1481
|
if (data.enable !== undefined) {
|
|
1539
1482
|
this.enable = data.enable;
|
|
1540
1483
|
}
|
|
1541
|
-
if (data.offset !== undefined) {
|
|
1542
|
-
this.offset = setRangeValue(data.offset);
|
|
1543
|
-
}
|
|
1544
1484
|
if (data.speed !== undefined) {
|
|
1545
1485
|
this.speed = data.speed;
|
|
1546
1486
|
}
|
|
@@ -1549,71 +1489,51 @@
|
|
|
1549
1489
|
}
|
|
1550
1490
|
}
|
|
1551
1491
|
}
|
|
1552
|
-
class
|
|
1492
|
+
class GradientColorOpacityAnimation {
|
|
1553
1493
|
constructor() {
|
|
1554
|
-
this.
|
|
1555
|
-
this.
|
|
1556
|
-
this.
|
|
1494
|
+
this.count = 0;
|
|
1495
|
+
this.enable = false;
|
|
1496
|
+
this.speed = 0;
|
|
1497
|
+
this.sync = false;
|
|
1498
|
+
this.startValue = "random";
|
|
1557
1499
|
}
|
|
1558
1500
|
load(data) {
|
|
1559
1501
|
if (!data) {
|
|
1560
1502
|
return;
|
|
1561
1503
|
}
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1504
|
+
if (data.count !== undefined) {
|
|
1505
|
+
this.count = data.count;
|
|
1506
|
+
}
|
|
1507
|
+
if (data.enable !== undefined) {
|
|
1508
|
+
this.enable = data.enable;
|
|
1509
|
+
}
|
|
1510
|
+
if (data.speed !== undefined) {
|
|
1511
|
+
this.speed = data.speed;
|
|
1512
|
+
}
|
|
1513
|
+
if (data.sync !== undefined) {
|
|
1514
|
+
this.sync = data.sync;
|
|
1515
|
+
}
|
|
1516
|
+
if (data.startValue !== undefined) {
|
|
1517
|
+
this.startValue = data.startValue;
|
|
1518
|
+
}
|
|
1565
1519
|
}
|
|
1566
1520
|
}
|
|
1567
|
-
class
|
|
1521
|
+
class ValueWithRandom_ValueWithRandom {
|
|
1568
1522
|
constructor() {
|
|
1569
|
-
|
|
1570
|
-
this.
|
|
1571
|
-
}
|
|
1572
|
-
static create(source, data) {
|
|
1573
|
-
const color = new AnimatableColor_AnimatableColor;
|
|
1574
|
-
color.load(source);
|
|
1575
|
-
if (data !== undefined) {
|
|
1576
|
-
if (typeof data === "string" || data instanceof Array) {
|
|
1577
|
-
color.load({
|
|
1578
|
-
value: data
|
|
1579
|
-
});
|
|
1580
|
-
} else {
|
|
1581
|
-
color.load(data);
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
return color;
|
|
1523
|
+
this.random = new Random;
|
|
1524
|
+
this.value = 0;
|
|
1585
1525
|
}
|
|
1586
1526
|
load(data) {
|
|
1587
|
-
super.load(data);
|
|
1588
1527
|
if (!data) {
|
|
1589
1528
|
return;
|
|
1590
1529
|
}
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
} else {
|
|
1596
|
-
this.animation.load(data.animation);
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
class Stroke_Stroke {
|
|
1602
|
-
constructor() {
|
|
1603
|
-
this.width = 0;
|
|
1604
|
-
}
|
|
1605
|
-
load(data) {
|
|
1606
|
-
if (data === undefined) {
|
|
1607
|
-
return;
|
|
1608
|
-
}
|
|
1609
|
-
if (data.color !== undefined) {
|
|
1610
|
-
this.color = AnimatableColor.create(this.color, data.color);
|
|
1611
|
-
}
|
|
1612
|
-
if (data.width !== undefined) {
|
|
1613
|
-
this.width = data.width;
|
|
1530
|
+
if (typeof data.random === "boolean") {
|
|
1531
|
+
this.random.enable = data.random;
|
|
1532
|
+
} else {
|
|
1533
|
+
this.random.load(data.random);
|
|
1614
1534
|
}
|
|
1615
|
-
if (data.
|
|
1616
|
-
this.
|
|
1535
|
+
if (data.value !== undefined) {
|
|
1536
|
+
this.value = setRangeValue(data.value, this.random.enable ? this.random.minimumValue : undefined);
|
|
1617
1537
|
}
|
|
1618
1538
|
}
|
|
1619
1539
|
}
|
|
@@ -1658,54 +1578,6 @@
|
|
|
1658
1578
|
this.overlap.load(data.overlap);
|
|
1659
1579
|
}
|
|
1660
1580
|
}
|
|
1661
|
-
class LifeDelay_LifeDelay extends(null && ValueWithRandom){
|
|
1662
|
-
constructor() {
|
|
1663
|
-
super();
|
|
1664
|
-
this.sync = false;
|
|
1665
|
-
}
|
|
1666
|
-
load(data) {
|
|
1667
|
-
if (!data) {
|
|
1668
|
-
return;
|
|
1669
|
-
}
|
|
1670
|
-
super.load(data);
|
|
1671
|
-
if (data.sync !== undefined) {
|
|
1672
|
-
this.sync = data.sync;
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
class LifeDuration_LifeDuration extends(null && ValueWithRandom){
|
|
1677
|
-
constructor() {
|
|
1678
|
-
super();
|
|
1679
|
-
this.random.minimumValue = 1e-4;
|
|
1680
|
-
this.sync = false;
|
|
1681
|
-
}
|
|
1682
|
-
load(data) {
|
|
1683
|
-
if (data === undefined) {
|
|
1684
|
-
return;
|
|
1685
|
-
}
|
|
1686
|
-
super.load(data);
|
|
1687
|
-
if (data.sync !== undefined) {
|
|
1688
|
-
this.sync = data.sync;
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
class Life_Life {
|
|
1693
|
-
constructor() {
|
|
1694
|
-
this.count = 0;
|
|
1695
|
-
this.delay = new LifeDelay;
|
|
1696
|
-
this.duration = new LifeDuration;
|
|
1697
|
-
}
|
|
1698
|
-
load(data) {
|
|
1699
|
-
if (data === undefined) {
|
|
1700
|
-
return;
|
|
1701
|
-
}
|
|
1702
|
-
if (data.count !== undefined) {
|
|
1703
|
-
this.count = data.count;
|
|
1704
|
-
}
|
|
1705
|
-
this.delay.load(data.delay);
|
|
1706
|
-
this.duration.load(data.duration);
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
1581
|
class SplitFactor_SplitFactor extends(null && ValueWithRandom){
|
|
1710
1582
|
constructor() {
|
|
1711
1583
|
super();
|
|
@@ -1760,318 +1632,582 @@
|
|
|
1760
1632
|
this.split.load(data.split);
|
|
1761
1633
|
}
|
|
1762
1634
|
}
|
|
1763
|
-
class
|
|
1764
|
-
constructor() {
|
|
1765
|
-
this.distance = 5;
|
|
1766
|
-
this.enable = false;
|
|
1767
|
-
this.speed = 50;
|
|
1768
|
-
}
|
|
1769
|
-
load(data) {
|
|
1770
|
-
if (!data) {
|
|
1771
|
-
return;
|
|
1772
|
-
}
|
|
1773
|
-
if (data.distance !== undefined) {
|
|
1774
|
-
this.distance = setRangeValue(data.distance);
|
|
1775
|
-
}
|
|
1776
|
-
if (data.enable !== undefined) {
|
|
1777
|
-
this.enable = data.enable;
|
|
1778
|
-
}
|
|
1779
|
-
if (data.speed !== undefined) {
|
|
1780
|
-
this.speed = setRangeValue(data.speed);
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
1635
|
+
class LifeDelay_LifeDelay extends(null && ValueWithRandom){
|
|
1785
1636
|
constructor() {
|
|
1786
1637
|
super();
|
|
1787
|
-
this.
|
|
1788
|
-
this.direction = "clockwise";
|
|
1789
|
-
this.enable = false;
|
|
1790
|
-
this.value = 0;
|
|
1638
|
+
this.sync = false;
|
|
1791
1639
|
}
|
|
1792
1640
|
load(data) {
|
|
1793
1641
|
if (!data) {
|
|
1794
1642
|
return;
|
|
1795
1643
|
}
|
|
1796
1644
|
super.load(data);
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
this.direction = data.direction;
|
|
1800
|
-
}
|
|
1801
|
-
if (data.enable !== undefined) {
|
|
1802
|
-
this.enable = data.enable;
|
|
1645
|
+
if (data.sync !== undefined) {
|
|
1646
|
+
this.sync = data.sync;
|
|
1803
1647
|
}
|
|
1804
1648
|
}
|
|
1805
1649
|
}
|
|
1806
|
-
class
|
|
1650
|
+
class LifeDuration_LifeDuration extends(null && ValueWithRandom){
|
|
1807
1651
|
constructor() {
|
|
1808
|
-
|
|
1809
|
-
this.
|
|
1810
|
-
this.
|
|
1811
|
-
this.mode = "vertical";
|
|
1812
|
-
this.speed = 25;
|
|
1652
|
+
super();
|
|
1653
|
+
this.random.minimumValue = 1e-4;
|
|
1654
|
+
this.sync = false;
|
|
1813
1655
|
}
|
|
1814
1656
|
load(data) {
|
|
1815
|
-
if (
|
|
1657
|
+
if (data === undefined) {
|
|
1816
1658
|
return;
|
|
1817
1659
|
}
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
this.darken.load(data.darken);
|
|
1822
|
-
if (data.enable !== undefined) {
|
|
1823
|
-
this.enable = data.enable;
|
|
1824
|
-
}
|
|
1825
|
-
this.enlighten.load(data.enlighten);
|
|
1826
|
-
if (data.mode !== undefined) {
|
|
1827
|
-
this.mode = data.mode;
|
|
1828
|
-
}
|
|
1829
|
-
if (data.speed !== undefined) {
|
|
1830
|
-
this.speed = setRangeValue(data.speed);
|
|
1660
|
+
super.load(data);
|
|
1661
|
+
if (data.sync !== undefined) {
|
|
1662
|
+
this.sync = data.sync;
|
|
1831
1663
|
}
|
|
1832
1664
|
}
|
|
1833
1665
|
}
|
|
1834
|
-
class
|
|
1666
|
+
class Life_Life {
|
|
1835
1667
|
constructor() {
|
|
1836
|
-
|
|
1837
|
-
this.
|
|
1838
|
-
this.
|
|
1839
|
-
this.velocityRate = 1;
|
|
1668
|
+
this.count = 0;
|
|
1669
|
+
this.delay = new LifeDelay;
|
|
1670
|
+
this.duration = new LifeDuration;
|
|
1840
1671
|
}
|
|
1841
1672
|
load(data) {
|
|
1842
|
-
|
|
1843
|
-
if (!data) {
|
|
1673
|
+
if (data === undefined) {
|
|
1844
1674
|
return;
|
|
1845
1675
|
}
|
|
1846
|
-
if (data.
|
|
1847
|
-
this.
|
|
1848
|
-
}
|
|
1849
|
-
if (data.sizeRate !== undefined) {
|
|
1850
|
-
this.sizeRate = data.sizeRate;
|
|
1851
|
-
}
|
|
1852
|
-
if (data.velocityRate !== undefined) {
|
|
1853
|
-
this.velocityRate = data.velocityRate;
|
|
1676
|
+
if (data.count !== undefined) {
|
|
1677
|
+
this.count = data.count;
|
|
1854
1678
|
}
|
|
1679
|
+
this.delay.load(data.delay);
|
|
1680
|
+
this.duration.load(data.duration);
|
|
1855
1681
|
}
|
|
1856
1682
|
}
|
|
1857
|
-
class
|
|
1683
|
+
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
1858
1684
|
constructor() {
|
|
1859
1685
|
super();
|
|
1860
|
-
this.value = 45;
|
|
1861
|
-
this.random.enable = false;
|
|
1862
|
-
this.random.minimumValue = 0;
|
|
1863
|
-
}
|
|
1864
|
-
load(data) {
|
|
1865
|
-
if (data === undefined) {
|
|
1866
|
-
return;
|
|
1867
|
-
}
|
|
1868
|
-
super.load(data);
|
|
1869
1686
|
}
|
|
1870
1687
|
}
|
|
1871
|
-
class
|
|
1688
|
+
class Path_Path {
|
|
1872
1689
|
constructor() {
|
|
1873
|
-
this.
|
|
1690
|
+
this.clamp = true;
|
|
1691
|
+
this.delay = new PathDelay;
|
|
1874
1692
|
this.enable = false;
|
|
1875
|
-
this.
|
|
1876
|
-
this.rotation = new OrbitRotation;
|
|
1877
|
-
this.width = 1;
|
|
1693
|
+
this.options = {};
|
|
1878
1694
|
}
|
|
1879
1695
|
load(data) {
|
|
1880
1696
|
if (data === undefined) {
|
|
1881
1697
|
return;
|
|
1882
1698
|
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1699
|
+
if (data.clamp !== undefined) {
|
|
1700
|
+
this.clamp = data.clamp;
|
|
1701
|
+
}
|
|
1702
|
+
this.delay.load(data.delay);
|
|
1885
1703
|
if (data.enable !== undefined) {
|
|
1886
1704
|
this.enable = data.enable;
|
|
1887
1705
|
}
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
if (data.width !== undefined) {
|
|
1892
|
-
this.width = data.width;
|
|
1893
|
-
}
|
|
1894
|
-
if (data.radius !== undefined) {
|
|
1895
|
-
this.radius = data.radius;
|
|
1896
|
-
}
|
|
1897
|
-
if (data.color !== undefined) {
|
|
1898
|
-
this.color = OptionsColor.create(this.color, data.color);
|
|
1706
|
+
this.generator = data.generator;
|
|
1707
|
+
if (data.options) {
|
|
1708
|
+
this.options = deepExtend(this.options, data.options);
|
|
1899
1709
|
}
|
|
1900
1710
|
}
|
|
1901
1711
|
}
|
|
1902
|
-
class
|
|
1712
|
+
class Spin_Spin {
|
|
1903
1713
|
constructor() {
|
|
1904
|
-
|
|
1905
|
-
this.
|
|
1906
|
-
this.distance = 1;
|
|
1907
|
-
this.duration = 1;
|
|
1908
|
-
this.factor = 1;
|
|
1909
|
-
this.speed = 1;
|
|
1714
|
+
this.acceleration = 0;
|
|
1715
|
+
this.enable = false;
|
|
1910
1716
|
}
|
|
1911
1717
|
load(data) {
|
|
1912
|
-
super.load(data);
|
|
1913
1718
|
if (!data) {
|
|
1914
1719
|
return;
|
|
1915
1720
|
}
|
|
1916
|
-
if (data.
|
|
1917
|
-
this.
|
|
1918
|
-
}
|
|
1919
|
-
if (data.distance !== undefined) {
|
|
1920
|
-
this.distance = data.distance;
|
|
1921
|
-
}
|
|
1922
|
-
if (data.duration !== undefined) {
|
|
1923
|
-
this.duration = data.duration;
|
|
1924
|
-
}
|
|
1925
|
-
if (data.factor !== undefined) {
|
|
1926
|
-
this.factor = data.factor;
|
|
1721
|
+
if (data.acceleration !== undefined) {
|
|
1722
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
1927
1723
|
}
|
|
1928
|
-
if (data.
|
|
1929
|
-
this.
|
|
1724
|
+
if (data.enable !== undefined) {
|
|
1725
|
+
this.enable = data.enable;
|
|
1930
1726
|
}
|
|
1727
|
+
this.position = data.position ? deepExtend({}, data.position) : undefined;
|
|
1931
1728
|
}
|
|
1932
1729
|
}
|
|
1933
|
-
class
|
|
1730
|
+
class Move_Move {
|
|
1934
1731
|
constructor() {
|
|
1935
|
-
this.angle = new
|
|
1936
|
-
this.
|
|
1937
|
-
this.
|
|
1732
|
+
this.angle = new MoveAngle;
|
|
1733
|
+
this.attract = new Attract;
|
|
1734
|
+
this.decay = 0;
|
|
1735
|
+
this.distance = {};
|
|
1736
|
+
this.direction = "none";
|
|
1737
|
+
this.drift = 0;
|
|
1738
|
+
this.enable = false;
|
|
1739
|
+
this.gravity = new MoveGravity;
|
|
1740
|
+
this.path = new Path;
|
|
1741
|
+
this.outModes = new OutModes;
|
|
1742
|
+
this.random = false;
|
|
1743
|
+
this.size = false;
|
|
1744
|
+
this.speed = 2;
|
|
1745
|
+
this.spin = new Spin;
|
|
1746
|
+
this.straight = false;
|
|
1747
|
+
this.trail = new Trail;
|
|
1748
|
+
this.vibrate = false;
|
|
1749
|
+
this.warp = false;
|
|
1938
1750
|
}
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1751
|
+
get collisions() {
|
|
1752
|
+
return false;
|
|
1753
|
+
}
|
|
1754
|
+
set collisions(value) {}
|
|
1755
|
+
get bounce() {
|
|
1756
|
+
return this.collisions;
|
|
1757
|
+
}
|
|
1758
|
+
set bounce(value) {
|
|
1759
|
+
this.collisions = value;
|
|
1760
|
+
}
|
|
1761
|
+
get out_mode() {
|
|
1762
|
+
return this.outMode;
|
|
1763
|
+
}
|
|
1764
|
+
set out_mode(value) {
|
|
1765
|
+
this.outMode = value;
|
|
1766
|
+
}
|
|
1767
|
+
get outMode() {
|
|
1768
|
+
return this.outModes.default;
|
|
1769
|
+
}
|
|
1770
|
+
set outMode(value) {
|
|
1771
|
+
this.outModes.default = value;
|
|
1772
|
+
}
|
|
1773
|
+
get noise() {
|
|
1774
|
+
return this.path;
|
|
1775
|
+
}
|
|
1776
|
+
set noise(value) {
|
|
1777
|
+
this.path = value;
|
|
1778
|
+
}
|
|
1779
|
+
load(data) {
|
|
1780
|
+
var _a, _b, _c;
|
|
1781
|
+
if (data === undefined) {
|
|
1782
|
+
return;
|
|
1942
1783
|
}
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
}));
|
|
1784
|
+
if (data.angle !== undefined) {
|
|
1785
|
+
if (typeof data.angle === "number") {
|
|
1786
|
+
this.angle.value = data.angle;
|
|
1787
|
+
} else {
|
|
1788
|
+
this.angle.load(data.angle);
|
|
1789
|
+
}
|
|
1950
1790
|
}
|
|
1951
|
-
|
|
1952
|
-
|
|
1791
|
+
this.attract.load(data.attract);
|
|
1792
|
+
if (data.decay !== undefined) {
|
|
1793
|
+
this.decay = data.decay;
|
|
1794
|
+
}
|
|
1795
|
+
if (data.direction !== undefined) {
|
|
1796
|
+
this.direction = data.direction;
|
|
1797
|
+
}
|
|
1798
|
+
if (data.distance !== undefined) {
|
|
1799
|
+
this.distance = typeof data.distance === "number" ? {
|
|
1800
|
+
horizontal: data.distance,
|
|
1801
|
+
vertical: data.distance
|
|
1802
|
+
} : deepExtend({}, data.distance);
|
|
1803
|
+
}
|
|
1804
|
+
if (data.drift !== undefined) {
|
|
1805
|
+
this.drift = setRangeValue(data.drift);
|
|
1806
|
+
}
|
|
1807
|
+
if (data.enable !== undefined) {
|
|
1808
|
+
this.enable = data.enable;
|
|
1809
|
+
}
|
|
1810
|
+
this.gravity.load(data.gravity);
|
|
1811
|
+
const outMode = (_a = data.outMode) !== null && _a !== void 0 ? _a : data.out_mode;
|
|
1812
|
+
if (data.outModes !== undefined || outMode !== undefined) {
|
|
1813
|
+
if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
|
|
1814
|
+
this.outModes.load({
|
|
1815
|
+
default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
|
|
1816
|
+
});
|
|
1817
|
+
} else {
|
|
1818
|
+
this.outModes.load(data.outModes);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
|
|
1822
|
+
if (data.random !== undefined) {
|
|
1823
|
+
this.random = data.random;
|
|
1824
|
+
}
|
|
1825
|
+
if (data.size !== undefined) {
|
|
1826
|
+
this.size = data.size;
|
|
1827
|
+
}
|
|
1828
|
+
if (data.speed !== undefined) {
|
|
1829
|
+
this.speed = setRangeValue(data.speed);
|
|
1830
|
+
}
|
|
1831
|
+
this.spin.load(data.spin);
|
|
1832
|
+
if (data.straight !== undefined) {
|
|
1833
|
+
this.straight = data.straight;
|
|
1834
|
+
}
|
|
1835
|
+
this.trail.load(data.trail);
|
|
1836
|
+
if (data.vibrate !== undefined) {
|
|
1837
|
+
this.vibrate = data.vibrate;
|
|
1838
|
+
}
|
|
1839
|
+
if (data.warp !== undefined) {
|
|
1840
|
+
this.warp = data.warp;
|
|
1953
1841
|
}
|
|
1954
1842
|
}
|
|
1955
1843
|
}
|
|
1956
|
-
class
|
|
1844
|
+
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
1957
1845
|
constructor() {
|
|
1958
|
-
|
|
1959
|
-
this.animation = new
|
|
1960
|
-
this.
|
|
1846
|
+
super();
|
|
1847
|
+
this.animation = new OpacityAnimation;
|
|
1848
|
+
this.random.minimumValue = .1;
|
|
1849
|
+
this.value = 1;
|
|
1850
|
+
}
|
|
1851
|
+
get anim() {
|
|
1852
|
+
return this.animation;
|
|
1853
|
+
}
|
|
1854
|
+
set anim(value) {
|
|
1855
|
+
this.animation = value;
|
|
1961
1856
|
}
|
|
1962
1857
|
load(data) {
|
|
1858
|
+
var _a;
|
|
1963
1859
|
if (!data) {
|
|
1964
1860
|
return;
|
|
1965
1861
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
this.direction = data.direction;
|
|
1862
|
+
super.load(data);
|
|
1863
|
+
const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
|
|
1864
|
+
if (animation !== undefined) {
|
|
1865
|
+
this.animation.load(animation);
|
|
1866
|
+
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
1972
1867
|
}
|
|
1973
1868
|
}
|
|
1974
1869
|
}
|
|
1975
|
-
class
|
|
1870
|
+
class OrbitRotation_OrbitRotation extends(null && ValueWithRandom){
|
|
1976
1871
|
constructor() {
|
|
1977
|
-
|
|
1978
|
-
this.
|
|
1872
|
+
super();
|
|
1873
|
+
this.value = 45;
|
|
1874
|
+
this.random.enable = false;
|
|
1875
|
+
this.random.minimumValue = 0;
|
|
1979
1876
|
}
|
|
1980
1877
|
load(data) {
|
|
1981
|
-
if (
|
|
1878
|
+
if (data === undefined) {
|
|
1982
1879
|
return;
|
|
1983
1880
|
}
|
|
1984
|
-
|
|
1985
|
-
if (data.value !== undefined) {
|
|
1986
|
-
this.value = setRangeValue(data.value);
|
|
1987
|
-
}
|
|
1881
|
+
super.load(data);
|
|
1988
1882
|
}
|
|
1989
1883
|
}
|
|
1990
|
-
class
|
|
1884
|
+
class Orbit_Orbit {
|
|
1991
1885
|
constructor() {
|
|
1992
|
-
this.
|
|
1993
|
-
this.
|
|
1886
|
+
this.animation = new AnimationOptions;
|
|
1887
|
+
this.enable = false;
|
|
1888
|
+
this.opacity = 1;
|
|
1889
|
+
this.rotation = new OrbitRotation;
|
|
1890
|
+
this.width = 1;
|
|
1994
1891
|
}
|
|
1995
1892
|
load(data) {
|
|
1996
|
-
if (
|
|
1893
|
+
if (data === undefined) {
|
|
1997
1894
|
return;
|
|
1998
1895
|
}
|
|
1999
|
-
|
|
2000
|
-
|
|
1896
|
+
this.animation.load(data.animation);
|
|
1897
|
+
this.rotation.load(data.rotation);
|
|
1898
|
+
if (data.enable !== undefined) {
|
|
1899
|
+
this.enable = data.enable;
|
|
2001
1900
|
}
|
|
2002
|
-
this.value = AnimatableColor.create(this.value, data.value);
|
|
2003
1901
|
if (data.opacity !== undefined) {
|
|
2004
|
-
this.opacity =
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1902
|
+
this.opacity = data.opacity;
|
|
1903
|
+
}
|
|
1904
|
+
if (data.width !== undefined) {
|
|
1905
|
+
this.width = data.width;
|
|
1906
|
+
}
|
|
1907
|
+
if (data.radius !== undefined) {
|
|
1908
|
+
this.radius = data.radius;
|
|
1909
|
+
}
|
|
1910
|
+
if (data.color !== undefined) {
|
|
1911
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
2010
1912
|
}
|
|
2011
1913
|
}
|
|
2012
1914
|
}
|
|
2013
|
-
class
|
|
1915
|
+
class Repulse_Repulse extends(null && ValueWithRandom){
|
|
2014
1916
|
constructor() {
|
|
2015
|
-
|
|
2016
|
-
this.
|
|
2017
|
-
this.
|
|
2018
|
-
this.
|
|
1917
|
+
super();
|
|
1918
|
+
this.enabled = false;
|
|
1919
|
+
this.distance = 1;
|
|
1920
|
+
this.duration = 1;
|
|
1921
|
+
this.factor = 1;
|
|
1922
|
+
this.speed = 1;
|
|
2019
1923
|
}
|
|
2020
1924
|
load(data) {
|
|
1925
|
+
super.load(data);
|
|
2021
1926
|
if (!data) {
|
|
2022
1927
|
return;
|
|
2023
1928
|
}
|
|
2024
|
-
if (data.
|
|
2025
|
-
this.
|
|
1929
|
+
if (data.enabled !== undefined) {
|
|
1930
|
+
this.enabled = data.enabled;
|
|
2026
1931
|
}
|
|
2027
|
-
if (data.
|
|
2028
|
-
this.
|
|
1932
|
+
if (data.distance !== undefined) {
|
|
1933
|
+
this.distance = data.distance;
|
|
1934
|
+
}
|
|
1935
|
+
if (data.duration !== undefined) {
|
|
1936
|
+
this.duration = data.duration;
|
|
1937
|
+
}
|
|
1938
|
+
if (data.factor !== undefined) {
|
|
1939
|
+
this.factor = data.factor;
|
|
2029
1940
|
}
|
|
2030
1941
|
if (data.speed !== undefined) {
|
|
2031
1942
|
this.speed = data.speed;
|
|
2032
1943
|
}
|
|
2033
|
-
if (data.sync !== undefined) {
|
|
2034
|
-
this.sync = data.sync;
|
|
2035
|
-
}
|
|
2036
1944
|
}
|
|
2037
1945
|
}
|
|
2038
|
-
class
|
|
1946
|
+
class Roll_Roll {
|
|
2039
1947
|
constructor() {
|
|
2040
|
-
this.
|
|
1948
|
+
this.darken = new RollLight;
|
|
2041
1949
|
this.enable = false;
|
|
2042
|
-
this.
|
|
2043
|
-
this.
|
|
2044
|
-
this.
|
|
1950
|
+
this.enlighten = new RollLight;
|
|
1951
|
+
this.mode = "vertical";
|
|
1952
|
+
this.speed = 25;
|
|
2045
1953
|
}
|
|
2046
1954
|
load(data) {
|
|
2047
1955
|
if (!data) {
|
|
2048
1956
|
return;
|
|
2049
1957
|
}
|
|
2050
|
-
if (data.
|
|
2051
|
-
this.
|
|
1958
|
+
if (data.backColor !== undefined) {
|
|
1959
|
+
this.backColor = OptionsColor.create(this.backColor, data.backColor);
|
|
2052
1960
|
}
|
|
1961
|
+
this.darken.load(data.darken);
|
|
2053
1962
|
if (data.enable !== undefined) {
|
|
2054
1963
|
this.enable = data.enable;
|
|
2055
1964
|
}
|
|
1965
|
+
this.enlighten.load(data.enlighten);
|
|
1966
|
+
if (data.mode !== undefined) {
|
|
1967
|
+
this.mode = data.mode;
|
|
1968
|
+
}
|
|
2056
1969
|
if (data.speed !== undefined) {
|
|
2057
|
-
this.speed = data.speed;
|
|
1970
|
+
this.speed = setRangeValue(data.speed);
|
|
2058
1971
|
}
|
|
2059
|
-
|
|
2060
|
-
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
1975
|
+
constructor() {
|
|
1976
|
+
super();
|
|
1977
|
+
this.animation = new RotateAnimation;
|
|
1978
|
+
this.direction = "clockwise";
|
|
1979
|
+
this.path = false;
|
|
1980
|
+
this.value = 0;
|
|
1981
|
+
}
|
|
1982
|
+
load(data) {
|
|
1983
|
+
if (!data) {
|
|
1984
|
+
return;
|
|
2061
1985
|
}
|
|
2062
|
-
|
|
2063
|
-
|
|
1986
|
+
super.load(data);
|
|
1987
|
+
if (data.direction !== undefined) {
|
|
1988
|
+
this.direction = data.direction;
|
|
1989
|
+
}
|
|
1990
|
+
this.animation.load(data.animation);
|
|
1991
|
+
if (data.path !== undefined) {
|
|
1992
|
+
this.path = data.path;
|
|
2064
1993
|
}
|
|
2065
1994
|
}
|
|
2066
1995
|
}
|
|
2067
|
-
class
|
|
1996
|
+
class Shape_Shape {
|
|
2068
1997
|
constructor() {
|
|
2069
|
-
this.
|
|
2070
|
-
this.
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
this.
|
|
1998
|
+
this.options = {};
|
|
1999
|
+
this.type = "circle";
|
|
2000
|
+
}
|
|
2001
|
+
get image() {
|
|
2002
|
+
var _a;
|
|
2003
|
+
return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
|
|
2004
|
+
}
|
|
2005
|
+
set image(value) {
|
|
2006
|
+
this.options["image"] = value;
|
|
2007
|
+
this.options["images"] = value;
|
|
2008
|
+
}
|
|
2009
|
+
get custom() {
|
|
2010
|
+
return this.options;
|
|
2011
|
+
}
|
|
2012
|
+
set custom(value) {
|
|
2013
|
+
this.options = value;
|
|
2014
|
+
}
|
|
2015
|
+
get images() {
|
|
2016
|
+
return this.image;
|
|
2017
|
+
}
|
|
2018
|
+
set images(value) {
|
|
2019
|
+
this.image = value;
|
|
2020
|
+
}
|
|
2021
|
+
get stroke() {
|
|
2022
|
+
return [];
|
|
2023
|
+
}
|
|
2024
|
+
set stroke(_value) {}
|
|
2025
|
+
get character() {
|
|
2026
|
+
var _a;
|
|
2027
|
+
return (_a = this.options["character"]) !== null && _a !== void 0 ? _a : this.options["char"];
|
|
2028
|
+
}
|
|
2029
|
+
set character(value) {
|
|
2030
|
+
this.options["character"] = value;
|
|
2031
|
+
this.options["char"] = value;
|
|
2032
|
+
}
|
|
2033
|
+
get polygon() {
|
|
2034
|
+
var _a;
|
|
2035
|
+
return (_a = this.options["polygon"]) !== null && _a !== void 0 ? _a : this.options["star"];
|
|
2036
|
+
}
|
|
2037
|
+
set polygon(value) {
|
|
2038
|
+
this.options["polygon"] = value;
|
|
2039
|
+
this.options["star"] = value;
|
|
2040
|
+
}
|
|
2041
|
+
load(data) {
|
|
2042
|
+
var _a, _b, _c;
|
|
2043
|
+
if (data === undefined) {
|
|
2044
|
+
return;
|
|
2045
|
+
}
|
|
2046
|
+
const options = (_a = data.options) !== null && _a !== void 0 ? _a : data.custom;
|
|
2047
|
+
if (options !== undefined) {
|
|
2048
|
+
for (const shape in options) {
|
|
2049
|
+
const item = options[shape];
|
|
2050
|
+
if (item !== undefined) {
|
|
2051
|
+
this.options[shape] = deepExtend((_b = this.options[shape]) !== null && _b !== void 0 ? _b : {}, item);
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
this.loadShape(data.character, "character", "char", true);
|
|
2056
|
+
this.loadShape(data.polygon, "polygon", "star", false);
|
|
2057
|
+
this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
|
|
2058
|
+
if (data.type !== undefined) {
|
|
2059
|
+
this.type = data.type;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
loadShape(item, mainKey, altKey, altOverride) {
|
|
2063
|
+
var _a, _b, _c, _d;
|
|
2064
|
+
if (item === undefined) {
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
if (item instanceof Array) {
|
|
2068
|
+
if (!(this.options[mainKey] instanceof Array)) {
|
|
2069
|
+
this.options[mainKey] = [];
|
|
2070
|
+
if (!this.options[altKey] || altOverride) {
|
|
2071
|
+
this.options[altKey] = [];
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
|
|
2075
|
+
if (!this.options[altKey] || altOverride) {
|
|
2076
|
+
this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
|
|
2077
|
+
}
|
|
2078
|
+
} else {
|
|
2079
|
+
if (this.options[mainKey] instanceof Array) {
|
|
2080
|
+
this.options[mainKey] = {};
|
|
2081
|
+
if (!this.options[altKey] || altOverride) {
|
|
2082
|
+
this.options[altKey] = {};
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
|
|
2086
|
+
if (!this.options[altKey] || altOverride) {
|
|
2087
|
+
this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
class Size_Size extends(null && ValueWithRandom){
|
|
2093
|
+
constructor() {
|
|
2094
|
+
super();
|
|
2095
|
+
this.animation = new SizeAnimation;
|
|
2096
|
+
this.random.minimumValue = 1;
|
|
2097
|
+
this.value = 3;
|
|
2098
|
+
}
|
|
2099
|
+
get anim() {
|
|
2100
|
+
return this.animation;
|
|
2101
|
+
}
|
|
2102
|
+
set anim(value) {
|
|
2103
|
+
this.animation = value;
|
|
2104
|
+
}
|
|
2105
|
+
load(data) {
|
|
2106
|
+
var _a;
|
|
2107
|
+
if (!data) {
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2110
|
+
super.load(data);
|
|
2111
|
+
const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
|
|
2112
|
+
if (animation !== undefined) {
|
|
2113
|
+
this.animation.load(animation);
|
|
2114
|
+
this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
class Stroke_Stroke {
|
|
2119
|
+
constructor() {
|
|
2120
|
+
this.width = 0;
|
|
2121
|
+
}
|
|
2122
|
+
load(data) {
|
|
2123
|
+
if (data === undefined) {
|
|
2124
|
+
return;
|
|
2125
|
+
}
|
|
2126
|
+
if (data.color !== undefined) {
|
|
2127
|
+
this.color = AnimatableColor.create(this.color, data.color);
|
|
2128
|
+
}
|
|
2129
|
+
if (data.width !== undefined) {
|
|
2130
|
+
this.width = data.width;
|
|
2131
|
+
}
|
|
2132
|
+
if (data.opacity !== undefined) {
|
|
2133
|
+
this.opacity = data.opacity;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
2138
|
+
constructor() {
|
|
2139
|
+
super();
|
|
2140
|
+
this.animation = new TiltAnimation;
|
|
2141
|
+
this.direction = "clockwise";
|
|
2142
|
+
this.enable = false;
|
|
2143
|
+
this.value = 0;
|
|
2144
|
+
}
|
|
2145
|
+
load(data) {
|
|
2146
|
+
if (!data) {
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
super.load(data);
|
|
2150
|
+
this.animation.load(data.animation);
|
|
2151
|
+
if (data.direction !== undefined) {
|
|
2152
|
+
this.direction = data.direction;
|
|
2153
|
+
}
|
|
2154
|
+
if (data.enable !== undefined) {
|
|
2155
|
+
this.enable = data.enable;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
class Wobble_Wobble {
|
|
2160
|
+
constructor() {
|
|
2161
|
+
this.distance = 5;
|
|
2162
|
+
this.enable = false;
|
|
2163
|
+
this.speed = 50;
|
|
2164
|
+
}
|
|
2165
|
+
load(data) {
|
|
2166
|
+
if (!data) {
|
|
2167
|
+
return;
|
|
2168
|
+
}
|
|
2169
|
+
if (data.distance !== undefined) {
|
|
2170
|
+
this.distance = setRangeValue(data.distance);
|
|
2171
|
+
}
|
|
2172
|
+
if (data.enable !== undefined) {
|
|
2173
|
+
this.enable = data.enable;
|
|
2174
|
+
}
|
|
2175
|
+
if (data.speed !== undefined) {
|
|
2176
|
+
this.speed = setRangeValue(data.speed);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
class ZIndex_ZIndex extends(null && ValueWithRandom){
|
|
2181
|
+
constructor() {
|
|
2182
|
+
super();
|
|
2183
|
+
this.opacityRate = 1;
|
|
2184
|
+
this.sizeRate = 1;
|
|
2185
|
+
this.velocityRate = 1;
|
|
2186
|
+
}
|
|
2187
|
+
load(data) {
|
|
2188
|
+
super.load(data);
|
|
2189
|
+
if (!data) {
|
|
2190
|
+
return;
|
|
2191
|
+
}
|
|
2192
|
+
if (data.opacityRate !== undefined) {
|
|
2193
|
+
this.opacityRate = data.opacityRate;
|
|
2194
|
+
}
|
|
2195
|
+
if (data.sizeRate !== undefined) {
|
|
2196
|
+
this.sizeRate = data.sizeRate;
|
|
2197
|
+
}
|
|
2198
|
+
if (data.velocityRate !== undefined) {
|
|
2199
|
+
this.velocityRate = data.velocityRate;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
class ParticlesOptions_ParticlesOptions {
|
|
2204
|
+
constructor() {
|
|
2205
|
+
this.bounce = new Bounce;
|
|
2206
|
+
this.collisions = new Collisions;
|
|
2207
|
+
this.color = new AnimatableColor;
|
|
2208
|
+
this.destroy = new Destroy;
|
|
2209
|
+
this.gradient = [];
|
|
2210
|
+
this.groups = {};
|
|
2075
2211
|
this.life = new Life;
|
|
2076
2212
|
this.links = new Links;
|
|
2077
2213
|
this.move = new Move;
|
|
@@ -2178,30 +2314,244 @@
|
|
|
2178
2314
|
}
|
|
2179
2315
|
}
|
|
2180
2316
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2317
|
+
class Responsive_Responsive {
|
|
2318
|
+
constructor() {
|
|
2319
|
+
this.maxWidth = Infinity;
|
|
2320
|
+
this.options = {};
|
|
2321
|
+
this.mode = "canvas";
|
|
2322
|
+
}
|
|
2323
|
+
load(data) {
|
|
2324
|
+
if (!data) {
|
|
2325
|
+
return;
|
|
2326
|
+
}
|
|
2327
|
+
if (data.maxWidth !== undefined) {
|
|
2328
|
+
this.maxWidth = data.maxWidth;
|
|
2329
|
+
}
|
|
2330
|
+
if (data.mode !== undefined) {
|
|
2331
|
+
if (data.mode === "screen") {
|
|
2332
|
+
this.mode = "screen";
|
|
2333
|
+
} else {
|
|
2334
|
+
this.mode = "canvas";
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
if (data.options !== undefined) {
|
|
2338
|
+
this.options = deepExtend({}, data.options);
|
|
2187
2339
|
}
|
|
2188
2340
|
}
|
|
2189
|
-
}
|
|
2190
|
-
class
|
|
2191
|
-
constructor(
|
|
2192
|
-
|
|
2193
|
-
this.
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
this.
|
|
2203
|
-
|
|
2204
|
-
|
|
2341
|
+
}
|
|
2342
|
+
class Theme_Theme {
|
|
2343
|
+
constructor() {
|
|
2344
|
+
this.name = "";
|
|
2345
|
+
this.default = new ThemeDefault;
|
|
2346
|
+
}
|
|
2347
|
+
load(data) {
|
|
2348
|
+
if (data === undefined) {
|
|
2349
|
+
return;
|
|
2350
|
+
}
|
|
2351
|
+
if (data.name !== undefined) {
|
|
2352
|
+
this.name = data.name;
|
|
2353
|
+
}
|
|
2354
|
+
this.default.load(data.default);
|
|
2355
|
+
if (data.options !== undefined) {
|
|
2356
|
+
this.options = deepExtend({}, data.options);
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
var Options_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2361
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2362
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2363
|
+
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");
|
|
2364
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2365
|
+
value;
|
|
2366
|
+
};
|
|
2367
|
+
var Options_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2368
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2369
|
+
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");
|
|
2370
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2371
|
+
};
|
|
2372
|
+
var _Options_instances, _Options_engine, _Options_findDefaultTheme;
|
|
2373
|
+
class Options_Options {
|
|
2374
|
+
constructor(engine) {
|
|
2375
|
+
_Options_instances.add(this);
|
|
2376
|
+
_Options_engine.set(this, void 0);
|
|
2377
|
+
Options_classPrivateFieldSet(this, _Options_engine, engine, "f");
|
|
2378
|
+
this.autoPlay = true;
|
|
2379
|
+
this.background = new Background;
|
|
2380
|
+
this.backgroundMask = new BackgroundMask;
|
|
2381
|
+
this.fullScreen = new FullScreen;
|
|
2382
|
+
this.detectRetina = true;
|
|
2383
|
+
this.duration = 0;
|
|
2384
|
+
this.fpsLimit = 120;
|
|
2385
|
+
this.interactivity = new Interactivity;
|
|
2386
|
+
this.manualParticles = [];
|
|
2387
|
+
this.motion = new Motion;
|
|
2388
|
+
this.particles = new ParticlesOptions;
|
|
2389
|
+
this.pauseOnBlur = true;
|
|
2390
|
+
this.pauseOnOutsideViewport = true;
|
|
2391
|
+
this.responsive = [];
|
|
2392
|
+
this.style = {};
|
|
2393
|
+
this.themes = [];
|
|
2394
|
+
this.zLayers = 100;
|
|
2395
|
+
}
|
|
2396
|
+
get fps_limit() {
|
|
2397
|
+
return this.fpsLimit;
|
|
2398
|
+
}
|
|
2399
|
+
set fps_limit(value) {
|
|
2400
|
+
this.fpsLimit = value;
|
|
2401
|
+
}
|
|
2402
|
+
get retina_detect() {
|
|
2403
|
+
return this.detectRetina;
|
|
2404
|
+
}
|
|
2405
|
+
set retina_detect(value) {
|
|
2406
|
+
this.detectRetina = value;
|
|
2407
|
+
}
|
|
2408
|
+
get backgroundMode() {
|
|
2409
|
+
return this.fullScreen;
|
|
2410
|
+
}
|
|
2411
|
+
set backgroundMode(value) {
|
|
2412
|
+
this.fullScreen.load(value);
|
|
2413
|
+
}
|
|
2414
|
+
load(data) {
|
|
2415
|
+
var _a, _b, _c, _d, _e;
|
|
2416
|
+
if (data === undefined) {
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
if (data.preset !== undefined) {
|
|
2420
|
+
if (data.preset instanceof Array) {
|
|
2421
|
+
for (const preset of data.preset) {
|
|
2422
|
+
this.importPreset(preset);
|
|
2423
|
+
}
|
|
2424
|
+
} else {
|
|
2425
|
+
this.importPreset(data.preset);
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
if (data.autoPlay !== undefined) {
|
|
2429
|
+
this.autoPlay = data.autoPlay;
|
|
2430
|
+
}
|
|
2431
|
+
const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
|
|
2432
|
+
if (detectRetina !== undefined) {
|
|
2433
|
+
this.detectRetina = detectRetina;
|
|
2434
|
+
}
|
|
2435
|
+
if (data.duration !== undefined) {
|
|
2436
|
+
this.duration = data.duration;
|
|
2437
|
+
}
|
|
2438
|
+
const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
|
|
2439
|
+
if (fpsLimit !== undefined) {
|
|
2440
|
+
this.fpsLimit = fpsLimit;
|
|
2441
|
+
}
|
|
2442
|
+
if (data.pauseOnBlur !== undefined) {
|
|
2443
|
+
this.pauseOnBlur = data.pauseOnBlur;
|
|
2444
|
+
}
|
|
2445
|
+
if (data.pauseOnOutsideViewport !== undefined) {
|
|
2446
|
+
this.pauseOnOutsideViewport = data.pauseOnOutsideViewport;
|
|
2447
|
+
}
|
|
2448
|
+
if (data.zLayers !== undefined) {
|
|
2449
|
+
this.zLayers = data.zLayers;
|
|
2450
|
+
}
|
|
2451
|
+
this.background.load(data.background);
|
|
2452
|
+
const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
|
|
2453
|
+
if (typeof fullScreen === "boolean") {
|
|
2454
|
+
this.fullScreen.enable = fullScreen;
|
|
2455
|
+
} else {
|
|
2456
|
+
this.fullScreen.load(fullScreen);
|
|
2457
|
+
}
|
|
2458
|
+
this.backgroundMask.load(data.backgroundMask);
|
|
2459
|
+
this.interactivity.load(data.interactivity);
|
|
2460
|
+
if (data.manualParticles !== undefined) {
|
|
2461
|
+
this.manualParticles = data.manualParticles.map((t => {
|
|
2462
|
+
const tmp = new ManualParticle;
|
|
2463
|
+
tmp.load(t);
|
|
2464
|
+
return tmp;
|
|
2465
|
+
}));
|
|
2466
|
+
}
|
|
2467
|
+
this.motion.load(data.motion);
|
|
2468
|
+
this.particles.load(data.particles);
|
|
2469
|
+
this.style = deepExtend(this.style, data.style);
|
|
2470
|
+
Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.loadOptions(this, data);
|
|
2471
|
+
if (data.responsive !== undefined) {
|
|
2472
|
+
for (const responsive of data.responsive) {
|
|
2473
|
+
const optResponsive = new Responsive;
|
|
2474
|
+
optResponsive.load(responsive);
|
|
2475
|
+
this.responsive.push(optResponsive);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
this.responsive.sort(((a, b) => a.maxWidth - b.maxWidth));
|
|
2479
|
+
if (data.themes !== undefined) {
|
|
2480
|
+
for (const theme of data.themes) {
|
|
2481
|
+
const optTheme = new Theme;
|
|
2482
|
+
optTheme.load(theme);
|
|
2483
|
+
this.themes.push(optTheme);
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
this.defaultDarkTheme = (_d = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
2487
|
+
this.defaultLightTheme = (_e = Options_classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
2488
|
+
}
|
|
2489
|
+
setTheme(name) {
|
|
2490
|
+
if (name) {
|
|
2491
|
+
const chosenTheme = this.themes.find((theme => theme.name === name));
|
|
2492
|
+
if (chosenTheme) {
|
|
2493
|
+
this.load(chosenTheme.options);
|
|
2494
|
+
}
|
|
2495
|
+
} else {
|
|
2496
|
+
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");
|
|
2497
|
+
if (defaultTheme) {
|
|
2498
|
+
this.load(defaultTheme.options);
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
setResponsive(width, pxRatio, defaultOptions) {
|
|
2503
|
+
this.load(defaultOptions);
|
|
2504
|
+
const responsiveOptions = this.responsive.find((t => t.mode === "screen" && screen ? t.maxWidth * pxRatio > screen.availWidth : t.maxWidth * pxRatio > width));
|
|
2505
|
+
this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
|
|
2506
|
+
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
2507
|
+
}
|
|
2508
|
+
importPreset(preset) {
|
|
2509
|
+
this.load(Options_classPrivateFieldGet(this, _Options_engine, "f").plugins.getPreset(preset));
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
_Options_engine = new WeakMap, _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
2513
|
+
var _a;
|
|
2514
|
+
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"));
|
|
2515
|
+
};
|
|
2516
|
+
var Particle_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2517
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2518
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2519
|
+
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");
|
|
2520
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2521
|
+
value;
|
|
2522
|
+
};
|
|
2523
|
+
var Particle_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2524
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2525
|
+
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");
|
|
2526
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2527
|
+
};
|
|
2528
|
+
var _Particle_engine;
|
|
2529
|
+
const fixOutMode = data => {
|
|
2530
|
+
if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
|
|
2531
|
+
if (data.coord > data.maxCoord - data.radius * 2) {
|
|
2532
|
+
data.setCb(-data.radius);
|
|
2533
|
+
} else if (data.coord < data.radius * 2) {
|
|
2534
|
+
data.setCb(data.radius);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
};
|
|
2538
|
+
class Particle_Particle {
|
|
2539
|
+
constructor(engine, id, container, position, overrideOptions, group) {
|
|
2540
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2541
|
+
this.id = id;
|
|
2542
|
+
this.container = container;
|
|
2543
|
+
this.group = group;
|
|
2544
|
+
_Particle_engine.set(this, void 0);
|
|
2545
|
+
Particle_classPrivateFieldSet(this, _Particle_engine, engine, "f");
|
|
2546
|
+
this.fill = true;
|
|
2547
|
+
this.close = true;
|
|
2548
|
+
this.lastPathTime = 0;
|
|
2549
|
+
this.destroyed = false;
|
|
2550
|
+
this.unbreakable = false;
|
|
2551
|
+
this.splitCount = 0;
|
|
2552
|
+
this.misplaced = false;
|
|
2553
|
+
this.retina = {
|
|
2554
|
+
maxDistance: {}
|
|
2205
2555
|
};
|
|
2206
2556
|
const pxRatio = container.retina.pixelRatio;
|
|
2207
2557
|
const mainOptions = container.actualOptions;
|
|
@@ -2286,7 +2636,7 @@
|
|
|
2286
2636
|
this.sides = 24;
|
|
2287
2637
|
let drawer = container.drawers.get(this.shape);
|
|
2288
2638
|
if (!drawer) {
|
|
2289
|
-
drawer =
|
|
2639
|
+
drawer = Particle_classPrivateFieldGet(this, _Particle_engine, "f").plugins.getShapeDrawer(this.shape);
|
|
2290
2640
|
if (drawer) {
|
|
2291
2641
|
container.drawers.set(this.shape, drawer);
|
|
2292
2642
|
}
|
|
@@ -2526,9 +2876,25 @@
|
|
|
2526
2876
|
return life;
|
|
2527
2877
|
}
|
|
2528
2878
|
}
|
|
2879
|
+
_Particle_engine = new WeakMap;
|
|
2880
|
+
var Particles_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
2881
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2882
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2883
|
+
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");
|
|
2884
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
2885
|
+
value;
|
|
2886
|
+
};
|
|
2887
|
+
var Particles_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
2888
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2889
|
+
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");
|
|
2890
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2891
|
+
};
|
|
2892
|
+
var _Particles_engine;
|
|
2529
2893
|
class Particles_Particles {
|
|
2530
|
-
constructor(container) {
|
|
2894
|
+
constructor(engine, container) {
|
|
2531
2895
|
this.container = container;
|
|
2896
|
+
_Particles_engine.set(this, void 0);
|
|
2897
|
+
Particles_classPrivateFieldSet(this, _Particles_engine, engine, "f");
|
|
2532
2898
|
this.nextId = 0;
|
|
2533
2899
|
this.array = [];
|
|
2534
2900
|
this.zArray = [];
|
|
@@ -2540,11 +2906,11 @@
|
|
|
2540
2906
|
links: new Map,
|
|
2541
2907
|
triangles: new Map
|
|
2542
2908
|
};
|
|
2543
|
-
this.interactionManager = new InteractionManager(container);
|
|
2909
|
+
this.interactionManager = new InteractionManager(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), container);
|
|
2544
2910
|
const canvasSize = this.container.canvas.size;
|
|
2545
2911
|
this.linksColors = new Map;
|
|
2546
2912
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
|
|
2547
|
-
this.updaters =
|
|
2913
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
2548
2914
|
}
|
|
2549
2915
|
get count() {
|
|
2550
2916
|
return this.array.length;
|
|
@@ -2558,7 +2924,7 @@
|
|
|
2558
2924
|
this.freqs.links = new Map;
|
|
2559
2925
|
this.freqs.triangles = new Map;
|
|
2560
2926
|
let handled = false;
|
|
2561
|
-
this.updaters =
|
|
2927
|
+
this.updaters = Particles_classPrivateFieldGet(this, _Particles_engine, "f").plugins.getUpdaters(container, true);
|
|
2562
2928
|
this.interactionManager.init();
|
|
2563
2929
|
for (const [, plugin] of container.plugins) {
|
|
2564
2930
|
if (plugin.particlesInitialization !== undefined) {
|
|
@@ -2710,505 +3076,226 @@
|
|
|
2710
3076
|
options.size.value.min /= factor;
|
|
2711
3077
|
options.size.value.max /= factor;
|
|
2712
3078
|
}
|
|
2713
|
-
options.load(splitOptions.particles);
|
|
2714
|
-
const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
|
|
2715
|
-
const position = {
|
|
2716
|
-
x: parent.position.x + randomInRange(offset),
|
|
2717
|
-
y: parent.position.y + randomInRange(offset)
|
|
2718
|
-
};
|
|
2719
|
-
return this.pushParticle(position, options, parent.group, (particle => {
|
|
2720
|
-
if (particle.size.value < .5) {
|
|
2721
|
-
return false;
|
|
2722
|
-
}
|
|
2723
|
-
particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
|
|
2724
|
-
particle.splitCount = parent.splitCount + 1;
|
|
2725
|
-
particle.unbreakable = true;
|
|
2726
|
-
setTimeout((() => {
|
|
2727
|
-
particle.unbreakable = false;
|
|
2728
|
-
}), 500);
|
|
2729
|
-
return true;
|
|
2730
|
-
}));
|
|
2731
|
-
}
|
|
2732
|
-
removeQuantity(quantity, group) {
|
|
2733
|
-
this.removeAt(0, quantity, group);
|
|
2734
|
-
}
|
|
2735
|
-
getLinkFrequency(p1, p2) {
|
|
2736
|
-
const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
|
|
2737
|
-
let res = this.freqs.links.get(key);
|
|
2738
|
-
if (res === undefined) {
|
|
2739
|
-
res = Math.random();
|
|
2740
|
-
this.freqs.links.set(key, res);
|
|
2741
|
-
}
|
|
2742
|
-
return res;
|
|
2743
|
-
}
|
|
2744
|
-
getTriangleFrequency(p1, p2, p3) {
|
|
2745
|
-
let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
|
|
2746
|
-
if (id1 > id2) {
|
|
2747
|
-
[id2, id1] = [ id1, id2 ];
|
|
2748
|
-
}
|
|
2749
|
-
if (id2 > id3) {
|
|
2750
|
-
[id3, id2] = [ id2, id3 ];
|
|
2751
|
-
}
|
|
2752
|
-
if (id1 > id3) {
|
|
2753
|
-
[id3, id1] = [ id1, id3 ];
|
|
2754
|
-
}
|
|
2755
|
-
const key = `${id1}_${id2}_${id3}`;
|
|
2756
|
-
let res = this.freqs.triangles.get(key);
|
|
2757
|
-
if (res === undefined) {
|
|
2758
|
-
res = Math.random();
|
|
2759
|
-
this.freqs.triangles.set(key, res);
|
|
2760
|
-
}
|
|
2761
|
-
return res;
|
|
2762
|
-
}
|
|
2763
|
-
addManualParticles() {
|
|
2764
|
-
const container = this.container, options = container.actualOptions;
|
|
2765
|
-
for (const particle of options.manualParticles) {
|
|
2766
|
-
const pos = particle.position ? {
|
|
2767
|
-
x: particle.position.x * container.canvas.size.width / 100,
|
|
2768
|
-
y: particle.position.y * container.canvas.size.height / 100
|
|
2769
|
-
} : undefined;
|
|
2770
|
-
this.addParticle(pos, particle.options);
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
setDensity() {
|
|
2774
|
-
const options = this.container.actualOptions;
|
|
2775
|
-
for (const group in options.particles.groups) {
|
|
2776
|
-
this.applyDensity(options.particles.groups[group], 0, group);
|
|
2777
|
-
}
|
|
2778
|
-
this.applyDensity(options.particles, options.manualParticles.length);
|
|
2779
|
-
}
|
|
2780
|
-
applyDensity(options, manualCount, group) {
|
|
2781
|
-
var _a;
|
|
2782
|
-
if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
|
|
2783
|
-
return;
|
|
2784
|
-
}
|
|
2785
|
-
const numberOptions = options.number;
|
|
2786
|
-
const densityFactor = this.initDensityFactor(numberOptions.density);
|
|
2787
|
-
const optParticlesNumber = numberOptions.value;
|
|
2788
|
-
const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
|
|
2789
|
-
const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
|
|
2790
|
-
const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
|
|
2791
|
-
this.limit = numberOptions.limit * densityFactor;
|
|
2792
|
-
if (particlesCount < particlesNumber) {
|
|
2793
|
-
this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
|
|
2794
|
-
} else if (particlesCount > particlesNumber) {
|
|
2795
|
-
this.removeQuantity(particlesCount - particlesNumber, group);
|
|
2796
|
-
}
|
|
2797
|
-
}
|
|
2798
|
-
initDensityFactor(densityOptions) {
|
|
2799
|
-
const container = this.container;
|
|
2800
|
-
if (!container.canvas.element || !densityOptions.enable) {
|
|
2801
|
-
return 1;
|
|
2802
|
-
}
|
|
2803
|
-
const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
|
|
2804
|
-
return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
|
|
2805
|
-
}
|
|
2806
|
-
pushParticle(position, overrideOptions, group, initializer) {
|
|
2807
|
-
try {
|
|
2808
|
-
const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
|
|
2809
|
-
let canAdd = true;
|
|
2810
|
-
if (initializer) {
|
|
2811
|
-
canAdd = initializer(particle);
|
|
2812
|
-
}
|
|
2813
|
-
if (!canAdd) {
|
|
2814
|
-
return;
|
|
2815
|
-
}
|
|
2816
|
-
this.array.push(particle);
|
|
2817
|
-
this.zArray.push(particle);
|
|
2818
|
-
this.nextId++;
|
|
2819
|
-
return particle;
|
|
2820
|
-
} catch (e) {
|
|
2821
|
-
console.warn(`error adding particle: ${e}`);
|
|
2822
|
-
return;
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
class Retina_Retina {
|
|
2827
|
-
constructor(container) {
|
|
2828
|
-
this.container = container;
|
|
2829
|
-
}
|
|
2830
|
-
init() {
|
|
2831
|
-
const container = this.container;
|
|
2832
|
-
const options = container.actualOptions;
|
|
2833
|
-
this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
|
|
2834
|
-
const motionOptions = this.container.actualOptions.motion;
|
|
2835
|
-
if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
|
|
2836
|
-
if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
|
|
2837
|
-
this.reduceFactor = 1;
|
|
2838
|
-
} else {
|
|
2839
|
-
const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
|
|
2840
|
-
if (mediaQuery) {
|
|
2841
|
-
this.handleMotionChange(mediaQuery);
|
|
2842
|
-
const handleChange = () => {
|
|
2843
|
-
this.handleMotionChange(mediaQuery);
|
|
2844
|
-
container.refresh().catch((() => {}));
|
|
2845
|
-
};
|
|
2846
|
-
if (mediaQuery.addEventListener !== undefined) {
|
|
2847
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
2848
|
-
} else if (mediaQuery.addListener !== undefined) {
|
|
2849
|
-
mediaQuery.addListener(handleChange);
|
|
2850
|
-
}
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2853
|
-
} else {
|
|
2854
|
-
this.reduceFactor = 1;
|
|
2855
|
-
}
|
|
2856
|
-
const ratio = this.pixelRatio;
|
|
2857
|
-
if (container.canvas.element) {
|
|
2858
|
-
const element = container.canvas.element;
|
|
2859
|
-
container.canvas.size.width = element.offsetWidth * ratio;
|
|
2860
|
-
container.canvas.size.height = element.offsetHeight * ratio;
|
|
2861
|
-
}
|
|
2862
|
-
const particles = options.particles;
|
|
2863
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
2864
|
-
this.linksDistance = particles.links.distance * ratio;
|
|
2865
|
-
this.linksWidth = particles.links.width * ratio;
|
|
2866
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
2867
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
2868
|
-
if (particles.orbit.radius !== undefined) {
|
|
2869
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
2870
|
-
}
|
|
2871
|
-
const modes = options.interactivity.modes;
|
|
2872
|
-
this.connectModeDistance = modes.connect.distance * ratio;
|
|
2873
|
-
this.connectModeRadius = modes.connect.radius * ratio;
|
|
2874
|
-
this.grabModeDistance = modes.grab.distance * ratio;
|
|
2875
|
-
this.repulseModeDistance = modes.repulse.distance * ratio;
|
|
2876
|
-
this.bounceModeDistance = modes.bounce.distance * ratio;
|
|
2877
|
-
this.attractModeDistance = modes.attract.distance * ratio;
|
|
2878
|
-
this.slowModeRadius = modes.slow.radius * ratio;
|
|
2879
|
-
this.bubbleModeDistance = modes.bubble.distance * ratio;
|
|
2880
|
-
if (modes.bubble.size) {
|
|
2881
|
-
this.bubbleModeSize = modes.bubble.size * ratio;
|
|
2882
|
-
}
|
|
2883
|
-
}
|
|
2884
|
-
initParticle(particle) {
|
|
2885
|
-
const options = particle.options;
|
|
2886
|
-
const ratio = this.pixelRatio;
|
|
2887
|
-
const moveDistance = options.move.distance;
|
|
2888
|
-
const props = particle.retina;
|
|
2889
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
2890
|
-
props.linksDistance = options.links.distance * ratio;
|
|
2891
|
-
props.linksWidth = options.links.width * ratio;
|
|
2892
|
-
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
2893
|
-
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
2894
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
2895
|
-
if (particle.spin) {
|
|
2896
|
-
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
2897
|
-
}
|
|
2898
|
-
const maxDistance = props.maxDistance;
|
|
2899
|
-
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
2900
|
-
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
2901
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
2902
|
-
}
|
|
2903
|
-
handleMotionChange(mediaQuery) {
|
|
2904
|
-
const options = this.container.actualOptions;
|
|
2905
|
-
if (mediaQuery.matches) {
|
|
2906
|
-
const motion = options.motion;
|
|
2907
|
-
this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
|
|
2908
|
-
} else {
|
|
2909
|
-
this.reduceFactor = 1;
|
|
2910
|
-
}
|
|
2911
|
-
}
|
|
2912
|
-
}
|
|
2913
|
-
class Trail_Trail {
|
|
2914
|
-
constructor() {
|
|
2915
|
-
this.delay = 1;
|
|
2916
|
-
this.pauseOnStop = false;
|
|
2917
|
-
this.quantity = 1;
|
|
2918
|
-
}
|
|
2919
|
-
load(data) {
|
|
2920
|
-
if (data === undefined) {
|
|
2921
|
-
return;
|
|
2922
|
-
}
|
|
2923
|
-
if (data.delay !== undefined) {
|
|
2924
|
-
this.delay = data.delay;
|
|
2925
|
-
}
|
|
2926
|
-
if (data.quantity !== undefined) {
|
|
2927
|
-
this.quantity = data.quantity;
|
|
2928
|
-
}
|
|
2929
|
-
if (data.particles !== undefined) {
|
|
2930
|
-
this.particles = deepExtend({}, data.particles);
|
|
2931
|
-
}
|
|
2932
|
-
if (data.pauseOnStop !== undefined) {
|
|
2933
|
-
this.pauseOnStop = data.pauseOnStop;
|
|
2934
|
-
}
|
|
2935
|
-
}
|
|
2936
|
-
}
|
|
2937
|
-
class Modes_Modes {
|
|
2938
|
-
constructor() {
|
|
2939
|
-
this.attract = new Attract;
|
|
2940
|
-
this.bounce = new Bounce;
|
|
2941
|
-
this.bubble = new Bubble;
|
|
2942
|
-
this.connect = new Connect;
|
|
2943
|
-
this.grab = new Grab;
|
|
2944
|
-
this.light = new Light;
|
|
2945
|
-
this.push = new Push;
|
|
2946
|
-
this.remove = new Remove;
|
|
2947
|
-
this.repulse = new Repulse;
|
|
2948
|
-
this.slow = new Slow;
|
|
2949
|
-
this.trail = new Trail;
|
|
2950
|
-
}
|
|
2951
|
-
load(data) {
|
|
2952
|
-
if (data === undefined) {
|
|
2953
|
-
return;
|
|
2954
|
-
}
|
|
2955
|
-
this.attract.load(data.attract);
|
|
2956
|
-
this.bubble.load(data.bubble);
|
|
2957
|
-
this.connect.load(data.connect);
|
|
2958
|
-
this.grab.load(data.grab);
|
|
2959
|
-
this.light.load(data.light);
|
|
2960
|
-
this.push.load(data.push);
|
|
2961
|
-
this.remove.load(data.remove);
|
|
2962
|
-
this.repulse.load(data.repulse);
|
|
2963
|
-
this.slow.load(data.slow);
|
|
2964
|
-
this.trail.load(data.trail);
|
|
2965
|
-
}
|
|
2966
|
-
}
|
|
2967
|
-
class Interactivity_Interactivity {
|
|
2968
|
-
constructor() {
|
|
2969
|
-
this.detectsOn = "window";
|
|
2970
|
-
this.events = new Events;
|
|
2971
|
-
this.modes = new Modes;
|
|
2972
|
-
}
|
|
2973
|
-
get detect_on() {
|
|
2974
|
-
return this.detectsOn;
|
|
2975
|
-
}
|
|
2976
|
-
set detect_on(value) {
|
|
2977
|
-
this.detectsOn = value;
|
|
2978
|
-
}
|
|
2979
|
-
load(data) {
|
|
2980
|
-
var _a, _b, _c;
|
|
2981
|
-
if (data === undefined) {
|
|
2982
|
-
return;
|
|
2983
|
-
}
|
|
2984
|
-
const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
|
|
2985
|
-
if (detectsOn !== undefined) {
|
|
2986
|
-
this.detectsOn = detectsOn;
|
|
2987
|
-
}
|
|
2988
|
-
this.events.load(data.events);
|
|
2989
|
-
this.modes.load(data.modes);
|
|
2990
|
-
if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
|
|
2991
|
-
if (this.events.onHover.mode instanceof Array) {
|
|
2992
|
-
if (this.events.onHover.mode.indexOf("slow") < 0) {
|
|
2993
|
-
this.events.onHover.mode.push("slow");
|
|
2994
|
-
}
|
|
2995
|
-
} else if (this.events.onHover.mode !== "slow") {
|
|
2996
|
-
this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
|
|
2997
|
-
}
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
}
|
|
3001
|
-
class Theme_Theme {
|
|
3002
|
-
constructor() {
|
|
3003
|
-
this.name = "";
|
|
3004
|
-
this.default = new ThemeDefault;
|
|
3005
|
-
}
|
|
3006
|
-
load(data) {
|
|
3007
|
-
if (data === undefined) {
|
|
3008
|
-
return;
|
|
3009
|
-
}
|
|
3010
|
-
if (data.name !== undefined) {
|
|
3011
|
-
this.name = data.name;
|
|
3012
|
-
}
|
|
3013
|
-
this.default.load(data.default);
|
|
3014
|
-
if (data.options !== undefined) {
|
|
3015
|
-
this.options = deepExtend({}, data.options);
|
|
3016
|
-
}
|
|
3017
|
-
}
|
|
3018
|
-
}
|
|
3019
|
-
class ManualParticle_ManualParticle {
|
|
3020
|
-
load(data) {
|
|
3021
|
-
var _a, _b;
|
|
3022
|
-
if (!data) {
|
|
3023
|
-
return;
|
|
3024
|
-
}
|
|
3025
|
-
if (data.position !== undefined) {
|
|
3026
|
-
this.position = {
|
|
3027
|
-
x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
|
|
3028
|
-
y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
|
|
3029
|
-
};
|
|
3030
|
-
}
|
|
3031
|
-
if (data.options !== undefined) {
|
|
3032
|
-
this.options = deepExtend({}, data.options);
|
|
3033
|
-
}
|
|
3034
|
-
}
|
|
3035
|
-
}
|
|
3036
|
-
class Responsive_Responsive {
|
|
3037
|
-
constructor() {
|
|
3038
|
-
this.maxWidth = Infinity;
|
|
3039
|
-
this.options = {};
|
|
3040
|
-
this.mode = "canvas";
|
|
3041
|
-
}
|
|
3042
|
-
load(data) {
|
|
3043
|
-
if (!data) {
|
|
3044
|
-
return;
|
|
3045
|
-
}
|
|
3046
|
-
if (data.maxWidth !== undefined) {
|
|
3047
|
-
this.maxWidth = data.maxWidth;
|
|
3048
|
-
}
|
|
3049
|
-
if (data.mode !== undefined) {
|
|
3050
|
-
if (data.mode === "screen") {
|
|
3051
|
-
this.mode = "screen";
|
|
3052
|
-
} else {
|
|
3053
|
-
this.mode = "canvas";
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
|
-
if (data.options !== undefined) {
|
|
3057
|
-
this.options = deepExtend({}, data.options);
|
|
3058
|
-
}
|
|
3059
|
-
}
|
|
3060
|
-
}
|
|
3061
|
-
var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3062
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3063
|
-
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");
|
|
3064
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3065
|
-
};
|
|
3066
|
-
var _Options_instances, _Options_findDefaultTheme;
|
|
3067
|
-
class Options_Options {
|
|
3068
|
-
constructor() {
|
|
3069
|
-
_Options_instances.add(this);
|
|
3070
|
-
this.autoPlay = true;
|
|
3071
|
-
this.background = new Background;
|
|
3072
|
-
this.backgroundMask = new BackgroundMask;
|
|
3073
|
-
this.fullScreen = new FullScreen;
|
|
3074
|
-
this.detectRetina = true;
|
|
3075
|
-
this.duration = 0;
|
|
3076
|
-
this.fpsLimit = 60;
|
|
3077
|
-
this.interactivity = new Interactivity;
|
|
3078
|
-
this.manualParticles = [];
|
|
3079
|
-
this.motion = new Motion;
|
|
3080
|
-
this.particles = new ParticlesOptions;
|
|
3081
|
-
this.pauseOnBlur = true;
|
|
3082
|
-
this.pauseOnOutsideViewport = true;
|
|
3083
|
-
this.responsive = [];
|
|
3084
|
-
this.style = {};
|
|
3085
|
-
this.themes = [];
|
|
3086
|
-
this.zLayers = 100;
|
|
3087
|
-
}
|
|
3088
|
-
get fps_limit() {
|
|
3089
|
-
return this.fpsLimit;
|
|
3090
|
-
}
|
|
3091
|
-
set fps_limit(value) {
|
|
3092
|
-
this.fpsLimit = value;
|
|
3093
|
-
}
|
|
3094
|
-
get retina_detect() {
|
|
3095
|
-
return this.detectRetina;
|
|
3096
|
-
}
|
|
3097
|
-
set retina_detect(value) {
|
|
3098
|
-
this.detectRetina = value;
|
|
3099
|
-
}
|
|
3100
|
-
get backgroundMode() {
|
|
3101
|
-
return this.fullScreen;
|
|
3102
|
-
}
|
|
3103
|
-
set backgroundMode(value) {
|
|
3104
|
-
this.fullScreen.load(value);
|
|
3105
|
-
}
|
|
3106
|
-
load(data) {
|
|
3107
|
-
var _a, _b, _c, _d, _e;
|
|
3108
|
-
if (data === undefined) {
|
|
3109
|
-
return;
|
|
3110
|
-
}
|
|
3111
|
-
if (data.preset !== undefined) {
|
|
3112
|
-
if (data.preset instanceof Array) {
|
|
3113
|
-
for (const preset of data.preset) {
|
|
3114
|
-
this.importPreset(preset);
|
|
3115
|
-
}
|
|
3116
|
-
} else {
|
|
3117
|
-
this.importPreset(data.preset);
|
|
3079
|
+
options.load(splitOptions.particles);
|
|
3080
|
+
const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
|
|
3081
|
+
const position = {
|
|
3082
|
+
x: parent.position.x + randomInRange(offset),
|
|
3083
|
+
y: parent.position.y + randomInRange(offset)
|
|
3084
|
+
};
|
|
3085
|
+
return this.pushParticle(position, options, parent.group, (particle => {
|
|
3086
|
+
if (particle.size.value < .5) {
|
|
3087
|
+
return false;
|
|
3118
3088
|
}
|
|
3089
|
+
particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
|
|
3090
|
+
particle.splitCount = parent.splitCount + 1;
|
|
3091
|
+
particle.unbreakable = true;
|
|
3092
|
+
setTimeout((() => {
|
|
3093
|
+
particle.unbreakable = false;
|
|
3094
|
+
}), 500);
|
|
3095
|
+
return true;
|
|
3096
|
+
}));
|
|
3097
|
+
}
|
|
3098
|
+
removeQuantity(quantity, group) {
|
|
3099
|
+
this.removeAt(0, quantity, group);
|
|
3100
|
+
}
|
|
3101
|
+
getLinkFrequency(p1, p2) {
|
|
3102
|
+
const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
|
|
3103
|
+
let res = this.freqs.links.get(key);
|
|
3104
|
+
if (res === undefined) {
|
|
3105
|
+
res = Math.random();
|
|
3106
|
+
this.freqs.links.set(key, res);
|
|
3119
3107
|
}
|
|
3120
|
-
|
|
3121
|
-
|
|
3108
|
+
return res;
|
|
3109
|
+
}
|
|
3110
|
+
getTriangleFrequency(p1, p2, p3) {
|
|
3111
|
+
let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
|
|
3112
|
+
if (id1 > id2) {
|
|
3113
|
+
[id2, id1] = [ id1, id2 ];
|
|
3122
3114
|
}
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
this.detectRetina = detectRetina;
|
|
3115
|
+
if (id2 > id3) {
|
|
3116
|
+
[id3, id2] = [ id2, id3 ];
|
|
3126
3117
|
}
|
|
3127
|
-
if (
|
|
3128
|
-
|
|
3118
|
+
if (id1 > id3) {
|
|
3119
|
+
[id3, id1] = [ id1, id3 ];
|
|
3129
3120
|
}
|
|
3130
|
-
const
|
|
3131
|
-
|
|
3132
|
-
|
|
3121
|
+
const key = `${id1}_${id2}_${id3}`;
|
|
3122
|
+
let res = this.freqs.triangles.get(key);
|
|
3123
|
+
if (res === undefined) {
|
|
3124
|
+
res = Math.random();
|
|
3125
|
+
this.freqs.triangles.set(key, res);
|
|
3133
3126
|
}
|
|
3134
|
-
|
|
3135
|
-
|
|
3127
|
+
return res;
|
|
3128
|
+
}
|
|
3129
|
+
addManualParticles() {
|
|
3130
|
+
const container = this.container, options = container.actualOptions;
|
|
3131
|
+
for (const particle of options.manualParticles) {
|
|
3132
|
+
const pos = particle.position ? {
|
|
3133
|
+
x: particle.position.x * container.canvas.size.width / 100,
|
|
3134
|
+
y: particle.position.y * container.canvas.size.height / 100
|
|
3135
|
+
} : undefined;
|
|
3136
|
+
this.addParticle(pos, particle.options);
|
|
3136
3137
|
}
|
|
3137
|
-
|
|
3138
|
-
|
|
3138
|
+
}
|
|
3139
|
+
setDensity() {
|
|
3140
|
+
const options = this.container.actualOptions;
|
|
3141
|
+
for (const group in options.particles.groups) {
|
|
3142
|
+
this.applyDensity(options.particles.groups[group], 0, group);
|
|
3139
3143
|
}
|
|
3140
|
-
|
|
3141
|
-
|
|
3144
|
+
this.applyDensity(options.particles, options.manualParticles.length);
|
|
3145
|
+
}
|
|
3146
|
+
applyDensity(options, manualCount, group) {
|
|
3147
|
+
var _a;
|
|
3148
|
+
if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
|
|
3149
|
+
return;
|
|
3142
3150
|
}
|
|
3143
|
-
|
|
3144
|
-
const
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3151
|
+
const numberOptions = options.number;
|
|
3152
|
+
const densityFactor = this.initDensityFactor(numberOptions.density);
|
|
3153
|
+
const optParticlesNumber = numberOptions.value;
|
|
3154
|
+
const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
|
|
3155
|
+
const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
|
|
3156
|
+
const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
|
|
3157
|
+
this.limit = numberOptions.limit * densityFactor;
|
|
3158
|
+
if (particlesCount < particlesNumber) {
|
|
3159
|
+
this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
|
|
3160
|
+
} else if (particlesCount > particlesNumber) {
|
|
3161
|
+
this.removeQuantity(particlesCount - particlesNumber, group);
|
|
3149
3162
|
}
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
tmp.load(t);
|
|
3156
|
-
return tmp;
|
|
3157
|
-
}));
|
|
3163
|
+
}
|
|
3164
|
+
initDensityFactor(densityOptions) {
|
|
3165
|
+
const container = this.container;
|
|
3166
|
+
if (!container.canvas.element || !densityOptions.enable) {
|
|
3167
|
+
return 1;
|
|
3158
3168
|
}
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3169
|
+
const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
|
|
3170
|
+
return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
|
|
3171
|
+
}
|
|
3172
|
+
pushParticle(position, overrideOptions, group, initializer) {
|
|
3173
|
+
try {
|
|
3174
|
+
const particle = new Particle(Particles_classPrivateFieldGet(this, _Particles_engine, "f"), this.nextId, this.container, position, overrideOptions, group);
|
|
3175
|
+
let canAdd = true;
|
|
3176
|
+
if (initializer) {
|
|
3177
|
+
canAdd = initializer(particle);
|
|
3168
3178
|
}
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
if (data.themes !== undefined) {
|
|
3172
|
-
for (const theme of data.themes) {
|
|
3173
|
-
const optTheme = new Theme;
|
|
3174
|
-
optTheme.load(theme);
|
|
3175
|
-
this.themes.push(optTheme);
|
|
3179
|
+
if (!canAdd) {
|
|
3180
|
+
return;
|
|
3176
3181
|
}
|
|
3182
|
+
this.array.push(particle);
|
|
3183
|
+
this.zArray.push(particle);
|
|
3184
|
+
this.nextId++;
|
|
3185
|
+
return particle;
|
|
3186
|
+
} catch (e) {
|
|
3187
|
+
console.warn(`error adding particle: ${e}`);
|
|
3188
|
+
return;
|
|
3177
3189
|
}
|
|
3178
|
-
this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
3179
|
-
this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
3180
3190
|
}
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3191
|
+
}
|
|
3192
|
+
_Particles_engine = new WeakMap;
|
|
3193
|
+
class Retina_Retina {
|
|
3194
|
+
constructor(container) {
|
|
3195
|
+
this.container = container;
|
|
3196
|
+
}
|
|
3197
|
+
init() {
|
|
3198
|
+
const container = this.container;
|
|
3199
|
+
const options = container.actualOptions;
|
|
3200
|
+
this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
|
|
3201
|
+
const motionOptions = this.container.actualOptions.motion;
|
|
3202
|
+
if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
|
|
3203
|
+
if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
|
|
3204
|
+
this.reduceFactor = 1;
|
|
3205
|
+
} else {
|
|
3206
|
+
const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
|
|
3207
|
+
if (mediaQuery) {
|
|
3208
|
+
this.handleMotionChange(mediaQuery);
|
|
3209
|
+
const handleChange = () => {
|
|
3210
|
+
this.handleMotionChange(mediaQuery);
|
|
3211
|
+
container.refresh().catch((() => {}));
|
|
3212
|
+
};
|
|
3213
|
+
if (mediaQuery.addEventListener !== undefined) {
|
|
3214
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
3215
|
+
} else if (mediaQuery.addListener !== undefined) {
|
|
3216
|
+
mediaQuery.addListener(handleChange);
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3186
3219
|
}
|
|
3187
3220
|
} else {
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3221
|
+
this.reduceFactor = 1;
|
|
3222
|
+
}
|
|
3223
|
+
const ratio = this.pixelRatio;
|
|
3224
|
+
if (container.canvas.element) {
|
|
3225
|
+
const element = container.canvas.element;
|
|
3226
|
+
container.canvas.size.width = element.offsetWidth * ratio;
|
|
3227
|
+
container.canvas.size.height = element.offsetHeight * ratio;
|
|
3228
|
+
}
|
|
3229
|
+
const particles = options.particles;
|
|
3230
|
+
this.attractDistance = particles.move.attract.distance * ratio;
|
|
3231
|
+
this.linksDistance = particles.links.distance * ratio;
|
|
3232
|
+
this.linksWidth = particles.links.width * ratio;
|
|
3233
|
+
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
3234
|
+
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
3235
|
+
if (particles.orbit.radius !== undefined) {
|
|
3236
|
+
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
3237
|
+
}
|
|
3238
|
+
const modes = options.interactivity.modes;
|
|
3239
|
+
this.connectModeDistance = modes.connect.distance * ratio;
|
|
3240
|
+
this.connectModeRadius = modes.connect.radius * ratio;
|
|
3241
|
+
this.grabModeDistance = modes.grab.distance * ratio;
|
|
3242
|
+
this.repulseModeDistance = modes.repulse.distance * ratio;
|
|
3243
|
+
this.bounceModeDistance = modes.bounce.distance * ratio;
|
|
3244
|
+
this.attractModeDistance = modes.attract.distance * ratio;
|
|
3245
|
+
this.slowModeRadius = modes.slow.radius * ratio;
|
|
3246
|
+
this.bubbleModeDistance = modes.bubble.distance * ratio;
|
|
3247
|
+
if (modes.bubble.size) {
|
|
3248
|
+
this.bubbleModeSize = modes.bubble.size * ratio;
|
|
3192
3249
|
}
|
|
3193
3250
|
}
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
const
|
|
3197
|
-
|
|
3198
|
-
|
|
3251
|
+
initParticle(particle) {
|
|
3252
|
+
const options = particle.options;
|
|
3253
|
+
const ratio = this.pixelRatio;
|
|
3254
|
+
const moveDistance = options.move.distance;
|
|
3255
|
+
const props = particle.retina;
|
|
3256
|
+
props.attractDistance = options.move.attract.distance * ratio;
|
|
3257
|
+
props.linksDistance = options.links.distance * ratio;
|
|
3258
|
+
props.linksWidth = options.links.width * ratio;
|
|
3259
|
+
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
3260
|
+
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
3261
|
+
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
3262
|
+
if (particle.spin) {
|
|
3263
|
+
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
3264
|
+
}
|
|
3265
|
+
const maxDistance = props.maxDistance;
|
|
3266
|
+
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
3267
|
+
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
3268
|
+
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
3199
3269
|
}
|
|
3200
|
-
|
|
3201
|
-
this.
|
|
3270
|
+
handleMotionChange(mediaQuery) {
|
|
3271
|
+
const options = this.container.actualOptions;
|
|
3272
|
+
if (mediaQuery.matches) {
|
|
3273
|
+
const motion = options.motion;
|
|
3274
|
+
this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
|
|
3275
|
+
} else {
|
|
3276
|
+
this.reduceFactor = 1;
|
|
3277
|
+
}
|
|
3202
3278
|
}
|
|
3203
3279
|
}
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3280
|
+
var Container_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3281
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3282
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3283
|
+
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");
|
|
3284
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3285
|
+
value;
|
|
3286
|
+
};
|
|
3287
|
+
var Container_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3288
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3289
|
+
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");
|
|
3290
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3207
3291
|
};
|
|
3292
|
+
var _Container_engine;
|
|
3208
3293
|
class Container_Container {
|
|
3209
|
-
constructor(id, sourceOptions, ...presets) {
|
|
3294
|
+
constructor(engine, id, sourceOptions, ...presets) {
|
|
3210
3295
|
this.id = id;
|
|
3211
|
-
this
|
|
3296
|
+
_Container_engine.set(this, void 0);
|
|
3297
|
+
Container_classPrivateFieldSet(this, _Container_engine, engine, "f");
|
|
3298
|
+
this.fpsLimit = 120;
|
|
3212
3299
|
this.duration = 0;
|
|
3213
3300
|
this.lifeTime = 0;
|
|
3214
3301
|
this.firstStart = true;
|
|
@@ -3222,7 +3309,7 @@
|
|
|
3222
3309
|
this._initialSourceOptions = sourceOptions;
|
|
3223
3310
|
this.retina = new Retina(this);
|
|
3224
3311
|
this.canvas = new Canvas(this);
|
|
3225
|
-
this.particles = new Particles(this);
|
|
3312
|
+
this.particles = new Particles(Container_classPrivateFieldGet(this, _Container_engine, "f"), this);
|
|
3226
3313
|
this.drawer = new FrameManager(this);
|
|
3227
3314
|
this.presets = presets;
|
|
3228
3315
|
this.pathGenerator = {
|
|
@@ -3251,8 +3338,8 @@
|
|
|
3251
3338
|
this.plugins = new Map;
|
|
3252
3339
|
this.drawers = new Map;
|
|
3253
3340
|
this.density = 1;
|
|
3254
|
-
this._options = new Options;
|
|
3255
|
-
this.actualOptions = new Options;
|
|
3341
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3342
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3256
3343
|
this.eventListeners = new EventListeners(this);
|
|
3257
3344
|
if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
|
|
3258
3345
|
this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
|
|
@@ -3367,7 +3454,7 @@
|
|
|
3367
3454
|
return this.start();
|
|
3368
3455
|
}
|
|
3369
3456
|
reset() {
|
|
3370
|
-
this._options = new Options;
|
|
3457
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3371
3458
|
return this.refresh();
|
|
3372
3459
|
}
|
|
3373
3460
|
stop() {
|
|
@@ -3381,7 +3468,7 @@
|
|
|
3381
3468
|
this.particles.clear();
|
|
3382
3469
|
this.canvas.clear();
|
|
3383
3470
|
if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
|
|
3384
|
-
this.intersectionObserver.
|
|
3471
|
+
this.intersectionObserver.unobserve(this.interactivity.element);
|
|
3385
3472
|
}
|
|
3386
3473
|
for (const [, plugin] of this.plugins) {
|
|
3387
3474
|
if (plugin.stop) {
|
|
@@ -3508,20 +3595,20 @@
|
|
|
3508
3595
|
return false;
|
|
3509
3596
|
}
|
|
3510
3597
|
async init() {
|
|
3511
|
-
this._options = new Options;
|
|
3598
|
+
this._options = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3512
3599
|
for (const preset of this.presets) {
|
|
3513
|
-
this._options.load(
|
|
3600
|
+
this._options.load(Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPreset(preset));
|
|
3514
3601
|
}
|
|
3515
|
-
const shapes =
|
|
3602
|
+
const shapes = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getSupportedShapes();
|
|
3516
3603
|
for (const type of shapes) {
|
|
3517
|
-
const drawer =
|
|
3604
|
+
const drawer = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getShapeDrawer(type);
|
|
3518
3605
|
if (drawer) {
|
|
3519
3606
|
this.drawers.set(type, drawer);
|
|
3520
3607
|
}
|
|
3521
3608
|
}
|
|
3522
3609
|
this._options.load(this._initialSourceOptions);
|
|
3523
3610
|
this._options.load(this._sourceOptions);
|
|
3524
|
-
this.actualOptions = new Options;
|
|
3611
|
+
this.actualOptions = new Options(Container_classPrivateFieldGet(this, _Container_engine, "f"));
|
|
3525
3612
|
this.actualOptions.load(this._options);
|
|
3526
3613
|
this.retina.init();
|
|
3527
3614
|
this.canvas.init();
|
|
@@ -3531,8 +3618,8 @@
|
|
|
3531
3618
|
this.zLayers = this.actualOptions.zLayers;
|
|
3532
3619
|
this.duration = getRangeValue(this.actualOptions.duration);
|
|
3533
3620
|
this.lifeTime = 0;
|
|
3534
|
-
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit :
|
|
3535
|
-
const availablePlugins =
|
|
3621
|
+
this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
|
|
3622
|
+
const availablePlugins = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getAvailablePlugins(this);
|
|
3536
3623
|
for (const [id, plugin] of availablePlugins) {
|
|
3537
3624
|
this.plugins.set(id, plugin);
|
|
3538
3625
|
}
|
|
@@ -3550,7 +3637,7 @@
|
|
|
3550
3637
|
}
|
|
3551
3638
|
const pathOptions = this.actualOptions.particles.move.path;
|
|
3552
3639
|
if (pathOptions.generator) {
|
|
3553
|
-
const customGenerator =
|
|
3640
|
+
const customGenerator = Container_classPrivateFieldGet(this, _Container_engine, "f").plugins.getPathGenerator(pathOptions.generator);
|
|
3554
3641
|
if (customGenerator) {
|
|
3555
3642
|
if (customGenerator.init) {
|
|
3556
3643
|
this.pathGenerator.init = customGenerator.init;
|
|
@@ -3587,24 +3674,41 @@
|
|
|
3587
3674
|
}
|
|
3588
3675
|
}
|
|
3589
3676
|
}
|
|
3590
|
-
|
|
3677
|
+
_Container_engine = new WeakMap;
|
|
3678
|
+
var Loader_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
3679
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3680
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
3681
|
+
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");
|
|
3682
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
3683
|
+
value;
|
|
3684
|
+
};
|
|
3685
|
+
var Loader_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
3686
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3687
|
+
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");
|
|
3688
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3689
|
+
};
|
|
3690
|
+
var _Loader_engine;
|
|
3591
3691
|
function fetchError(statusCode) {
|
|
3592
3692
|
console.error(`Error tsParticles - fetch status: ${statusCode}`);
|
|
3593
3693
|
console.error("Error tsParticles - File config not found");
|
|
3594
3694
|
}
|
|
3595
3695
|
class Loader {
|
|
3596
|
-
|
|
3597
|
-
|
|
3696
|
+
constructor(engine) {
|
|
3697
|
+
_Loader_engine.set(this, void 0);
|
|
3698
|
+
Loader_classPrivateFieldSet(this, _Loader_engine, engine, "f");
|
|
3699
|
+
}
|
|
3700
|
+
dom() {
|
|
3701
|
+
return Loader_classPrivateFieldGet(this, _Loader_engine, "f").domArray;
|
|
3598
3702
|
}
|
|
3599
|
-
|
|
3600
|
-
const dom =
|
|
3703
|
+
domItem(index) {
|
|
3704
|
+
const dom = this.dom();
|
|
3601
3705
|
const item = dom[index];
|
|
3602
3706
|
if (item && !item.destroyed) {
|
|
3603
3707
|
return item;
|
|
3604
3708
|
}
|
|
3605
3709
|
dom.splice(index, 1);
|
|
3606
3710
|
}
|
|
3607
|
-
|
|
3711
|
+
async loadOptions(params) {
|
|
3608
3712
|
var _a, _b, _c;
|
|
3609
3713
|
const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
|
|
3610
3714
|
const {options: options, index: index} = params;
|
|
@@ -3615,10 +3719,10 @@
|
|
|
3615
3719
|
(_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
|
|
3616
3720
|
}
|
|
3617
3721
|
const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
|
|
3618
|
-
const dom =
|
|
3722
|
+
const dom = this.dom();
|
|
3619
3723
|
const oldIndex = dom.findIndex((v => v.id === tagId));
|
|
3620
3724
|
if (oldIndex >= 0) {
|
|
3621
|
-
const old =
|
|
3725
|
+
const old = this.domItem(oldIndex);
|
|
3622
3726
|
if (old && !old.destroyed) {
|
|
3623
3727
|
old.destroy();
|
|
3624
3728
|
dom.splice(oldIndex, 1);
|
|
@@ -3641,7 +3745,7 @@
|
|
|
3641
3745
|
domContainer.appendChild(canvasEl);
|
|
3642
3746
|
}
|
|
3643
3747
|
}
|
|
3644
|
-
const newItem = new Container(tagId, currentOptions);
|
|
3748
|
+
const newItem = new Container(Loader_classPrivateFieldGet(this, _Loader_engine, "f"), tagId, currentOptions);
|
|
3645
3749
|
if (oldIndex >= 0) {
|
|
3646
3750
|
dom.splice(oldIndex, 0, newItem);
|
|
3647
3751
|
} else {
|
|
@@ -3651,7 +3755,7 @@
|
|
|
3651
3755
|
await newItem.start();
|
|
3652
3756
|
return newItem;
|
|
3653
3757
|
}
|
|
3654
|
-
|
|
3758
|
+
async loadRemoteOptions(params) {
|
|
3655
3759
|
const {url: jsonUrl, index: index} = params;
|
|
3656
3760
|
const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
|
|
3657
3761
|
if (!url) {
|
|
@@ -3663,14 +3767,14 @@
|
|
|
3663
3767
|
return;
|
|
3664
3768
|
}
|
|
3665
3769
|
const data = await response.json();
|
|
3666
|
-
return
|
|
3770
|
+
return this.loadOptions({
|
|
3667
3771
|
tagId: params.tagId,
|
|
3668
3772
|
element: params.element,
|
|
3669
3773
|
index: index,
|
|
3670
3774
|
options: data
|
|
3671
3775
|
});
|
|
3672
3776
|
}
|
|
3673
|
-
|
|
3777
|
+
load(tagId, options, index) {
|
|
3674
3778
|
const params = {
|
|
3675
3779
|
index: index
|
|
3676
3780
|
};
|
|
@@ -3686,7 +3790,7 @@
|
|
|
3686
3790
|
}
|
|
3687
3791
|
return this.loadOptions(params);
|
|
3688
3792
|
}
|
|
3689
|
-
|
|
3793
|
+
async set(id, domContainer, options, index) {
|
|
3690
3794
|
const params = {
|
|
3691
3795
|
index: index
|
|
3692
3796
|
};
|
|
@@ -3707,7 +3811,7 @@
|
|
|
3707
3811
|
}
|
|
3708
3812
|
return this.loadOptions(params);
|
|
3709
3813
|
}
|
|
3710
|
-
|
|
3814
|
+
async loadJSON(tagId, jsonUrl, index) {
|
|
3711
3815
|
let url, id;
|
|
3712
3816
|
if (typeof jsonUrl === "number" || jsonUrl === undefined) {
|
|
3713
3817
|
url = tagId;
|
|
@@ -3715,13 +3819,13 @@
|
|
|
3715
3819
|
id = tagId;
|
|
3716
3820
|
url = jsonUrl;
|
|
3717
3821
|
}
|
|
3718
|
-
return
|
|
3822
|
+
return this.loadRemoteOptions({
|
|
3719
3823
|
tagId: id,
|
|
3720
3824
|
url: url,
|
|
3721
3825
|
index: index
|
|
3722
3826
|
});
|
|
3723
3827
|
}
|
|
3724
|
-
|
|
3828
|
+
async setJSON(id, domContainer, jsonUrl, index) {
|
|
3725
3829
|
let url, newId, newIndex, element;
|
|
3726
3830
|
if (id instanceof HTMLElement) {
|
|
3727
3831
|
element = id;
|
|
@@ -3733,15 +3837,15 @@
|
|
|
3733
3837
|
url = jsonUrl;
|
|
3734
3838
|
newIndex = index;
|
|
3735
3839
|
}
|
|
3736
|
-
return
|
|
3840
|
+
return this.loadRemoteOptions({
|
|
3737
3841
|
tagId: newId,
|
|
3738
3842
|
url: url,
|
|
3739
3843
|
index: newIndex,
|
|
3740
3844
|
element: element
|
|
3741
3845
|
});
|
|
3742
3846
|
}
|
|
3743
|
-
|
|
3744
|
-
const dom =
|
|
3847
|
+
setOnClickHandler(callback) {
|
|
3848
|
+
const dom = this.dom();
|
|
3745
3849
|
if (dom.length === 0) {
|
|
3746
3850
|
throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
|
|
3747
3851
|
}
|
|
@@ -3750,6 +3854,7 @@
|
|
|
3750
3854
|
}
|
|
3751
3855
|
}
|
|
3752
3856
|
}
|
|
3857
|
+
_Loader_engine = new WeakMap;
|
|
3753
3858
|
function NumberUtils_clamp(num, min, max) {
|
|
3754
3859
|
return Math.min(Math.max(num, min), max);
|
|
3755
3860
|
}
|
|
@@ -4873,8 +4978,8 @@
|
|
|
4873
4978
|
updateTilt(particle, delta);
|
|
4874
4979
|
}
|
|
4875
4980
|
}
|
|
4876
|
-
async function loadTiltUpdater(
|
|
4877
|
-
await
|
|
4981
|
+
async function loadTiltUpdater(engine) {
|
|
4982
|
+
await engine.addParticleUpdater("tilt", (container => new TiltUpdater(container)));
|
|
4878
4983
|
}
|
|
4879
4984
|
return __webpack_exports__;
|
|
4880
4985
|
}();
|