tsparticles 1.38.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.js +28 -28
- package/Core/Container.d.ts +2 -3
- package/Core/Container.js +7 -8
- package/Core/Interfaces/ICircleBouncer.d.ts +1 -1
- package/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
- package/Core/Interfaces/IParticle.d.ts +1 -1
- package/Core/Interfaces/index.d.ts +3 -1
- package/Core/Interfaces/index.js +3 -1
- package/Core/Loader.js +4 -3
- package/Core/Particle.d.ts +2 -5
- package/Core/Particle.js +16 -18
- package/Core/Particles.d.ts +1 -1
- package/Core/Particles.js +13 -19
- package/{Utils → Core/Utils}/Circle.d.ts +1 -1
- package/{Utils → Core/Utils}/Circle.js +2 -2
- package/{esm → Core}/Utils/CircleWarp.d.ts +1 -2
- package/{Utils → Core/Utils}/CircleWarp.js +0 -0
- package/{Utils → Core/Utils}/Constants.d.ts +0 -0
- package/{Utils → Core/Utils}/Constants.js +0 -0
- package/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
- package/{Utils → Core/Utils}/EventListeners.js +10 -11
- package/Core/{ExternalInteractorBase.d.ts → Utils/ExternalInteractorBase.d.ts} +4 -4
- package/Core/{ExternalInteractorBase.js → Utils/ExternalInteractorBase.js} +1 -2
- package/{esm/Core → Core/Utils}/FrameManager.d.ts +1 -1
- package/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
- package/{esm/Core → Core/Utils}/InteractionManager.d.ts +3 -3
- package/Core/{InteractionManager.js → Utils/InteractionManager.js} +2 -3
- package/{esm/Core → Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
- package/Core/{ParticlesInteractorBase.js → Utils/ParticlesInteractorBase.js} +1 -2
- package/{esm/Core/Particle/Mover.d.ts → Core/Utils/ParticlesMover.d.ts} +1 -1
- package/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +6 -7
- package/{esm → Core}/Utils/Plugins.d.ts +5 -5
- package/{Utils → Core/Utils}/Plugins.js +0 -0
- package/{Utils → Core/Utils}/Point.d.ts +2 -2
- package/{Utils → Core/Utils}/Point.js +0 -0
- package/{Utils → Core/Utils}/QuadTree.d.ts +3 -3
- package/{Utils → Core/Utils}/QuadTree.js +2 -2
- package/{esm → Core}/Utils/Range.d.ts +1 -1
- package/{Utils → Core/Utils}/Range.js +0 -0
- package/{esm → Core}/Utils/Rectangle.d.ts +1 -2
- package/{Utils → Core/Utils}/Rectangle.js +0 -0
- package/Core/{Particle → Utils}/Vector.d.ts +0 -0
- package/Core/{Particle → Utils}/Vector.js +0 -0
- package/Core/{Particle → Utils}/Vector3d.d.ts +0 -0
- package/Core/{Particle → Utils}/Vector3d.js +0 -0
- package/Core/Utils/index.d.ts +16 -0
- package/Core/Utils/index.js +28 -0
- package/Core/index.d.ts +8 -0
- package/Core/index.js +20 -0
- package/Enums/AnimationStatus.d.ts +1 -1
- package/Enums/AnimationStatus.js +0 -6
- package/Enums/Directions/MoveDirection.d.ts +1 -1
- package/Enums/Directions/MoveDirection.js +0 -13
- package/Enums/Directions/OutModeDirection.d.ts +1 -1
- package/Enums/Directions/OutModeDirection.js +0 -8
- package/Enums/Directions/RotateDirection.d.ts +1 -1
- package/Enums/Directions/RotateDirection.js +0 -7
- package/Enums/Directions/TiltDirection.d.ts +1 -1
- package/Enums/Directions/TiltDirection.js +0 -7
- package/Enums/InteractivityDetect.d.ts +1 -1
- package/Enums/InteractivityDetect.js +0 -7
- package/Enums/Modes/ClickMode.d.ts +1 -1
- package/Enums/Modes/ClickMode.js +0 -11
- package/Enums/Modes/CollisionMode.d.ts +1 -1
- package/Enums/Modes/CollisionMode.js +0 -7
- package/Enums/Modes/DestroyMode.d.ts +1 -1
- package/Enums/Modes/DestroyMode.js +0 -6
- package/Enums/Modes/DivMode.d.ts +1 -1
- package/Enums/Modes/DivMode.js +0 -7
- package/Enums/Modes/HoverMode.d.ts +1 -1
- package/Enums/Modes/HoverMode.js +0 -13
- package/Enums/Modes/OutMode.d.ts +1 -1
- package/Enums/Modes/OutMode.js +0 -11
- package/Enums/Modes/ResponsiveMode.d.ts +1 -1
- package/Enums/Modes/ResponsiveMode.js +0 -6
- package/Enums/Modes/RollMode.d.ts +1 -1
- package/Enums/Modes/RollMode.js +0 -7
- package/Enums/Modes/SizeMode.d.ts +1 -1
- package/Enums/Modes/SizeMode.js +0 -6
- package/Enums/Modes/ThemeMode.d.ts +1 -1
- package/Enums/Modes/ThemeMode.js +0 -7
- package/Enums/Types/AlterType.d.ts +1 -1
- package/Enums/Types/AlterType.js +0 -6
- package/Enums/Types/DestroyType.d.ts +1 -1
- package/Enums/Types/DestroyType.js +0 -7
- package/Enums/Types/DivType.d.ts +1 -1
- package/Enums/Types/DivType.js +0 -6
- package/Enums/Types/EasingType.d.ts +1 -1
- package/Enums/Types/EasingType.js +0 -12
- package/Enums/Types/GradientType.d.ts +1 -1
- package/Enums/Types/GradientType.js +0 -7
- package/Enums/Types/InteractorType.d.ts +1 -1
- package/Enums/Types/InteractorType.js +0 -6
- package/Enums/Types/OrbitType.d.ts +1 -1
- package/Enums/Types/OrbitType.js +0 -6
- package/Enums/Types/ShapeType.d.ts +1 -1
- package/Enums/Types/ShapeType.js +0 -15
- package/Enums/Types/StartValueType.d.ts +1 -1
- package/Enums/Types/StartValueType.js +0 -7
- package/Interactions/External/Attract/Attractor.d.ts +2 -2
- package/Interactions/External/Attract/Attractor.js +9 -11
- package/Interactions/External/Attract/index.d.ts +2 -2
- package/Interactions/External/Bounce/Bouncer.d.ts +2 -2
- package/Interactions/External/Bounce/Bouncer.js +15 -17
- package/Interactions/External/Bounce/index.d.ts +2 -2
- package/Interactions/External/Bubble/Bubbler.d.ts +3 -3
- package/Interactions/External/Bubble/Bubbler.js +20 -22
- package/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
- package/Interactions/External/Bubble/ProcessBubbleType.js +0 -7
- package/Interactions/External/Bubble/index.d.ts +2 -2
- package/Interactions/External/Connect/Connector.d.ts +2 -2
- package/Interactions/External/Connect/Connector.js +3 -4
- package/Interactions/External/Connect/index.d.ts +2 -2
- package/Interactions/External/Grab/Grabber.d.ts +2 -2
- package/Interactions/External/Grab/Grabber.js +4 -5
- package/Interactions/External/Grab/index.d.ts +2 -2
- package/Interactions/External/Repulse/Repulser.d.ts +2 -2
- package/Interactions/External/Repulse/Repulser.js +15 -17
- package/Interactions/External/Repulse/index.d.ts +2 -2
- package/Interactions/External/Trail/TrailMaker.d.ts +2 -3
- package/Interactions/External/Trail/TrailMaker.js +4 -5
- package/Interactions/External/Trail/index.d.ts +2 -2
- package/Interactions/Particles/Attract/Attractor.d.ts +2 -4
- package/Interactions/Particles/Attract/Attractor.js +2 -2
- package/Interactions/Particles/Attract/index.d.ts +2 -2
- package/Interactions/Particles/Collisions/Collider.d.ts +2 -3
- package/Interactions/Particles/Collisions/Collider.js +5 -6
- package/Interactions/Particles/Collisions/index.d.ts +2 -2
- package/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
- package/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
- package/Interactions/Particles/Links/Linker.d.ts +3 -4
- package/Interactions/Particles/Links/Linker.js +4 -4
- package/Interactions/Particles/Links/index.d.ts +2 -3
- package/Interactions/Particles/Links/index.js +3 -7
- package/Interactions/Particles/Links/interaction.d.ts +2 -0
- package/Interactions/Particles/Links/interaction.js +8 -0
- package/Interactions/Particles/Links/plugin.d.ts +2 -2
- package/Interactions/Particles/Links/plugin.js +2 -2
- package/Options/Classes/AnimatableGradient.js +3 -4
- package/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
- package/Options/Classes/Interactivity/Interactivity.js +5 -6
- package/Options/Classes/Interactivity/Modes/Attract.js +1 -2
- package/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
- package/Options/Classes/Options.js +8 -8
- package/Options/Classes/Particles/Collisions/Collisions.js +1 -2
- package/Options/Classes/Particles/Destroy/Destroy.js +1 -2
- package/Options/Classes/Particles/Move/Move.js +1 -2
- package/Options/Classes/Particles/Move/OutModes.js +1 -2
- package/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
- package/Options/Classes/Particles/Roll/Roll.js +1 -2
- package/Options/Classes/Particles/Rotate/Rotate.js +1 -2
- package/Options/Classes/Particles/Shape/Shape.js +13 -14
- package/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
- package/Options/Classes/Particles/Tilt/Tilt.js +1 -2
- package/Options/Classes/Responsive.js +4 -5
- package/Options/Classes/Theme/ThemeDefault.js +1 -2
- package/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
- package/Plugins/Absorbers/AbsorberInstance.d.ts +2 -4
- package/Plugins/Absorbers/AbsorberInstance.js +9 -10
- package/Plugins/Absorbers/Absorbers.d.ts +1 -4
- package/Plugins/Absorbers/Absorbers.js +1 -2
- package/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
- package/Plugins/Absorbers/Enums/AbsorberClickMode.js +0 -5
- package/Plugins/Absorbers/index.d.ts +2 -0
- package/Plugins/Absorbers/{plugin.js → index.js} +3 -4
- package/Plugins/Emitters/EmitterContainer.d.ts +1 -1
- package/Plugins/Emitters/EmitterInstance.d.ts +1 -2
- package/Plugins/Emitters/EmitterInstance.js +3 -4
- package/Plugins/Emitters/Emitters.d.ts +1 -2
- package/Plugins/Emitters/Emitters.js +1 -2
- package/Plugins/Emitters/EmittersMain.d.ts +2 -2
- package/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
- package/Plugins/Emitters/Enums/EmitterClickMode.js +0 -5
- package/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
- package/Plugins/Emitters/Enums/EmitterShapeType.js +0 -6
- package/Plugins/Emitters/IEmitterShape.d.ts +1 -1
- package/Plugins/Emitters/Options/Classes/Emitter.js +1 -2
- package/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
- package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
- package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
- package/Plugins/Emitters/{plugin.d.ts → index.d.ts} +0 -0
- package/Plugins/Emitters/{plugin.js → index.js} +3 -4
- package/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
- package/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
- package/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
- package/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
- package/{esm/Plugins/PolygonMask/Enums/Type.d.ts → Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
- package/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
- package/Plugins/PolygonMask/Enums/index.d.ts +3 -3
- package/Plugins/PolygonMask/Enums/index.js +3 -3
- package/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +13 -13
- package/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
- package/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +5 -5
- package/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +15 -14
- package/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +3 -3
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +29 -0
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +17 -0
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +29 -0
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
- package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +21 -0
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
- package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
- package/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
- package/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
- package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +2 -0
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
- package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +2 -0
- package/Plugins/PolygonMask/PolygonMaskInstance.d.ts +2 -4
- package/Plugins/PolygonMask/PolygonMaskInstance.js +33 -30
- package/Plugins/PolygonMask/{types.d.ts → Types.d.ts} +0 -0
- package/Plugins/PolygonMask/Types.js +2 -0
- package/{esm/Plugins/PolygonMask/utils.d.ts → Plugins/PolygonMask/Utils.d.ts} +5 -5
- package/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
- package/Plugins/PolygonMask/index.d.ts +2 -0
- package/Plugins/PolygonMask/{plugin.js → index.js} +4 -5
- package/Plugins/PolygonMask/pathseg.js +54 -43
- package/Shapes/Circle/CircleDrawer.d.ts +1 -1
- package/Shapes/Circle/index.d.ts +2 -2
- package/Shapes/Image/ImageDrawer.d.ts +3 -7
- package/Shapes/Image/ImageDrawer.js +29 -109
- package/Shapes/Image/Utils.d.ts +8 -5
- package/Shapes/Image/Utils.js +69 -38
- package/Shapes/Image/index.d.ts +2 -2
- package/Shapes/Line/LineDrawer.d.ts +1 -1
- package/Shapes/Line/index.d.ts +2 -2
- package/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
- package/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
- package/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
- package/Shapes/Polygon/index.d.ts +4 -4
- package/Shapes/Square/SquareDrawer.d.ts +1 -1
- package/Shapes/Square/index.d.ts +2 -2
- package/Shapes/Star/StarDrawer.d.ts +1 -1
- package/Shapes/Star/index.d.ts +2 -2
- package/Shapes/Text/TextDrawer.d.ts +1 -2
- package/Shapes/Text/index.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.d.ts +1 -3
- package/Updaters/Angle/AngleUpdater.js +8 -9
- package/Updaters/Angle/index.d.ts +2 -2
- package/Updaters/Color/ColorUpdater.d.ts +1 -3
- package/Updaters/Color/ColorUpdater.js +3 -4
- package/Updaters/Color/index.d.ts +2 -2
- package/Updaters/Life/LifeUpdater.d.ts +1 -3
- package/Updaters/Life/index.d.ts +2 -2
- package/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
- package/Updaters/Opacity/OpacityUpdater.js +13 -14
- package/Updaters/Opacity/index.d.ts +2 -2
- package/Updaters/OutModes/IBounceData.d.ts +1 -2
- package/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
- package/Updaters/OutModes/OutOfCanvasUpdater.js +19 -20
- package/Updaters/OutModes/Utils.js +12 -13
- package/Updaters/OutModes/index.d.ts +2 -2
- package/Updaters/Roll/RollUpdater.d.ts +1 -2
- package/Updaters/Roll/RollUpdater.js +4 -5
- package/Updaters/Roll/index.d.ts +2 -2
- package/Updaters/Size/SizeUpdater.d.ts +1 -2
- package/Updaters/Size/SizeUpdater.js +6 -7
- package/Updaters/Size/index.d.ts +2 -2
- package/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
- package/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
- package/Updaters/StrokeColor/index.d.ts +2 -2
- package/Updaters/Tilt/TiltUpdater.d.ts +1 -3
- package/Updaters/Tilt/TiltUpdater.js +8 -9
- package/Updaters/Tilt/index.d.ts +2 -2
- package/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
- package/Updaters/Wobble/index.d.ts +2 -2
- package/Utils/CanvasUtils.d.ts +3 -3
- package/Utils/CanvasUtils.js +4 -5
- package/Utils/ColorUtils.d.ts +1 -1
- package/Utils/ColorUtils.js +7 -8
- package/Utils/NumberUtils.d.ts +2 -2
- package/Utils/NumberUtils.js +20 -21
- package/Utils/Utils.d.ts +1 -1
- package/Utils/Utils.js +6 -7
- package/Utils/index.d.ts +0 -9
- package/Utils/index.js +0 -9
- package/browser/Core/Canvas.js +9 -9
- package/browser/Core/Container.d.ts +2 -3
- package/browser/Core/Container.js +2 -3
- package/browser/Core/Interfaces/ICircleBouncer.d.ts +1 -1
- package/browser/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
- package/browser/Core/Interfaces/IParticle.d.ts +1 -1
- package/browser/Core/Interfaces/index.d.ts +3 -1
- package/browser/Core/Interfaces/index.js +3 -1
- package/browser/Core/Loader.js +2 -1
- package/browser/Core/Particle.d.ts +2 -5
- package/browser/Core/Particle.js +13 -15
- package/browser/Core/Particles.d.ts +1 -1
- package/browser/Core/Particles.js +8 -14
- package/browser/{Utils → Core/Utils}/Circle.d.ts +1 -1
- package/browser/{Utils → Core/Utils}/Circle.js +1 -1
- package/browser/{Utils → Core/Utils}/CircleWarp.d.ts +1 -2
- package/browser/{Utils → Core/Utils}/CircleWarp.js +0 -0
- package/browser/{Utils → Core/Utils}/Constants.d.ts +0 -0
- package/browser/{Utils → Core/Utils}/Constants.js +0 -0
- package/browser/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
- package/browser/{Utils → Core/Utils}/EventListeners.js +10 -11
- package/{esm/Core → browser/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
- package/browser/Core/{ExternalInteractorBase.js → Utils/ExternalInteractorBase.js} +1 -2
- package/browser/Core/{FrameManager.d.ts → Utils/FrameManager.d.ts} +1 -1
- package/browser/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
- package/browser/Core/{InteractionManager.d.ts → Utils/InteractionManager.d.ts} +3 -3
- package/browser/Core/{InteractionManager.js → Utils/InteractionManager.js} +2 -3
- package/{Core → browser/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
- package/{esm/Core → browser/Core/Utils}/ParticlesInteractorBase.js +1 -2
- package/browser/Core/{Particle/Mover.d.ts → Utils/ParticlesMover.d.ts} +1 -1
- package/browser/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
- package/browser/{Utils → Core/Utils}/Plugins.d.ts +5 -5
- package/browser/{Utils → Core/Utils}/Plugins.js +0 -0
- package/browser/{Utils → Core/Utils}/Point.d.ts +2 -2
- package/browser/{Utils → Core/Utils}/Point.js +0 -0
- package/browser/{Utils → Core/Utils}/QuadTree.d.ts +3 -3
- package/browser/{Utils → Core/Utils}/QuadTree.js +1 -1
- package/browser/{Utils → Core/Utils}/Range.d.ts +1 -1
- package/browser/{Utils → Core/Utils}/Range.js +0 -0
- package/browser/{Utils → Core/Utils}/Rectangle.d.ts +1 -2
- package/browser/{Utils → Core/Utils}/Rectangle.js +0 -0
- package/browser/Core/{Particle → Utils}/Vector.d.ts +0 -0
- package/browser/Core/{Particle → Utils}/Vector.js +0 -0
- package/browser/Core/{Particle → Utils}/Vector3d.d.ts +0 -0
- package/browser/Core/{Particle → Utils}/Vector3d.js +0 -0
- package/browser/Core/Utils/index.d.ts +16 -0
- package/browser/Core/Utils/index.js +16 -0
- package/browser/Core/index.d.ts +8 -0
- package/browser/Core/index.js +8 -0
- package/browser/Enums/AnimationStatus.d.ts +1 -1
- package/browser/Enums/AnimationStatus.js +1 -5
- package/browser/Enums/Directions/MoveDirection.d.ts +1 -1
- package/browser/Enums/Directions/MoveDirection.js +1 -15
- package/browser/Enums/Directions/OutModeDirection.d.ts +1 -1
- package/browser/Enums/Directions/OutModeDirection.js +1 -7
- package/browser/Enums/Directions/RotateDirection.d.ts +1 -1
- package/browser/Enums/Directions/RotateDirection.js +1 -9
- package/browser/Enums/Directions/TiltDirection.d.ts +1 -1
- package/browser/Enums/Directions/TiltDirection.js +1 -9
- package/browser/Enums/InteractivityDetect.d.ts +1 -1
- package/browser/Enums/InteractivityDetect.js +1 -9
- package/browser/Enums/Modes/ClickMode.d.ts +1 -1
- package/browser/Enums/Modes/ClickMode.js +1 -13
- package/browser/Enums/Modes/CollisionMode.d.ts +1 -1
- package/browser/Enums/Modes/CollisionMode.js +1 -9
- package/browser/Enums/Modes/DestroyMode.d.ts +1 -1
- package/browser/Enums/Modes/DestroyMode.js +1 -5
- package/browser/Enums/Modes/DivMode.d.ts +1 -1
- package/browser/Enums/Modes/DivMode.js +1 -9
- package/browser/Enums/Modes/HoverMode.d.ts +1 -1
- package/browser/Enums/Modes/HoverMode.js +1 -15
- package/browser/Enums/Modes/OutMode.d.ts +1 -1
- package/browser/Enums/Modes/OutMode.js +1 -13
- package/browser/Enums/Modes/ResponsiveMode.d.ts +1 -1
- package/browser/Enums/Modes/ResponsiveMode.js +1 -5
- package/browser/Enums/Modes/RollMode.d.ts +1 -1
- package/browser/Enums/Modes/RollMode.js +1 -6
- package/browser/Enums/Modes/SizeMode.d.ts +1 -1
- package/browser/Enums/Modes/SizeMode.js +1 -8
- package/browser/Enums/Modes/ThemeMode.d.ts +1 -1
- package/browser/Enums/Modes/ThemeMode.js +1 -6
- package/browser/Enums/Types/AlterType.d.ts +1 -1
- package/browser/Enums/Types/AlterType.js +1 -5
- package/browser/Enums/Types/DestroyType.d.ts +1 -1
- package/browser/Enums/Types/DestroyType.js +1 -9
- package/browser/Enums/Types/DivType.d.ts +1 -1
- package/browser/Enums/Types/DivType.js +1 -8
- package/browser/Enums/Types/EasingType.d.ts +1 -1
- package/browser/Enums/Types/EasingType.js +1 -11
- package/browser/Enums/Types/GradientType.d.ts +1 -1
- package/browser/Enums/Types/GradientType.js +1 -6
- package/browser/Enums/Types/InteractorType.d.ts +1 -1
- package/browser/Enums/Types/InteractorType.js +1 -5
- package/browser/Enums/Types/OrbitType.d.ts +1 -1
- package/browser/Enums/Types/OrbitType.js +1 -8
- package/browser/Enums/Types/ShapeType.d.ts +1 -1
- package/browser/Enums/Types/ShapeType.js +1 -17
- package/browser/Enums/Types/StartValueType.d.ts +1 -1
- package/browser/Enums/Types/StartValueType.js +1 -9
- package/browser/Interactions/External/Attract/Attractor.d.ts +2 -2
- package/browser/Interactions/External/Attract/Attractor.js +5 -7
- package/browser/Interactions/External/Attract/index.d.ts +2 -2
- package/browser/Interactions/External/Bounce/Bouncer.d.ts +2 -2
- package/browser/Interactions/External/Bounce/Bouncer.js +7 -9
- package/browser/Interactions/External/Bounce/index.d.ts +2 -2
- package/browser/Interactions/External/Bubble/Bubbler.d.ts +3 -3
- package/browser/Interactions/External/Bubble/Bubbler.js +16 -18
- package/browser/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
- package/browser/Interactions/External/Bubble/ProcessBubbleType.js +1 -9
- package/browser/Interactions/External/Bubble/index.d.ts +2 -2
- package/browser/Interactions/External/Connect/Connector.d.ts +2 -2
- package/browser/Interactions/External/Connect/Connector.js +2 -3
- package/browser/Interactions/External/Connect/index.d.ts +2 -2
- package/browser/Interactions/External/Grab/Grabber.d.ts +2 -2
- package/browser/Interactions/External/Grab/Grabber.js +3 -4
- package/browser/Interactions/External/Grab/index.d.ts +2 -2
- package/browser/Interactions/External/Repulse/Repulser.d.ts +2 -2
- package/browser/Interactions/External/Repulse/Repulser.js +8 -10
- package/browser/Interactions/External/Repulse/index.d.ts +2 -2
- package/browser/Interactions/External/Trail/TrailMaker.d.ts +2 -3
- package/browser/Interactions/External/Trail/TrailMaker.js +3 -4
- package/browser/Interactions/External/Trail/index.d.ts +2 -2
- package/browser/Interactions/Particles/Attract/Attractor.d.ts +2 -4
- package/browser/Interactions/Particles/Attract/Attractor.js +1 -1
- package/browser/Interactions/Particles/Attract/index.d.ts +2 -2
- package/browser/Interactions/Particles/Collisions/Collider.d.ts +2 -3
- package/browser/Interactions/Particles/Collisions/Collider.js +4 -5
- package/browser/Interactions/Particles/Collisions/index.d.ts +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
- package/browser/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
- package/browser/Interactions/Particles/Links/Linker.d.ts +3 -4
- package/browser/Interactions/Particles/Links/Linker.js +2 -2
- package/browser/Interactions/Particles/Links/index.d.ts +2 -3
- package/browser/Interactions/Particles/Links/index.js +1 -4
- package/browser/Interactions/Particles/Links/interaction.d.ts +2 -0
- package/browser/Interactions/Particles/Links/interaction.js +4 -0
- package/browser/Interactions/Particles/Links/plugin.d.ts +2 -2
- package/browser/Interactions/Particles/Links/plugin.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.js +3 -4
- package/browser/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
- package/browser/Options/Classes/Interactivity/Interactivity.js +5 -6
- package/browser/Options/Classes/Interactivity/Modes/Attract.js +1 -2
- package/browser/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
- package/browser/Options/Classes/Options.js +7 -7
- package/browser/Options/Classes/Particles/Collisions/Collisions.js +1 -2
- package/browser/Options/Classes/Particles/Destroy/Destroy.js +1 -2
- package/browser/Options/Classes/Particles/Move/Move.js +1 -2
- package/browser/Options/Classes/Particles/Move/OutModes.js +1 -2
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
- package/browser/Options/Classes/Particles/Roll/Roll.js +1 -2
- package/browser/Options/Classes/Particles/Rotate/Rotate.js +1 -2
- package/browser/Options/Classes/Particles/Shape/Shape.js +13 -14
- package/browser/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
- package/browser/Options/Classes/Particles/Tilt/Tilt.js +1 -2
- package/browser/Options/Classes/Responsive.js +4 -5
- package/browser/Options/Classes/Theme/ThemeDefault.js +1 -2
- package/browser/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
- package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +2 -4
- package/browser/Plugins/Absorbers/AbsorberInstance.js +4 -5
- package/browser/Plugins/Absorbers/Absorbers.d.ts +1 -4
- package/browser/Plugins/Absorbers/Absorbers.js +1 -2
- package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
- package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -7
- package/browser/Plugins/Absorbers/index.d.ts +2 -0
- package/browser/Plugins/Absorbers/{plugin.js → index.js} +3 -4
- package/browser/Plugins/Emitters/EmitterContainer.d.ts +1 -1
- package/browser/Plugins/Emitters/EmitterInstance.d.ts +1 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -4
- package/browser/Plugins/Emitters/Emitters.d.ts +1 -2
- package/browser/Plugins/Emitters/Emitters.js +1 -2
- package/browser/Plugins/Emitters/EmittersMain.d.ts +2 -2
- package/browser/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
- package/browser/Plugins/Emitters/Enums/EmitterClickMode.js +1 -7
- package/browser/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
- package/browser/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
- package/browser/Plugins/Emitters/IEmitterShape.d.ts +1 -1
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +1 -2
- package/browser/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
- package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
- package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
- package/browser/Plugins/Emitters/{plugin.d.ts → index.d.ts} +0 -0
- package/browser/Plugins/Emitters/{plugin.js → index.js} +3 -4
- package/browser/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
- package/browser/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
- package/browser/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
- package/browser/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
- package/{Plugins/PolygonMask/Enums/Type.d.ts → browser/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
- package/browser/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
- package/browser/Plugins/PolygonMask/Enums/index.d.ts +3 -3
- package/browser/Plugins/PolygonMask/Enums/index.js +3 -3
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +13 -13
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
- package/browser/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +5 -5
- package/browser/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
- package/browser/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +3 -3
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +28 -0
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +12 -0
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +16 -0
- package/browser/Plugins/PolygonMask/Options/Classes/{LocalSvg.d.ts → PolygonMaskLocalSvg.d.ts} +4 -4
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +28 -0
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +13 -0
- package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +20 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
- package/browser/Plugins/PolygonMask/Options/Interfaces/{IDraw.d.ts → IPolygonMaskDraw.d.ts} +4 -4
- package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/{IDrawStroke.d.ts → IPolygonMaskDrawStroke.d.ts} +2 -2
- package/browser/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +7 -0
- package/browser/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
- package/{esm/Plugins/PolygonMask/Options/Interfaces/IDraw.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js} +0 -0
- package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +8 -0
- package/{esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js} +0 -0
- package/browser/Plugins/PolygonMask/PolygonMaskInstance.d.ts +2 -4
- package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
- package/browser/Plugins/PolygonMask/{types.d.ts → Types.d.ts} +0 -0
- package/{esm/Plugins/PolygonMask/Options/Interfaces/IInline.js → browser/Plugins/PolygonMask/Types.js} +0 -0
- package/{Plugins/PolygonMask/utils.d.ts → browser/Plugins/PolygonMask/Utils.d.ts} +5 -5
- package/browser/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
- package/browser/Plugins/PolygonMask/index.d.ts +2 -0
- package/browser/Plugins/PolygonMask/{plugin.js → index.js} +5 -6
- package/browser/Plugins/PolygonMask/pathseg.js +54 -44
- package/browser/Shapes/Circle/CircleDrawer.d.ts +1 -1
- package/browser/Shapes/Circle/index.d.ts +2 -2
- package/browser/Shapes/Image/ImageDrawer.d.ts +3 -7
- package/browser/Shapes/Image/ImageDrawer.js +28 -111
- package/browser/Shapes/Image/Utils.d.ts +8 -5
- package/browser/Shapes/Image/Utils.js +71 -37
- package/browser/Shapes/Image/index.d.ts +2 -2
- package/browser/Shapes/Line/LineDrawer.d.ts +1 -1
- package/browser/Shapes/Line/index.d.ts +2 -2
- package/browser/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
- package/browser/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
- package/browser/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
- package/browser/Shapes/Polygon/index.d.ts +4 -4
- package/browser/Shapes/Square/SquareDrawer.d.ts +1 -1
- package/browser/Shapes/Square/index.d.ts +2 -2
- package/browser/Shapes/Star/StarDrawer.d.ts +1 -1
- package/browser/Shapes/Star/index.d.ts +2 -2
- package/browser/Shapes/Text/TextDrawer.d.ts +1 -2
- package/browser/Shapes/Text/index.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.d.ts +1 -3
- package/browser/Updaters/Angle/AngleUpdater.js +8 -9
- package/browser/Updaters/Angle/index.d.ts +2 -2
- package/browser/Updaters/Color/ColorUpdater.d.ts +1 -3
- package/browser/Updaters/Color/ColorUpdater.js +3 -4
- package/browser/Updaters/Color/index.d.ts +2 -2
- package/browser/Updaters/Life/LifeUpdater.d.ts +1 -3
- package/browser/Updaters/Life/index.d.ts +2 -2
- package/browser/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
- package/browser/Updaters/Opacity/OpacityUpdater.js +13 -14
- package/browser/Updaters/Opacity/index.d.ts +2 -2
- package/browser/Updaters/OutModes/IBounceData.d.ts +1 -2
- package/browser/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
- package/browser/Updaters/OutModes/OutOfCanvasUpdater.js +19 -20
- package/browser/Updaters/OutModes/Utils.js +12 -13
- package/browser/Updaters/OutModes/index.d.ts +2 -2
- package/browser/Updaters/Roll/RollUpdater.d.ts +1 -2
- package/browser/Updaters/Roll/RollUpdater.js +4 -5
- package/browser/Updaters/Roll/index.d.ts +2 -2
- package/browser/Updaters/Size/SizeUpdater.d.ts +1 -2
- package/browser/Updaters/Size/SizeUpdater.js +6 -7
- package/browser/Updaters/Size/index.d.ts +2 -2
- package/browser/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
- package/browser/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
- package/browser/Updaters/StrokeColor/index.d.ts +2 -2
- package/browser/Updaters/Tilt/TiltUpdater.d.ts +1 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +8 -9
- package/browser/Updaters/Tilt/index.d.ts +2 -2
- package/browser/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
- package/browser/Updaters/Wobble/index.d.ts +2 -2
- package/browser/Utils/CanvasUtils.d.ts +3 -3
- package/browser/Utils/CanvasUtils.js +4 -5
- package/browser/Utils/ColorUtils.d.ts +1 -1
- package/browser/Utils/ColorUtils.js +2 -3
- package/browser/Utils/NumberUtils.d.ts +2 -2
- package/browser/Utils/NumberUtils.js +18 -19
- package/browser/Utils/Utils.d.ts +1 -1
- package/browser/Utils/Utils.js +5 -6
- package/browser/Utils/index.d.ts +0 -9
- package/browser/Utils/index.js +0 -9
- package/browser/{main.d.ts → engine.d.ts} +4 -6
- package/browser/{main.js → engine.js} +10 -11
- package/browser/full.d.ts +2 -2
- package/browser/full.js +3 -3
- package/browser/index.d.ts +6 -16
- package/browser/index.engine.d.ts +13 -0
- package/browser/index.engine.js +12 -0
- package/browser/index.js +5 -13
- package/browser/index.slim.d.ts +6 -16
- package/browser/index.slim.js +5 -13
- package/browser/pjs.d.ts +3 -3
- package/browser/pjs.js +6 -5
- package/browser/slim.d.ts +2 -2
- package/{esm/main.d.ts → engine.d.ts} +2 -4
- package/{main.js → engine.js} +24 -25
- package/esm/Core/Canvas.js +9 -9
- package/esm/Core/Container.d.ts +2 -3
- package/esm/Core/Container.js +2 -3
- package/esm/Core/Interfaces/ICircleBouncer.d.ts +1 -1
- package/esm/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
- package/esm/Core/Interfaces/IParticle.d.ts +1 -1
- package/esm/Core/Interfaces/index.d.ts +3 -1
- package/esm/Core/Interfaces/index.js +3 -1
- package/esm/Core/Loader.js +2 -1
- package/esm/Core/Particle.d.ts +2 -5
- package/esm/Core/Particle.js +13 -15
- package/esm/Core/Particles.d.ts +1 -1
- package/esm/Core/Particles.js +8 -14
- package/esm/{Utils → Core/Utils}/Circle.d.ts +1 -1
- package/esm/{Utils → Core/Utils}/Circle.js +1 -1
- package/{Utils → esm/Core/Utils}/CircleWarp.d.ts +1 -2
- package/esm/{Utils → Core/Utils}/CircleWarp.js +0 -0
- package/esm/{Utils → Core/Utils}/Constants.d.ts +0 -0
- package/esm/{Utils → Core/Utils}/Constants.js +0 -0
- package/esm/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
- package/esm/{Utils → Core/Utils}/EventListeners.js +10 -11
- package/{browser/Core → esm/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
- package/esm/Core/{ExternalInteractorBase.js → Utils/ExternalInteractorBase.js} +1 -2
- package/{Core → esm/Core/Utils}/FrameManager.d.ts +1 -1
- package/esm/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
- package/{Core → esm/Core/Utils}/InteractionManager.d.ts +3 -3
- package/esm/Core/{InteractionManager.js → Utils/InteractionManager.js} +2 -3
- package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
- package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.js +1 -2
- package/{Core/Particle/Mover.d.ts → esm/Core/Utils/ParticlesMover.d.ts} +1 -1
- package/esm/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
- package/{Utils → esm/Core/Utils}/Plugins.d.ts +5 -5
- package/esm/{Utils → Core/Utils}/Plugins.js +0 -0
- package/esm/{Utils → Core/Utils}/Point.d.ts +2 -2
- package/esm/{Utils → Core/Utils}/Point.js +0 -0
- package/esm/{Utils → Core/Utils}/QuadTree.d.ts +3 -3
- package/esm/{Utils → Core/Utils}/QuadTree.js +1 -1
- package/{Utils → esm/Core/Utils}/Range.d.ts +1 -1
- package/esm/{Utils → Core/Utils}/Range.js +0 -0
- package/{Utils → esm/Core/Utils}/Rectangle.d.ts +1 -2
- package/esm/{Utils → Core/Utils}/Rectangle.js +0 -0
- package/esm/Core/{Particle → Utils}/Vector.d.ts +0 -0
- package/esm/Core/{Particle → Utils}/Vector.js +0 -0
- package/esm/Core/{Particle → Utils}/Vector3d.d.ts +0 -0
- package/esm/Core/{Particle → Utils}/Vector3d.js +0 -0
- package/esm/Core/Utils/index.d.ts +16 -0
- package/esm/Core/Utils/index.js +16 -0
- package/esm/Core/index.d.ts +8 -0
- package/esm/Core/index.js +8 -0
- package/esm/Enums/AnimationStatus.d.ts +1 -1
- package/esm/Enums/AnimationStatus.js +1 -5
- package/esm/Enums/Directions/MoveDirection.d.ts +1 -1
- package/esm/Enums/Directions/MoveDirection.js +1 -12
- package/esm/Enums/Directions/OutModeDirection.d.ts +1 -1
- package/esm/Enums/Directions/OutModeDirection.js +1 -7
- package/esm/Enums/Directions/RotateDirection.d.ts +1 -1
- package/esm/Enums/Directions/RotateDirection.js +1 -6
- package/esm/Enums/Directions/TiltDirection.d.ts +1 -1
- package/esm/Enums/Directions/TiltDirection.js +1 -6
- package/esm/Enums/InteractivityDetect.d.ts +1 -1
- package/esm/Enums/InteractivityDetect.js +1 -6
- package/esm/Enums/Modes/ClickMode.d.ts +1 -1
- package/esm/Enums/Modes/ClickMode.js +1 -10
- package/esm/Enums/Modes/CollisionMode.d.ts +1 -1
- package/esm/Enums/Modes/CollisionMode.js +1 -6
- package/esm/Enums/Modes/DestroyMode.d.ts +1 -1
- package/esm/Enums/Modes/DestroyMode.js +1 -5
- package/esm/Enums/Modes/DivMode.d.ts +1 -1
- package/esm/Enums/Modes/DivMode.js +1 -6
- package/esm/Enums/Modes/HoverMode.d.ts +1 -1
- package/esm/Enums/Modes/HoverMode.js +1 -12
- package/esm/Enums/Modes/OutMode.d.ts +1 -1
- package/esm/Enums/Modes/OutMode.js +1 -10
- package/esm/Enums/Modes/ResponsiveMode.d.ts +1 -1
- package/esm/Enums/Modes/ResponsiveMode.js +1 -5
- package/esm/Enums/Modes/RollMode.d.ts +1 -1
- package/esm/Enums/Modes/RollMode.js +1 -6
- package/esm/Enums/Modes/SizeMode.d.ts +1 -1
- package/esm/Enums/Modes/SizeMode.js +1 -5
- package/esm/Enums/Modes/ThemeMode.d.ts +1 -1
- package/esm/Enums/Modes/ThemeMode.js +1 -6
- package/esm/Enums/Types/AlterType.d.ts +1 -1
- package/esm/Enums/Types/AlterType.js +1 -5
- package/esm/Enums/Types/DestroyType.d.ts +1 -1
- package/esm/Enums/Types/DestroyType.js +1 -6
- package/esm/Enums/Types/DivType.d.ts +1 -1
- package/esm/Enums/Types/DivType.js +1 -5
- package/esm/Enums/Types/EasingType.d.ts +1 -1
- package/esm/Enums/Types/EasingType.js +1 -11
- package/esm/Enums/Types/GradientType.d.ts +1 -1
- package/esm/Enums/Types/GradientType.js +1 -6
- package/esm/Enums/Types/InteractorType.d.ts +1 -1
- package/esm/Enums/Types/InteractorType.js +1 -5
- package/esm/Enums/Types/OrbitType.d.ts +1 -1
- package/esm/Enums/Types/OrbitType.js +1 -5
- package/esm/Enums/Types/ShapeType.d.ts +1 -1
- package/esm/Enums/Types/ShapeType.js +1 -14
- package/esm/Enums/Types/StartValueType.d.ts +1 -1
- package/esm/Enums/Types/StartValueType.js +1 -6
- package/esm/Interactions/External/Attract/Attractor.d.ts +2 -2
- package/esm/Interactions/External/Attract/Attractor.js +5 -7
- package/esm/Interactions/External/Attract/index.d.ts +2 -2
- package/esm/Interactions/External/Bounce/Bouncer.d.ts +2 -2
- package/esm/Interactions/External/Bounce/Bouncer.js +7 -9
- package/esm/Interactions/External/Bounce/index.d.ts +2 -2
- package/esm/Interactions/External/Bubble/Bubbler.d.ts +3 -3
- package/esm/Interactions/External/Bubble/Bubbler.js +16 -18
- package/esm/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
- package/esm/Interactions/External/Bubble/ProcessBubbleType.js +1 -6
- package/esm/Interactions/External/Bubble/index.d.ts +2 -2
- package/esm/Interactions/External/Connect/Connector.d.ts +2 -2
- package/esm/Interactions/External/Connect/Connector.js +2 -3
- package/esm/Interactions/External/Connect/index.d.ts +2 -2
- package/esm/Interactions/External/Grab/Grabber.d.ts +2 -2
- package/esm/Interactions/External/Grab/Grabber.js +3 -4
- package/esm/Interactions/External/Grab/index.d.ts +2 -2
- package/esm/Interactions/External/Repulse/Repulser.d.ts +2 -2
- package/esm/Interactions/External/Repulse/Repulser.js +8 -10
- package/esm/Interactions/External/Repulse/index.d.ts +2 -2
- package/esm/Interactions/External/Trail/TrailMaker.d.ts +2 -3
- package/esm/Interactions/External/Trail/TrailMaker.js +3 -4
- package/esm/Interactions/External/Trail/index.d.ts +2 -2
- package/esm/Interactions/Particles/Attract/Attractor.d.ts +2 -4
- package/esm/Interactions/Particles/Attract/Attractor.js +1 -1
- package/esm/Interactions/Particles/Attract/index.d.ts +2 -2
- package/esm/Interactions/Particles/Collisions/Collider.d.ts +2 -3
- package/esm/Interactions/Particles/Collisions/Collider.js +4 -5
- package/esm/Interactions/Particles/Collisions/index.d.ts +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
- package/esm/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
- package/esm/Interactions/Particles/Links/Linker.d.ts +3 -4
- package/esm/Interactions/Particles/Links/Linker.js +2 -2
- package/esm/Interactions/Particles/Links/index.d.ts +2 -3
- package/esm/Interactions/Particles/Links/index.js +1 -4
- package/esm/Interactions/Particles/Links/interaction.d.ts +2 -0
- package/esm/Interactions/Particles/Links/interaction.js +4 -0
- package/esm/Interactions/Particles/Links/plugin.d.ts +2 -2
- package/esm/Interactions/Particles/Links/plugin.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.js +3 -4
- package/esm/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
- package/esm/Options/Classes/Interactivity/Interactivity.js +5 -6
- package/esm/Options/Classes/Interactivity/Modes/Attract.js +1 -2
- package/esm/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
- package/esm/Options/Classes/Options.js +7 -7
- package/esm/Options/Classes/Particles/Collisions/Collisions.js +1 -2
- package/esm/Options/Classes/Particles/Destroy/Destroy.js +1 -2
- package/esm/Options/Classes/Particles/Move/Move.js +1 -2
- package/esm/Options/Classes/Particles/Move/OutModes.js +1 -2
- package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
- package/esm/Options/Classes/Particles/Roll/Roll.js +1 -2
- package/esm/Options/Classes/Particles/Rotate/Rotate.js +1 -2
- package/esm/Options/Classes/Particles/Shape/Shape.js +13 -14
- package/esm/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
- package/esm/Options/Classes/Particles/Tilt/Tilt.js +1 -2
- package/esm/Options/Classes/Responsive.js +4 -5
- package/esm/Options/Classes/Theme/ThemeDefault.js +1 -2
- package/esm/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
- package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +2 -4
- package/esm/Plugins/Absorbers/AbsorberInstance.js +4 -5
- package/esm/Plugins/Absorbers/Absorbers.d.ts +1 -4
- package/esm/Plugins/Absorbers/Absorbers.js +1 -2
- package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
- package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -4
- package/esm/Plugins/Absorbers/index.d.ts +2 -0
- package/esm/Plugins/Absorbers/{plugin.js → index.js} +3 -4
- package/esm/Plugins/Emitters/EmitterContainer.d.ts +1 -1
- package/esm/Plugins/Emitters/EmitterInstance.d.ts +1 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +3 -4
- package/esm/Plugins/Emitters/Emitters.d.ts +1 -2
- package/esm/Plugins/Emitters/Emitters.js +1 -2
- package/esm/Plugins/Emitters/EmittersMain.d.ts +2 -2
- package/esm/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
- package/esm/Plugins/Emitters/Enums/EmitterClickMode.js +1 -4
- package/esm/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
- package/esm/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
- package/esm/Plugins/Emitters/IEmitterShape.d.ts +1 -1
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +1 -2
- package/esm/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
- package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
- package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
- package/esm/Plugins/Emitters/{plugin.d.ts → index.d.ts} +0 -0
- package/esm/Plugins/Emitters/{plugin.js → index.js} +3 -4
- package/esm/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
- package/esm/Plugins/PolygonMask/{Options/Interfaces/ILocalSvg.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
- package/esm/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
- package/esm/Plugins/PolygonMask/{Options/Interfaces/IMove.js → Enums/PolygonMaskMoveType.js} +0 -0
- package/{browser/Plugins/PolygonMask/Enums/Type.d.ts → esm/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
- package/esm/Plugins/PolygonMask/{types.js → Enums/PolygonMaskType.js} +0 -0
- package/esm/Plugins/PolygonMask/Enums/index.d.ts +3 -3
- package/esm/Plugins/PolygonMask/Enums/index.js +3 -3
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +13 -13
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
- package/esm/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +5 -5
- package/esm/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
- package/esm/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +3 -3
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +25 -0
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +13 -0
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +25 -0
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
- package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +17 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.js +1 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.js +1 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.js +1 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +1 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
- package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +1 -0
- package/esm/Plugins/PolygonMask/PolygonMaskInstance.d.ts +2 -4
- package/esm/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
- package/esm/Plugins/PolygonMask/{types.d.ts → Types.d.ts} +0 -0
- package/esm/Plugins/PolygonMask/Types.js +1 -0
- package/{browser/Plugins/PolygonMask/utils.d.ts → esm/Plugins/PolygonMask/Utils.d.ts} +5 -5
- package/esm/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
- package/esm/Plugins/PolygonMask/index.d.ts +2 -0
- package/esm/Plugins/PolygonMask/{plugin.js → index.js} +4 -5
- package/esm/Plugins/PolygonMask/pathseg.js +54 -43
- package/esm/Shapes/Circle/CircleDrawer.d.ts +1 -1
- package/esm/Shapes/Circle/index.d.ts +2 -2
- package/esm/Shapes/Image/ImageDrawer.d.ts +3 -7
- package/esm/Shapes/Image/ImageDrawer.js +28 -108
- package/esm/Shapes/Image/Utils.d.ts +8 -5
- package/esm/Shapes/Image/Utils.js +67 -36
- package/esm/Shapes/Image/index.d.ts +2 -2
- package/esm/Shapes/Line/LineDrawer.d.ts +1 -1
- package/esm/Shapes/Line/index.d.ts +2 -2
- package/esm/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
- package/esm/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
- package/esm/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
- package/esm/Shapes/Polygon/index.d.ts +4 -4
- package/esm/Shapes/Square/SquareDrawer.d.ts +1 -1
- package/esm/Shapes/Square/index.d.ts +2 -2
- package/esm/Shapes/Star/StarDrawer.d.ts +1 -1
- package/esm/Shapes/Star/index.d.ts +2 -2
- package/esm/Shapes/Text/TextDrawer.d.ts +1 -2
- package/esm/Shapes/Text/index.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.d.ts +1 -3
- package/esm/Updaters/Angle/AngleUpdater.js +8 -9
- package/esm/Updaters/Angle/index.d.ts +2 -2
- package/esm/Updaters/Color/ColorUpdater.d.ts +1 -3
- package/esm/Updaters/Color/ColorUpdater.js +3 -4
- package/esm/Updaters/Color/index.d.ts +2 -2
- package/esm/Updaters/Life/LifeUpdater.d.ts +1 -3
- package/esm/Updaters/Life/index.d.ts +2 -2
- package/esm/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
- package/esm/Updaters/Opacity/OpacityUpdater.js +13 -14
- package/esm/Updaters/Opacity/index.d.ts +2 -2
- package/esm/Updaters/OutModes/IBounceData.d.ts +1 -2
- package/esm/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
- package/esm/Updaters/OutModes/OutOfCanvasUpdater.js +19 -20
- package/esm/Updaters/OutModes/Utils.js +12 -13
- package/esm/Updaters/OutModes/index.d.ts +2 -2
- package/esm/Updaters/Roll/RollUpdater.d.ts +1 -2
- package/esm/Updaters/Roll/RollUpdater.js +4 -5
- package/esm/Updaters/Roll/index.d.ts +2 -2
- package/esm/Updaters/Size/SizeUpdater.d.ts +1 -2
- package/esm/Updaters/Size/SizeUpdater.js +6 -7
- package/esm/Updaters/Size/index.d.ts +2 -2
- package/esm/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
- package/esm/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
- package/esm/Updaters/StrokeColor/index.d.ts +2 -2
- package/esm/Updaters/Tilt/TiltUpdater.d.ts +1 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +8 -9
- package/esm/Updaters/Tilt/index.d.ts +2 -2
- package/esm/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
- package/esm/Updaters/Wobble/index.d.ts +2 -2
- package/esm/Utils/CanvasUtils.d.ts +3 -3
- package/esm/Utils/CanvasUtils.js +4 -5
- package/esm/Utils/ColorUtils.d.ts +1 -1
- package/esm/Utils/ColorUtils.js +2 -3
- package/esm/Utils/NumberUtils.d.ts +2 -2
- package/esm/Utils/NumberUtils.js +18 -19
- package/esm/Utils/Utils.d.ts +1 -1
- package/esm/Utils/Utils.js +5 -6
- package/esm/Utils/index.d.ts +0 -9
- package/esm/Utils/index.js +0 -9
- package/{main.d.ts → esm/engine.d.ts} +2 -4
- package/esm/{main.js → engine.js} +8 -9
- package/esm/full.d.ts +2 -2
- package/esm/full.js +3 -3
- package/esm/index.d.ts +6 -16
- package/esm/index.engine.d.ts +13 -0
- package/esm/index.engine.js +11 -0
- package/esm/index.js +5 -13
- package/esm/index.slim.d.ts +6 -16
- package/esm/index.slim.js +5 -13
- package/esm/pjs.d.ts +3 -3
- package/esm/pjs.js +6 -5
- package/esm/slim.d.ts +2 -2
- package/full.d.ts +2 -2
- package/full.js +6 -6
- package/index.d.ts +6 -16
- package/index.engine.d.ts +13 -0
- package/index.engine.js +27 -0
- package/index.js +7 -19
- package/index.slim.d.ts +6 -16
- package/index.slim.js +7 -19
- package/package.json +1 -1
- package/pjs.d.ts +3 -3
- package/pjs.js +6 -5
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/slim.d.ts +2 -2
- package/tsparticles.engine.js +6746 -0
- package/tsparticles.engine.min.js +2 -0
- package/tsparticles.interaction.external.attract.js +4976 -0
- package/tsparticles.interaction.external.attract.min.js +2 -0
- package/tsparticles.interaction.external.bounce.js +4997 -0
- package/tsparticles.interaction.external.bounce.min.js +2 -0
- package/tsparticles.interaction.external.bubble.js +5083 -0
- package/tsparticles.interaction.external.bubble.min.js +2 -0
- package/tsparticles.interaction.external.connect.js +4845 -0
- package/tsparticles.interaction.external.connect.min.js +2 -0
- package/tsparticles.interaction.external.grab.js +4851 -0
- package/tsparticles.interaction.external.grab.min.js +2 -0
- package/tsparticles.interaction.external.repulse.js +5028 -0
- package/tsparticles.interaction.external.repulse.min.js +2 -0
- package/tsparticles.interaction.external.trail.js +4853 -0
- package/tsparticles.interaction.external.trail.min.js +2 -0
- package/tsparticles.interaction.particles.attract.js +4834 -0
- package/tsparticles.interaction.particles.attract.min.js +2 -0
- package/tsparticles.interaction.particles.collisions.js +4999 -0
- package/tsparticles.interaction.particles.collisions.min.js +2 -0
- package/tsparticles.interaction.particles.links.js +5071 -0
- package/tsparticles.interaction.particles.links.min.js +2 -0
- package/tsparticles.js +1263 -1572
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +2 -0
- package/tsparticles.plugins.absorbers.js +5332 -0
- package/tsparticles.plugins.absorbers.min.js +2 -0
- package/tsparticles.plugins.emitters.js +5419 -0
- package/tsparticles.plugins.emitters.min.js +2 -0
- package/tsparticles.plugins.polygonMask.js +5862 -0
- package/tsparticles.plugins.polygonMask.min.js +2 -0
- package/tsparticles.shape.circle.js +59 -0
- package/tsparticles.shape.circle.min.js +2 -0
- package/tsparticles.shape.image.js +5021 -0
- package/tsparticles.shape.image.min.js +2 -0
- package/tsparticles.shape.line.js +60 -0
- package/tsparticles.shape.line.min.js +2 -0
- package/tsparticles.shape.polygon.js +131 -0
- package/tsparticles.shape.polygon.min.js +2 -0
- package/tsparticles.shape.square.js +62 -0
- package/tsparticles.shape.square.min.js +2 -0
- package/tsparticles.shape.star.js +71 -0
- package/tsparticles.shape.star.min.js +2 -0
- package/tsparticles.shape.text.js +4865 -0
- package/tsparticles.shape.text.min.js +2 -0
- package/tsparticles.slim.js +1052 -1314
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +4880 -0
- package/tsparticles.updater.angle.min.js +2 -0
- package/tsparticles.updater.color.js +4862 -0
- package/tsparticles.updater.color.min.js +2 -0
- package/tsparticles.updater.life.js +4864 -0
- package/tsparticles.updater.life.min.js +2 -0
- package/tsparticles.updater.opacity.js +4914 -0
- package/tsparticles.updater.opacity.min.js +2 -0
- package/tsparticles.updater.outModes.js +4998 -0
- package/tsparticles.updater.outModes.min.js +2 -0
- package/tsparticles.updater.roll.js +4862 -0
- package/tsparticles.updater.roll.min.js +2 -0
- package/tsparticles.updater.size.js +4870 -0
- package/tsparticles.updater.size.min.js +2 -0
- package/tsparticles.updater.strokeColor.js +4875 -0
- package/tsparticles.updater.strokeColor.min.js +2 -0
- package/tsparticles.updater.tilt.js +4881 -0
- package/tsparticles.updater.tilt.min.js +2 -0
- package/tsparticles.updater.wobble.js +4850 -0
- package/tsparticles.updater.wobble.min.js +2 -0
- package/Plugins/Absorbers/plugin.d.ts +0 -2
- package/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
- package/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -11
- package/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
- package/Plugins/PolygonMask/Enums/MoveType.js +0 -8
- package/Plugins/PolygonMask/Enums/Type.js +0 -10
- package/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -28
- package/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
- package/Plugins/PolygonMask/Options/Classes/Inline.js +0 -17
- package/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
- package/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -28
- package/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
- package/Plugins/PolygonMask/Options/Classes/Move.js +0 -21
- package/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
- package/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
- package/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
- package/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
- package/Plugins/PolygonMask/plugin.d.ts +0 -2
- package/browser/Plugins/Absorbers/plugin.d.ts +0 -2
- package/browser/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
- package/browser/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
- package/browser/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
- package/browser/Plugins/PolygonMask/Enums/MoveType.js +0 -5
- package/browser/Plugins/PolygonMask/Enums/Type.js +0 -7
- package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -27
- package/browser/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -12
- package/browser/Plugins/PolygonMask/Options/Classes/Inline.js +0 -16
- package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -27
- package/browser/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -13
- package/browser/Plugins/PolygonMask/Options/Classes/Move.js +0 -20
- package/browser/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -7
- package/browser/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -8
- package/browser/Plugins/PolygonMask/plugin.d.ts +0 -2
- package/esm/Plugins/Absorbers/plugin.d.ts +0 -2
- package/esm/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
- package/esm/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
- package/esm/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
- package/esm/Plugins/PolygonMask/Enums/MoveType.js +0 -5
- package/esm/Plugins/PolygonMask/Enums/Type.js +0 -7
- package/esm/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -24
- package/esm/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
- package/esm/Plugins/PolygonMask/Options/Classes/Inline.js +0 -13
- package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
- package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -24
- package/esm/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
- package/esm/Plugins/PolygonMask/Options/Classes/Move.js +0 -17
- package/esm/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
- package/esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
- package/esm/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
- package/esm/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
- package/esm/Plugins/PolygonMask/plugin.d.ts +0 -2
- package/tsparticles.pathseg.js +0 -1472
package/tsparticles.js
CHANGED
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}();
|
|
118
118
|
!function() {
|
|
119
119
|
__webpack_require__.u = function(chunkId) {
|
|
120
|
-
return "" + "tsparticles.pathseg" + ".js";
|
|
120
|
+
return "" + "tsparticles.pathseg.min" + ".js";
|
|
121
121
|
};
|
|
122
122
|
}();
|
|
123
123
|
!function() {
|
|
@@ -298,20 +298,14 @@
|
|
|
298
298
|
}();
|
|
299
299
|
!function() {
|
|
300
300
|
__webpack_require__.O(0, [ 649 ], (function() {
|
|
301
|
-
__webpack_require__.E(
|
|
301
|
+
__webpack_require__.E(404);
|
|
302
302
|
}), 5);
|
|
303
303
|
}();
|
|
304
304
|
var __webpack_exports__ = {};
|
|
305
305
|
__webpack_require__.r(__webpack_exports__);
|
|
306
306
|
__webpack_require__.d(__webpack_exports__, {
|
|
307
|
-
|
|
308
|
-
return
|
|
309
|
-
},
|
|
310
|
-
AlterType: function() {
|
|
311
|
-
return AlterType;
|
|
312
|
-
},
|
|
313
|
-
AnimationStatus: function() {
|
|
314
|
-
return AnimationStatus;
|
|
307
|
+
Canvas: function() {
|
|
308
|
+
return Canvas;
|
|
315
309
|
},
|
|
316
310
|
Circle: function() {
|
|
317
311
|
return Circle;
|
|
@@ -319,117 +313,69 @@
|
|
|
319
313
|
CircleWarp: function() {
|
|
320
314
|
return CircleWarp;
|
|
321
315
|
},
|
|
322
|
-
ClickMode: function() {
|
|
323
|
-
return ClickMode;
|
|
324
|
-
},
|
|
325
|
-
CollisionMode: function() {
|
|
326
|
-
return CollisionMode;
|
|
327
|
-
},
|
|
328
316
|
Constants: function() {
|
|
329
317
|
return Constants;
|
|
330
318
|
},
|
|
331
319
|
Container: function() {
|
|
332
320
|
return Container;
|
|
333
321
|
},
|
|
334
|
-
|
|
335
|
-
return
|
|
336
|
-
},
|
|
337
|
-
DestroyType: function() {
|
|
338
|
-
return DestroyType;
|
|
339
|
-
},
|
|
340
|
-
DivMode: function() {
|
|
341
|
-
return DivMode;
|
|
342
|
-
},
|
|
343
|
-
DivType: function() {
|
|
344
|
-
return DivType;
|
|
345
|
-
},
|
|
346
|
-
EasingType: function() {
|
|
347
|
-
return EasingType;
|
|
322
|
+
Engine: function() {
|
|
323
|
+
return Engine;
|
|
348
324
|
},
|
|
349
|
-
|
|
350
|
-
return
|
|
351
|
-
},
|
|
352
|
-
EmitterShapeType: function() {
|
|
353
|
-
return EmitterShapeType;
|
|
325
|
+
EventListeners: function() {
|
|
326
|
+
return EventListeners;
|
|
354
327
|
},
|
|
355
328
|
ExternalInteractorBase: function() {
|
|
356
329
|
return ExternalInteractorBase;
|
|
357
330
|
},
|
|
358
|
-
|
|
359
|
-
return
|
|
360
|
-
},
|
|
361
|
-
HoverMode: function() {
|
|
362
|
-
return HoverMode;
|
|
331
|
+
FrameManager: function() {
|
|
332
|
+
return FrameManager;
|
|
363
333
|
},
|
|
364
|
-
|
|
365
|
-
return
|
|
334
|
+
InteractionManager: function() {
|
|
335
|
+
return InteractionManager;
|
|
366
336
|
},
|
|
367
|
-
|
|
368
|
-
return
|
|
369
|
-
},
|
|
370
|
-
InteractorType: function() {
|
|
371
|
-
return InteractorType;
|
|
337
|
+
Loader: function() {
|
|
338
|
+
return Loader;
|
|
372
339
|
},
|
|
373
340
|
Main: function() {
|
|
374
|
-
return
|
|
375
|
-
},
|
|
376
|
-
MoveDirection: function() {
|
|
377
|
-
return MoveDirection;
|
|
378
|
-
},
|
|
379
|
-
MoveType: function() {
|
|
380
|
-
return MoveType;
|
|
381
|
-
},
|
|
382
|
-
OrbitType: function() {
|
|
383
|
-
return OrbitType;
|
|
384
|
-
},
|
|
385
|
-
OutMode: function() {
|
|
386
|
-
return OutMode;
|
|
387
|
-
},
|
|
388
|
-
OutModeDirection: function() {
|
|
389
|
-
return OutModeDirection;
|
|
341
|
+
return Engine;
|
|
390
342
|
},
|
|
391
343
|
Particle: function() {
|
|
392
344
|
return Particle;
|
|
393
345
|
},
|
|
346
|
+
Particles: function() {
|
|
347
|
+
return Particles;
|
|
348
|
+
},
|
|
394
349
|
ParticlesInteractorBase: function() {
|
|
395
350
|
return ParticlesInteractorBase;
|
|
396
351
|
},
|
|
397
|
-
|
|
398
|
-
return
|
|
399
|
-
},
|
|
400
|
-
Rectangle: function() {
|
|
401
|
-
return Rectangle;
|
|
402
|
-
},
|
|
403
|
-
ResponsiveMode: function() {
|
|
404
|
-
return ResponsiveMode;
|
|
405
|
-
},
|
|
406
|
-
RollMode: function() {
|
|
407
|
-
return RollMode;
|
|
352
|
+
ParticlesMover: function() {
|
|
353
|
+
return ParticlesMover;
|
|
408
354
|
},
|
|
409
|
-
|
|
410
|
-
return
|
|
355
|
+
Plugins: function() {
|
|
356
|
+
return Plugins;
|
|
411
357
|
},
|
|
412
|
-
|
|
413
|
-
return
|
|
414
|
-
},
|
|
415
|
-
SizeMode: function() {
|
|
416
|
-
return SizeMode;
|
|
358
|
+
Point: function() {
|
|
359
|
+
return Point;
|
|
417
360
|
},
|
|
418
|
-
|
|
419
|
-
return
|
|
361
|
+
QuadTree: function() {
|
|
362
|
+
return QuadTree;
|
|
420
363
|
},
|
|
421
|
-
|
|
422
|
-
return
|
|
364
|
+
Range: function() {
|
|
365
|
+
return Range;
|
|
423
366
|
},
|
|
424
|
-
|
|
425
|
-
return
|
|
367
|
+
Rectangle: function() {
|
|
368
|
+
return Rectangle;
|
|
426
369
|
},
|
|
427
|
-
|
|
428
|
-
return
|
|
370
|
+
Retina: function() {
|
|
371
|
+
return Retina;
|
|
429
372
|
},
|
|
430
373
|
Vector: function() {
|
|
431
374
|
return Vector;
|
|
432
375
|
},
|
|
376
|
+
Vector3d: function() {
|
|
377
|
+
return Vector3d;
|
|
378
|
+
},
|
|
433
379
|
alterHsl: function() {
|
|
434
380
|
return alterHsl;
|
|
435
381
|
},
|
|
@@ -650,10 +596,10 @@
|
|
|
650
596
|
return tsParticles;
|
|
651
597
|
}
|
|
652
598
|
});
|
|
653
|
-
const initPjs =
|
|
654
|
-
const particlesJS = (tagId, options) =>
|
|
599
|
+
const initPjs = engine => {
|
|
600
|
+
const particlesJS = (tagId, options) => engine.load(tagId, options);
|
|
655
601
|
particlesJS.load = (tagId, pathConfigJson, callback) => {
|
|
656
|
-
|
|
602
|
+
engine.loadJSON(tagId, pathConfigJson).then((container => {
|
|
657
603
|
if (container) {
|
|
658
604
|
callback(container);
|
|
659
605
|
}
|
|
@@ -662,279 +608,20 @@
|
|
|
662
608
|
}));
|
|
663
609
|
};
|
|
664
610
|
particlesJS.setOnClickHandler = callback => {
|
|
665
|
-
|
|
611
|
+
engine.setOnClickHandler(callback);
|
|
666
612
|
};
|
|
667
|
-
const pJSDom =
|
|
613
|
+
const pJSDom = engine.dom();
|
|
668
614
|
return {
|
|
669
615
|
particlesJS: particlesJS,
|
|
670
616
|
pJSDom: pJSDom
|
|
671
617
|
};
|
|
672
618
|
};
|
|
673
|
-
|
|
674
|
-
(function(MoveDirection) {
|
|
675
|
-
MoveDirection["bottom"] = "bottom";
|
|
676
|
-
MoveDirection["bottomLeft"] = "bottom-left";
|
|
677
|
-
MoveDirection["bottomRight"] = "bottom-right";
|
|
678
|
-
MoveDirection["left"] = "left";
|
|
679
|
-
MoveDirection["none"] = "none";
|
|
680
|
-
MoveDirection["right"] = "right";
|
|
681
|
-
MoveDirection["top"] = "top";
|
|
682
|
-
MoveDirection["topLeft"] = "top-left";
|
|
683
|
-
MoveDirection["topRight"] = "top-right";
|
|
684
|
-
})(MoveDirection || (MoveDirection = {}));
|
|
685
|
-
var RotateDirection;
|
|
686
|
-
(function(RotateDirection) {
|
|
687
|
-
RotateDirection["clockwise"] = "clockwise";
|
|
688
|
-
RotateDirection["counterClockwise"] = "counter-clockwise";
|
|
689
|
-
RotateDirection["random"] = "random";
|
|
690
|
-
})(RotateDirection || (RotateDirection = {}));
|
|
691
|
-
var OutModeDirection;
|
|
692
|
-
(function(OutModeDirection) {
|
|
693
|
-
OutModeDirection["bottom"] = "bottom";
|
|
694
|
-
OutModeDirection["left"] = "left";
|
|
695
|
-
OutModeDirection["right"] = "right";
|
|
696
|
-
OutModeDirection["top"] = "top";
|
|
697
|
-
})(OutModeDirection || (OutModeDirection = {}));
|
|
698
|
-
var TiltDirection;
|
|
699
|
-
(function(TiltDirection) {
|
|
700
|
-
TiltDirection["clockwise"] = "clockwise";
|
|
701
|
-
TiltDirection["counterClockwise"] = "counter-clockwise";
|
|
702
|
-
TiltDirection["random"] = "random";
|
|
703
|
-
})(TiltDirection || (TiltDirection = {}));
|
|
704
|
-
var ClickMode;
|
|
705
|
-
(function(ClickMode) {
|
|
706
|
-
ClickMode["attract"] = "attract";
|
|
707
|
-
ClickMode["bubble"] = "bubble";
|
|
708
|
-
ClickMode["push"] = "push";
|
|
709
|
-
ClickMode["remove"] = "remove";
|
|
710
|
-
ClickMode["repulse"] = "repulse";
|
|
711
|
-
ClickMode["pause"] = "pause";
|
|
712
|
-
ClickMode["trail"] = "trail";
|
|
713
|
-
})(ClickMode || (ClickMode = {}));
|
|
714
|
-
var DestroyMode;
|
|
715
|
-
(function(DestroyMode) {
|
|
716
|
-
DestroyMode["none"] = "none";
|
|
717
|
-
DestroyMode["split"] = "split";
|
|
718
|
-
})(DestroyMode || (DestroyMode = {}));
|
|
719
|
-
var DivMode;
|
|
720
|
-
(function(DivMode) {
|
|
721
|
-
DivMode["bounce"] = "bounce";
|
|
722
|
-
DivMode["bubble"] = "bubble";
|
|
723
|
-
DivMode["repulse"] = "repulse";
|
|
724
|
-
})(DivMode || (DivMode = {}));
|
|
725
|
-
var HoverMode;
|
|
726
|
-
(function(HoverMode) {
|
|
727
|
-
HoverMode["attract"] = "attract";
|
|
728
|
-
HoverMode["bounce"] = "bounce";
|
|
729
|
-
HoverMode["bubble"] = "bubble";
|
|
730
|
-
HoverMode["connect"] = "connect";
|
|
731
|
-
HoverMode["grab"] = "grab";
|
|
732
|
-
HoverMode["light"] = "light";
|
|
733
|
-
HoverMode["repulse"] = "repulse";
|
|
734
|
-
HoverMode["slow"] = "slow";
|
|
735
|
-
HoverMode["trail"] = "trail";
|
|
736
|
-
})(HoverMode || (HoverMode = {}));
|
|
737
|
-
var CollisionMode;
|
|
738
|
-
(function(CollisionMode) {
|
|
739
|
-
CollisionMode["absorb"] = "absorb";
|
|
740
|
-
CollisionMode["bounce"] = "bounce";
|
|
741
|
-
CollisionMode["destroy"] = "destroy";
|
|
742
|
-
})(CollisionMode || (CollisionMode = {}));
|
|
743
|
-
var OutMode;
|
|
744
|
-
(function(OutMode) {
|
|
745
|
-
OutMode["bounce"] = "bounce";
|
|
746
|
-
OutMode["bounceHorizontal"] = "bounce-horizontal";
|
|
747
|
-
OutMode["bounceVertical"] = "bounce-vertical";
|
|
748
|
-
OutMode["none"] = "none";
|
|
749
|
-
OutMode["out"] = "out";
|
|
750
|
-
OutMode["destroy"] = "destroy";
|
|
751
|
-
OutMode["split"] = "split";
|
|
752
|
-
})(OutMode || (OutMode = {}));
|
|
753
|
-
var RollMode;
|
|
754
|
-
(function(RollMode) {
|
|
755
|
-
RollMode["both"] = "both";
|
|
756
|
-
RollMode["horizontal"] = "horizontal";
|
|
757
|
-
RollMode["vertical"] = "vertical";
|
|
758
|
-
})(RollMode || (RollMode = {}));
|
|
759
|
-
var SizeMode;
|
|
760
|
-
(function(SizeMode) {
|
|
761
|
-
SizeMode["precise"] = "precise";
|
|
762
|
-
SizeMode["percent"] = "percent";
|
|
763
|
-
})(SizeMode || (SizeMode = {}));
|
|
764
|
-
var ThemeMode;
|
|
765
|
-
(function(ThemeMode) {
|
|
766
|
-
ThemeMode["any"] = "any";
|
|
767
|
-
ThemeMode["dark"] = "dark";
|
|
768
|
-
ThemeMode["light"] = "light";
|
|
769
|
-
})(ThemeMode || (ThemeMode = {}));
|
|
770
|
-
var ResponsiveMode;
|
|
771
|
-
(function(ResponsiveMode) {
|
|
772
|
-
ResponsiveMode["screen"] = "screen";
|
|
773
|
-
ResponsiveMode["canvas"] = "canvas";
|
|
774
|
-
})(ResponsiveMode || (ResponsiveMode = {}));
|
|
775
|
-
var AnimationStatus;
|
|
776
|
-
(function(AnimationStatus) {
|
|
777
|
-
AnimationStatus[AnimationStatus["increasing"] = 0] = "increasing";
|
|
778
|
-
AnimationStatus[AnimationStatus["decreasing"] = 1] = "decreasing";
|
|
779
|
-
})(AnimationStatus || (AnimationStatus = {}));
|
|
780
|
-
var AlterType;
|
|
781
|
-
(function(AlterType) {
|
|
782
|
-
AlterType["darken"] = "darken";
|
|
783
|
-
AlterType["enlighten"] = "enlighten";
|
|
784
|
-
})(AlterType || (AlterType = {}));
|
|
785
|
-
var DestroyType;
|
|
786
|
-
(function(DestroyType) {
|
|
787
|
-
DestroyType["none"] = "none";
|
|
788
|
-
DestroyType["max"] = "max";
|
|
789
|
-
DestroyType["min"] = "min";
|
|
790
|
-
})(DestroyType || (DestroyType = {}));
|
|
791
|
-
var GradientType;
|
|
792
|
-
(function(GradientType) {
|
|
793
|
-
GradientType["linear"] = "linear";
|
|
794
|
-
GradientType["radial"] = "radial";
|
|
795
|
-
GradientType["random"] = "random";
|
|
796
|
-
})(GradientType || (GradientType = {}));
|
|
797
|
-
var InteractorType;
|
|
798
|
-
(function(InteractorType) {
|
|
799
|
-
InteractorType[InteractorType["External"] = 0] = "External";
|
|
800
|
-
InteractorType[InteractorType["Particles"] = 1] = "Particles";
|
|
801
|
-
})(InteractorType || (InteractorType = {}));
|
|
802
|
-
var ShapeType;
|
|
803
|
-
(function(ShapeType) {
|
|
804
|
-
ShapeType["char"] = "char";
|
|
805
|
-
ShapeType["character"] = "character";
|
|
806
|
-
ShapeType["circle"] = "circle";
|
|
807
|
-
ShapeType["edge"] = "edge";
|
|
808
|
-
ShapeType["image"] = "image";
|
|
809
|
-
ShapeType["images"] = "images";
|
|
810
|
-
ShapeType["line"] = "line";
|
|
811
|
-
ShapeType["polygon"] = "polygon";
|
|
812
|
-
ShapeType["square"] = "square";
|
|
813
|
-
ShapeType["star"] = "star";
|
|
814
|
-
ShapeType["triangle"] = "triangle";
|
|
815
|
-
})(ShapeType || (ShapeType = {}));
|
|
816
|
-
var StartValueType;
|
|
817
|
-
(function(StartValueType) {
|
|
818
|
-
StartValueType["max"] = "max";
|
|
819
|
-
StartValueType["min"] = "min";
|
|
820
|
-
StartValueType["random"] = "random";
|
|
821
|
-
})(StartValueType || (StartValueType = {}));
|
|
822
|
-
var DivType;
|
|
823
|
-
(function(DivType) {
|
|
824
|
-
DivType["circle"] = "circle";
|
|
825
|
-
DivType["rectangle"] = "rectangle";
|
|
826
|
-
})(DivType || (DivType = {}));
|
|
827
|
-
var EasingType;
|
|
828
|
-
(function(EasingType) {
|
|
829
|
-
EasingType["easeOutBack"] = "ease-out-back";
|
|
830
|
-
EasingType["easeOutCirc"] = "ease-out-circ";
|
|
831
|
-
EasingType["easeOutCubic"] = "ease-out-cubic";
|
|
832
|
-
EasingType["easeOutQuad"] = "ease-out-quad";
|
|
833
|
-
EasingType["easeOutQuart"] = "ease-out-quart";
|
|
834
|
-
EasingType["easeOutQuint"] = "ease-out-quint";
|
|
835
|
-
EasingType["easeOutExpo"] = "ease-out-expo";
|
|
836
|
-
EasingType["easeOutSine"] = "ease-out-sine";
|
|
837
|
-
})(EasingType || (EasingType = {}));
|
|
838
|
-
var OrbitType;
|
|
839
|
-
(function(OrbitType) {
|
|
840
|
-
OrbitType["front"] = "front";
|
|
841
|
-
OrbitType["back"] = "back";
|
|
842
|
-
})(OrbitType || (OrbitType = {}));
|
|
843
|
-
var InteractivityDetect;
|
|
844
|
-
(function(InteractivityDetect) {
|
|
845
|
-
InteractivityDetect["canvas"] = "canvas";
|
|
846
|
-
InteractivityDetect["parent"] = "parent";
|
|
847
|
-
InteractivityDetect["window"] = "window";
|
|
848
|
-
})(InteractivityDetect || (InteractivityDetect = {}));
|
|
849
|
-
class Vector {
|
|
619
|
+
class Range {
|
|
850
620
|
constructor(x, y) {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
const coords = x;
|
|
857
|
-
[defX, defY] = [ coords.x, coords.y ];
|
|
858
|
-
} else {
|
|
859
|
-
[defX, defY] = [ x, y ];
|
|
860
|
-
}
|
|
861
|
-
this.x = defX;
|
|
862
|
-
this.y = defY;
|
|
863
|
-
}
|
|
864
|
-
static clone(source) {
|
|
865
|
-
return Vector.create(source.x, source.y);
|
|
866
|
-
}
|
|
867
|
-
static create(x, y) {
|
|
868
|
-
return new Vector(x, y);
|
|
869
|
-
}
|
|
870
|
-
static get origin() {
|
|
871
|
-
return Vector.create(0, 0);
|
|
872
|
-
}
|
|
873
|
-
get angle() {
|
|
874
|
-
return Math.atan2(this.y, this.x);
|
|
875
|
-
}
|
|
876
|
-
set angle(angle) {
|
|
877
|
-
this.updateFromAngle(angle, this.length);
|
|
878
|
-
}
|
|
879
|
-
get length() {
|
|
880
|
-
return Math.sqrt(this.x ** 2 + this.y ** 2);
|
|
881
|
-
}
|
|
882
|
-
set length(length) {
|
|
883
|
-
this.updateFromAngle(this.angle, length);
|
|
884
|
-
}
|
|
885
|
-
add(v) {
|
|
886
|
-
return Vector.create(this.x + v.x, this.y + v.y);
|
|
887
|
-
}
|
|
888
|
-
addTo(v) {
|
|
889
|
-
this.x += v.x;
|
|
890
|
-
this.y += v.y;
|
|
891
|
-
}
|
|
892
|
-
sub(v) {
|
|
893
|
-
return Vector.create(this.x - v.x, this.y - v.y);
|
|
894
|
-
}
|
|
895
|
-
subFrom(v) {
|
|
896
|
-
this.x -= v.x;
|
|
897
|
-
this.y -= v.y;
|
|
898
|
-
}
|
|
899
|
-
mult(n) {
|
|
900
|
-
return Vector.create(this.x * n, this.y * n);
|
|
901
|
-
}
|
|
902
|
-
multTo(n) {
|
|
903
|
-
this.x *= n;
|
|
904
|
-
this.y *= n;
|
|
905
|
-
}
|
|
906
|
-
div(n) {
|
|
907
|
-
return Vector.create(this.x / n, this.y / n);
|
|
908
|
-
}
|
|
909
|
-
divTo(n) {
|
|
910
|
-
this.x /= n;
|
|
911
|
-
this.y /= n;
|
|
912
|
-
}
|
|
913
|
-
distanceTo(v) {
|
|
914
|
-
return this.sub(v).length;
|
|
915
|
-
}
|
|
916
|
-
getLengthSq() {
|
|
917
|
-
return this.x ** 2 + this.y ** 2;
|
|
918
|
-
}
|
|
919
|
-
distanceToSq(v) {
|
|
920
|
-
return this.sub(v).getLengthSq();
|
|
921
|
-
}
|
|
922
|
-
manhattanDistanceTo(v) {
|
|
923
|
-
return Math.abs(v.x - this.x) + Math.abs(v.y - this.y);
|
|
924
|
-
}
|
|
925
|
-
copy() {
|
|
926
|
-
return Vector.clone(this);
|
|
927
|
-
}
|
|
928
|
-
setTo(velocity) {
|
|
929
|
-
this.x = velocity.x;
|
|
930
|
-
this.y = velocity.y;
|
|
931
|
-
}
|
|
932
|
-
rotate(angle) {
|
|
933
|
-
return Vector.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle));
|
|
934
|
-
}
|
|
935
|
-
updateFromAngle(angle, length) {
|
|
936
|
-
this.x = Math.cos(angle) * length;
|
|
937
|
-
this.y = Math.sin(angle) * length;
|
|
621
|
+
this.position = {
|
|
622
|
+
x: x,
|
|
623
|
+
y: y
|
|
624
|
+
};
|
|
938
625
|
}
|
|
939
626
|
}
|
|
940
627
|
function clamp(num, min, max) {
|
|
@@ -995,31 +682,31 @@
|
|
|
995
682
|
return direction * Math.PI / 180;
|
|
996
683
|
} else {
|
|
997
684
|
switch (direction) {
|
|
998
|
-
case
|
|
685
|
+
case "top":
|
|
999
686
|
return -Math.PI / 2;
|
|
1000
687
|
|
|
1001
|
-
case
|
|
688
|
+
case "top-right":
|
|
1002
689
|
return -Math.PI / 4;
|
|
1003
690
|
|
|
1004
|
-
case
|
|
691
|
+
case "right":
|
|
1005
692
|
return 0;
|
|
1006
693
|
|
|
1007
|
-
case
|
|
694
|
+
case "bottom-right":
|
|
1008
695
|
return Math.PI / 4;
|
|
1009
696
|
|
|
1010
|
-
case
|
|
697
|
+
case "bottom":
|
|
1011
698
|
return Math.PI / 2;
|
|
1012
699
|
|
|
1013
|
-
case
|
|
700
|
+
case "bottom-left":
|
|
1014
701
|
return 3 * Math.PI / 4;
|
|
1015
702
|
|
|
1016
|
-
case
|
|
703
|
+
case "left":
|
|
1017
704
|
return Math.PI;
|
|
1018
705
|
|
|
1019
|
-
case
|
|
706
|
+
case "top-left":
|
|
1020
707
|
return -3 * Math.PI / 4;
|
|
1021
708
|
|
|
1022
|
-
case
|
|
709
|
+
case "none":
|
|
1023
710
|
default:
|
|
1024
711
|
return Math.random() * Math.PI * 2;
|
|
1025
712
|
}
|
|
@@ -1036,32 +723,32 @@
|
|
|
1036
723
|
}
|
|
1037
724
|
function calcEasing(value, type) {
|
|
1038
725
|
switch (type) {
|
|
1039
|
-
case
|
|
726
|
+
case "ease-out-quad":
|
|
1040
727
|
return 1 - (1 - value) ** 2;
|
|
1041
728
|
|
|
1042
|
-
case
|
|
729
|
+
case "ease-out-cubic":
|
|
1043
730
|
return 1 - (1 - value) ** 3;
|
|
1044
731
|
|
|
1045
|
-
case
|
|
732
|
+
case "ease-out-quart":
|
|
1046
733
|
return 1 - (1 - value) ** 4;
|
|
1047
734
|
|
|
1048
|
-
case
|
|
735
|
+
case "ease-out-quint":
|
|
1049
736
|
return 1 - (1 - value) ** 5;
|
|
1050
737
|
|
|
1051
|
-
case
|
|
738
|
+
case "ease-out-expo":
|
|
1052
739
|
return value === 1 ? 1 : 1 - Math.pow(2, -10 * value);
|
|
1053
740
|
|
|
1054
|
-
case
|
|
741
|
+
case "ease-out-sine":
|
|
1055
742
|
return Math.sin(value * Math.PI / 2);
|
|
1056
743
|
|
|
1057
|
-
case
|
|
744
|
+
case "ease-out-back":
|
|
1058
745
|
{
|
|
1059
746
|
const c1 = 1.70158;
|
|
1060
747
|
const c3 = c1 + 1;
|
|
1061
748
|
return 1 + c3 * Math.pow(value - 1, 3) + c1 * Math.pow(value - 1, 2);
|
|
1062
749
|
}
|
|
1063
750
|
|
|
1064
|
-
case
|
|
751
|
+
case "ease-out-circ":
|
|
1065
752
|
return Math.sqrt(1 - Math.pow(value - 1, 2));
|
|
1066
753
|
|
|
1067
754
|
default:
|
|
@@ -1122,16 +809,16 @@
|
|
|
1122
809
|
}
|
|
1123
810
|
function areBoundsInside(bounds, size, direction) {
|
|
1124
811
|
let inside = true;
|
|
1125
|
-
if (!direction || direction ===
|
|
812
|
+
if (!direction || direction === "bottom") {
|
|
1126
813
|
inside = bounds.top < size.height;
|
|
1127
814
|
}
|
|
1128
|
-
if (inside && (!direction || direction ===
|
|
815
|
+
if (inside && (!direction || direction === "left")) {
|
|
1129
816
|
inside = bounds.right > 0;
|
|
1130
817
|
}
|
|
1131
|
-
if (inside && (!direction || direction ===
|
|
818
|
+
if (inside && (!direction || direction === "right")) {
|
|
1132
819
|
inside = bounds.left < size.width;
|
|
1133
820
|
}
|
|
1134
|
-
if (inside && (!direction || direction ===
|
|
821
|
+
if (inside && (!direction || direction === "top")) {
|
|
1135
822
|
inside = bounds.bottom > 0;
|
|
1136
823
|
}
|
|
1137
824
|
return inside;
|
|
@@ -1288,23 +975,6 @@
|
|
|
1288
975
|
}
|
|
1289
976
|
}
|
|
1290
977
|
}
|
|
1291
|
-
class Constants {}
|
|
1292
|
-
Constants.generatedAttribute = "generated";
|
|
1293
|
-
Constants.randomColorValue = "random";
|
|
1294
|
-
Constants.midColorValue = "mid";
|
|
1295
|
-
Constants.touchEndEvent = "touchend";
|
|
1296
|
-
Constants.mouseDownEvent = "mousedown";
|
|
1297
|
-
Constants.mouseUpEvent = "mouseup";
|
|
1298
|
-
Constants.mouseMoveEvent = "mousemove";
|
|
1299
|
-
Constants.touchStartEvent = "touchstart";
|
|
1300
|
-
Constants.touchMoveEvent = "touchmove";
|
|
1301
|
-
Constants.mouseLeaveEvent = "mouseleave";
|
|
1302
|
-
Constants.mouseOutEvent = "mouseout";
|
|
1303
|
-
Constants.touchCancelEvent = "touchcancel";
|
|
1304
|
-
Constants.resizeEvent = "resize";
|
|
1305
|
-
Constants.visibilityChangeEvent = "visibilitychange";
|
|
1306
|
-
Constants.noPolygonDataLoaded = "No polygon data loaded.";
|
|
1307
|
-
Constants.noPolygonFound = "No polygon found, you need to specify SVG url in config.";
|
|
1308
978
|
function hue2rgb(p, q, t) {
|
|
1309
979
|
let tCalc = t;
|
|
1310
980
|
if (tCalc < 0) {
|
|
@@ -1714,7 +1384,7 @@
|
|
|
1714
1384
|
if (colorAnimation.sync) {
|
|
1715
1385
|
return;
|
|
1716
1386
|
}
|
|
1717
|
-
colorValue.status =
|
|
1387
|
+
colorValue.status = 0;
|
|
1718
1388
|
colorValue.velocity *= Math.random();
|
|
1719
1389
|
if (colorValue.value) {
|
|
1720
1390
|
colorValue.value *= Math.random();
|
|
@@ -1877,8 +1547,8 @@
|
|
|
1877
1547
|
if (tiltOptions.enable || rollOptions.enable) {
|
|
1878
1548
|
const roll = rollOptions.enable && particle.roll;
|
|
1879
1549
|
const tilt = tiltOptions.enable && particle.tilt;
|
|
1880
|
-
const rollHorizontal = roll && (rollOptions.mode ===
|
|
1881
|
-
const rollVertical = roll && (rollOptions.mode ===
|
|
1550
|
+
const rollHorizontal = roll && (rollOptions.mode === "horizontal" || rollOptions.mode === "both");
|
|
1551
|
+
const rollVertical = roll && (rollOptions.mode === "vertical" || rollOptions.mode === "both");
|
|
1882
1552
|
context.setTransform(rollHorizontal ? Math.cos(particle.roll.angle) : 1, tilt ? Math.cos(particle.tilt.value) * particle.tilt.cosDirection : 0, tilt ? Math.sin(particle.tilt.value) * particle.tilt.sinDirection : 0, rollVertical ? Math.sin(particle.roll.angle) : 1, pos.x, pos.y);
|
|
1883
1553
|
} else {
|
|
1884
1554
|
context.translate(pos.x, pos.y);
|
|
@@ -1900,7 +1570,7 @@
|
|
|
1900
1570
|
}
|
|
1901
1571
|
if (gradient) {
|
|
1902
1572
|
const gradientAngle = gradient.angle.value;
|
|
1903
|
-
const fillGradient = gradient.type ===
|
|
1573
|
+
const fillGradient = gradient.type === "radial" ? context.createRadialGradient(0, 0, 0, 0, 0, radius) : context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);
|
|
1904
1574
|
for (const color of gradient.colors) {
|
|
1905
1575
|
fillGradient.addColorStop(color.stop, getStyleFromHsl({
|
|
1906
1576
|
h: color.value.h.value,
|
|
@@ -1998,17 +1668,9 @@
|
|
|
1998
1668
|
return {
|
|
1999
1669
|
h: color.h,
|
|
2000
1670
|
s: color.s,
|
|
2001
|
-
l: color.l + (type ===
|
|
1671
|
+
l: color.l + (type === "darken" ? -1 : 1) * value
|
|
2002
1672
|
};
|
|
2003
1673
|
}
|
|
2004
|
-
class Range {
|
|
2005
|
-
constructor(x, y) {
|
|
2006
|
-
this.position = {
|
|
2007
|
-
x: x,
|
|
2008
|
-
y: y
|
|
2009
|
-
};
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
1674
|
class Circle extends Range {
|
|
2013
1675
|
constructor(x, y, radius) {
|
|
2014
1676
|
super(x, y);
|
|
@@ -2129,6 +1791,23 @@
|
|
|
2129
1791
|
return false;
|
|
2130
1792
|
}
|
|
2131
1793
|
}
|
|
1794
|
+
class Constants {}
|
|
1795
|
+
Constants.generatedAttribute = "generated";
|
|
1796
|
+
Constants.randomColorValue = "random";
|
|
1797
|
+
Constants.midColorValue = "mid";
|
|
1798
|
+
Constants.touchEndEvent = "touchend";
|
|
1799
|
+
Constants.mouseDownEvent = "mousedown";
|
|
1800
|
+
Constants.mouseUpEvent = "mouseup";
|
|
1801
|
+
Constants.mouseMoveEvent = "mousemove";
|
|
1802
|
+
Constants.touchStartEvent = "touchstart";
|
|
1803
|
+
Constants.touchMoveEvent = "touchmove";
|
|
1804
|
+
Constants.mouseLeaveEvent = "mouseleave";
|
|
1805
|
+
Constants.mouseOutEvent = "mouseout";
|
|
1806
|
+
Constants.touchCancelEvent = "touchcancel";
|
|
1807
|
+
Constants.resizeEvent = "resize";
|
|
1808
|
+
Constants.visibilityChangeEvent = "visibilitychange";
|
|
1809
|
+
Constants.noPolygonDataLoaded = "No polygon data loaded.";
|
|
1810
|
+
Constants.noPolygonFound = "No polygon found, you need to specify SVG url in config.";
|
|
2132
1811
|
function manageListener(element, event, handler, add, options) {
|
|
2133
1812
|
if (add) {
|
|
2134
1813
|
let addOptions = {
|
|
@@ -2175,10 +1854,10 @@
|
|
|
2175
1854
|
const options = container.actualOptions;
|
|
2176
1855
|
const detectType = options.interactivity.detectsOn;
|
|
2177
1856
|
let mouseLeaveEvent = Constants.mouseLeaveEvent;
|
|
2178
|
-
if (detectType ===
|
|
1857
|
+
if (detectType === "window") {
|
|
2179
1858
|
container.interactivity.element = window;
|
|
2180
1859
|
mouseLeaveEvent = Constants.mouseOutEvent;
|
|
2181
|
-
} else if (detectType ===
|
|
1860
|
+
} else if (detectType === "parent" && container.canvas.element) {
|
|
2182
1861
|
const canvasEl = container.canvas.element;
|
|
2183
1862
|
container.interactivity.element = (_a = canvasEl.parentElement) !== null && _a !== void 0 ? _a : canvasEl.parentNode;
|
|
2184
1863
|
} else {
|
|
@@ -2302,7 +1981,7 @@
|
|
|
2302
1981
|
y: mouseEvent.clientY - clientRect.top
|
|
2303
1982
|
};
|
|
2304
1983
|
}
|
|
2305
|
-
} else if (options.interactivity.detectsOn ===
|
|
1984
|
+
} else if (options.interactivity.detectsOn === "parent") {
|
|
2306
1985
|
const source = mouseEvent.target;
|
|
2307
1986
|
const target = mouseEvent.currentTarget;
|
|
2308
1987
|
const canvasEl = container.canvas.element;
|
|
@@ -2423,7 +2102,7 @@
|
|
|
2423
2102
|
const pushNb = options.interactivity.modes.push.quantity;
|
|
2424
2103
|
const removeNb = options.interactivity.modes.remove.quantity;
|
|
2425
2104
|
switch (mode) {
|
|
2426
|
-
case
|
|
2105
|
+
case "push":
|
|
2427
2106
|
{
|
|
2428
2107
|
if (pushNb > 0) {
|
|
2429
2108
|
const pushOptions = options.interactivity.modes.push;
|
|
@@ -2434,15 +2113,15 @@
|
|
|
2434
2113
|
break;
|
|
2435
2114
|
}
|
|
2436
2115
|
|
|
2437
|
-
case
|
|
2116
|
+
case "remove":
|
|
2438
2117
|
container.particles.removeQuantity(removeNb);
|
|
2439
2118
|
break;
|
|
2440
2119
|
|
|
2441
|
-
case
|
|
2120
|
+
case "bubble":
|
|
2442
2121
|
container.bubble.clicking = true;
|
|
2443
2122
|
break;
|
|
2444
2123
|
|
|
2445
|
-
case
|
|
2124
|
+
case "repulse":
|
|
2446
2125
|
container.repulse.clicking = true;
|
|
2447
2126
|
container.repulse.count = 0;
|
|
2448
2127
|
for (const particle of container.repulse.particles) {
|
|
@@ -2457,7 +2136,7 @@
|
|
|
2457
2136
|
}), options.interactivity.modes.repulse.duration * 1e3);
|
|
2458
2137
|
break;
|
|
2459
2138
|
|
|
2460
|
-
case
|
|
2139
|
+
case "attract":
|
|
2461
2140
|
container.attract.clicking = true;
|
|
2462
2141
|
container.attract.count = 0;
|
|
2463
2142
|
for (const particle of container.attract.particles) {
|
|
@@ -2472,7 +2151,7 @@
|
|
|
2472
2151
|
}), options.interactivity.modes.attract.duration * 1e3);
|
|
2473
2152
|
break;
|
|
2474
2153
|
|
|
2475
|
-
case
|
|
2154
|
+
case "pause":
|
|
2476
2155
|
if (container.getAnimationStatus()) {
|
|
2477
2156
|
container.pause();
|
|
2478
2157
|
} else {
|
|
@@ -2487,50 +2166,311 @@
|
|
|
2487
2166
|
}
|
|
2488
2167
|
}
|
|
2489
2168
|
}
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
const updaters = new Map;
|
|
2495
|
-
const presets = new Map;
|
|
2496
|
-
const drawers = new Map;
|
|
2497
|
-
const pathGenerators = new Map;
|
|
2498
|
-
class Plugins {
|
|
2499
|
-
static getPlugin(plugin) {
|
|
2500
|
-
return plugins.find((t => t.id === plugin));
|
|
2169
|
+
class ExternalInteractorBase {
|
|
2170
|
+
constructor(container) {
|
|
2171
|
+
this.container = container;
|
|
2172
|
+
this.type = 0;
|
|
2501
2173
|
}
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2174
|
+
}
|
|
2175
|
+
class FrameManager {
|
|
2176
|
+
constructor(container) {
|
|
2177
|
+
this.container = container;
|
|
2506
2178
|
}
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2179
|
+
nextFrame(timestamp) {
|
|
2180
|
+
var _a;
|
|
2181
|
+
try {
|
|
2182
|
+
const container = this.container;
|
|
2183
|
+
if (container.lastFrameTime !== undefined && timestamp < container.lastFrameTime + 1e3 / container.fpsLimit) {
|
|
2184
|
+
container.draw(false);
|
|
2185
|
+
return;
|
|
2512
2186
|
}
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2187
|
+
(_a = container.lastFrameTime) !== null && _a !== void 0 ? _a : container.lastFrameTime = timestamp;
|
|
2188
|
+
const deltaValue = timestamp - container.lastFrameTime;
|
|
2189
|
+
const delta = {
|
|
2190
|
+
value: deltaValue,
|
|
2191
|
+
factor: 60 * deltaValue / 1e3
|
|
2192
|
+
};
|
|
2193
|
+
container.lifeTime += delta.value;
|
|
2194
|
+
container.lastFrameTime = timestamp;
|
|
2195
|
+
if (deltaValue > 1e3) {
|
|
2196
|
+
container.draw(false);
|
|
2197
|
+
return;
|
|
2198
|
+
}
|
|
2199
|
+
container.particles.draw(delta);
|
|
2200
|
+
if (container.duration > 0 && container.lifeTime > container.duration) {
|
|
2201
|
+
container.destroy();
|
|
2202
|
+
return;
|
|
2203
|
+
}
|
|
2204
|
+
if (container.getAnimationStatus()) {
|
|
2205
|
+
container.draw(false);
|
|
2206
|
+
}
|
|
2207
|
+
} catch (e) {
|
|
2208
|
+
console.error("tsParticles error in animation loop", e);
|
|
2520
2209
|
}
|
|
2521
2210
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2211
|
+
}
|
|
2212
|
+
class InteractionManager {
|
|
2213
|
+
constructor(container) {
|
|
2214
|
+
this.container = container;
|
|
2215
|
+
this.externalInteractors = [];
|
|
2216
|
+
this.particleInteractors = [];
|
|
2217
|
+
this.init();
|
|
2524
2218
|
}
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2219
|
+
init() {
|
|
2220
|
+
const interactors = Plugins.getInteractors(this.container, true);
|
|
2221
|
+
for (const interactor of interactors) {
|
|
2222
|
+
switch (interactor.type) {
|
|
2223
|
+
case 0:
|
|
2224
|
+
this.externalInteractors.push(interactor);
|
|
2225
|
+
break;
|
|
2226
|
+
|
|
2227
|
+
case 1:
|
|
2228
|
+
this.particleInteractors.push(interactor);
|
|
2229
|
+
break;
|
|
2230
|
+
}
|
|
2528
2231
|
}
|
|
2529
2232
|
}
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2233
|
+
externalInteract(delta) {
|
|
2234
|
+
for (const interactor of this.externalInteractors) {
|
|
2235
|
+
if (interactor.isEnabled()) {
|
|
2236
|
+
interactor.interact(delta);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
particlesInteract(particle, delta) {
|
|
2241
|
+
for (const interactor of this.externalInteractors) {
|
|
2242
|
+
interactor.reset(particle);
|
|
2243
|
+
}
|
|
2244
|
+
for (const interactor of this.particleInteractors) {
|
|
2245
|
+
if (interactor.isEnabled(particle)) {
|
|
2246
|
+
interactor.interact(particle, delta);
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
class ParticlesInteractorBase {
|
|
2252
|
+
constructor(container) {
|
|
2253
|
+
this.container = container;
|
|
2254
|
+
this.type = 1;
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
function applyDistance(particle) {
|
|
2258
|
+
const initialPosition = particle.initialPosition;
|
|
2259
|
+
const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
|
|
2260
|
+
const dxFixed = Math.abs(dx), dyFixed = Math.abs(dy);
|
|
2261
|
+
const hDistance = particle.retina.maxDistance.horizontal;
|
|
2262
|
+
const vDistance = particle.retina.maxDistance.vertical;
|
|
2263
|
+
if (!hDistance && !vDistance) {
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
if ((hDistance && dxFixed >= hDistance || vDistance && dyFixed >= vDistance) && !particle.misplaced) {
|
|
2267
|
+
particle.misplaced = !!hDistance && dxFixed > hDistance || !!vDistance && dyFixed > vDistance;
|
|
2268
|
+
if (hDistance) {
|
|
2269
|
+
particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
|
|
2270
|
+
}
|
|
2271
|
+
if (vDistance) {
|
|
2272
|
+
particle.velocity.y = particle.velocity.x / 2 - particle.velocity.y;
|
|
2273
|
+
}
|
|
2274
|
+
} else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {
|
|
2275
|
+
particle.misplaced = false;
|
|
2276
|
+
} else if (particle.misplaced) {
|
|
2277
|
+
const pos = particle.position, vel = particle.velocity;
|
|
2278
|
+
if (hDistance && (pos.x < initialPosition.x && vel.x < 0 || pos.x > initialPosition.x && vel.x > 0)) {
|
|
2279
|
+
vel.x *= -Math.random();
|
|
2280
|
+
}
|
|
2281
|
+
if (vDistance && (pos.y < initialPosition.y && vel.y < 0 || pos.y > initialPosition.y && vel.y > 0)) {
|
|
2282
|
+
vel.y *= -Math.random();
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
class ParticlesMover {
|
|
2287
|
+
constructor(container) {
|
|
2288
|
+
this.container = container;
|
|
2289
|
+
}
|
|
2290
|
+
move(particle, delta) {
|
|
2291
|
+
if (particle.destroyed) {
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
this.moveParticle(particle, delta);
|
|
2295
|
+
this.moveParallax(particle);
|
|
2296
|
+
}
|
|
2297
|
+
moveParticle(particle, delta) {
|
|
2298
|
+
var _a, _b, _c;
|
|
2299
|
+
var _d, _e;
|
|
2300
|
+
const particleOptions = particle.options;
|
|
2301
|
+
const moveOptions = particleOptions.move;
|
|
2302
|
+
if (!moveOptions.enable) {
|
|
2303
|
+
return;
|
|
2304
|
+
}
|
|
2305
|
+
const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : _d.moveSpeed = getRangeValue(moveOptions.speed) * container.retina.pixelRatio) * container.retina.reduceFactor, moveDrift = (_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : _e.moveDrift = getRangeValue(particle.options.move.drift) * container.retina.pixelRatio, maxSize = getRangeMax(particleOptions.size.value) * container.retina.pixelRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, diffFactor = 2, speedFactor = sizeFactor * slowFactor * (delta.factor || 1) / diffFactor, moveSpeed = baseSpeed * speedFactor;
|
|
2306
|
+
this.applyPath(particle, delta);
|
|
2307
|
+
const gravityOptions = moveOptions.gravity;
|
|
2308
|
+
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
2309
|
+
if (gravityOptions.enable && moveSpeed) {
|
|
2310
|
+
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
2311
|
+
}
|
|
2312
|
+
if (moveDrift && moveSpeed) {
|
|
2313
|
+
particle.velocity.x += moveDrift * delta.factor / (60 * moveSpeed);
|
|
2314
|
+
}
|
|
2315
|
+
const decay = particle.moveDecay;
|
|
2316
|
+
if (decay != 1) {
|
|
2317
|
+
particle.velocity.multTo(decay);
|
|
2318
|
+
}
|
|
2319
|
+
const velocity = particle.velocity.mult(moveSpeed);
|
|
2320
|
+
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
2321
|
+
if (gravityOptions.enable && gravityOptions.maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
2322
|
+
velocity.y = gravityFactor * maxSpeed;
|
|
2323
|
+
if (moveSpeed) {
|
|
2324
|
+
particle.velocity.y = velocity.y / moveSpeed;
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
const zIndexOptions = particle.options.zIndex, zVelocityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.velocityRate;
|
|
2328
|
+
if (moveOptions.spin.enable) {
|
|
2329
|
+
this.spin(particle, moveSpeed);
|
|
2330
|
+
} else {
|
|
2331
|
+
if (zVelocityFactor != 1) {
|
|
2332
|
+
velocity.multTo(zVelocityFactor);
|
|
2333
|
+
}
|
|
2334
|
+
particle.position.addTo(velocity);
|
|
2335
|
+
if (moveOptions.vibrate) {
|
|
2336
|
+
particle.position.x += Math.sin(particle.position.x * Math.cos(particle.position.y));
|
|
2337
|
+
particle.position.y += Math.cos(particle.position.y * Math.sin(particle.position.x));
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
applyDistance(particle);
|
|
2341
|
+
}
|
|
2342
|
+
spin(particle, moveSpeed) {
|
|
2343
|
+
const container = this.container;
|
|
2344
|
+
if (!particle.spin) {
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2347
|
+
const updateFunc = {
|
|
2348
|
+
x: particle.spin.direction === "clockwise" ? Math.cos : Math.sin,
|
|
2349
|
+
y: particle.spin.direction === "clockwise" ? Math.sin : Math.cos
|
|
2350
|
+
};
|
|
2351
|
+
particle.position.x = particle.spin.center.x + particle.spin.radius * updateFunc.x(particle.spin.angle);
|
|
2352
|
+
particle.position.y = particle.spin.center.y + particle.spin.radius * updateFunc.y(particle.spin.angle);
|
|
2353
|
+
particle.spin.radius += particle.spin.acceleration;
|
|
2354
|
+
const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height);
|
|
2355
|
+
if (particle.spin.radius > maxCanvasSize / 2) {
|
|
2356
|
+
particle.spin.radius = maxCanvasSize / 2;
|
|
2357
|
+
particle.spin.acceleration *= -1;
|
|
2358
|
+
} else if (particle.spin.radius < 0) {
|
|
2359
|
+
particle.spin.radius = 0;
|
|
2360
|
+
particle.spin.acceleration *= -1;
|
|
2361
|
+
}
|
|
2362
|
+
particle.spin.angle += moveSpeed / 100 * (1 - particle.spin.radius / maxCanvasSize);
|
|
2363
|
+
}
|
|
2364
|
+
applyPath(particle, delta) {
|
|
2365
|
+
const particlesOptions = particle.options;
|
|
2366
|
+
const pathOptions = particlesOptions.move.path;
|
|
2367
|
+
const pathEnabled = pathOptions.enable;
|
|
2368
|
+
if (!pathEnabled) {
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
const container = this.container;
|
|
2372
|
+
if (particle.lastPathTime <= particle.pathDelay) {
|
|
2373
|
+
particle.lastPathTime += delta.value;
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
const path = container.pathGenerator.generate(particle);
|
|
2377
|
+
particle.velocity.addTo(path);
|
|
2378
|
+
if (pathOptions.clamp) {
|
|
2379
|
+
particle.velocity.x = clamp(particle.velocity.x, -1, 1);
|
|
2380
|
+
particle.velocity.y = clamp(particle.velocity.y, -1, 1);
|
|
2381
|
+
}
|
|
2382
|
+
particle.lastPathTime -= particle.pathDelay;
|
|
2383
|
+
}
|
|
2384
|
+
moveParallax(particle) {
|
|
2385
|
+
const container = this.container;
|
|
2386
|
+
const options = container.actualOptions;
|
|
2387
|
+
if (isSsr() || !options.interactivity.events.onHover.parallax.enable) {
|
|
2388
|
+
return;
|
|
2389
|
+
}
|
|
2390
|
+
const parallaxForce = options.interactivity.events.onHover.parallax.force;
|
|
2391
|
+
const mousePos = container.interactivity.mouse.position;
|
|
2392
|
+
if (!mousePos) {
|
|
2393
|
+
return;
|
|
2394
|
+
}
|
|
2395
|
+
const canvasCenter = {
|
|
2396
|
+
x: container.canvas.size.width / 2,
|
|
2397
|
+
y: container.canvas.size.height / 2
|
|
2398
|
+
};
|
|
2399
|
+
const parallaxSmooth = options.interactivity.events.onHover.parallax.smooth;
|
|
2400
|
+
const factor = particle.getRadius() / parallaxForce;
|
|
2401
|
+
const tmp = {
|
|
2402
|
+
x: (mousePos.x - canvasCenter.x) * factor,
|
|
2403
|
+
y: (mousePos.y - canvasCenter.y) * factor
|
|
2404
|
+
};
|
|
2405
|
+
particle.offset.x += (tmp.x - particle.offset.x) / parallaxSmooth;
|
|
2406
|
+
particle.offset.y += (tmp.y - particle.offset.y) / parallaxSmooth;
|
|
2407
|
+
}
|
|
2408
|
+
getProximitySpeedFactor(particle) {
|
|
2409
|
+
const container = this.container;
|
|
2410
|
+
const options = container.actualOptions;
|
|
2411
|
+
const active = isInArray("slow", options.interactivity.events.onHover.mode);
|
|
2412
|
+
if (!active) {
|
|
2413
|
+
return 1;
|
|
2414
|
+
}
|
|
2415
|
+
const mousePos = this.container.interactivity.mouse.position;
|
|
2416
|
+
if (!mousePos) {
|
|
2417
|
+
return 1;
|
|
2418
|
+
}
|
|
2419
|
+
const particlePos = particle.getPosition();
|
|
2420
|
+
const dist = getDistance(mousePos, particlePos);
|
|
2421
|
+
const radius = container.retina.slowModeRadius;
|
|
2422
|
+
if (dist > radius) {
|
|
2423
|
+
return 1;
|
|
2424
|
+
}
|
|
2425
|
+
const proximityFactor = dist / radius || 0;
|
|
2426
|
+
const slowFactor = options.interactivity.modes.slow.factor;
|
|
2427
|
+
return proximityFactor / slowFactor;
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
const plugins = [];
|
|
2431
|
+
const interactorsInitializers = new Map;
|
|
2432
|
+
const updatersInitializers = new Map;
|
|
2433
|
+
const interactors = new Map;
|
|
2434
|
+
const updaters = new Map;
|
|
2435
|
+
const presets = new Map;
|
|
2436
|
+
const drawers = new Map;
|
|
2437
|
+
const pathGenerators = new Map;
|
|
2438
|
+
class Plugins {
|
|
2439
|
+
static getPlugin(plugin) {
|
|
2440
|
+
return plugins.find((t => t.id === plugin));
|
|
2441
|
+
}
|
|
2442
|
+
static addPlugin(plugin) {
|
|
2443
|
+
if (!Plugins.getPlugin(plugin.id)) {
|
|
2444
|
+
plugins.push(plugin);
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
static getAvailablePlugins(container) {
|
|
2448
|
+
const res = new Map;
|
|
2449
|
+
for (const plugin of plugins) {
|
|
2450
|
+
if (!plugin.needsPlugin(container.actualOptions)) {
|
|
2451
|
+
continue;
|
|
2452
|
+
}
|
|
2453
|
+
res.set(plugin.id, plugin.getPlugin(container));
|
|
2454
|
+
}
|
|
2455
|
+
return res;
|
|
2456
|
+
}
|
|
2457
|
+
static loadOptions(options, sourceOptions) {
|
|
2458
|
+
for (const plugin of plugins) {
|
|
2459
|
+
plugin.loadOptions(options, sourceOptions);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
static getPreset(preset) {
|
|
2463
|
+
return presets.get(preset);
|
|
2464
|
+
}
|
|
2465
|
+
static addPreset(presetKey, options, override = false) {
|
|
2466
|
+
if (override || !Plugins.getPreset(presetKey)) {
|
|
2467
|
+
presets.set(presetKey, options);
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
static addShapeDrawer(type, drawer) {
|
|
2471
|
+
if (!Plugins.getShapeDrawer(type)) {
|
|
2472
|
+
drawers.set(type, drawer);
|
|
2473
|
+
}
|
|
2534
2474
|
}
|
|
2535
2475
|
static getShapeDrawer(type) {
|
|
2536
2476
|
return drawers.get(type);
|
|
@@ -2641,6 +2581,150 @@
|
|
|
2641
2581
|
return res;
|
|
2642
2582
|
}
|
|
2643
2583
|
}
|
|
2584
|
+
class Vector {
|
|
2585
|
+
constructor(x, y) {
|
|
2586
|
+
let defX, defY;
|
|
2587
|
+
if (y === undefined) {
|
|
2588
|
+
if (typeof x === "number") {
|
|
2589
|
+
throw new Error("tsParticles - Vector not initialized correctly");
|
|
2590
|
+
}
|
|
2591
|
+
const coords = x;
|
|
2592
|
+
[defX, defY] = [ coords.x, coords.y ];
|
|
2593
|
+
} else {
|
|
2594
|
+
[defX, defY] = [ x, y ];
|
|
2595
|
+
}
|
|
2596
|
+
this.x = defX;
|
|
2597
|
+
this.y = defY;
|
|
2598
|
+
}
|
|
2599
|
+
static clone(source) {
|
|
2600
|
+
return Vector.create(source.x, source.y);
|
|
2601
|
+
}
|
|
2602
|
+
static create(x, y) {
|
|
2603
|
+
return new Vector(x, y);
|
|
2604
|
+
}
|
|
2605
|
+
static get origin() {
|
|
2606
|
+
return Vector.create(0, 0);
|
|
2607
|
+
}
|
|
2608
|
+
get angle() {
|
|
2609
|
+
return Math.atan2(this.y, this.x);
|
|
2610
|
+
}
|
|
2611
|
+
set angle(angle) {
|
|
2612
|
+
this.updateFromAngle(angle, this.length);
|
|
2613
|
+
}
|
|
2614
|
+
get length() {
|
|
2615
|
+
return Math.sqrt(this.x ** 2 + this.y ** 2);
|
|
2616
|
+
}
|
|
2617
|
+
set length(length) {
|
|
2618
|
+
this.updateFromAngle(this.angle, length);
|
|
2619
|
+
}
|
|
2620
|
+
add(v) {
|
|
2621
|
+
return Vector.create(this.x + v.x, this.y + v.y);
|
|
2622
|
+
}
|
|
2623
|
+
addTo(v) {
|
|
2624
|
+
this.x += v.x;
|
|
2625
|
+
this.y += v.y;
|
|
2626
|
+
}
|
|
2627
|
+
sub(v) {
|
|
2628
|
+
return Vector.create(this.x - v.x, this.y - v.y);
|
|
2629
|
+
}
|
|
2630
|
+
subFrom(v) {
|
|
2631
|
+
this.x -= v.x;
|
|
2632
|
+
this.y -= v.y;
|
|
2633
|
+
}
|
|
2634
|
+
mult(n) {
|
|
2635
|
+
return Vector.create(this.x * n, this.y * n);
|
|
2636
|
+
}
|
|
2637
|
+
multTo(n) {
|
|
2638
|
+
this.x *= n;
|
|
2639
|
+
this.y *= n;
|
|
2640
|
+
}
|
|
2641
|
+
div(n) {
|
|
2642
|
+
return Vector.create(this.x / n, this.y / n);
|
|
2643
|
+
}
|
|
2644
|
+
divTo(n) {
|
|
2645
|
+
this.x /= n;
|
|
2646
|
+
this.y /= n;
|
|
2647
|
+
}
|
|
2648
|
+
distanceTo(v) {
|
|
2649
|
+
return this.sub(v).length;
|
|
2650
|
+
}
|
|
2651
|
+
getLengthSq() {
|
|
2652
|
+
return this.x ** 2 + this.y ** 2;
|
|
2653
|
+
}
|
|
2654
|
+
distanceToSq(v) {
|
|
2655
|
+
return this.sub(v).getLengthSq();
|
|
2656
|
+
}
|
|
2657
|
+
manhattanDistanceTo(v) {
|
|
2658
|
+
return Math.abs(v.x - this.x) + Math.abs(v.y - this.y);
|
|
2659
|
+
}
|
|
2660
|
+
copy() {
|
|
2661
|
+
return Vector.clone(this);
|
|
2662
|
+
}
|
|
2663
|
+
setTo(velocity) {
|
|
2664
|
+
this.x = velocity.x;
|
|
2665
|
+
this.y = velocity.y;
|
|
2666
|
+
}
|
|
2667
|
+
rotate(angle) {
|
|
2668
|
+
return Vector.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle));
|
|
2669
|
+
}
|
|
2670
|
+
updateFromAngle(angle, length) {
|
|
2671
|
+
this.x = Math.cos(angle) * length;
|
|
2672
|
+
this.y = Math.sin(angle) * length;
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
class Vector3d extends Vector {
|
|
2676
|
+
constructor(x, y, z) {
|
|
2677
|
+
super(x, y);
|
|
2678
|
+
this.z = z === undefined ? x.z : z;
|
|
2679
|
+
}
|
|
2680
|
+
static clone(source) {
|
|
2681
|
+
return Vector3d.create(source.x, source.y, source.z);
|
|
2682
|
+
}
|
|
2683
|
+
static create(x, y, z) {
|
|
2684
|
+
return new Vector3d(x, y, z);
|
|
2685
|
+
}
|
|
2686
|
+
add(v) {
|
|
2687
|
+
return v instanceof Vector3d ? Vector3d.create(this.x + v.x, this.y + v.y, this.z + v.z) : super.add(v);
|
|
2688
|
+
}
|
|
2689
|
+
addTo(v) {
|
|
2690
|
+
super.addTo(v);
|
|
2691
|
+
if (v instanceof Vector3d) {
|
|
2692
|
+
this.z += v.z;
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
sub(v) {
|
|
2696
|
+
return v instanceof Vector3d ? Vector3d.create(this.x - v.x, this.y - v.y, this.z - v.z) : super.sub(v);
|
|
2697
|
+
}
|
|
2698
|
+
subFrom(v) {
|
|
2699
|
+
super.subFrom(v);
|
|
2700
|
+
if (v instanceof Vector3d) {
|
|
2701
|
+
this.z -= v.z;
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
mult(n) {
|
|
2705
|
+
return Vector3d.create(this.x * n, this.y * n, this.z * n);
|
|
2706
|
+
}
|
|
2707
|
+
multTo(n) {
|
|
2708
|
+
super.multTo(n);
|
|
2709
|
+
this.z *= n;
|
|
2710
|
+
}
|
|
2711
|
+
div(n) {
|
|
2712
|
+
return Vector3d.create(this.x / n, this.y / n, this.z / n);
|
|
2713
|
+
}
|
|
2714
|
+
divTo(n) {
|
|
2715
|
+
super.divTo(n);
|
|
2716
|
+
this.z /= n;
|
|
2717
|
+
}
|
|
2718
|
+
copy() {
|
|
2719
|
+
return Vector3d.clone(this);
|
|
2720
|
+
}
|
|
2721
|
+
setTo(v) {
|
|
2722
|
+
super.setTo(v);
|
|
2723
|
+
if (v instanceof Vector3d) {
|
|
2724
|
+
this.z = v.z;
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2644
2728
|
class Canvas {
|
|
2645
2729
|
constructor(container) {
|
|
2646
2730
|
this.container = container;
|
|
@@ -2907,12 +2991,12 @@
|
|
|
2907
2991
|
const originalStyle = this.originalStyle;
|
|
2908
2992
|
if (options.fullScreen.enable) {
|
|
2909
2993
|
this.originalStyle = deepExtend({}, element.style);
|
|
2910
|
-
element.style.position
|
|
2911
|
-
element.style.
|
|
2912
|
-
element.style.top
|
|
2913
|
-
element.style.left
|
|
2914
|
-
element.style.width
|
|
2915
|
-
element.style.height
|
|
2994
|
+
element.style.setProperty("position", "fixed", "important");
|
|
2995
|
+
element.style.setProperty("z-index", options.fullScreen.zIndex.toString(10), "important");
|
|
2996
|
+
element.style.setProperty("top", "0", "important");
|
|
2997
|
+
element.style.setProperty("left", "0", "important");
|
|
2998
|
+
element.style.setProperty("width", "100%", "important");
|
|
2999
|
+
element.style.setProperty("height", "100%", "important");
|
|
2916
3000
|
} else if (originalStyle) {
|
|
2917
3001
|
element.style.position = originalStyle.position;
|
|
2918
3002
|
element.style.zIndex = originalStyle.zIndex;
|
|
@@ -2929,7 +3013,7 @@
|
|
|
2929
3013
|
if (!value) {
|
|
2930
3014
|
continue;
|
|
2931
3015
|
}
|
|
2932
|
-
element.style
|
|
3016
|
+
element.style.setProperty(key, value, "important");
|
|
2933
3017
|
}
|
|
2934
3018
|
}
|
|
2935
3019
|
paintBase(baseColor) {
|
|
@@ -3234,7 +3318,7 @@
|
|
|
3234
3318
|
}
|
|
3235
3319
|
class OutModes {
|
|
3236
3320
|
constructor() {
|
|
3237
|
-
this.default =
|
|
3321
|
+
this.default = "out";
|
|
3238
3322
|
}
|
|
3239
3323
|
load(data) {
|
|
3240
3324
|
var _a, _b, _c, _d;
|
|
@@ -3274,7 +3358,7 @@
|
|
|
3274
3358
|
this.attract = new Attract;
|
|
3275
3359
|
this.decay = 0;
|
|
3276
3360
|
this.distance = {};
|
|
3277
|
-
this.direction =
|
|
3361
|
+
this.direction = "none";
|
|
3278
3362
|
this.drift = 0;
|
|
3279
3363
|
this.enable = false;
|
|
3280
3364
|
this.gravity = new MoveGravity;
|
|
@@ -3466,10 +3550,10 @@
|
|
|
3466
3550
|
class OpacityAnimation extends AnimationOptions {
|
|
3467
3551
|
constructor() {
|
|
3468
3552
|
super();
|
|
3469
|
-
this.destroy =
|
|
3553
|
+
this.destroy = "none";
|
|
3470
3554
|
this.enable = false;
|
|
3471
3555
|
this.speed = 2;
|
|
3472
|
-
this.startValue =
|
|
3556
|
+
this.startValue = "random";
|
|
3473
3557
|
this.sync = false;
|
|
3474
3558
|
}
|
|
3475
3559
|
get opacity_min() {
|
|
@@ -3531,15 +3615,15 @@
|
|
|
3531
3615
|
class Shape {
|
|
3532
3616
|
constructor() {
|
|
3533
3617
|
this.options = {};
|
|
3534
|
-
this.type =
|
|
3618
|
+
this.type = "circle";
|
|
3535
3619
|
}
|
|
3536
3620
|
get image() {
|
|
3537
3621
|
var _a;
|
|
3538
|
-
return (_a = this.options[
|
|
3622
|
+
return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
|
|
3539
3623
|
}
|
|
3540
3624
|
set image(value) {
|
|
3541
|
-
this.options[
|
|
3542
|
-
this.options[
|
|
3625
|
+
this.options["image"] = value;
|
|
3626
|
+
this.options["images"] = value;
|
|
3543
3627
|
}
|
|
3544
3628
|
get custom() {
|
|
3545
3629
|
return this.options;
|
|
@@ -3559,19 +3643,19 @@
|
|
|
3559
3643
|
set stroke(_value) {}
|
|
3560
3644
|
get character() {
|
|
3561
3645
|
var _a;
|
|
3562
|
-
return (_a = this.options[
|
|
3646
|
+
return (_a = this.options["character"]) !== null && _a !== void 0 ? _a : this.options["char"];
|
|
3563
3647
|
}
|
|
3564
3648
|
set character(value) {
|
|
3565
|
-
this.options[
|
|
3566
|
-
this.options[
|
|
3649
|
+
this.options["character"] = value;
|
|
3650
|
+
this.options["char"] = value;
|
|
3567
3651
|
}
|
|
3568
3652
|
get polygon() {
|
|
3569
3653
|
var _a;
|
|
3570
|
-
return (_a = this.options[
|
|
3654
|
+
return (_a = this.options["polygon"]) !== null && _a !== void 0 ? _a : this.options["star"];
|
|
3571
3655
|
}
|
|
3572
3656
|
set polygon(value) {
|
|
3573
|
-
this.options[
|
|
3574
|
-
this.options[
|
|
3657
|
+
this.options["polygon"] = value;
|
|
3658
|
+
this.options["star"] = value;
|
|
3575
3659
|
}
|
|
3576
3660
|
load(data) {
|
|
3577
3661
|
var _a, _b, _c;
|
|
@@ -3587,9 +3671,9 @@
|
|
|
3587
3671
|
}
|
|
3588
3672
|
}
|
|
3589
3673
|
}
|
|
3590
|
-
this.loadShape(data.character,
|
|
3591
|
-
this.loadShape(data.polygon,
|
|
3592
|
-
this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images,
|
|
3674
|
+
this.loadShape(data.character, "character", "char", true);
|
|
3675
|
+
this.loadShape(data.polygon, "polygon", "star", false);
|
|
3676
|
+
this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
|
|
3593
3677
|
if (data.type !== undefined) {
|
|
3594
3678
|
this.type = data.type;
|
|
3595
3679
|
}
|
|
@@ -3627,10 +3711,10 @@
|
|
|
3627
3711
|
class SizeAnimation extends AnimationOptions {
|
|
3628
3712
|
constructor() {
|
|
3629
3713
|
super();
|
|
3630
|
-
this.destroy =
|
|
3714
|
+
this.destroy = "none";
|
|
3631
3715
|
this.enable = false;
|
|
3632
3716
|
this.speed = 5;
|
|
3633
|
-
this.startValue =
|
|
3717
|
+
this.startValue = "random";
|
|
3634
3718
|
this.sync = false;
|
|
3635
3719
|
}
|
|
3636
3720
|
get size_min() {
|
|
@@ -3714,7 +3798,7 @@
|
|
|
3714
3798
|
constructor() {
|
|
3715
3799
|
super();
|
|
3716
3800
|
this.animation = new RotateAnimation;
|
|
3717
|
-
this.direction =
|
|
3801
|
+
this.direction = "clockwise";
|
|
3718
3802
|
this.path = false;
|
|
3719
3803
|
this.value = 0;
|
|
3720
3804
|
}
|
|
@@ -3903,7 +3987,7 @@
|
|
|
3903
3987
|
constructor() {
|
|
3904
3988
|
this.bounce = new Bounce;
|
|
3905
3989
|
this.enable = false;
|
|
3906
|
-
this.mode =
|
|
3990
|
+
this.mode = "bounce";
|
|
3907
3991
|
this.overlap = new CollisionsOverlap;
|
|
3908
3992
|
}
|
|
3909
3993
|
load(data) {
|
|
@@ -4046,7 +4130,7 @@
|
|
|
4046
4130
|
}
|
|
4047
4131
|
class Destroy {
|
|
4048
4132
|
constructor() {
|
|
4049
|
-
this.mode =
|
|
4133
|
+
this.mode = "none";
|
|
4050
4134
|
this.split = new Split;
|
|
4051
4135
|
}
|
|
4052
4136
|
load(data) {
|
|
@@ -4105,7 +4189,7 @@
|
|
|
4105
4189
|
constructor() {
|
|
4106
4190
|
super();
|
|
4107
4191
|
this.animation = new TiltAnimation;
|
|
4108
|
-
this.direction =
|
|
4192
|
+
this.direction = "clockwise";
|
|
4109
4193
|
this.enable = false;
|
|
4110
4194
|
this.value = 0;
|
|
4111
4195
|
}
|
|
@@ -4145,7 +4229,7 @@
|
|
|
4145
4229
|
this.darken = new RollLight;
|
|
4146
4230
|
this.enable = false;
|
|
4147
4231
|
this.enlighten = new RollLight;
|
|
4148
|
-
this.mode =
|
|
4232
|
+
this.mode = "vertical";
|
|
4149
4233
|
this.speed = 25;
|
|
4150
4234
|
}
|
|
4151
4235
|
load(data) {
|
|
@@ -4271,7 +4355,7 @@
|
|
|
4271
4355
|
constructor() {
|
|
4272
4356
|
this.angle = new GradientAngle;
|
|
4273
4357
|
this.colors = [];
|
|
4274
|
-
this.type =
|
|
4358
|
+
this.type = "random";
|
|
4275
4359
|
}
|
|
4276
4360
|
load(data) {
|
|
4277
4361
|
if (!data) {
|
|
@@ -4294,7 +4378,7 @@
|
|
|
4294
4378
|
constructor() {
|
|
4295
4379
|
this.value = 0;
|
|
4296
4380
|
this.animation = new GradientAngleAnimation;
|
|
4297
|
-
this.direction =
|
|
4381
|
+
this.direction = "clockwise";
|
|
4298
4382
|
}
|
|
4299
4383
|
load(data) {
|
|
4300
4384
|
if (!data) {
|
|
@@ -4378,7 +4462,7 @@
|
|
|
4378
4462
|
this.enable = false;
|
|
4379
4463
|
this.speed = 0;
|
|
4380
4464
|
this.sync = false;
|
|
4381
|
-
this.startValue =
|
|
4465
|
+
this.startValue = "random";
|
|
4382
4466
|
}
|
|
4383
4467
|
load(data) {
|
|
4384
4468
|
if (!data) {
|
|
@@ -4485,86 +4569,33 @@
|
|
|
4485
4569
|
this.collisions.load(data.collisions);
|
|
4486
4570
|
const strokeToLoad = (_g = data.stroke) !== null && _g !== void 0 ? _g : (_h = data.shape) === null || _h === void 0 ? void 0 : _h.stroke;
|
|
4487
4571
|
if (strokeToLoad) {
|
|
4488
|
-
if (strokeToLoad instanceof Array) {
|
|
4489
|
-
this.stroke = strokeToLoad.map((s => {
|
|
4490
|
-
const tmp = new Stroke;
|
|
4491
|
-
tmp.load(s);
|
|
4492
|
-
return tmp;
|
|
4493
|
-
}));
|
|
4494
|
-
} else {
|
|
4495
|
-
if (this.stroke instanceof Array) {
|
|
4496
|
-
this.stroke = new Stroke;
|
|
4497
|
-
}
|
|
4498
|
-
this.stroke.load(strokeToLoad);
|
|
4499
|
-
}
|
|
4500
|
-
}
|
|
4501
|
-
const gradientToLoad = data.gradient;
|
|
4502
|
-
if (gradientToLoad) {
|
|
4503
|
-
if (gradientToLoad instanceof Array) {
|
|
4504
|
-
this.gradient = gradientToLoad.map((s => {
|
|
4505
|
-
const tmp = new AnimatableGradient;
|
|
4506
|
-
tmp.load(s);
|
|
4507
|
-
return tmp;
|
|
4508
|
-
}));
|
|
4509
|
-
} else {
|
|
4510
|
-
if (this.gradient instanceof Array) {
|
|
4511
|
-
this.gradient = new AnimatableGradient;
|
|
4512
|
-
}
|
|
4513
|
-
this.gradient.load(gradientToLoad);
|
|
4514
|
-
}
|
|
4515
|
-
}
|
|
4516
|
-
}
|
|
4517
|
-
}
|
|
4518
|
-
class Vector3d extends Vector {
|
|
4519
|
-
constructor(x, y, z) {
|
|
4520
|
-
super(x, y);
|
|
4521
|
-
this.z = z === undefined ? x.z : z;
|
|
4522
|
-
}
|
|
4523
|
-
static clone(source) {
|
|
4524
|
-
return Vector3d.create(source.x, source.y, source.z);
|
|
4525
|
-
}
|
|
4526
|
-
static create(x, y, z) {
|
|
4527
|
-
return new Vector3d(x, y, z);
|
|
4528
|
-
}
|
|
4529
|
-
add(v) {
|
|
4530
|
-
return v instanceof Vector3d ? Vector3d.create(this.x + v.x, this.y + v.y, this.z + v.z) : super.add(v);
|
|
4531
|
-
}
|
|
4532
|
-
addTo(v) {
|
|
4533
|
-
super.addTo(v);
|
|
4534
|
-
if (v instanceof Vector3d) {
|
|
4535
|
-
this.z += v.z;
|
|
4536
|
-
}
|
|
4537
|
-
}
|
|
4538
|
-
sub(v) {
|
|
4539
|
-
return v instanceof Vector3d ? Vector3d.create(this.x - v.x, this.y - v.y, this.z - v.z) : super.sub(v);
|
|
4540
|
-
}
|
|
4541
|
-
subFrom(v) {
|
|
4542
|
-
super.subFrom(v);
|
|
4543
|
-
if (v instanceof Vector3d) {
|
|
4544
|
-
this.z -= v.z;
|
|
4572
|
+
if (strokeToLoad instanceof Array) {
|
|
4573
|
+
this.stroke = strokeToLoad.map((s => {
|
|
4574
|
+
const tmp = new Stroke;
|
|
4575
|
+
tmp.load(s);
|
|
4576
|
+
return tmp;
|
|
4577
|
+
}));
|
|
4578
|
+
} else {
|
|
4579
|
+
if (this.stroke instanceof Array) {
|
|
4580
|
+
this.stroke = new Stroke;
|
|
4581
|
+
}
|
|
4582
|
+
this.stroke.load(strokeToLoad);
|
|
4583
|
+
}
|
|
4545
4584
|
}
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
}
|
|
4561
|
-
copy() {
|
|
4562
|
-
return Vector3d.clone(this);
|
|
4563
|
-
}
|
|
4564
|
-
setTo(v) {
|
|
4565
|
-
super.setTo(v);
|
|
4566
|
-
if (v instanceof Vector3d) {
|
|
4567
|
-
this.z = v.z;
|
|
4585
|
+
const gradientToLoad = data.gradient;
|
|
4586
|
+
if (gradientToLoad) {
|
|
4587
|
+
if (gradientToLoad instanceof Array) {
|
|
4588
|
+
this.gradient = gradientToLoad.map((s => {
|
|
4589
|
+
const tmp = new AnimatableGradient;
|
|
4590
|
+
tmp.load(s);
|
|
4591
|
+
return tmp;
|
|
4592
|
+
}));
|
|
4593
|
+
} else {
|
|
4594
|
+
if (this.gradient instanceof Array) {
|
|
4595
|
+
this.gradient = new AnimatableGradient;
|
|
4596
|
+
}
|
|
4597
|
+
this.gradient.load(gradientToLoad);
|
|
4598
|
+
}
|
|
4568
4599
|
}
|
|
4569
4600
|
}
|
|
4570
4601
|
}
|
|
@@ -4636,22 +4667,22 @@
|
|
|
4636
4667
|
};
|
|
4637
4668
|
const sizeAnimation = sizeOptions.animation;
|
|
4638
4669
|
if (sizeAnimation.enable) {
|
|
4639
|
-
this.size.status =
|
|
4670
|
+
this.size.status = 0;
|
|
4640
4671
|
switch (sizeAnimation.startValue) {
|
|
4641
|
-
case
|
|
4672
|
+
case "min":
|
|
4642
4673
|
this.size.value = this.size.min;
|
|
4643
|
-
this.size.status =
|
|
4674
|
+
this.size.status = 0;
|
|
4644
4675
|
break;
|
|
4645
4676
|
|
|
4646
|
-
case
|
|
4677
|
+
case "random":
|
|
4647
4678
|
this.size.value = randomInRange(this.size) * pxRatio;
|
|
4648
|
-
this.size.status = Math.random() >= .5 ?
|
|
4679
|
+
this.size.status = Math.random() >= .5 ? 0 : 1;
|
|
4649
4680
|
break;
|
|
4650
4681
|
|
|
4651
|
-
case
|
|
4682
|
+
case "max":
|
|
4652
4683
|
default:
|
|
4653
4684
|
this.size.value = this.size.max;
|
|
4654
|
-
this.size.status =
|
|
4685
|
+
this.size.status = 1;
|
|
4655
4686
|
break;
|
|
4656
4687
|
}
|
|
4657
4688
|
this.size.velocity = ((_g = this.retina.sizeAnimationSpeed) !== null && _g !== void 0 ? _g : container.retina.sizeAnimationSpeed) / 100 * container.retina.reduceFactor;
|
|
@@ -4703,7 +4734,7 @@
|
|
|
4703
4734
|
const distance = getDistance(pos, spinCenter);
|
|
4704
4735
|
this.spin = {
|
|
4705
4736
|
center: spinCenter,
|
|
4706
|
-
direction: this.velocity.x >= 0 ?
|
|
4737
|
+
direction: this.velocity.x >= 0 ? "clockwise" : "counter-clockwise",
|
|
4707
4738
|
angle: this.velocity.angle,
|
|
4708
4739
|
radius: distance,
|
|
4709
4740
|
acceleration: (_j = this.retina.spinAcceleration) !== null && _j !== void 0 ? _j : getRangeValue(this.options.move.spin.acceleration)
|
|
@@ -4789,343 +4820,131 @@
|
|
|
4789
4820
|
if (override) {
|
|
4790
4821
|
return;
|
|
4791
4822
|
}
|
|
4792
|
-
const destroyOptions = this.options.destroy;
|
|
4793
|
-
if (destroyOptions.mode ===
|
|
4794
|
-
this.split();
|
|
4795
|
-
}
|
|
4796
|
-
}
|
|
4797
|
-
reset() {
|
|
4798
|
-
if (this.opacity) {
|
|
4799
|
-
this.opacity.loops = 0;
|
|
4800
|
-
}
|
|
4801
|
-
this.size.loops = 0;
|
|
4802
|
-
}
|
|
4803
|
-
split() {
|
|
4804
|
-
const splitOptions = this.options.destroy.split;
|
|
4805
|
-
if (splitOptions.count >= 0 && this.splitCount++ > splitOptions.count) {
|
|
4806
|
-
return;
|
|
4807
|
-
}
|
|
4808
|
-
const rate = getRangeValue(splitOptions.rate.value);
|
|
4809
|
-
for (let i = 0; i < rate; i++) {
|
|
4810
|
-
this.container.particles.addSplitParticle(this);
|
|
4811
|
-
}
|
|
4812
|
-
}
|
|
4813
|
-
calcPosition(container, position, zIndex, tryCount = 0) {
|
|
4814
|
-
var _a, _b, _c, _d, _e, _f;
|
|
4815
|
-
for (const [, plugin] of container.plugins) {
|
|
4816
|
-
const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;
|
|
4817
|
-
if (pluginPos !== undefined) {
|
|
4818
|
-
return Vector3d.create(pluginPos.x, pluginPos.y, zIndex);
|
|
4819
|
-
}
|
|
4820
|
-
}
|
|
4821
|
-
const canvasSize = container.canvas.size;
|
|
4822
|
-
const pos = Vector3d.create((_a = position === null || position === void 0 ? void 0 : position.x) !== null && _a !== void 0 ? _a : Math.random() * canvasSize.width, (_b = position === null || position === void 0 ? void 0 : position.y) !== null && _b !== void 0 ? _b : Math.random() * canvasSize.height, zIndex);
|
|
4823
|
-
const radius = this.getRadius();
|
|
4824
|
-
const outModes = this.options.move.outModes, fixHorizontal = outMode => {
|
|
4825
|
-
fixOutMode({
|
|
4826
|
-
outMode: outMode,
|
|
4827
|
-
checkModes: [ OutMode.bounce, OutMode.bounceHorizontal ],
|
|
4828
|
-
coord: pos.x,
|
|
4829
|
-
maxCoord: container.canvas.size.width,
|
|
4830
|
-
setCb: value => pos.x += value,
|
|
4831
|
-
radius: radius
|
|
4832
|
-
});
|
|
4833
|
-
}, fixVertical = outMode => {
|
|
4834
|
-
fixOutMode({
|
|
4835
|
-
outMode: outMode,
|
|
4836
|
-
checkModes: [ OutMode.bounce, OutMode.bounceVertical ],
|
|
4837
|
-
coord: pos.y,
|
|
4838
|
-
maxCoord: container.canvas.size.height,
|
|
4839
|
-
setCb: value => pos.y += value,
|
|
4840
|
-
radius: radius
|
|
4841
|
-
});
|
|
4842
|
-
};
|
|
4843
|
-
fixHorizontal((_c = outModes.left) !== null && _c !== void 0 ? _c : outModes.default);
|
|
4844
|
-
fixHorizontal((_d = outModes.right) !== null && _d !== void 0 ? _d : outModes.default);
|
|
4845
|
-
fixVertical((_e = outModes.top) !== null && _e !== void 0 ? _e : outModes.default);
|
|
4846
|
-
fixVertical((_f = outModes.bottom) !== null && _f !== void 0 ? _f : outModes.default);
|
|
4847
|
-
if (this.checkOverlap(pos, tryCount)) {
|
|
4848
|
-
return this.calcPosition(container, undefined, zIndex, tryCount + 1);
|
|
4849
|
-
}
|
|
4850
|
-
return pos;
|
|
4851
|
-
}
|
|
4852
|
-
checkOverlap(pos, tryCount = 0) {
|
|
4853
|
-
const collisionsOptions = this.options.collisions;
|
|
4854
|
-
const radius = this.getRadius();
|
|
4855
|
-
if (!collisionsOptions.enable) {
|
|
4856
|
-
return false;
|
|
4857
|
-
}
|
|
4858
|
-
const overlapOptions = collisionsOptions.overlap;
|
|
4859
|
-
if (overlapOptions.enable) {
|
|
4860
|
-
return false;
|
|
4861
|
-
}
|
|
4862
|
-
const retries = overlapOptions.retries;
|
|
4863
|
-
if (retries >= 0 && tryCount > retries) {
|
|
4864
|
-
throw new Error("Particle is overlapping and can't be placed");
|
|
4865
|
-
}
|
|
4866
|
-
let overlaps = false;
|
|
4867
|
-
for (const particle of this.container.particles.array) {
|
|
4868
|
-
if (getDistance(pos, particle.position) < radius + particle.getRadius()) {
|
|
4869
|
-
overlaps = true;
|
|
4870
|
-
break;
|
|
4871
|
-
}
|
|
4872
|
-
}
|
|
4873
|
-
return overlaps;
|
|
4874
|
-
}
|
|
4875
|
-
calculateVelocity() {
|
|
4876
|
-
const baseVelocity = getParticleBaseVelocity(this.direction);
|
|
4877
|
-
const res = baseVelocity.copy();
|
|
4878
|
-
const moveOptions = this.options.move;
|
|
4879
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
4880
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
4881
|
-
const range = {
|
|
4882
|
-
left: radOffset - rad / 2,
|
|
4883
|
-
right: radOffset + rad / 2
|
|
4884
|
-
};
|
|
4885
|
-
if (!moveOptions.straight) {
|
|
4886
|
-
res.angle += randomInRange(setRangeValue(range.left, range.right));
|
|
4887
|
-
}
|
|
4888
|
-
if (moveOptions.random && typeof moveOptions.speed === "number") {
|
|
4889
|
-
res.length *= Math.random();
|
|
4890
|
-
}
|
|
4891
|
-
return res;
|
|
4892
|
-
}
|
|
4893
|
-
loadShapeData(shapeOptions, reduceDuplicates) {
|
|
4894
|
-
const shapeData = shapeOptions.options[this.shape];
|
|
4895
|
-
if (shapeData) {
|
|
4896
|
-
return deepExtend({}, shapeData instanceof Array ? itemFromArray(shapeData, this.id, reduceDuplicates) : shapeData);
|
|
4897
|
-
}
|
|
4898
|
-
}
|
|
4899
|
-
loadLife() {
|
|
4900
|
-
const container = this.container;
|
|
4901
|
-
const particlesOptions = this.options;
|
|
4902
|
-
const lifeOptions = particlesOptions.life;
|
|
4903
|
-
const life = {
|
|
4904
|
-
delay: container.retina.reduceFactor ? getRangeValue(lifeOptions.delay.value) * (lifeOptions.delay.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
|
|
4905
|
-
delayTime: 0,
|
|
4906
|
-
duration: container.retina.reduceFactor ? getRangeValue(lifeOptions.duration.value) * (lifeOptions.duration.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
|
|
4907
|
-
time: 0,
|
|
4908
|
-
count: particlesOptions.life.count
|
|
4909
|
-
};
|
|
4910
|
-
if (life.duration <= 0) {
|
|
4911
|
-
life.duration = -1;
|
|
4912
|
-
}
|
|
4913
|
-
if (life.count <= 0) {
|
|
4914
|
-
life.count = -1;
|
|
4915
|
-
}
|
|
4916
|
-
return life;
|
|
4917
|
-
}
|
|
4918
|
-
}
|
|
4919
|
-
class InteractionManager {
|
|
4920
|
-
constructor(container) {
|
|
4921
|
-
this.container = container;
|
|
4922
|
-
this.externalInteractors = [];
|
|
4923
|
-
this.particleInteractors = [];
|
|
4924
|
-
this.init();
|
|
4925
|
-
}
|
|
4926
|
-
init() {
|
|
4927
|
-
const interactors = Plugins.getInteractors(this.container, true);
|
|
4928
|
-
for (const interactor of interactors) {
|
|
4929
|
-
switch (interactor.type) {
|
|
4930
|
-
case InteractorType.External:
|
|
4931
|
-
this.externalInteractors.push(interactor);
|
|
4932
|
-
break;
|
|
4933
|
-
|
|
4934
|
-
case InteractorType.Particles:
|
|
4935
|
-
this.particleInteractors.push(interactor);
|
|
4936
|
-
break;
|
|
4937
|
-
}
|
|
4938
|
-
}
|
|
4939
|
-
}
|
|
4940
|
-
externalInteract(delta) {
|
|
4941
|
-
for (const interactor of this.externalInteractors) {
|
|
4942
|
-
if (interactor.isEnabled()) {
|
|
4943
|
-
interactor.interact(delta);
|
|
4944
|
-
}
|
|
4945
|
-
}
|
|
4946
|
-
}
|
|
4947
|
-
particlesInteract(particle, delta) {
|
|
4948
|
-
for (const interactor of this.externalInteractors) {
|
|
4949
|
-
interactor.reset(particle);
|
|
4950
|
-
}
|
|
4951
|
-
for (const interactor of this.particleInteractors) {
|
|
4952
|
-
if (interactor.isEnabled(particle)) {
|
|
4953
|
-
interactor.interact(particle, delta);
|
|
4954
|
-
}
|
|
4955
|
-
}
|
|
4956
|
-
}
|
|
4957
|
-
}
|
|
4958
|
-
function applyDistance(particle) {
|
|
4959
|
-
const initialPosition = particle.initialPosition;
|
|
4960
|
-
const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
|
|
4961
|
-
const dxFixed = Math.abs(dx), dyFixed = Math.abs(dy);
|
|
4962
|
-
const hDistance = particle.retina.maxDistance.horizontal;
|
|
4963
|
-
const vDistance = particle.retina.maxDistance.vertical;
|
|
4964
|
-
if (!hDistance && !vDistance) {
|
|
4965
|
-
return;
|
|
4966
|
-
}
|
|
4967
|
-
if ((hDistance && dxFixed >= hDistance || vDistance && dyFixed >= vDistance) && !particle.misplaced) {
|
|
4968
|
-
particle.misplaced = !!hDistance && dxFixed > hDistance || !!vDistance && dyFixed > vDistance;
|
|
4969
|
-
if (hDistance) {
|
|
4970
|
-
particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
|
|
4971
|
-
}
|
|
4972
|
-
if (vDistance) {
|
|
4973
|
-
particle.velocity.y = particle.velocity.x / 2 - particle.velocity.y;
|
|
4974
|
-
}
|
|
4975
|
-
} else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {
|
|
4976
|
-
particle.misplaced = false;
|
|
4977
|
-
} else if (particle.misplaced) {
|
|
4978
|
-
const pos = particle.position, vel = particle.velocity;
|
|
4979
|
-
if (hDistance && (pos.x < initialPosition.x && vel.x < 0 || pos.x > initialPosition.x && vel.x > 0)) {
|
|
4980
|
-
vel.x *= -Math.random();
|
|
4981
|
-
}
|
|
4982
|
-
if (vDistance && (pos.y < initialPosition.y && vel.y < 0 || pos.y > initialPosition.y && vel.y > 0)) {
|
|
4983
|
-
vel.y *= -Math.random();
|
|
4984
|
-
}
|
|
4985
|
-
}
|
|
4986
|
-
}
|
|
4987
|
-
class Mover {
|
|
4988
|
-
constructor(container) {
|
|
4989
|
-
this.container = container;
|
|
4990
|
-
}
|
|
4991
|
-
move(particle, delta) {
|
|
4992
|
-
if (particle.destroyed) {
|
|
4993
|
-
return;
|
|
4994
|
-
}
|
|
4995
|
-
this.moveParticle(particle, delta);
|
|
4996
|
-
this.moveParallax(particle);
|
|
4997
|
-
}
|
|
4998
|
-
moveParticle(particle, delta) {
|
|
4999
|
-
var _a, _b, _c;
|
|
5000
|
-
var _d, _e;
|
|
5001
|
-
const particleOptions = particle.options;
|
|
5002
|
-
const moveOptions = particleOptions.move;
|
|
5003
|
-
if (!moveOptions.enable) {
|
|
5004
|
-
return;
|
|
5005
|
-
}
|
|
5006
|
-
const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : _d.moveSpeed = getRangeValue(moveOptions.speed) * container.retina.pixelRatio) * container.retina.reduceFactor, moveDrift = (_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : _e.moveDrift = getRangeValue(particle.options.move.drift) * container.retina.pixelRatio, maxSize = getRangeMax(particleOptions.size.value) * container.retina.pixelRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, diffFactor = 2, speedFactor = sizeFactor * slowFactor * (delta.factor || 1) / diffFactor, moveSpeed = baseSpeed * speedFactor;
|
|
5007
|
-
this.applyPath(particle, delta);
|
|
5008
|
-
const gravityOptions = moveOptions.gravity;
|
|
5009
|
-
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
5010
|
-
if (gravityOptions.enable && moveSpeed) {
|
|
5011
|
-
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
5012
|
-
}
|
|
5013
|
-
if (moveDrift && moveSpeed) {
|
|
5014
|
-
particle.velocity.x += moveDrift * delta.factor / (60 * moveSpeed);
|
|
4823
|
+
const destroyOptions = this.options.destroy;
|
|
4824
|
+
if (destroyOptions.mode === "split") {
|
|
4825
|
+
this.split();
|
|
5015
4826
|
}
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
4827
|
+
}
|
|
4828
|
+
reset() {
|
|
4829
|
+
if (this.opacity) {
|
|
4830
|
+
this.opacity.loops = 0;
|
|
5019
4831
|
}
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
}
|
|
4832
|
+
this.size.loops = 0;
|
|
4833
|
+
}
|
|
4834
|
+
split() {
|
|
4835
|
+
const splitOptions = this.options.destroy.split;
|
|
4836
|
+
if (splitOptions.count >= 0 && this.splitCount++ > splitOptions.count) {
|
|
4837
|
+
return;
|
|
5027
4838
|
}
|
|
5028
|
-
const
|
|
5029
|
-
|
|
5030
|
-
this.
|
|
5031
|
-
} else {
|
|
5032
|
-
if (zVelocityFactor != 1) {
|
|
5033
|
-
velocity.multTo(zVelocityFactor);
|
|
5034
|
-
}
|
|
5035
|
-
particle.position.addTo(velocity);
|
|
5036
|
-
if (moveOptions.vibrate) {
|
|
5037
|
-
particle.position.x += Math.sin(particle.position.x * Math.cos(particle.position.y));
|
|
5038
|
-
particle.position.y += Math.cos(particle.position.y * Math.sin(particle.position.x));
|
|
5039
|
-
}
|
|
4839
|
+
const rate = getRangeValue(splitOptions.rate.value);
|
|
4840
|
+
for (let i = 0; i < rate; i++) {
|
|
4841
|
+
this.container.particles.addSplitParticle(this);
|
|
5040
4842
|
}
|
|
5041
|
-
applyDistance(particle);
|
|
5042
4843
|
}
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
4844
|
+
calcPosition(container, position, zIndex, tryCount = 0) {
|
|
4845
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4846
|
+
for (const [, plugin] of container.plugins) {
|
|
4847
|
+
const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;
|
|
4848
|
+
if (pluginPos !== undefined) {
|
|
4849
|
+
return Vector3d.create(pluginPos.x, pluginPos.y, zIndex);
|
|
4850
|
+
}
|
|
5047
4851
|
}
|
|
5048
|
-
const
|
|
5049
|
-
|
|
5050
|
-
|
|
4852
|
+
const canvasSize = container.canvas.size;
|
|
4853
|
+
const pos = Vector3d.create((_a = position === null || position === void 0 ? void 0 : position.x) !== null && _a !== void 0 ? _a : Math.random() * canvasSize.width, (_b = position === null || position === void 0 ? void 0 : position.y) !== null && _b !== void 0 ? _b : Math.random() * canvasSize.height, zIndex);
|
|
4854
|
+
const radius = this.getRadius();
|
|
4855
|
+
const outModes = this.options.move.outModes, fixHorizontal = outMode => {
|
|
4856
|
+
fixOutMode({
|
|
4857
|
+
outMode: outMode,
|
|
4858
|
+
checkModes: [ "bounce", "bounce-horizontal" ],
|
|
4859
|
+
coord: pos.x,
|
|
4860
|
+
maxCoord: container.canvas.size.width,
|
|
4861
|
+
setCb: value => pos.x += value,
|
|
4862
|
+
radius: radius
|
|
4863
|
+
});
|
|
4864
|
+
}, fixVertical = outMode => {
|
|
4865
|
+
fixOutMode({
|
|
4866
|
+
outMode: outMode,
|
|
4867
|
+
checkModes: [ "bounce", "bounce-vertical" ],
|
|
4868
|
+
coord: pos.y,
|
|
4869
|
+
maxCoord: container.canvas.size.height,
|
|
4870
|
+
setCb: value => pos.y += value,
|
|
4871
|
+
radius: radius
|
|
4872
|
+
});
|
|
5051
4873
|
};
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
if (
|
|
5057
|
-
|
|
5058
|
-
particle.spin.acceleration *= -1;
|
|
5059
|
-
} else if (particle.spin.radius < 0) {
|
|
5060
|
-
particle.spin.radius = 0;
|
|
5061
|
-
particle.spin.acceleration *= -1;
|
|
4874
|
+
fixHorizontal((_c = outModes.left) !== null && _c !== void 0 ? _c : outModes.default);
|
|
4875
|
+
fixHorizontal((_d = outModes.right) !== null && _d !== void 0 ? _d : outModes.default);
|
|
4876
|
+
fixVertical((_e = outModes.top) !== null && _e !== void 0 ? _e : outModes.default);
|
|
4877
|
+
fixVertical((_f = outModes.bottom) !== null && _f !== void 0 ? _f : outModes.default);
|
|
4878
|
+
if (this.checkOverlap(pos, tryCount)) {
|
|
4879
|
+
return this.calcPosition(container, undefined, zIndex, tryCount + 1);
|
|
5062
4880
|
}
|
|
5063
|
-
|
|
4881
|
+
return pos;
|
|
5064
4882
|
}
|
|
5065
|
-
|
|
5066
|
-
const
|
|
5067
|
-
const
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
return;
|
|
4883
|
+
checkOverlap(pos, tryCount = 0) {
|
|
4884
|
+
const collisionsOptions = this.options.collisions;
|
|
4885
|
+
const radius = this.getRadius();
|
|
4886
|
+
if (!collisionsOptions.enable) {
|
|
4887
|
+
return false;
|
|
5071
4888
|
}
|
|
5072
|
-
const
|
|
5073
|
-
if (
|
|
5074
|
-
|
|
5075
|
-
return;
|
|
4889
|
+
const overlapOptions = collisionsOptions.overlap;
|
|
4890
|
+
if (overlapOptions.enable) {
|
|
4891
|
+
return false;
|
|
5076
4892
|
}
|
|
5077
|
-
const
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
particle.velocity.x = clamp(particle.velocity.x, -1, 1);
|
|
5081
|
-
particle.velocity.y = clamp(particle.velocity.y, -1, 1);
|
|
4893
|
+
const retries = overlapOptions.retries;
|
|
4894
|
+
if (retries >= 0 && tryCount > retries) {
|
|
4895
|
+
throw new Error("Particle is overlapping and can't be placed");
|
|
5082
4896
|
}
|
|
5083
|
-
|
|
4897
|
+
let overlaps = false;
|
|
4898
|
+
for (const particle of this.container.particles.array) {
|
|
4899
|
+
if (getDistance(pos, particle.position) < radius + particle.getRadius()) {
|
|
4900
|
+
overlaps = true;
|
|
4901
|
+
break;
|
|
4902
|
+
}
|
|
4903
|
+
}
|
|
4904
|
+
return overlaps;
|
|
5084
4905
|
}
|
|
5085
|
-
|
|
5086
|
-
const
|
|
5087
|
-
const
|
|
5088
|
-
|
|
5089
|
-
|
|
4906
|
+
calculateVelocity() {
|
|
4907
|
+
const baseVelocity = getParticleBaseVelocity(this.direction);
|
|
4908
|
+
const res = baseVelocity.copy();
|
|
4909
|
+
const moveOptions = this.options.move;
|
|
4910
|
+
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
4911
|
+
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
4912
|
+
const range = {
|
|
4913
|
+
left: radOffset - rad / 2,
|
|
4914
|
+
right: radOffset + rad / 2
|
|
4915
|
+
};
|
|
4916
|
+
if (!moveOptions.straight) {
|
|
4917
|
+
res.angle += randomInRange(setRangeValue(range.left, range.right));
|
|
5090
4918
|
}
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
if (!mousePos) {
|
|
5094
|
-
return;
|
|
4919
|
+
if (moveOptions.random && typeof moveOptions.speed === "number") {
|
|
4920
|
+
res.length *= Math.random();
|
|
5095
4921
|
}
|
|
5096
|
-
|
|
5097
|
-
x: container.canvas.size.width / 2,
|
|
5098
|
-
y: container.canvas.size.height / 2
|
|
5099
|
-
};
|
|
5100
|
-
const parallaxSmooth = options.interactivity.events.onHover.parallax.smooth;
|
|
5101
|
-
const factor = particle.getRadius() / parallaxForce;
|
|
5102
|
-
const tmp = {
|
|
5103
|
-
x: (mousePos.x - canvasCenter.x) * factor,
|
|
5104
|
-
y: (mousePos.y - canvasCenter.y) * factor
|
|
5105
|
-
};
|
|
5106
|
-
particle.offset.x += (tmp.x - particle.offset.x) / parallaxSmooth;
|
|
5107
|
-
particle.offset.y += (tmp.y - particle.offset.y) / parallaxSmooth;
|
|
4922
|
+
return res;
|
|
5108
4923
|
}
|
|
5109
|
-
|
|
5110
|
-
const
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
if (!active) {
|
|
5114
|
-
return 1;
|
|
4924
|
+
loadShapeData(shapeOptions, reduceDuplicates) {
|
|
4925
|
+
const shapeData = shapeOptions.options[this.shape];
|
|
4926
|
+
if (shapeData) {
|
|
4927
|
+
return deepExtend({}, shapeData instanceof Array ? itemFromArray(shapeData, this.id, reduceDuplicates) : shapeData);
|
|
5115
4928
|
}
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
4929
|
+
}
|
|
4930
|
+
loadLife() {
|
|
4931
|
+
const container = this.container;
|
|
4932
|
+
const particlesOptions = this.options;
|
|
4933
|
+
const lifeOptions = particlesOptions.life;
|
|
4934
|
+
const life = {
|
|
4935
|
+
delay: container.retina.reduceFactor ? getRangeValue(lifeOptions.delay.value) * (lifeOptions.delay.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
|
|
4936
|
+
delayTime: 0,
|
|
4937
|
+
duration: container.retina.reduceFactor ? getRangeValue(lifeOptions.duration.value) * (lifeOptions.duration.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
|
|
4938
|
+
time: 0,
|
|
4939
|
+
count: particlesOptions.life.count
|
|
4940
|
+
};
|
|
4941
|
+
if (life.duration <= 0) {
|
|
4942
|
+
life.duration = -1;
|
|
5119
4943
|
}
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
const radius = container.retina.slowModeRadius;
|
|
5123
|
-
if (dist > radius) {
|
|
5124
|
-
return 1;
|
|
4944
|
+
if (life.count <= 0) {
|
|
4945
|
+
life.count = -1;
|
|
5125
4946
|
}
|
|
5126
|
-
|
|
5127
|
-
const slowFactor = options.interactivity.modes.slow.factor;
|
|
5128
|
-
return proximityFactor / slowFactor;
|
|
4947
|
+
return life;
|
|
5129
4948
|
}
|
|
5130
4949
|
}
|
|
5131
4950
|
class Particles {
|
|
@@ -5134,7 +4953,7 @@
|
|
|
5134
4953
|
this.nextId = 0;
|
|
5135
4954
|
this.array = [];
|
|
5136
4955
|
this.zArray = [];
|
|
5137
|
-
this.mover = new
|
|
4956
|
+
this.mover = new ParticlesMover(container);
|
|
5138
4957
|
this.limit = 0;
|
|
5139
4958
|
this.needsSort = false;
|
|
5140
4959
|
this.lastZIndex = 0;
|
|
@@ -5288,9 +5107,7 @@
|
|
|
5288
5107
|
this.pushing = false;
|
|
5289
5108
|
}
|
|
5290
5109
|
addParticle(position, overrideOptions, group) {
|
|
5291
|
-
const container = this.container;
|
|
5292
|
-
const options = container.actualOptions;
|
|
5293
|
-
const limit = options.particles.number.limit * container.density;
|
|
5110
|
+
const container = this.container, options = container.actualOptions, limit = options.particles.number.limit * container.density;
|
|
5294
5111
|
if (limit > 0) {
|
|
5295
5112
|
const countToRemove = this.count + 1 - limit;
|
|
5296
5113
|
if (countToRemove > 0) {
|
|
@@ -5300,8 +5117,7 @@
|
|
|
5300
5117
|
return this.pushParticle(position, overrideOptions, group);
|
|
5301
5118
|
}
|
|
5302
5119
|
addSplitParticle(parent) {
|
|
5303
|
-
const splitOptions = parent.options.destroy.split;
|
|
5304
|
-
const options = new ParticlesOptions;
|
|
5120
|
+
const splitOptions = parent.options.destroy.split, options = new ParticlesOptions;
|
|
5305
5121
|
options.load(parent.options);
|
|
5306
5122
|
const factor = getRangeValue(splitOptions.factor.value);
|
|
5307
5123
|
options.color.load({
|
|
@@ -5338,7 +5154,7 @@
|
|
|
5338
5154
|
this.removeAt(0, quantity, group);
|
|
5339
5155
|
}
|
|
5340
5156
|
getLinkFrequency(p1, p2) {
|
|
5341
|
-
const
|
|
5157
|
+
const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
|
|
5342
5158
|
let res = this.freqs.links.get(key);
|
|
5343
5159
|
if (res === undefined) {
|
|
5344
5160
|
res = Math.random();
|
|
@@ -5366,8 +5182,7 @@
|
|
|
5366
5182
|
return res;
|
|
5367
5183
|
}
|
|
5368
5184
|
addManualParticles() {
|
|
5369
|
-
const container = this.container;
|
|
5370
|
-
const options = container.actualOptions;
|
|
5185
|
+
const container = this.container, options = container.actualOptions;
|
|
5371
5186
|
for (const particle of options.manualParticles) {
|
|
5372
5187
|
const pos = particle.position ? {
|
|
5373
5188
|
x: particle.position.x * container.canvas.size.width / 100,
|
|
@@ -5406,8 +5221,7 @@
|
|
|
5406
5221
|
if (!container.canvas.element || !densityOptions.enable) {
|
|
5407
5222
|
return 1;
|
|
5408
5223
|
}
|
|
5409
|
-
const canvas = container.canvas.element;
|
|
5410
|
-
const pxRatio = container.retina.pixelRatio;
|
|
5224
|
+
const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
|
|
5411
5225
|
return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
|
|
5412
5226
|
}
|
|
5413
5227
|
pushParticle(position, overrideOptions, group, initializer) {
|
|
@@ -5506,51 +5320,14 @@
|
|
|
5506
5320
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
5507
5321
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
5508
5322
|
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
5509
|
-
}
|
|
5510
|
-
handleMotionChange(mediaQuery) {
|
|
5511
|
-
const options = this.container.actualOptions;
|
|
5512
|
-
if (mediaQuery.matches) {
|
|
5513
|
-
const motion = options.motion;
|
|
5514
|
-
this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
|
|
5515
|
-
} else {
|
|
5516
|
-
this.reduceFactor = 1;
|
|
5517
|
-
}
|
|
5518
|
-
}
|
|
5519
|
-
}
|
|
5520
|
-
class FrameManager {
|
|
5521
|
-
constructor(container) {
|
|
5522
|
-
this.container = container;
|
|
5523
|
-
}
|
|
5524
|
-
nextFrame(timestamp) {
|
|
5525
|
-
var _a;
|
|
5526
|
-
try {
|
|
5527
|
-
const container = this.container;
|
|
5528
|
-
if (container.lastFrameTime !== undefined && timestamp < container.lastFrameTime + 1e3 / container.fpsLimit) {
|
|
5529
|
-
container.draw(false);
|
|
5530
|
-
return;
|
|
5531
|
-
}
|
|
5532
|
-
(_a = container.lastFrameTime) !== null && _a !== void 0 ? _a : container.lastFrameTime = timestamp;
|
|
5533
|
-
const deltaValue = timestamp - container.lastFrameTime;
|
|
5534
|
-
const delta = {
|
|
5535
|
-
value: deltaValue,
|
|
5536
|
-
factor: 60 * deltaValue / 1e3
|
|
5537
|
-
};
|
|
5538
|
-
container.lifeTime += delta.value;
|
|
5539
|
-
container.lastFrameTime = timestamp;
|
|
5540
|
-
if (deltaValue > 1e3) {
|
|
5541
|
-
container.draw(false);
|
|
5542
|
-
return;
|
|
5543
|
-
}
|
|
5544
|
-
container.particles.draw(delta);
|
|
5545
|
-
if (container.duration > 0 && container.lifeTime > container.duration) {
|
|
5546
|
-
container.destroy();
|
|
5547
|
-
return;
|
|
5548
|
-
}
|
|
5549
|
-
if (container.getAnimationStatus()) {
|
|
5550
|
-
container.draw(false);
|
|
5551
|
-
}
|
|
5552
|
-
} catch (e) {
|
|
5553
|
-
console.error("tsParticles error in animation loop", e);
|
|
5323
|
+
}
|
|
5324
|
+
handleMotionChange(mediaQuery) {
|
|
5325
|
+
const options = this.container.actualOptions;
|
|
5326
|
+
if (mediaQuery.matches) {
|
|
5327
|
+
const motion = options.motion;
|
|
5328
|
+
this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
|
|
5329
|
+
} else {
|
|
5330
|
+
this.reduceFactor = 1;
|
|
5554
5331
|
}
|
|
5555
5332
|
}
|
|
5556
5333
|
}
|
|
@@ -5576,7 +5353,7 @@
|
|
|
5576
5353
|
this.selectors = [];
|
|
5577
5354
|
this.enable = false;
|
|
5578
5355
|
this.mode = [];
|
|
5579
|
-
this.type =
|
|
5356
|
+
this.type = "circle";
|
|
5580
5357
|
}
|
|
5581
5358
|
get elementId() {
|
|
5582
5359
|
return this.ids;
|
|
@@ -5945,7 +5722,7 @@
|
|
|
5945
5722
|
this.factor = 100;
|
|
5946
5723
|
this.speed = 1;
|
|
5947
5724
|
this.maxSpeed = 50;
|
|
5948
|
-
this.easing =
|
|
5725
|
+
this.easing = "ease-out-quad";
|
|
5949
5726
|
}
|
|
5950
5727
|
load(data) {
|
|
5951
5728
|
if (!data) {
|
|
@@ -6072,7 +5849,7 @@
|
|
|
6072
5849
|
constructor() {
|
|
6073
5850
|
this.distance = 200;
|
|
6074
5851
|
this.duration = .4;
|
|
6075
|
-
this.easing =
|
|
5852
|
+
this.easing = "ease-out-quad";
|
|
6076
5853
|
this.factor = 1;
|
|
6077
5854
|
this.maxSpeed = 50;
|
|
6078
5855
|
this.speed = 1;
|
|
@@ -6205,7 +5982,7 @@
|
|
|
6205
5982
|
}
|
|
6206
5983
|
class Interactivity {
|
|
6207
5984
|
constructor() {
|
|
6208
|
-
this.detectsOn =
|
|
5985
|
+
this.detectsOn = "window";
|
|
6209
5986
|
this.events = new Events;
|
|
6210
5987
|
this.modes = new Modes;
|
|
6211
5988
|
}
|
|
@@ -6228,11 +6005,11 @@
|
|
|
6228
6005
|
this.modes.load(data.modes);
|
|
6229
6006
|
if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
|
|
6230
6007
|
if (this.events.onHover.mode instanceof Array) {
|
|
6231
|
-
if (this.events.onHover.mode.indexOf(
|
|
6232
|
-
this.events.onHover.mode.push(
|
|
6008
|
+
if (this.events.onHover.mode.indexOf("slow") < 0) {
|
|
6009
|
+
this.events.onHover.mode.push("slow");
|
|
6233
6010
|
}
|
|
6234
|
-
} else if (this.events.onHover.mode !==
|
|
6235
|
-
this.events.onHover.mode = [ this.events.onHover.mode,
|
|
6011
|
+
} else if (this.events.onHover.mode !== "slow") {
|
|
6012
|
+
this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
|
|
6236
6013
|
}
|
|
6237
6014
|
}
|
|
6238
6015
|
}
|
|
@@ -6318,7 +6095,7 @@
|
|
|
6318
6095
|
class ThemeDefault {
|
|
6319
6096
|
constructor() {
|
|
6320
6097
|
this.auto = false;
|
|
6321
|
-
this.mode =
|
|
6098
|
+
this.mode = "any";
|
|
6322
6099
|
this.value = false;
|
|
6323
6100
|
}
|
|
6324
6101
|
load(data) {
|
|
@@ -6424,7 +6201,7 @@
|
|
|
6424
6201
|
constructor() {
|
|
6425
6202
|
this.maxWidth = Infinity;
|
|
6426
6203
|
this.options = {};
|
|
6427
|
-
this.mode =
|
|
6204
|
+
this.mode = "canvas";
|
|
6428
6205
|
}
|
|
6429
6206
|
load(data) {
|
|
6430
6207
|
if (!data) {
|
|
@@ -6434,10 +6211,10 @@
|
|
|
6434
6211
|
this.maxWidth = data.maxWidth;
|
|
6435
6212
|
}
|
|
6436
6213
|
if (data.mode !== undefined) {
|
|
6437
|
-
if (data.mode ===
|
|
6438
|
-
this.mode =
|
|
6214
|
+
if (data.mode === "screen") {
|
|
6215
|
+
this.mode = "screen";
|
|
6439
6216
|
} else {
|
|
6440
|
-
this.mode =
|
|
6217
|
+
this.mode = "canvas";
|
|
6441
6218
|
}
|
|
6442
6219
|
}
|
|
6443
6220
|
if (data.options !== undefined) {
|
|
@@ -6562,8 +6339,8 @@
|
|
|
6562
6339
|
this.themes.push(optTheme);
|
|
6563
6340
|
}
|
|
6564
6341
|
}
|
|
6565
|
-
this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this,
|
|
6566
|
-
this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this,
|
|
6342
|
+
this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
|
|
6343
|
+
this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
|
|
6567
6344
|
}
|
|
6568
6345
|
setTheme(name) {
|
|
6569
6346
|
if (name) {
|
|
@@ -6572,7 +6349,7 @@
|
|
|
6572
6349
|
this.load(chosenTheme.options);
|
|
6573
6350
|
}
|
|
6574
6351
|
} else {
|
|
6575
|
-
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, clientDarkMode ?
|
|
6352
|
+
const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, clientDarkMode ? "dark" : "light");
|
|
6576
6353
|
if (defaultTheme) {
|
|
6577
6354
|
this.load(defaultTheme.options);
|
|
6578
6355
|
}
|
|
@@ -6580,7 +6357,7 @@
|
|
|
6580
6357
|
}
|
|
6581
6358
|
setResponsive(width, pxRatio, defaultOptions) {
|
|
6582
6359
|
this.load(defaultOptions);
|
|
6583
|
-
const responsiveOptions = this.responsive.find((t => t.mode ===
|
|
6360
|
+
const responsiveOptions = this.responsive.find((t => t.mode === "screen" && screen ? t.maxWidth * pxRatio > screen.availWidth : t.maxWidth * pxRatio > width));
|
|
6584
6361
|
this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
|
|
6585
6362
|
return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
|
|
6586
6363
|
}
|
|
@@ -6590,7 +6367,7 @@
|
|
|
6590
6367
|
}
|
|
6591
6368
|
_Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
|
|
6592
6369
|
var _a;
|
|
6593
|
-
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 ===
|
|
6370
|
+
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"));
|
|
6594
6371
|
};
|
|
6595
6372
|
class Container {
|
|
6596
6373
|
constructor(id, sourceOptions, ...presets) {
|
|
@@ -7144,20 +6921,20 @@
|
|
|
7144
6921
|
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value),
|
|
7145
6922
|
value;
|
|
7146
6923
|
};
|
|
7147
|
-
var
|
|
6924
|
+
var engine_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
7148
6925
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7149
6926
|
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");
|
|
7150
6927
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
7151
6928
|
};
|
|
7152
|
-
var
|
|
7153
|
-
class
|
|
6929
|
+
var _Engine_initialized;
|
|
6930
|
+
class Engine {
|
|
7154
6931
|
constructor() {
|
|
7155
|
-
|
|
7156
|
-
__classPrivateFieldSet(this,
|
|
6932
|
+
_Engine_initialized.set(this, void 0);
|
|
6933
|
+
__classPrivateFieldSet(this, _Engine_initialized, false, "f");
|
|
7157
6934
|
}
|
|
7158
6935
|
init() {
|
|
7159
|
-
if (!
|
|
7160
|
-
__classPrivateFieldSet(this,
|
|
6936
|
+
if (!engine_classPrivateFieldGet(this, _Engine_initialized, "f")) {
|
|
6937
|
+
__classPrivateFieldSet(this, _Engine_initialized, true, "f");
|
|
7161
6938
|
}
|
|
7162
6939
|
}
|
|
7163
6940
|
async loadFromArray(tagId, options, index) {
|
|
@@ -7225,7 +7002,7 @@
|
|
|
7225
7002
|
await this.refresh();
|
|
7226
7003
|
}
|
|
7227
7004
|
}
|
|
7228
|
-
|
|
7005
|
+
_Engine_initialized = new WeakMap;
|
|
7229
7006
|
class CircleDrawer {
|
|
7230
7007
|
getSidesCount() {
|
|
7231
7008
|
return 12;
|
|
@@ -7299,12 +7076,6 @@
|
|
|
7299
7076
|
async function loadLifeUpdater(tsParticles) {
|
|
7300
7077
|
await tsParticles.addParticleUpdater("life", (container => new LifeUpdater(container)));
|
|
7301
7078
|
}
|
|
7302
|
-
class ExternalInteractorBase {
|
|
7303
|
-
constructor(container) {
|
|
7304
|
-
this.container = container;
|
|
7305
|
-
this.type = InteractorType.External;
|
|
7306
|
-
}
|
|
7307
|
-
}
|
|
7308
7079
|
class Connector extends ExternalInteractorBase {
|
|
7309
7080
|
constructor(container) {
|
|
7310
7081
|
super(container);
|
|
@@ -7314,7 +7085,7 @@
|
|
|
7314
7085
|
if (!(events.onHover.enable && mouse.position)) {
|
|
7315
7086
|
return false;
|
|
7316
7087
|
}
|
|
7317
|
-
return isInArray(
|
|
7088
|
+
return isInArray("connect", events.onHover.mode);
|
|
7318
7089
|
}
|
|
7319
7090
|
reset() {}
|
|
7320
7091
|
interact() {
|
|
@@ -7344,13 +7115,13 @@
|
|
|
7344
7115
|
}
|
|
7345
7116
|
function checkDestroy(particle, value, minValue, maxValue) {
|
|
7346
7117
|
switch (particle.options.opacity.animation.destroy) {
|
|
7347
|
-
case
|
|
7118
|
+
case "max":
|
|
7348
7119
|
if (value >= maxValue) {
|
|
7349
7120
|
particle.destroy();
|
|
7350
7121
|
}
|
|
7351
7122
|
break;
|
|
7352
7123
|
|
|
7353
|
-
case
|
|
7124
|
+
case "min":
|
|
7354
7125
|
if (value <= minValue) {
|
|
7355
7126
|
particle.destroy();
|
|
7356
7127
|
}
|
|
@@ -7368,9 +7139,9 @@
|
|
|
7368
7139
|
return;
|
|
7369
7140
|
}
|
|
7370
7141
|
switch (particle.opacity.status) {
|
|
7371
|
-
case
|
|
7142
|
+
case 0:
|
|
7372
7143
|
if (particle.opacity.value >= maxValue) {
|
|
7373
|
-
particle.opacity.status =
|
|
7144
|
+
particle.opacity.status = 1;
|
|
7374
7145
|
if (!particle.opacity.loops) {
|
|
7375
7146
|
particle.opacity.loops = 0;
|
|
7376
7147
|
}
|
|
@@ -7380,9 +7151,9 @@
|
|
|
7380
7151
|
}
|
|
7381
7152
|
break;
|
|
7382
7153
|
|
|
7383
|
-
case
|
|
7154
|
+
case 1:
|
|
7384
7155
|
if (particle.opacity.value <= minValue) {
|
|
7385
|
-
particle.opacity.status =
|
|
7156
|
+
particle.opacity.status = 0;
|
|
7386
7157
|
if (!particle.opacity.loops) {
|
|
7387
7158
|
particle.opacity.loops = 0;
|
|
7388
7159
|
}
|
|
@@ -7413,25 +7184,25 @@
|
|
|
7413
7184
|
};
|
|
7414
7185
|
const opacityAnimation = opacityOptions.animation;
|
|
7415
7186
|
if (opacityAnimation.enable) {
|
|
7416
|
-
particle.opacity.status =
|
|
7187
|
+
particle.opacity.status = 0;
|
|
7417
7188
|
const opacityRange = opacityOptions.value;
|
|
7418
7189
|
particle.opacity.min = getRangeMin(opacityRange);
|
|
7419
7190
|
particle.opacity.max = getRangeMax(opacityRange);
|
|
7420
7191
|
switch (opacityAnimation.startValue) {
|
|
7421
|
-
case
|
|
7192
|
+
case "min":
|
|
7422
7193
|
particle.opacity.value = particle.opacity.min;
|
|
7423
|
-
particle.opacity.status =
|
|
7194
|
+
particle.opacity.status = 0;
|
|
7424
7195
|
break;
|
|
7425
7196
|
|
|
7426
|
-
case
|
|
7197
|
+
case "random":
|
|
7427
7198
|
particle.opacity.value = randomInRange(particle.opacity);
|
|
7428
|
-
particle.opacity.status = Math.random() >= .5 ?
|
|
7199
|
+
particle.opacity.status = Math.random() >= .5 ? 0 : 1;
|
|
7429
7200
|
break;
|
|
7430
7201
|
|
|
7431
|
-
case
|
|
7202
|
+
case "max":
|
|
7432
7203
|
default:
|
|
7433
7204
|
particle.opacity.value = particle.opacity.max;
|
|
7434
|
-
particle.opacity.status =
|
|
7205
|
+
particle.opacity.status = 1;
|
|
7435
7206
|
break;
|
|
7436
7207
|
}
|
|
7437
7208
|
particle.opacity.velocity = opacityAnimation.speed / 100 * this.container.retina.reduceFactor;
|
|
@@ -7454,56 +7225,94 @@
|
|
|
7454
7225
|
async function loadOpacityUpdater(tsParticles) {
|
|
7455
7226
|
await tsParticles.addParticleUpdater("opacity", (container => new OpacityUpdater(container)));
|
|
7456
7227
|
}
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7228
|
+
const currentColorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;
|
|
7229
|
+
function replaceColorSvg(imageShape, color, opacity) {
|
|
7230
|
+
const {svgData: svgData} = imageShape;
|
|
7231
|
+
if (!svgData) {
|
|
7232
|
+
return "";
|
|
7233
|
+
}
|
|
7234
|
+
const colorStyle = getStyleFromHsl(color, opacity);
|
|
7235
|
+
if (svgData.includes("fill")) {
|
|
7236
|
+
return svgData.replace(currentColorRegex, (() => colorStyle));
|
|
7237
|
+
}
|
|
7238
|
+
const preFillIndex = svgData.indexOf(">");
|
|
7239
|
+
return `${svgData.substring(0, preFillIndex)} fill="${colorStyle}"${svgData.substring(preFillIndex)}`;
|
|
7240
|
+
}
|
|
7241
|
+
async function loadImage(image) {
|
|
7242
|
+
return new Promise((resolve => {
|
|
7243
|
+
image.loading = true;
|
|
7467
7244
|
const img = new Image;
|
|
7468
7245
|
img.addEventListener("load", (() => {
|
|
7469
7246
|
image.element = img;
|
|
7470
|
-
|
|
7247
|
+
image.loading = false;
|
|
7248
|
+
resolve();
|
|
7471
7249
|
}));
|
|
7472
7250
|
img.addEventListener("error", (() => {
|
|
7473
|
-
|
|
7251
|
+
image.error = true;
|
|
7252
|
+
image.loading = false;
|
|
7253
|
+
console.error(`Error tsParticles - loading image: ${image.source}`);
|
|
7254
|
+
resolve();
|
|
7474
7255
|
}));
|
|
7475
|
-
img.src = source;
|
|
7256
|
+
img.src = image.source;
|
|
7476
7257
|
}));
|
|
7477
7258
|
}
|
|
7478
|
-
async function downloadSvgImage(
|
|
7479
|
-
if (!source) {
|
|
7480
|
-
throw new Error("Error tsParticles - No image.src");
|
|
7481
|
-
}
|
|
7482
|
-
const image = {
|
|
7483
|
-
source: source,
|
|
7484
|
-
type: source.substr(source.length - 3)
|
|
7485
|
-
};
|
|
7259
|
+
async function downloadSvgImage(image) {
|
|
7486
7260
|
if (image.type !== "svg") {
|
|
7487
|
-
|
|
7261
|
+
await loadImage(image);
|
|
7262
|
+
return;
|
|
7488
7263
|
}
|
|
7264
|
+
image.loading = true;
|
|
7489
7265
|
const response = await fetch(image.source);
|
|
7266
|
+
image.loading = false;
|
|
7490
7267
|
if (!response.ok) {
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
image.svgData = await response.text();
|
|
7494
|
-
return image;
|
|
7495
|
-
}
|
|
7496
|
-
function replaceColorSvg(imageShape, color, opacity) {
|
|
7497
|
-
const {svgData: svgData} = imageShape;
|
|
7498
|
-
if (!svgData) {
|
|
7499
|
-
return "";
|
|
7268
|
+
console.error("Error tsParticles - Image not found");
|
|
7269
|
+
image.error = true;
|
|
7500
7270
|
}
|
|
7501
|
-
if (
|
|
7502
|
-
|
|
7503
|
-
return svgData.replace(currentColor, (() => getStyleFromHsl(color, opacity)));
|
|
7271
|
+
if (!image.error) {
|
|
7272
|
+
image.svgData = await response.text();
|
|
7504
7273
|
}
|
|
7505
|
-
|
|
7506
|
-
|
|
7274
|
+
}
|
|
7275
|
+
function replaceImageColor(image, imageData, color, particle) {
|
|
7276
|
+
var _a, _b, _c;
|
|
7277
|
+
const svgColoredData = replaceColorSvg(image, color, (_b = (_a = particle.opacity) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 1);
|
|
7278
|
+
const svg = new Blob([ svgColoredData ], {
|
|
7279
|
+
type: "image/svg+xml"
|
|
7280
|
+
});
|
|
7281
|
+
const domUrl = URL || window.URL || window.webkitURL || window;
|
|
7282
|
+
const url = domUrl.createObjectURL(svg);
|
|
7283
|
+
const img = new Image;
|
|
7284
|
+
const imageRes = {
|
|
7285
|
+
data: Object.assign(Object.assign({}, image), {
|
|
7286
|
+
svgData: svgColoredData
|
|
7287
|
+
}),
|
|
7288
|
+
ratio: imageData.width / imageData.height,
|
|
7289
|
+
replaceColor: (_c = imageData.replaceColor) !== null && _c !== void 0 ? _c : imageData.replace_color,
|
|
7290
|
+
source: imageData.src
|
|
7291
|
+
};
|
|
7292
|
+
img.addEventListener("load", (() => {
|
|
7293
|
+
const pImage = particle.image;
|
|
7294
|
+
if (pImage) {
|
|
7295
|
+
pImage.loaded = true;
|
|
7296
|
+
image.element = img;
|
|
7297
|
+
}
|
|
7298
|
+
domUrl.revokeObjectURL(url);
|
|
7299
|
+
}));
|
|
7300
|
+
img.addEventListener("error", (() => {
|
|
7301
|
+
domUrl.revokeObjectURL(url);
|
|
7302
|
+
const img2 = Object.assign(Object.assign({}, image), {
|
|
7303
|
+
error: false,
|
|
7304
|
+
loading: true
|
|
7305
|
+
});
|
|
7306
|
+
loadImage(img2).then((() => {
|
|
7307
|
+
const pImage = particle.image;
|
|
7308
|
+
if (pImage) {
|
|
7309
|
+
image.element = img2.element;
|
|
7310
|
+
pImage.loaded = true;
|
|
7311
|
+
}
|
|
7312
|
+
}));
|
|
7313
|
+
}));
|
|
7314
|
+
img.src = url;
|
|
7315
|
+
return imageRes;
|
|
7507
7316
|
}
|
|
7508
7317
|
var ImageDrawer_classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
7509
7318
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
@@ -7542,80 +7351,30 @@
|
|
|
7542
7351
|
const containerImages = this.getImages(container);
|
|
7543
7352
|
containerImages === null || containerImages === void 0 ? void 0 : containerImages.images.push(image);
|
|
7544
7353
|
}
|
|
7545
|
-
async init(container) {
|
|
7546
|
-
await this.loadImagesFromParticlesOptions(container, container.actualOptions.particles);
|
|
7547
|
-
await this.loadImagesFromParticlesOptions(container, container.actualOptions.interactivity.modes.trail.particles);
|
|
7548
|
-
for (const manualParticle of container.actualOptions.manualParticles) {
|
|
7549
|
-
await this.loadImagesFromParticlesOptions(container, manualParticle.options);
|
|
7550
|
-
}
|
|
7551
|
-
const emitterOptions = container.actualOptions;
|
|
7552
|
-
if (emitterOptions.emitters) {
|
|
7553
|
-
if (emitterOptions.emitters instanceof Array) {
|
|
7554
|
-
for (const emitter of emitterOptions.emitters) {
|
|
7555
|
-
await this.loadImagesFromParticlesOptions(container, emitter.particles);
|
|
7556
|
-
}
|
|
7557
|
-
} else {
|
|
7558
|
-
await this.loadImagesFromParticlesOptions(container, emitterOptions.emitters.particles);
|
|
7559
|
-
}
|
|
7560
|
-
}
|
|
7561
|
-
const interactiveEmitters = emitterOptions.interactivity.modes.emitters;
|
|
7562
|
-
if (interactiveEmitters) {
|
|
7563
|
-
if (interactiveEmitters instanceof Array) {
|
|
7564
|
-
for (const emitter of interactiveEmitters) {
|
|
7565
|
-
await this.loadImagesFromParticlesOptions(container, emitter.particles);
|
|
7566
|
-
}
|
|
7567
|
-
} else {
|
|
7568
|
-
await this.loadImagesFromParticlesOptions(container, interactiveEmitters.particles);
|
|
7569
|
-
}
|
|
7570
|
-
}
|
|
7571
|
-
}
|
|
7572
7354
|
destroy() {
|
|
7573
7355
|
ImageDrawer_classPrivateFieldSet(this, _ImageDrawer_images, [], "f");
|
|
7574
7356
|
}
|
|
7575
|
-
async loadImagesFromParticlesOptions(container, options) {
|
|
7576
|
-
var _a, _b, _c;
|
|
7577
|
-
const shapeOptions = options === null || options === void 0 ? void 0 : options.shape;
|
|
7578
|
-
if (!(shapeOptions === null || shapeOptions === void 0 ? void 0 : shapeOptions.type) || !shapeOptions.options || !isInArray(ShapeType.image, shapeOptions.type) && !isInArray(ShapeType.images, shapeOptions.type)) {
|
|
7579
|
-
return;
|
|
7580
|
-
}
|
|
7581
|
-
const idx = ImageDrawer_classPrivateFieldGet(this, _ImageDrawer_images, "f").findIndex((t => t.id === container.id));
|
|
7582
|
-
if (idx >= 0) {
|
|
7583
|
-
ImageDrawer_classPrivateFieldGet(this, _ImageDrawer_images, "f").splice(idx, 1);
|
|
7584
|
-
}
|
|
7585
|
-
const imageOptions = (_a = shapeOptions.options[ShapeType.images]) !== null && _a !== void 0 ? _a : shapeOptions.options[ShapeType.image];
|
|
7586
|
-
if (imageOptions instanceof Array) {
|
|
7587
|
-
for (const optionsImage of imageOptions) {
|
|
7588
|
-
await this.loadImageShape(container, optionsImage);
|
|
7589
|
-
}
|
|
7590
|
-
} else {
|
|
7591
|
-
await this.loadImageShape(container, imageOptions);
|
|
7592
|
-
}
|
|
7593
|
-
if (options === null || options === void 0 ? void 0 : options.groups) {
|
|
7594
|
-
for (const groupName in options.groups) {
|
|
7595
|
-
const group = options.groups[groupName];
|
|
7596
|
-
await this.loadImagesFromParticlesOptions(container, group);
|
|
7597
|
-
}
|
|
7598
|
-
}
|
|
7599
|
-
if ((_c = (_b = options === null || options === void 0 ? void 0 : options.destroy) === null || _b === void 0 ? void 0 : _b.split) === null || _c === void 0 ? void 0 : _c.particles) {
|
|
7600
|
-
await this.loadImagesFromParticlesOptions(container, options === null || options === void 0 ? void 0 : options.destroy.split.particles);
|
|
7601
|
-
}
|
|
7602
|
-
}
|
|
7603
7357
|
async loadImageShape(container, imageShape) {
|
|
7358
|
+
const source = imageShape.src;
|
|
7359
|
+
if (!source) {
|
|
7360
|
+
throw new Error("Error tsParticles - No image.src");
|
|
7361
|
+
}
|
|
7604
7362
|
try {
|
|
7363
|
+
const image = {
|
|
7364
|
+
source: source,
|
|
7365
|
+
type: source.substr(source.length - 3),
|
|
7366
|
+
error: false,
|
|
7367
|
+
loading: true
|
|
7368
|
+
};
|
|
7369
|
+
this.addImage(container, image);
|
|
7605
7370
|
const imageFunc = imageShape.replaceColor ? downloadSvgImage : loadImage;
|
|
7606
|
-
|
|
7607
|
-
if (image) {
|
|
7608
|
-
this.addImage(container, image);
|
|
7609
|
-
}
|
|
7371
|
+
await imageFunc(image);
|
|
7610
7372
|
} catch (_a) {
|
|
7611
|
-
|
|
7373
|
+
throw new Error(`tsParticles error - ${imageShape.src} not found`);
|
|
7612
7374
|
}
|
|
7613
7375
|
}
|
|
7614
7376
|
draw(context, particle, radius, opacity) {
|
|
7615
7377
|
var _a, _b;
|
|
7616
|
-
if (!context) {
|
|
7617
|
-
return;
|
|
7618
|
-
}
|
|
7619
7378
|
const image = particle.image;
|
|
7620
7379
|
const element = (_a = image === null || image === void 0 ? void 0 : image.data) === null || _a === void 0 ? void 0 : _a.element;
|
|
7621
7380
|
if (!element) {
|
|
@@ -7635,67 +7394,40 @@
|
|
|
7635
7394
|
}
|
|
7636
7395
|
}
|
|
7637
7396
|
loadShape(particle) {
|
|
7638
|
-
var _a, _b, _c
|
|
7397
|
+
var _a, _b, _c;
|
|
7639
7398
|
if (particle.shape !== "image" && particle.shape !== "images") {
|
|
7640
7399
|
return;
|
|
7641
7400
|
}
|
|
7642
7401
|
const images = this.getImages(particle.container).images;
|
|
7643
7402
|
const imageData = particle.shapeData;
|
|
7644
|
-
const image =
|
|
7645
|
-
const color = particle.getFillColor();
|
|
7403
|
+
const image = images.find((t => t.source === imageData.src));
|
|
7646
7404
|
let imageRes;
|
|
7647
7405
|
if (!image) {
|
|
7406
|
+
this.loadImageShape(particle.container, imageData).then((() => {
|
|
7407
|
+
this.loadShape(particle);
|
|
7408
|
+
}));
|
|
7648
7409
|
return;
|
|
7649
7410
|
}
|
|
7650
|
-
if (image.
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
const url = domUrl.createObjectURL(svg);
|
|
7657
|
-
const img = new Image;
|
|
7658
|
-
imageRes = {
|
|
7659
|
-
data: Object.assign(Object.assign({}, image), {
|
|
7660
|
-
svgData: svgColoredData
|
|
7661
|
-
}),
|
|
7662
|
-
ratio: imageData.width / imageData.height,
|
|
7663
|
-
replaceColor: (_d = imageData.replaceColor) !== null && _d !== void 0 ? _d : imageData.replace_color,
|
|
7664
|
-
source: imageData.src
|
|
7665
|
-
};
|
|
7666
|
-
img.addEventListener("load", (() => {
|
|
7667
|
-
const pImage = particle.image;
|
|
7668
|
-
if (pImage) {
|
|
7669
|
-
pImage.loaded = true;
|
|
7670
|
-
image.element = img;
|
|
7671
|
-
}
|
|
7672
|
-
domUrl.revokeObjectURL(url);
|
|
7673
|
-
}));
|
|
7674
|
-
img.addEventListener("error", (() => {
|
|
7675
|
-
domUrl.revokeObjectURL(url);
|
|
7676
|
-
loadImage(imageData.src).then((img2 => {
|
|
7677
|
-
const pImage = particle.image;
|
|
7678
|
-
if (pImage) {
|
|
7679
|
-
image.element = img2 === null || img2 === void 0 ? void 0 : img2.element;
|
|
7680
|
-
pImage.loaded = true;
|
|
7681
|
-
}
|
|
7682
|
-
}));
|
|
7683
|
-
}));
|
|
7684
|
-
img.src = url;
|
|
7411
|
+
if (image.error) {
|
|
7412
|
+
return;
|
|
7413
|
+
}
|
|
7414
|
+
const color = particle.getFillColor();
|
|
7415
|
+
if (image.svgData && imageData.replaceColor && color) {
|
|
7416
|
+
imageRes = replaceImageColor(image, imageData, color, particle);
|
|
7685
7417
|
} else {
|
|
7686
7418
|
imageRes = {
|
|
7687
7419
|
data: image,
|
|
7688
7420
|
loaded: true,
|
|
7689
7421
|
ratio: imageData.width / imageData.height,
|
|
7690
|
-
replaceColor: (
|
|
7422
|
+
replaceColor: (_a = imageData.replaceColor) !== null && _a !== void 0 ? _a : imageData.replace_color,
|
|
7691
7423
|
source: imageData.src
|
|
7692
7424
|
};
|
|
7693
7425
|
}
|
|
7694
7426
|
if (!imageRes.ratio) {
|
|
7695
7427
|
imageRes.ratio = 1;
|
|
7696
7428
|
}
|
|
7697
|
-
const fill = (
|
|
7698
|
-
const close = (
|
|
7429
|
+
const fill = (_b = imageData.fill) !== null && _b !== void 0 ? _b : particle.fill;
|
|
7430
|
+
const close = (_c = imageData.close) !== null && _c !== void 0 ? _c : particle.close;
|
|
7699
7431
|
const imageShape = {
|
|
7700
7432
|
image: imageRes,
|
|
7701
7433
|
fill: fill,
|
|
@@ -7789,12 +7521,6 @@
|
|
|
7789
7521
|
await loadGenericPolygonShape(tsParticles);
|
|
7790
7522
|
await loadTriangleShape(tsParticles);
|
|
7791
7523
|
}
|
|
7792
|
-
var ProcessBubbleType;
|
|
7793
|
-
(function(ProcessBubbleType) {
|
|
7794
|
-
ProcessBubbleType["color"] = "color";
|
|
7795
|
-
ProcessBubbleType["opacity"] = "opacity";
|
|
7796
|
-
ProcessBubbleType["size"] = "size";
|
|
7797
|
-
})(ProcessBubbleType || (ProcessBubbleType = {}));
|
|
7798
7524
|
function calculateBubbleValue(particleValue, modeValue, optionsValue, ratio) {
|
|
7799
7525
|
if (modeValue >= optionsValue) {
|
|
7800
7526
|
const value = particleValue + (modeValue - optionsValue) * ratio;
|
|
@@ -7809,13 +7535,13 @@
|
|
|
7809
7535
|
super(container);
|
|
7810
7536
|
}
|
|
7811
7537
|
isEnabled() {
|
|
7812
|
-
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = options.interactivity.events, divs = events.onDiv, divBubble = isDivModeEnabled(
|
|
7538
|
+
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = options.interactivity.events, divs = events.onDiv, divBubble = isDivModeEnabled("bubble", divs);
|
|
7813
7539
|
if (!(divBubble || events.onHover.enable && mouse.position || events.onClick.enable && mouse.clickPosition)) {
|
|
7814
7540
|
return false;
|
|
7815
7541
|
}
|
|
7816
7542
|
const hoverMode = events.onHover.mode;
|
|
7817
7543
|
const clickMode = events.onClick.mode;
|
|
7818
|
-
return isInArray(
|
|
7544
|
+
return isInArray("bubble", hoverMode) || isInArray("bubble", clickMode) || divBubble;
|
|
7819
7545
|
}
|
|
7820
7546
|
reset(particle, force) {
|
|
7821
7547
|
if (!(!particle.bubble.inRange || force)) {
|
|
@@ -7828,12 +7554,12 @@
|
|
|
7828
7554
|
}
|
|
7829
7555
|
interact() {
|
|
7830
7556
|
const options = this.container.actualOptions, events = options.interactivity.events, onHover = events.onHover, onClick = events.onClick, hoverEnabled = onHover.enable, hoverMode = onHover.mode, clickEnabled = onClick.enable, clickMode = onClick.mode, divs = events.onDiv;
|
|
7831
|
-
if (hoverEnabled && isInArray(
|
|
7557
|
+
if (hoverEnabled && isInArray("bubble", hoverMode)) {
|
|
7832
7558
|
this.hoverBubble();
|
|
7833
|
-
} else if (clickEnabled && isInArray(
|
|
7559
|
+
} else if (clickEnabled && isInArray("bubble", clickMode)) {
|
|
7834
7560
|
this.clickBubble();
|
|
7835
7561
|
} else {
|
|
7836
|
-
divModeExecute(
|
|
7562
|
+
divModeExecute("bubble", divs, ((selector, div) => this.singleSelectorHover(selector, div)));
|
|
7837
7563
|
}
|
|
7838
7564
|
}
|
|
7839
7565
|
singleSelectorHover(selector, div) {
|
|
@@ -7845,7 +7571,7 @@
|
|
|
7845
7571
|
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
|
|
7846
7572
|
x: (elem.offsetLeft + elem.offsetWidth / 2) * pxRatio,
|
|
7847
7573
|
y: (elem.offsetTop + elem.offsetHeight / 2) * pxRatio
|
|
7848
|
-
}, repulseRadius = elem.offsetWidth / 2 * pxRatio, area = div.type ===
|
|
7574
|
+
}, repulseRadius = elem.offsetWidth / 2 * pxRatio, area = div.type === "circle" ? new Circle(pos.x, pos.y, repulseRadius) : new Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area);
|
|
7849
7575
|
for (const particle of query) {
|
|
7850
7576
|
if (!area.contains(particle.getPosition())) {
|
|
7851
7577
|
continue;
|
|
@@ -7877,26 +7603,26 @@
|
|
|
7877
7603
|
const obj = pObjBubble !== null && pObjBubble !== void 0 ? pObjBubble : pObj;
|
|
7878
7604
|
if (obj !== bubbleParam) {
|
|
7879
7605
|
const value = pObj - timeSpent * (pObj - bubbleParam) / bubbleDuration;
|
|
7880
|
-
if (type ===
|
|
7606
|
+
if (type === "size") {
|
|
7881
7607
|
particle.bubble.radius = value;
|
|
7882
7608
|
}
|
|
7883
|
-
if (type ===
|
|
7609
|
+
if (type === "opacity") {
|
|
7884
7610
|
particle.bubble.opacity = value;
|
|
7885
7611
|
}
|
|
7886
7612
|
}
|
|
7887
7613
|
} else {
|
|
7888
|
-
if (type ===
|
|
7614
|
+
if (type === "size") {
|
|
7889
7615
|
delete particle.bubble.radius;
|
|
7890
7616
|
}
|
|
7891
|
-
if (type ===
|
|
7617
|
+
if (type === "opacity") {
|
|
7892
7618
|
delete particle.bubble.opacity;
|
|
7893
7619
|
}
|
|
7894
7620
|
}
|
|
7895
7621
|
} else if (pObjBubble) {
|
|
7896
|
-
if (type ===
|
|
7622
|
+
if (type === "size") {
|
|
7897
7623
|
delete particle.bubble.radius;
|
|
7898
7624
|
}
|
|
7899
|
-
if (type ===
|
|
7625
|
+
if (type === "opacity") {
|
|
7900
7626
|
delete particle.bubble.opacity;
|
|
7901
7627
|
}
|
|
7902
7628
|
}
|
|
@@ -7930,7 +7656,7 @@
|
|
|
7930
7656
|
optValue: getRangeMax(particle.options.size.value) * container.retina.pixelRatio,
|
|
7931
7657
|
value: particle.size.value
|
|
7932
7658
|
},
|
|
7933
|
-
type:
|
|
7659
|
+
type: "size"
|
|
7934
7660
|
};
|
|
7935
7661
|
this.process(particle, distMouse, timeSpent, sizeData);
|
|
7936
7662
|
const opacityData = {
|
|
@@ -7942,7 +7668,7 @@
|
|
|
7942
7668
|
optValue: getRangeMax(particle.options.opacity.value),
|
|
7943
7669
|
value: (_b = (_a = particle.opacity) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 1
|
|
7944
7670
|
},
|
|
7945
|
-
type:
|
|
7671
|
+
type: "opacity"
|
|
7946
7672
|
};
|
|
7947
7673
|
this.process(particle, distMouse, timeSpent, opacityData);
|
|
7948
7674
|
if (!container.bubble.durationEnd) {
|
|
@@ -8040,14 +7766,14 @@
|
|
|
8040
7766
|
return false;
|
|
8041
7767
|
}
|
|
8042
7768
|
const hoverMode = events.onHover.mode, clickMode = events.onClick.mode;
|
|
8043
|
-
return isInArray(
|
|
7769
|
+
return isInArray("attract", hoverMode) || isInArray("attract", clickMode);
|
|
8044
7770
|
}
|
|
8045
7771
|
reset() {}
|
|
8046
7772
|
interact() {
|
|
8047
7773
|
const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === Constants.mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode;
|
|
8048
|
-
if (mouseMoveStatus && hoverEnabled && isInArray(
|
|
7774
|
+
if (mouseMoveStatus && hoverEnabled && isInArray("attract", hoverMode)) {
|
|
8049
7775
|
this.hoverAttract();
|
|
8050
|
-
} else if (clickEnabled && isInArray(
|
|
7776
|
+
} else if (clickEnabled && isInArray("attract", clickMode)) {
|
|
8051
7777
|
this.clickAttract();
|
|
8052
7778
|
}
|
|
8053
7779
|
}
|
|
@@ -8105,7 +7831,7 @@
|
|
|
8105
7831
|
}
|
|
8106
7832
|
isEnabled() {
|
|
8107
7833
|
const container = this.container, mouse = container.interactivity.mouse, events = container.actualOptions.interactivity.events;
|
|
8108
|
-
return events.onHover.enable && !!mouse.position && isInArray(
|
|
7834
|
+
return events.onHover.enable && !!mouse.position && isInArray("grab", events.onHover.mode);
|
|
8109
7835
|
}
|
|
8110
7836
|
reset() {}
|
|
8111
7837
|
interact() {
|
|
@@ -8165,12 +7891,6 @@
|
|
|
8165
7891
|
async function loadStarShape(tsParticles) {
|
|
8166
7892
|
await tsParticles.addShape("star", new StarDrawer);
|
|
8167
7893
|
}
|
|
8168
|
-
class ParticlesInteractorBase {
|
|
8169
|
-
constructor(container) {
|
|
8170
|
-
this.container = container;
|
|
8171
|
-
this.type = InteractorType.Particles;
|
|
8172
|
-
}
|
|
8173
|
-
}
|
|
8174
7894
|
class Attractor_Attractor extends ParticlesInteractorBase {
|
|
8175
7895
|
constructor(container) {
|
|
8176
7896
|
super(container);
|
|
@@ -8219,16 +7939,16 @@
|
|
|
8219
7939
|
}
|
|
8220
7940
|
const offset = randomInRange(valueAnimation.offset);
|
|
8221
7941
|
const velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6;
|
|
8222
|
-
if (!decrease || colorValue.status ===
|
|
7942
|
+
if (!decrease || colorValue.status === 0) {
|
|
8223
7943
|
colorValue.value += velocity;
|
|
8224
7944
|
if (decrease && colorValue.value > max) {
|
|
8225
|
-
colorValue.status =
|
|
7945
|
+
colorValue.status = 1;
|
|
8226
7946
|
colorValue.value -= colorValue.value % max;
|
|
8227
7947
|
}
|
|
8228
7948
|
} else {
|
|
8229
7949
|
colorValue.value -= velocity;
|
|
8230
7950
|
if (colorValue.value < 0) {
|
|
8231
|
-
colorValue.status =
|
|
7951
|
+
colorValue.status = 0;
|
|
8232
7952
|
colorValue.value += colorValue.value;
|
|
8233
7953
|
}
|
|
8234
7954
|
}
|
|
@@ -8292,16 +8012,16 @@
|
|
|
8292
8012
|
}
|
|
8293
8013
|
const offset = randomInRange(valueAnimation.offset);
|
|
8294
8014
|
const velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6;
|
|
8295
|
-
if (!decrease || colorValue.status ===
|
|
8015
|
+
if (!decrease || colorValue.status === 0) {
|
|
8296
8016
|
colorValue.value += velocity;
|
|
8297
8017
|
if (decrease && colorValue.value > max) {
|
|
8298
|
-
colorValue.status =
|
|
8018
|
+
colorValue.status = 1;
|
|
8299
8019
|
colorValue.value -= colorValue.value % max;
|
|
8300
8020
|
}
|
|
8301
8021
|
} else {
|
|
8302
8022
|
colorValue.value -= velocity;
|
|
8303
8023
|
if (colorValue.value < 0) {
|
|
8304
|
-
colorValue.status =
|
|
8024
|
+
colorValue.status = 0;
|
|
8305
8025
|
colorValue.value += colorValue.value;
|
|
8306
8026
|
}
|
|
8307
8027
|
}
|
|
@@ -8394,19 +8114,19 @@
|
|
|
8394
8114
|
}
|
|
8395
8115
|
resolveCollision(p1, p2) {
|
|
8396
8116
|
switch (p1.options.collisions.mode) {
|
|
8397
|
-
case
|
|
8117
|
+
case "absorb":
|
|
8398
8118
|
{
|
|
8399
8119
|
this.absorb(p1, p2);
|
|
8400
8120
|
break;
|
|
8401
8121
|
}
|
|
8402
8122
|
|
|
8403
|
-
case
|
|
8123
|
+
case "bounce":
|
|
8404
8124
|
{
|
|
8405
8125
|
bounce(p1, p2);
|
|
8406
8126
|
break;
|
|
8407
8127
|
}
|
|
8408
8128
|
|
|
8409
|
-
case
|
|
8129
|
+
case "destroy":
|
|
8410
8130
|
{
|
|
8411
8131
|
destroy(p1, p2);
|
|
8412
8132
|
break;
|
|
@@ -8458,14 +8178,14 @@
|
|
|
8458
8178
|
return;
|
|
8459
8179
|
}
|
|
8460
8180
|
switch (rotate.status) {
|
|
8461
|
-
case
|
|
8181
|
+
case 0:
|
|
8462
8182
|
rotate.value += speed;
|
|
8463
8183
|
if (rotate.value > max) {
|
|
8464
8184
|
rotate.value -= max;
|
|
8465
8185
|
}
|
|
8466
8186
|
break;
|
|
8467
8187
|
|
|
8468
|
-
case
|
|
8188
|
+
case 1:
|
|
8469
8189
|
default:
|
|
8470
8190
|
rotate.value -= speed;
|
|
8471
8191
|
if (rotate.value < 0) {
|
|
@@ -8485,18 +8205,18 @@
|
|
|
8485
8205
|
value: getRangeValue(rotateOptions.value) * Math.PI / 180
|
|
8486
8206
|
};
|
|
8487
8207
|
let rotateDirection = rotateOptions.direction;
|
|
8488
|
-
if (rotateDirection ===
|
|
8208
|
+
if (rotateDirection === "random") {
|
|
8489
8209
|
const index = Math.floor(Math.random() * 2);
|
|
8490
|
-
rotateDirection = index > 0 ?
|
|
8210
|
+
rotateDirection = index > 0 ? "counter-clockwise" : "clockwise";
|
|
8491
8211
|
}
|
|
8492
8212
|
switch (rotateDirection) {
|
|
8493
|
-
case
|
|
8213
|
+
case "counter-clockwise":
|
|
8494
8214
|
case "counterClockwise":
|
|
8495
|
-
particle.rotate.status =
|
|
8215
|
+
particle.rotate.status = 1;
|
|
8496
8216
|
break;
|
|
8497
8217
|
|
|
8498
|
-
case
|
|
8499
|
-
particle.rotate.status =
|
|
8218
|
+
case "clockwise":
|
|
8219
|
+
particle.rotate.status = 0;
|
|
8500
8220
|
break;
|
|
8501
8221
|
}
|
|
8502
8222
|
const rotateAnimation = particle.options.rotate.animation;
|
|
@@ -8523,12 +8243,12 @@
|
|
|
8523
8243
|
await tsParticles.addParticleUpdater("angle", (container => new AngleUpdater(container)));
|
|
8524
8244
|
}
|
|
8525
8245
|
function bounceHorizontal(data) {
|
|
8526
|
-
if (!(data.outMode ===
|
|
8246
|
+
if (!(data.outMode === "bounce" || data.outMode === "bounce-horizontal" || data.outMode === "bounceHorizontal" || data.outMode === "split")) {
|
|
8527
8247
|
return;
|
|
8528
8248
|
}
|
|
8529
8249
|
const velocity = data.particle.velocity.x;
|
|
8530
8250
|
let bounced = false;
|
|
8531
|
-
if (data.direction ===
|
|
8251
|
+
if (data.direction === "right" && data.bounds.right >= data.canvasSize.width && velocity > 0 || data.direction === "left" && data.bounds.left <= 0 && velocity < 0) {
|
|
8532
8252
|
const newVelocity = getRangeValue(data.particle.options.bounce.horizontal.value);
|
|
8533
8253
|
data.particle.velocity.x *= -newVelocity;
|
|
8534
8254
|
bounced = true;
|
|
@@ -8542,15 +8262,15 @@
|
|
|
8542
8262
|
} else if (data.bounds.left <= 0) {
|
|
8543
8263
|
data.particle.position.x = minPos;
|
|
8544
8264
|
}
|
|
8545
|
-
if (data.outMode ===
|
|
8265
|
+
if (data.outMode === "split") {
|
|
8546
8266
|
data.particle.destroy();
|
|
8547
8267
|
}
|
|
8548
8268
|
}
|
|
8549
8269
|
function bounceVertical(data) {
|
|
8550
|
-
if (data.outMode ===
|
|
8270
|
+
if (data.outMode === "bounce" || data.outMode === "bounce-vertical" || data.outMode === "bounceVertical" || data.outMode === "split") {
|
|
8551
8271
|
const velocity = data.particle.velocity.y;
|
|
8552
8272
|
let bounced = false;
|
|
8553
|
-
if (data.direction ===
|
|
8273
|
+
if (data.direction === "bottom" && data.bounds.bottom >= data.canvasSize.height && velocity > 0 || data.direction === "top" && data.bounds.top <= 0 && velocity < 0) {
|
|
8554
8274
|
const newVelocity = getRangeValue(data.particle.options.bounce.vertical.value);
|
|
8555
8275
|
data.particle.velocity.y *= -newVelocity;
|
|
8556
8276
|
bounced = true;
|
|
@@ -8564,7 +8284,7 @@
|
|
|
8564
8284
|
} else if (data.bounds.top <= 0) {
|
|
8565
8285
|
data.particle.position.y = minPos;
|
|
8566
8286
|
}
|
|
8567
|
-
if (data.outMode ===
|
|
8287
|
+
if (data.outMode === "split") {
|
|
8568
8288
|
data.particle.destroy();
|
|
8569
8289
|
}
|
|
8570
8290
|
}
|
|
@@ -8580,31 +8300,31 @@
|
|
|
8580
8300
|
update(particle, delta) {
|
|
8581
8301
|
var _a, _b, _c, _d;
|
|
8582
8302
|
const outModes = particle.options.move.outModes;
|
|
8583
|
-
this.updateOutMode(particle, delta, (_a = outModes.bottom) !== null && _a !== void 0 ? _a : outModes.default,
|
|
8584
|
-
this.updateOutMode(particle, delta, (_b = outModes.left) !== null && _b !== void 0 ? _b : outModes.default,
|
|
8585
|
-
this.updateOutMode(particle, delta, (_c = outModes.right) !== null && _c !== void 0 ? _c : outModes.default,
|
|
8586
|
-
this.updateOutMode(particle, delta, (_d = outModes.top) !== null && _d !== void 0 ? _d : outModes.default,
|
|
8303
|
+
this.updateOutMode(particle, delta, (_a = outModes.bottom) !== null && _a !== void 0 ? _a : outModes.default, "bottom");
|
|
8304
|
+
this.updateOutMode(particle, delta, (_b = outModes.left) !== null && _b !== void 0 ? _b : outModes.default, "left");
|
|
8305
|
+
this.updateOutMode(particle, delta, (_c = outModes.right) !== null && _c !== void 0 ? _c : outModes.default, "right");
|
|
8306
|
+
this.updateOutMode(particle, delta, (_d = outModes.top) !== null && _d !== void 0 ? _d : outModes.default, "top");
|
|
8587
8307
|
}
|
|
8588
8308
|
updateOutMode(particle, delta, outMode, direction) {
|
|
8589
8309
|
switch (outMode) {
|
|
8590
|
-
case
|
|
8591
|
-
case
|
|
8592
|
-
case
|
|
8310
|
+
case "bounce":
|
|
8311
|
+
case "bounce-vertical":
|
|
8312
|
+
case "bounce-horizontal":
|
|
8593
8313
|
case "bounceVertical":
|
|
8594
8314
|
case "bounceHorizontal":
|
|
8595
|
-
case
|
|
8315
|
+
case "split":
|
|
8596
8316
|
this.bounce(particle, delta, direction, outMode);
|
|
8597
8317
|
break;
|
|
8598
8318
|
|
|
8599
|
-
case
|
|
8319
|
+
case "destroy":
|
|
8600
8320
|
this.destroy(particle, direction);
|
|
8601
8321
|
break;
|
|
8602
8322
|
|
|
8603
|
-
case
|
|
8323
|
+
case "out":
|
|
8604
8324
|
this.out(particle, direction);
|
|
8605
8325
|
break;
|
|
8606
8326
|
|
|
8607
|
-
case
|
|
8327
|
+
case "none":
|
|
8608
8328
|
default:
|
|
8609
8329
|
this.none(particle, direction);
|
|
8610
8330
|
break;
|
|
@@ -8628,14 +8348,14 @@
|
|
|
8628
8348
|
right: canvasSize.width + particle.getRadius() + particle.offset.x,
|
|
8629
8349
|
top: -particle.getRadius() - particle.offset.y
|
|
8630
8350
|
}, sizeValue = particle.getRadius(), nextBounds = calculateBounds(particle.position, sizeValue);
|
|
8631
|
-
if (direction ===
|
|
8351
|
+
if (direction === "right" && nextBounds.left > canvasSize.width + particle.offset.x) {
|
|
8632
8352
|
particle.position.x = newPos.left;
|
|
8633
8353
|
particle.initialPosition.x = particle.position.x;
|
|
8634
8354
|
if (!wrap) {
|
|
8635
8355
|
particle.position.y = Math.random() * canvasSize.height;
|
|
8636
8356
|
particle.initialPosition.y = particle.position.y;
|
|
8637
8357
|
}
|
|
8638
|
-
} else if (direction ===
|
|
8358
|
+
} else if (direction === "left" && nextBounds.right < -particle.offset.x) {
|
|
8639
8359
|
particle.position.x = newPos.right;
|
|
8640
8360
|
particle.initialPosition.x = particle.position.x;
|
|
8641
8361
|
if (!wrap) {
|
|
@@ -8643,14 +8363,14 @@
|
|
|
8643
8363
|
particle.initialPosition.y = particle.position.y;
|
|
8644
8364
|
}
|
|
8645
8365
|
}
|
|
8646
|
-
if (direction ===
|
|
8366
|
+
if (direction === "bottom" && nextBounds.top > canvasSize.height + particle.offset.y) {
|
|
8647
8367
|
if (!wrap) {
|
|
8648
8368
|
particle.position.x = Math.random() * canvasSize.width;
|
|
8649
8369
|
particle.initialPosition.x = particle.position.x;
|
|
8650
8370
|
}
|
|
8651
8371
|
particle.position.y = newPos.top;
|
|
8652
8372
|
particle.initialPosition.y = particle.position.y;
|
|
8653
|
-
} else if (direction ===
|
|
8373
|
+
} else if (direction === "top" && nextBounds.bottom < -particle.offset.y) {
|
|
8654
8374
|
if (!wrap) {
|
|
8655
8375
|
particle.position.x = Math.random() * canvasSize.width;
|
|
8656
8376
|
particle.initialPosition.x = particle.position.x;
|
|
@@ -8694,7 +8414,7 @@
|
|
|
8694
8414
|
});
|
|
8695
8415
|
}
|
|
8696
8416
|
none(particle, direction) {
|
|
8697
|
-
if (particle.options.move.distance.horizontal && (direction ===
|
|
8417
|
+
if (particle.options.move.distance.horizontal && (direction === "left" || direction === "right") || particle.options.move.distance.vertical && (direction === "top" || direction === "bottom")) {
|
|
8698
8418
|
return;
|
|
8699
8419
|
}
|
|
8700
8420
|
const gravityOptions = particle.options.move.gravity, container = this.container;
|
|
@@ -8709,7 +8429,7 @@
|
|
|
8709
8429
|
}
|
|
8710
8430
|
} else {
|
|
8711
8431
|
const position = particle.position;
|
|
8712
|
-
if (!gravityOptions.inverse && position.y > canvasSize.height + pRadius && direction ===
|
|
8432
|
+
if (!gravityOptions.inverse && position.y > canvasSize.height + pRadius && direction === "bottom" || gravityOptions.inverse && position.y < -pRadius && direction === "top") {
|
|
8713
8433
|
container.particles.remove(particle);
|
|
8714
8434
|
}
|
|
8715
8435
|
}
|
|
@@ -8723,22 +8443,22 @@
|
|
|
8723
8443
|
super(container);
|
|
8724
8444
|
}
|
|
8725
8445
|
isEnabled() {
|
|
8726
|
-
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = options.interactivity.events, divs = events.onDiv, divRepulse = isDivModeEnabled(
|
|
8446
|
+
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = options.interactivity.events, divs = events.onDiv, divRepulse = isDivModeEnabled("repulse", divs);
|
|
8727
8447
|
if (!(divRepulse || events.onHover.enable && mouse.position || events.onClick.enable && mouse.clickPosition)) {
|
|
8728
8448
|
return false;
|
|
8729
8449
|
}
|
|
8730
8450
|
const hoverMode = events.onHover.mode, clickMode = events.onClick.mode;
|
|
8731
|
-
return isInArray(
|
|
8451
|
+
return isInArray("repulse", hoverMode) || isInArray("repulse", clickMode) || divRepulse;
|
|
8732
8452
|
}
|
|
8733
8453
|
reset() {}
|
|
8734
8454
|
interact() {
|
|
8735
8455
|
const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === Constants.mouseMoveEvent, events = options.interactivity.events, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, clickEnabled = events.onClick.enable, clickMode = events.onClick.mode, divs = events.onDiv;
|
|
8736
|
-
if (mouseMoveStatus && hoverEnabled && isInArray(
|
|
8456
|
+
if (mouseMoveStatus && hoverEnabled && isInArray("repulse", hoverMode)) {
|
|
8737
8457
|
this.hoverRepulse();
|
|
8738
|
-
} else if (clickEnabled && isInArray(
|
|
8458
|
+
} else if (clickEnabled && isInArray("repulse", clickMode)) {
|
|
8739
8459
|
this.clickRepulse();
|
|
8740
8460
|
} else {
|
|
8741
|
-
divModeExecute(
|
|
8461
|
+
divModeExecute("repulse", divs, ((selector, div) => this.singleSelectorRepulse(selector, div)));
|
|
8742
8462
|
}
|
|
8743
8463
|
}
|
|
8744
8464
|
singleSelectorRepulse(selector, div) {
|
|
@@ -8750,7 +8470,7 @@
|
|
|
8750
8470
|
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
|
|
8751
8471
|
x: (elem.offsetLeft + elem.offsetWidth / 2) * pxRatio,
|
|
8752
8472
|
y: (elem.offsetTop + elem.offsetHeight / 2) * pxRatio
|
|
8753
|
-
}, repulseRadius = elem.offsetWidth / 2 * pxRatio, area = div.type ===
|
|
8473
|
+
}, repulseRadius = elem.offsetWidth / 2 * pxRatio, area = div.type === "circle" ? new Circle(pos.x, pos.y, repulseRadius) : new Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), divs = container.actualOptions.interactivity.modes.repulse.divs, divRepulse = divMode(divs, elem);
|
|
8754
8474
|
this.processRepulse(pos, repulseRadius, area, divRepulse);
|
|
8755
8475
|
}));
|
|
8756
8476
|
}
|
|
@@ -8825,14 +8545,14 @@
|
|
|
8825
8545
|
}
|
|
8826
8546
|
isEnabled() {
|
|
8827
8547
|
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = options.interactivity.events, divs = events.onDiv;
|
|
8828
|
-
return mouse.position && events.onHover.enable && isInArray(
|
|
8548
|
+
return mouse.position && events.onHover.enable && isInArray("bounce", events.onHover.mode) || isDivModeEnabled("bounce", divs);
|
|
8829
8549
|
}
|
|
8830
8550
|
interact() {
|
|
8831
8551
|
const container = this.container, options = container.actualOptions, events = options.interactivity.events, mouseMoveStatus = container.interactivity.status === Constants.mouseMoveEvent, hoverEnabled = events.onHover.enable, hoverMode = events.onHover.mode, divs = events.onDiv;
|
|
8832
|
-
if (mouseMoveStatus && hoverEnabled && isInArray(
|
|
8552
|
+
if (mouseMoveStatus && hoverEnabled && isInArray("bounce", hoverMode)) {
|
|
8833
8553
|
this.processMouseBounce();
|
|
8834
8554
|
} else {
|
|
8835
|
-
divModeExecute(
|
|
8555
|
+
divModeExecute("bounce", divs, ((selector, div) => this.singleSelectorBounce(selector, div)));
|
|
8836
8556
|
}
|
|
8837
8557
|
}
|
|
8838
8558
|
reset() {}
|
|
@@ -8853,7 +8573,7 @@
|
|
|
8853
8573
|
x: (elem.offsetLeft + elem.offsetWidth / 2) * pxRatio,
|
|
8854
8574
|
y: (elem.offsetTop + elem.offsetHeight / 2) * pxRatio
|
|
8855
8575
|
}, radius = elem.offsetWidth / 2 * pxRatio, tolerance = 10 * pxRatio;
|
|
8856
|
-
const area = div.type ===
|
|
8576
|
+
const area = div.type === "circle" ? new Circle(pos.x, pos.y, radius + tolerance) : new Rectangle(elem.offsetLeft * pxRatio - tolerance, elem.offsetTop * pxRatio - tolerance, elem.offsetWidth * pxRatio + tolerance * 2, elem.offsetHeight * pxRatio + tolerance * 2);
|
|
8857
8577
|
this.processBounce(pos, radius, area);
|
|
8858
8578
|
}));
|
|
8859
8579
|
}
|
|
@@ -8940,93 +8660,6 @@
|
|
|
8940
8660
|
await tsParticles.addShape(type, drawer);
|
|
8941
8661
|
}
|
|
8942
8662
|
}
|
|
8943
|
-
function getLinkDistance(pos1, pos2, optDistance, canvasSize, warp) {
|
|
8944
|
-
let distance = getDistance(pos1, pos2);
|
|
8945
|
-
if (!warp || distance <= optDistance) {
|
|
8946
|
-
return distance;
|
|
8947
|
-
}
|
|
8948
|
-
const pos2NE = {
|
|
8949
|
-
x: pos2.x - canvasSize.width,
|
|
8950
|
-
y: pos2.y
|
|
8951
|
-
};
|
|
8952
|
-
distance = getDistance(pos1, pos2NE);
|
|
8953
|
-
if (distance <= optDistance) {
|
|
8954
|
-
return distance;
|
|
8955
|
-
}
|
|
8956
|
-
const pos2SE = {
|
|
8957
|
-
x: pos2.x - canvasSize.width,
|
|
8958
|
-
y: pos2.y - canvasSize.height
|
|
8959
|
-
};
|
|
8960
|
-
distance = getDistance(pos1, pos2SE);
|
|
8961
|
-
if (distance <= optDistance) {
|
|
8962
|
-
return distance;
|
|
8963
|
-
}
|
|
8964
|
-
const pos2SW = {
|
|
8965
|
-
x: pos2.x,
|
|
8966
|
-
y: pos2.y - canvasSize.height
|
|
8967
|
-
};
|
|
8968
|
-
distance = getDistance(pos1, pos2SW);
|
|
8969
|
-
return distance;
|
|
8970
|
-
}
|
|
8971
|
-
class Linker extends ParticlesInteractorBase {
|
|
8972
|
-
constructor(container) {
|
|
8973
|
-
super(container);
|
|
8974
|
-
}
|
|
8975
|
-
isEnabled(particle) {
|
|
8976
|
-
return particle.options.links.enable;
|
|
8977
|
-
}
|
|
8978
|
-
reset() {}
|
|
8979
|
-
interact(p1) {
|
|
8980
|
-
var _a;
|
|
8981
|
-
p1.links = [];
|
|
8982
|
-
const pos1 = p1.getPosition();
|
|
8983
|
-
const container = this.container;
|
|
8984
|
-
const canvasSize = container.canvas.size;
|
|
8985
|
-
if (pos1.x < 0 || pos1.y < 0 || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
|
|
8986
|
-
return;
|
|
8987
|
-
}
|
|
8988
|
-
const linkOpt1 = p1.options.links;
|
|
8989
|
-
const optOpacity = linkOpt1.opacity;
|
|
8990
|
-
const optDistance = (_a = p1.retina.linksDistance) !== null && _a !== void 0 ? _a : container.retina.linksDistance;
|
|
8991
|
-
const warp = linkOpt1.warp;
|
|
8992
|
-
const range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance);
|
|
8993
|
-
const query = container.particles.quadTree.query(range);
|
|
8994
|
-
for (const p2 of query) {
|
|
8995
|
-
const linkOpt2 = p2.options.links;
|
|
8996
|
-
if (p1 === p2 || !linkOpt2.enable || linkOpt1.id !== linkOpt2.id || p2.spawning || p2.destroyed || p1.links.map((t => t.destination)).indexOf(p2) !== -1 || p2.links.map((t => t.destination)).indexOf(p1) !== -1) {
|
|
8997
|
-
continue;
|
|
8998
|
-
}
|
|
8999
|
-
const pos2 = p2.getPosition();
|
|
9000
|
-
if (pos2.x < 0 || pos2.y < 0 || pos2.x > canvasSize.width || pos2.y > canvasSize.height) {
|
|
9001
|
-
continue;
|
|
9002
|
-
}
|
|
9003
|
-
const distance = getLinkDistance(pos1, pos2, optDistance, canvasSize, warp && linkOpt2.warp);
|
|
9004
|
-
if (distance > optDistance) {
|
|
9005
|
-
return;
|
|
9006
|
-
}
|
|
9007
|
-
const opacityLine = (1 - distance / optDistance) * optOpacity;
|
|
9008
|
-
this.setColor(p1);
|
|
9009
|
-
p1.links.push({
|
|
9010
|
-
destination: p2,
|
|
9011
|
-
opacity: opacityLine
|
|
9012
|
-
});
|
|
9013
|
-
}
|
|
9014
|
-
}
|
|
9015
|
-
setColor(p1) {
|
|
9016
|
-
const container = this.container;
|
|
9017
|
-
const linksOptions = p1.options.links;
|
|
9018
|
-
let linkColor = linksOptions.id === undefined ? container.particles.linksColor : container.particles.linksColors.get(linksOptions.id);
|
|
9019
|
-
if (!linkColor) {
|
|
9020
|
-
const optColor = linksOptions.color;
|
|
9021
|
-
linkColor = getLinkRandomColor(optColor, linksOptions.blink, linksOptions.consent);
|
|
9022
|
-
if (linksOptions.id === undefined) {
|
|
9023
|
-
container.particles.linksColor = linkColor;
|
|
9024
|
-
} else {
|
|
9025
|
-
container.particles.linksColors.set(linksOptions.id, linkColor);
|
|
9026
|
-
}
|
|
9027
|
-
}
|
|
9028
|
-
}
|
|
9029
|
-
}
|
|
9030
8663
|
class LinkInstance {
|
|
9031
8664
|
constructor(container) {
|
|
9032
8665
|
this.container = container;
|
|
@@ -9126,35 +8759,122 @@
|
|
|
9126
8759
|
opacity = twinkle.opacity;
|
|
9127
8760
|
}
|
|
9128
8761
|
}
|
|
9129
|
-
if (!colorLine) {
|
|
9130
|
-
const linksOptions = p1.options.links;
|
|
9131
|
-
const linkColor = linksOptions.id !== undefined ? container.particles.linksColors.get(linksOptions.id) : container.particles.linksColor;
|
|
9132
|
-
colorLine = getLinkColor(p1, p2, linkColor);
|
|
8762
|
+
if (!colorLine) {
|
|
8763
|
+
const linksOptions = p1.options.links;
|
|
8764
|
+
const linkColor = linksOptions.id !== undefined ? container.particles.linksColors.get(linksOptions.id) : container.particles.linksColor;
|
|
8765
|
+
colorLine = getLinkColor(p1, p2, linkColor);
|
|
8766
|
+
}
|
|
8767
|
+
if (!colorLine) {
|
|
8768
|
+
return;
|
|
8769
|
+
}
|
|
8770
|
+
const width = (_a = p1.retina.linksWidth) !== null && _a !== void 0 ? _a : container.retina.linksWidth;
|
|
8771
|
+
const maxDistance = (_b = p1.retina.linksDistance) !== null && _b !== void 0 ? _b : container.retina.linksDistance;
|
|
8772
|
+
drawLinkLine(ctx, width, pos1, pos2, maxDistance, container.canvas.size, p1.options.links.warp, options.backgroundMask.enable, options.backgroundMask.composite, colorLine, opacity, p1.options.links.shadow);
|
|
8773
|
+
}));
|
|
8774
|
+
}
|
|
8775
|
+
}
|
|
8776
|
+
class LinksPlugin {
|
|
8777
|
+
constructor() {
|
|
8778
|
+
this.id = "links";
|
|
8779
|
+
}
|
|
8780
|
+
getPlugin(container) {
|
|
8781
|
+
return new LinkInstance(container);
|
|
8782
|
+
}
|
|
8783
|
+
needsPlugin() {
|
|
8784
|
+
return true;
|
|
8785
|
+
}
|
|
8786
|
+
loadOptions() {}
|
|
8787
|
+
}
|
|
8788
|
+
async function loadPlugin(tsParticles) {
|
|
8789
|
+
const plugin = new LinksPlugin;
|
|
8790
|
+
await tsParticles.addPlugin(plugin);
|
|
8791
|
+
}
|
|
8792
|
+
function getLinkDistance(pos1, pos2, optDistance, canvasSize, warp) {
|
|
8793
|
+
let distance = getDistance(pos1, pos2);
|
|
8794
|
+
if (!warp || distance <= optDistance) {
|
|
8795
|
+
return distance;
|
|
8796
|
+
}
|
|
8797
|
+
const pos2NE = {
|
|
8798
|
+
x: pos2.x - canvasSize.width,
|
|
8799
|
+
y: pos2.y
|
|
8800
|
+
};
|
|
8801
|
+
distance = getDistance(pos1, pos2NE);
|
|
8802
|
+
if (distance <= optDistance) {
|
|
8803
|
+
return distance;
|
|
8804
|
+
}
|
|
8805
|
+
const pos2SE = {
|
|
8806
|
+
x: pos2.x - canvasSize.width,
|
|
8807
|
+
y: pos2.y - canvasSize.height
|
|
8808
|
+
};
|
|
8809
|
+
distance = getDistance(pos1, pos2SE);
|
|
8810
|
+
if (distance <= optDistance) {
|
|
8811
|
+
return distance;
|
|
8812
|
+
}
|
|
8813
|
+
const pos2SW = {
|
|
8814
|
+
x: pos2.x,
|
|
8815
|
+
y: pos2.y - canvasSize.height
|
|
8816
|
+
};
|
|
8817
|
+
distance = getDistance(pos1, pos2SW);
|
|
8818
|
+
return distance;
|
|
8819
|
+
}
|
|
8820
|
+
class Linker extends ParticlesInteractorBase {
|
|
8821
|
+
constructor(container) {
|
|
8822
|
+
super(container);
|
|
8823
|
+
}
|
|
8824
|
+
isEnabled(particle) {
|
|
8825
|
+
return particle.options.links.enable;
|
|
8826
|
+
}
|
|
8827
|
+
reset() {}
|
|
8828
|
+
interact(p1) {
|
|
8829
|
+
var _a;
|
|
8830
|
+
p1.links = [];
|
|
8831
|
+
const pos1 = p1.getPosition();
|
|
8832
|
+
const container = this.container;
|
|
8833
|
+
const canvasSize = container.canvas.size;
|
|
8834
|
+
if (pos1.x < 0 || pos1.y < 0 || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
|
|
8835
|
+
return;
|
|
8836
|
+
}
|
|
8837
|
+
const linkOpt1 = p1.options.links;
|
|
8838
|
+
const optOpacity = linkOpt1.opacity;
|
|
8839
|
+
const optDistance = (_a = p1.retina.linksDistance) !== null && _a !== void 0 ? _a : container.retina.linksDistance;
|
|
8840
|
+
const warp = linkOpt1.warp;
|
|
8841
|
+
const range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance);
|
|
8842
|
+
const query = container.particles.quadTree.query(range);
|
|
8843
|
+
for (const p2 of query) {
|
|
8844
|
+
const linkOpt2 = p2.options.links;
|
|
8845
|
+
if (p1 === p2 || !linkOpt2.enable || linkOpt1.id !== linkOpt2.id || p2.spawning || p2.destroyed || p1.links.map((t => t.destination)).indexOf(p2) !== -1 || p2.links.map((t => t.destination)).indexOf(p1) !== -1) {
|
|
8846
|
+
continue;
|
|
8847
|
+
}
|
|
8848
|
+
const pos2 = p2.getPosition();
|
|
8849
|
+
if (pos2.x < 0 || pos2.y < 0 || pos2.x > canvasSize.width || pos2.y > canvasSize.height) {
|
|
8850
|
+
continue;
|
|
9133
8851
|
}
|
|
9134
|
-
|
|
8852
|
+
const distance = getLinkDistance(pos1, pos2, optDistance, canvasSize, warp && linkOpt2.warp);
|
|
8853
|
+
if (distance > optDistance) {
|
|
9135
8854
|
return;
|
|
9136
8855
|
}
|
|
9137
|
-
const
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
constructor() {
|
|
9145
|
-
this.id = "links";
|
|
9146
|
-
}
|
|
9147
|
-
getPlugin(container) {
|
|
9148
|
-
return new LinkInstance(container);
|
|
8856
|
+
const opacityLine = (1 - distance / optDistance) * optOpacity;
|
|
8857
|
+
this.setColor(p1);
|
|
8858
|
+
p1.links.push({
|
|
8859
|
+
destination: p2,
|
|
8860
|
+
opacity: opacityLine
|
|
8861
|
+
});
|
|
8862
|
+
}
|
|
9149
8863
|
}
|
|
9150
|
-
|
|
9151
|
-
|
|
8864
|
+
setColor(p1) {
|
|
8865
|
+
const container = this.container;
|
|
8866
|
+
const linksOptions = p1.options.links;
|
|
8867
|
+
let linkColor = linksOptions.id === undefined ? container.particles.linksColor : container.particles.linksColors.get(linksOptions.id);
|
|
8868
|
+
if (!linkColor) {
|
|
8869
|
+
const optColor = linksOptions.color;
|
|
8870
|
+
linkColor = getLinkRandomColor(optColor, linksOptions.blink, linksOptions.consent);
|
|
8871
|
+
if (linksOptions.id === undefined) {
|
|
8872
|
+
container.particles.linksColor = linkColor;
|
|
8873
|
+
} else {
|
|
8874
|
+
container.particles.linksColors.set(linksOptions.id, linkColor);
|
|
8875
|
+
}
|
|
8876
|
+
}
|
|
9152
8877
|
}
|
|
9153
|
-
loadOptions() {}
|
|
9154
|
-
}
|
|
9155
|
-
async function loadPlugin(tsParticles) {
|
|
9156
|
-
const plugin = new Plugin;
|
|
9157
|
-
await tsParticles.addPlugin(plugin);
|
|
9158
8878
|
}
|
|
9159
8879
|
async function loadInteraction(tsParticles) {
|
|
9160
8880
|
await tsParticles.addInteractor("particlesLinks", (container => new Linker(container)));
|
|
@@ -9165,13 +8885,13 @@
|
|
|
9165
8885
|
}
|
|
9166
8886
|
function SizeUpdater_checkDestroy(particle, value, minValue, maxValue) {
|
|
9167
8887
|
switch (particle.options.size.animation.destroy) {
|
|
9168
|
-
case
|
|
8888
|
+
case "max":
|
|
9169
8889
|
if (value >= maxValue) {
|
|
9170
8890
|
particle.destroy();
|
|
9171
8891
|
}
|
|
9172
8892
|
break;
|
|
9173
8893
|
|
|
9174
|
-
case
|
|
8894
|
+
case "min":
|
|
9175
8895
|
if (value <= minValue) {
|
|
9176
8896
|
particle.destroy();
|
|
9177
8897
|
}
|
|
@@ -9187,9 +8907,9 @@
|
|
|
9187
8907
|
return;
|
|
9188
8908
|
}
|
|
9189
8909
|
switch (particle.size.status) {
|
|
9190
|
-
case
|
|
8910
|
+
case 0:
|
|
9191
8911
|
if (particle.size.value >= maxValue) {
|
|
9192
|
-
particle.size.status =
|
|
8912
|
+
particle.size.status = 1;
|
|
9193
8913
|
if (!particle.size.loops) {
|
|
9194
8914
|
particle.size.loops = 0;
|
|
9195
8915
|
}
|
|
@@ -9199,9 +8919,9 @@
|
|
|
9199
8919
|
}
|
|
9200
8920
|
break;
|
|
9201
8921
|
|
|
9202
|
-
case
|
|
8922
|
+
case 1:
|
|
9203
8923
|
if (particle.size.value <= minValue) {
|
|
9204
|
-
particle.size.status =
|
|
8924
|
+
particle.size.status = 0;
|
|
9205
8925
|
if (!particle.size.loops) {
|
|
9206
8926
|
particle.size.loops = 0;
|
|
9207
8927
|
}
|
|
@@ -9294,7 +9014,7 @@
|
|
|
9294
9014
|
}
|
|
9295
9015
|
isEnabled() {
|
|
9296
9016
|
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = options.interactivity.events;
|
|
9297
|
-
return mouse.clicking && mouse.inside && !!mouse.position && isInArray(
|
|
9017
|
+
return mouse.clicking && mouse.inside && !!mouse.position && isInArray("trail", events.onClick.mode) || mouse.inside && !!mouse.position && isInArray("trail", events.onHover.mode);
|
|
9298
9018
|
}
|
|
9299
9019
|
reset() {}
|
|
9300
9020
|
}
|
|
@@ -9314,14 +9034,14 @@
|
|
|
9314
9034
|
return;
|
|
9315
9035
|
}
|
|
9316
9036
|
switch (particle.tilt.status) {
|
|
9317
|
-
case
|
|
9037
|
+
case 0:
|
|
9318
9038
|
particle.tilt.value += speed;
|
|
9319
9039
|
if (particle.tilt.value > max) {
|
|
9320
9040
|
particle.tilt.value -= max;
|
|
9321
9041
|
}
|
|
9322
9042
|
break;
|
|
9323
9043
|
|
|
9324
|
-
case
|
|
9044
|
+
case 1:
|
|
9325
9045
|
default:
|
|
9326
9046
|
particle.tilt.value -= speed;
|
|
9327
9047
|
if (particle.tilt.value < 0) {
|
|
@@ -9343,18 +9063,18 @@
|
|
|
9343
9063
|
cosDirection: Math.random() >= .5 ? 1 : -1
|
|
9344
9064
|
};
|
|
9345
9065
|
let tiltDirection = tiltOptions.direction;
|
|
9346
|
-
if (tiltDirection ===
|
|
9066
|
+
if (tiltDirection === "random") {
|
|
9347
9067
|
const index = Math.floor(Math.random() * 2);
|
|
9348
|
-
tiltDirection = index > 0 ?
|
|
9068
|
+
tiltDirection = index > 0 ? "counter-clockwise" : "clockwise";
|
|
9349
9069
|
}
|
|
9350
9070
|
switch (tiltDirection) {
|
|
9351
|
-
case
|
|
9071
|
+
case "counter-clockwise":
|
|
9352
9072
|
case "counterClockwise":
|
|
9353
|
-
particle.tilt.status =
|
|
9073
|
+
particle.tilt.status = 1;
|
|
9354
9074
|
break;
|
|
9355
9075
|
|
|
9356
|
-
case
|
|
9357
|
-
particle.tilt.status =
|
|
9076
|
+
case "clockwise":
|
|
9077
|
+
particle.tilt.status = 0;
|
|
9358
9078
|
break;
|
|
9359
9079
|
}
|
|
9360
9080
|
const tiltAnimation = particle.options.tilt.animation;
|
|
@@ -9428,6 +9148,66 @@
|
|
|
9428
9148
|
async function loadWobbleUpdater(tsParticles) {
|
|
9429
9149
|
await tsParticles.addParticleUpdater("wobble", (container => new WobbleUpdater(container)));
|
|
9430
9150
|
}
|
|
9151
|
+
function updateRoll(particle, delta) {
|
|
9152
|
+
const roll = particle.options.roll;
|
|
9153
|
+
if (!particle.roll || !roll.enable) {
|
|
9154
|
+
return;
|
|
9155
|
+
}
|
|
9156
|
+
const speed = particle.roll.speed * delta.factor;
|
|
9157
|
+
const max = 2 * Math.PI;
|
|
9158
|
+
particle.roll.angle += speed;
|
|
9159
|
+
if (particle.roll.angle > max) {
|
|
9160
|
+
particle.roll.angle -= max;
|
|
9161
|
+
}
|
|
9162
|
+
}
|
|
9163
|
+
class RollUpdater {
|
|
9164
|
+
init(particle) {
|
|
9165
|
+
const rollOpt = particle.options.roll;
|
|
9166
|
+
if (rollOpt.enable) {
|
|
9167
|
+
particle.roll = {
|
|
9168
|
+
angle: Math.random() * Math.PI * 2,
|
|
9169
|
+
speed: getRangeValue(rollOpt.speed) / 360
|
|
9170
|
+
};
|
|
9171
|
+
if (rollOpt.backColor) {
|
|
9172
|
+
particle.backColor = colorToHsl(rollOpt.backColor);
|
|
9173
|
+
} else if (rollOpt.darken.enable && rollOpt.enlighten.enable) {
|
|
9174
|
+
const alterType = Math.random() >= .5 ? "darken" : "enlighten";
|
|
9175
|
+
particle.roll.alter = {
|
|
9176
|
+
type: alterType,
|
|
9177
|
+
value: alterType === "darken" ? rollOpt.darken.value : rollOpt.enlighten.value
|
|
9178
|
+
};
|
|
9179
|
+
} else if (rollOpt.darken.enable) {
|
|
9180
|
+
particle.roll.alter = {
|
|
9181
|
+
type: "darken",
|
|
9182
|
+
value: rollOpt.darken.value
|
|
9183
|
+
};
|
|
9184
|
+
} else if (rollOpt.enlighten.enable) {
|
|
9185
|
+
particle.roll.alter = {
|
|
9186
|
+
type: "enlighten",
|
|
9187
|
+
value: rollOpt.enlighten.value
|
|
9188
|
+
};
|
|
9189
|
+
}
|
|
9190
|
+
} else {
|
|
9191
|
+
particle.roll = {
|
|
9192
|
+
angle: 0,
|
|
9193
|
+
speed: 0
|
|
9194
|
+
};
|
|
9195
|
+
}
|
|
9196
|
+
}
|
|
9197
|
+
isEnabled(particle) {
|
|
9198
|
+
const roll = particle.options.roll;
|
|
9199
|
+
return !particle.destroyed && !particle.spawning && roll.enable;
|
|
9200
|
+
}
|
|
9201
|
+
update(particle, delta) {
|
|
9202
|
+
if (!this.isEnabled(particle)) {
|
|
9203
|
+
return;
|
|
9204
|
+
}
|
|
9205
|
+
updateRoll(particle, delta);
|
|
9206
|
+
}
|
|
9207
|
+
}
|
|
9208
|
+
async function loadRollUpdater(tsParticles) {
|
|
9209
|
+
await tsParticles.addParticleUpdater("roll", (() => new RollUpdater));
|
|
9210
|
+
}
|
|
9431
9211
|
class AbsorberInstance {
|
|
9432
9212
|
constructor(absorbers, container, options, position) {
|
|
9433
9213
|
var _a, _b, _c, _d, _e;
|
|
@@ -9548,7 +9328,7 @@
|
|
|
9548
9328
|
particle.absorberOrbit.length = minSize * (1 + (Math.random() * .2 - .1));
|
|
9549
9329
|
}
|
|
9550
9330
|
if (particle.absorberOrbitDirection === undefined) {
|
|
9551
|
-
particle.absorberOrbitDirection = particle.velocity.x >= 0 ?
|
|
9331
|
+
particle.absorberOrbitDirection = particle.velocity.x >= 0 ? "clockwise" : "counter-clockwise";
|
|
9552
9332
|
}
|
|
9553
9333
|
const orbitRadius = particle.absorberOrbit.length;
|
|
9554
9334
|
const orbitAngle = particle.absorberOrbit.angle;
|
|
@@ -9556,8 +9336,8 @@
|
|
|
9556
9336
|
particle.velocity.x = 0;
|
|
9557
9337
|
particle.velocity.y = 0;
|
|
9558
9338
|
const updateFunc = {
|
|
9559
|
-
x: orbitDirection ===
|
|
9560
|
-
y: orbitDirection ===
|
|
9339
|
+
x: orbitDirection === "clockwise" ? Math.cos : Math.sin,
|
|
9340
|
+
y: orbitDirection === "clockwise" ? Math.sin : Math.cos
|
|
9561
9341
|
};
|
|
9562
9342
|
particle.position.x = this.position.x + orbitRadius * updateFunc.x(orbitAngle);
|
|
9563
9343
|
particle.position.y = this.position.y + orbitRadius * updateFunc.y(orbitAngle);
|
|
@@ -9652,10 +9432,6 @@
|
|
|
9652
9432
|
}
|
|
9653
9433
|
}
|
|
9654
9434
|
}
|
|
9655
|
-
var AbsorberClickMode;
|
|
9656
|
-
(function(AbsorberClickMode) {
|
|
9657
|
-
AbsorberClickMode["absorber"] = "absorber";
|
|
9658
|
-
})(AbsorberClickMode || (AbsorberClickMode = {}));
|
|
9659
9435
|
class Absorbers {
|
|
9660
9436
|
constructor(container) {
|
|
9661
9437
|
this.container = container;
|
|
@@ -9735,7 +9511,7 @@
|
|
|
9735
9511
|
const container = this.container;
|
|
9736
9512
|
const absorberOptions = this.absorbers;
|
|
9737
9513
|
const modeAbsorbers = this.interactivityAbsorbers;
|
|
9738
|
-
if (mode ===
|
|
9514
|
+
if (mode === "absorber") {
|
|
9739
9515
|
let absorbersModeOptions;
|
|
9740
9516
|
if (modeAbsorbers instanceof Array) {
|
|
9741
9517
|
if (modeAbsorbers.length > 0) {
|
|
@@ -9761,7 +9537,7 @@
|
|
|
9761
9537
|
}
|
|
9762
9538
|
}
|
|
9763
9539
|
}
|
|
9764
|
-
class
|
|
9540
|
+
class AbsorbersPlugin {
|
|
9765
9541
|
constructor() {
|
|
9766
9542
|
this.id = "absorbers";
|
|
9767
9543
|
}
|
|
@@ -9781,7 +9557,7 @@
|
|
|
9781
9557
|
}
|
|
9782
9558
|
} else if (absorbers !== undefined) {
|
|
9783
9559
|
loadAbsorbers = true;
|
|
9784
|
-
} else if (((_c = (_b = (_a = options.interactivity) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.onClick) === null || _c === void 0 ? void 0 : _c.mode) && isInArray(
|
|
9560
|
+
} else if (((_c = (_b = (_a = options.interactivity) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.onClick) === null || _c === void 0 ? void 0 : _c.mode) && isInArray("absorber", options.interactivity.events.onClick.mode)) {
|
|
9785
9561
|
loadAbsorbers = true;
|
|
9786
9562
|
}
|
|
9787
9563
|
return loadAbsorbers;
|
|
@@ -9826,12 +9602,12 @@
|
|
|
9826
9602
|
}
|
|
9827
9603
|
}
|
|
9828
9604
|
async function loadAbsorbersPlugin(tsParticles) {
|
|
9829
|
-
const plugin = new
|
|
9605
|
+
const plugin = new AbsorbersPlugin;
|
|
9830
9606
|
await tsParticles.addPlugin(plugin);
|
|
9831
9607
|
}
|
|
9832
9608
|
class EmitterSize {
|
|
9833
9609
|
constructor() {
|
|
9834
|
-
this.mode =
|
|
9610
|
+
this.mode = "percent";
|
|
9835
9611
|
this.height = 0;
|
|
9836
9612
|
this.width = 0;
|
|
9837
9613
|
}
|
|
@@ -9910,7 +9686,7 @@
|
|
|
9910
9686
|
const size = new EmitterSize;
|
|
9911
9687
|
size.load({
|
|
9912
9688
|
height: 0,
|
|
9913
|
-
mode:
|
|
9689
|
+
mode: "percent",
|
|
9914
9690
|
width: 0
|
|
9915
9691
|
});
|
|
9916
9692
|
return size;
|
|
@@ -10036,8 +9812,8 @@
|
|
|
10036
9812
|
const container = this.container;
|
|
10037
9813
|
const position = this.position;
|
|
10038
9814
|
const offset = {
|
|
10039
|
-
x: this.size.mode ===
|
|
10040
|
-
y: this.size.mode ===
|
|
9815
|
+
x: this.size.mode === "percent" ? container.canvas.size.width * this.size.width / 100 : this.size.width,
|
|
9816
|
+
y: this.size.mode === "percent" ? container.canvas.size.height * this.size.height / 100 : this.size.height
|
|
10041
9817
|
};
|
|
10042
9818
|
for (let i = 0; i < quantity; i++) {
|
|
10043
9819
|
const particlesOptions = deepExtend({}, this.particlesOptions);
|
|
@@ -10119,22 +9895,13 @@
|
|
|
10119
9895
|
}
|
|
10120
9896
|
}
|
|
10121
9897
|
}
|
|
10122
|
-
var EmitterClickMode;
|
|
10123
|
-
(function(EmitterClickMode) {
|
|
10124
|
-
EmitterClickMode["emitter"] = "emitter";
|
|
10125
|
-
})(EmitterClickMode || (EmitterClickMode = {}));
|
|
10126
|
-
var EmitterShapeType;
|
|
10127
|
-
(function(EmitterShapeType) {
|
|
10128
|
-
EmitterShapeType["circle"] = "circle";
|
|
10129
|
-
EmitterShapeType["square"] = "square";
|
|
10130
|
-
})(EmitterShapeType || (EmitterShapeType = {}));
|
|
10131
9898
|
class Emitter {
|
|
10132
9899
|
constructor() {
|
|
10133
9900
|
this.autoPlay = true;
|
|
10134
9901
|
this.fill = true;
|
|
10135
9902
|
this.life = new EmitterLife;
|
|
10136
9903
|
this.rate = new EmitterRate;
|
|
10137
|
-
this.shape =
|
|
9904
|
+
this.shape = "square";
|
|
10138
9905
|
this.startCount = 0;
|
|
10139
9906
|
}
|
|
10140
9907
|
load(data) {
|
|
@@ -10268,7 +10035,7 @@
|
|
|
10268
10035
|
const container = this.container;
|
|
10269
10036
|
const emitterOptions = this.emitters;
|
|
10270
10037
|
const modeEmitters = this.interactivityEmitters;
|
|
10271
|
-
if (mode ===
|
|
10038
|
+
if (mode === "emitter") {
|
|
10272
10039
|
let emitterModeOptions;
|
|
10273
10040
|
if (modeEmitters instanceof Array) {
|
|
10274
10041
|
if (modeEmitters.length > 0) {
|
|
@@ -10378,7 +10145,7 @@
|
|
|
10378
10145
|
return false;
|
|
10379
10146
|
}
|
|
10380
10147
|
const emitters = options.emitters;
|
|
10381
|
-
return emitters instanceof Array && !!emitters.length || emitters !== undefined || !!((_c = (_b = (_a = options.interactivity) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.onClick) === null || _c === void 0 ? void 0 : _c.mode) && isInArray(
|
|
10148
|
+
return emitters instanceof Array && !!emitters.length || emitters !== undefined || !!((_c = (_b = (_a = options.interactivity) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.onClick) === null || _c === void 0 ? void 0 : _c.mode) && isInArray("emitter", options.interactivity.events.onClick.mode);
|
|
10382
10149
|
}
|
|
10383
10150
|
loadOptions(options, source) {
|
|
10384
10151
|
var _a, _b;
|
|
@@ -10427,30 +10194,10 @@
|
|
|
10427
10194
|
ShapeManager.addShape(name, shape);
|
|
10428
10195
|
};
|
|
10429
10196
|
}
|
|
10430
|
-
tsParticles.addEmitterShape(
|
|
10431
|
-
tsParticles.addEmitterShape(
|
|
10432
|
-
}
|
|
10433
|
-
|
|
10434
|
-
(function(InlineArrangement) {
|
|
10435
|
-
InlineArrangement["equidistant"] = "equidistant";
|
|
10436
|
-
InlineArrangement["onePerPoint"] = "one-per-point";
|
|
10437
|
-
InlineArrangement["perPoint"] = "per-point";
|
|
10438
|
-
InlineArrangement["randomLength"] = "random-length";
|
|
10439
|
-
InlineArrangement["randomPoint"] = "random-point";
|
|
10440
|
-
})(InlineArrangement || (InlineArrangement = {}));
|
|
10441
|
-
var MoveType;
|
|
10442
|
-
(function(MoveType) {
|
|
10443
|
-
MoveType["path"] = "path";
|
|
10444
|
-
MoveType["radius"] = "radius";
|
|
10445
|
-
})(MoveType || (MoveType = {}));
|
|
10446
|
-
var Type;
|
|
10447
|
-
(function(Type) {
|
|
10448
|
-
Type["inline"] = "inline";
|
|
10449
|
-
Type["inside"] = "inside";
|
|
10450
|
-
Type["outside"] = "outside";
|
|
10451
|
-
Type["none"] = "none";
|
|
10452
|
-
})(Type || (Type = {}));
|
|
10453
|
-
class DrawStroke {
|
|
10197
|
+
tsParticles.addEmitterShape("circle", new CircleShape);
|
|
10198
|
+
tsParticles.addEmitterShape("square", new SquareShape);
|
|
10199
|
+
}
|
|
10200
|
+
class PolygonMaskDrawStroke {
|
|
10454
10201
|
constructor() {
|
|
10455
10202
|
this.color = new OptionsColor;
|
|
10456
10203
|
this.width = .5;
|
|
@@ -10458,24 +10205,25 @@
|
|
|
10458
10205
|
}
|
|
10459
10206
|
load(data) {
|
|
10460
10207
|
var _a;
|
|
10461
|
-
if (data
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10208
|
+
if (!data) {
|
|
10209
|
+
return;
|
|
10210
|
+
}
|
|
10211
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
10212
|
+
if (typeof this.color.value === "string") {
|
|
10213
|
+
this.opacity = (_a = stringToAlpha(this.color.value)) !== null && _a !== void 0 ? _a : this.opacity;
|
|
10214
|
+
}
|
|
10215
|
+
if (data.opacity !== undefined) {
|
|
10216
|
+
this.opacity = data.opacity;
|
|
10217
|
+
}
|
|
10218
|
+
if (data.width !== undefined) {
|
|
10219
|
+
this.width = data.width;
|
|
10472
10220
|
}
|
|
10473
10221
|
}
|
|
10474
10222
|
}
|
|
10475
|
-
class
|
|
10223
|
+
class PolygonMaskDraw {
|
|
10476
10224
|
constructor() {
|
|
10477
10225
|
this.enable = false;
|
|
10478
|
-
this.stroke = new
|
|
10226
|
+
this.stroke = new PolygonMaskDrawStroke;
|
|
10479
10227
|
}
|
|
10480
10228
|
get lineWidth() {
|
|
10481
10229
|
return this.stroke.width;
|
|
@@ -10491,47 +10239,50 @@
|
|
|
10491
10239
|
}
|
|
10492
10240
|
load(data) {
|
|
10493
10241
|
var _a;
|
|
10494
|
-
if (data
|
|
10495
|
-
|
|
10496
|
-
this.enable = data.enable;
|
|
10497
|
-
}
|
|
10498
|
-
const stroke = (_a = data.stroke) !== null && _a !== void 0 ? _a : {
|
|
10499
|
-
color: data.lineColor,
|
|
10500
|
-
width: data.lineWidth
|
|
10501
|
-
};
|
|
10502
|
-
this.stroke.load(stroke);
|
|
10242
|
+
if (!data) {
|
|
10243
|
+
return;
|
|
10503
10244
|
}
|
|
10245
|
+
if (data.enable !== undefined) {
|
|
10246
|
+
this.enable = data.enable;
|
|
10247
|
+
}
|
|
10248
|
+
const stroke = (_a = data.stroke) !== null && _a !== void 0 ? _a : {
|
|
10249
|
+
color: data.lineColor,
|
|
10250
|
+
width: data.lineWidth
|
|
10251
|
+
};
|
|
10252
|
+
this.stroke.load(stroke);
|
|
10504
10253
|
}
|
|
10505
10254
|
}
|
|
10506
|
-
class
|
|
10255
|
+
class PolygonMaskMove {
|
|
10507
10256
|
constructor() {
|
|
10508
10257
|
this.radius = 10;
|
|
10509
|
-
this.type =
|
|
10258
|
+
this.type = "path";
|
|
10510
10259
|
}
|
|
10511
10260
|
load(data) {
|
|
10512
|
-
if (data
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10261
|
+
if (!data) {
|
|
10262
|
+
return;
|
|
10263
|
+
}
|
|
10264
|
+
if (data.radius !== undefined) {
|
|
10265
|
+
this.radius = data.radius;
|
|
10266
|
+
}
|
|
10267
|
+
if (data.type !== undefined) {
|
|
10268
|
+
this.type = data.type;
|
|
10519
10269
|
}
|
|
10520
10270
|
}
|
|
10521
10271
|
}
|
|
10522
|
-
class
|
|
10272
|
+
class PolygonMaskInline {
|
|
10523
10273
|
constructor() {
|
|
10524
|
-
this.arrangement =
|
|
10274
|
+
this.arrangement = "one-per-point";
|
|
10525
10275
|
}
|
|
10526
10276
|
load(data) {
|
|
10527
|
-
if (data
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10277
|
+
if (!data) {
|
|
10278
|
+
return;
|
|
10279
|
+
}
|
|
10280
|
+
if (data.arrangement !== undefined) {
|
|
10281
|
+
this.arrangement = data.arrangement;
|
|
10531
10282
|
}
|
|
10532
10283
|
}
|
|
10533
10284
|
}
|
|
10534
|
-
class
|
|
10285
|
+
class PolygonMaskLocalSvg {
|
|
10535
10286
|
constructor() {
|
|
10536
10287
|
this.path = [];
|
|
10537
10288
|
this.size = {
|
|
@@ -10540,29 +10291,30 @@
|
|
|
10540
10291
|
};
|
|
10541
10292
|
}
|
|
10542
10293
|
load(data) {
|
|
10543
|
-
if (data
|
|
10544
|
-
|
|
10545
|
-
|
|
10294
|
+
if (!data) {
|
|
10295
|
+
return;
|
|
10296
|
+
}
|
|
10297
|
+
if (data.path !== undefined) {
|
|
10298
|
+
this.path = data.path;
|
|
10299
|
+
}
|
|
10300
|
+
if (data.size !== undefined) {
|
|
10301
|
+
if (data.size.width !== undefined) {
|
|
10302
|
+
this.size.width = data.size.width;
|
|
10546
10303
|
}
|
|
10547
|
-
if (data.size !== undefined) {
|
|
10548
|
-
|
|
10549
|
-
this.size.width = data.size.width;
|
|
10550
|
-
}
|
|
10551
|
-
if (data.size.height !== undefined) {
|
|
10552
|
-
this.size.height = data.size.height;
|
|
10553
|
-
}
|
|
10304
|
+
if (data.size.height !== undefined) {
|
|
10305
|
+
this.size.height = data.size.height;
|
|
10554
10306
|
}
|
|
10555
10307
|
}
|
|
10556
10308
|
}
|
|
10557
10309
|
}
|
|
10558
10310
|
class PolygonMask {
|
|
10559
10311
|
constructor() {
|
|
10560
|
-
this.draw = new
|
|
10312
|
+
this.draw = new PolygonMaskDraw;
|
|
10561
10313
|
this.enable = false;
|
|
10562
|
-
this.inline = new
|
|
10563
|
-
this.move = new
|
|
10314
|
+
this.inline = new PolygonMaskInline;
|
|
10315
|
+
this.move = new PolygonMaskMove;
|
|
10564
10316
|
this.scale = 1;
|
|
10565
|
-
this.type =
|
|
10317
|
+
this.type = "none";
|
|
10566
10318
|
}
|
|
10567
10319
|
get inlineArrangement() {
|
|
10568
10320
|
return this.inline.arrangement;
|
|
@@ -10572,41 +10324,42 @@
|
|
|
10572
10324
|
}
|
|
10573
10325
|
load(data) {
|
|
10574
10326
|
var _a;
|
|
10575
|
-
if (data
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
this.
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10327
|
+
if (!data) {
|
|
10328
|
+
return;
|
|
10329
|
+
}
|
|
10330
|
+
this.draw.load(data.draw);
|
|
10331
|
+
const inline = (_a = data.inline) !== null && _a !== void 0 ? _a : {
|
|
10332
|
+
arrangement: data.inlineArrangement
|
|
10333
|
+
};
|
|
10334
|
+
if (inline !== undefined) {
|
|
10335
|
+
this.inline.load(inline);
|
|
10336
|
+
}
|
|
10337
|
+
this.move.load(data.move);
|
|
10338
|
+
if (data.scale !== undefined) {
|
|
10339
|
+
this.scale = data.scale;
|
|
10340
|
+
}
|
|
10341
|
+
if (data.type !== undefined) {
|
|
10342
|
+
this.type = data.type;
|
|
10343
|
+
}
|
|
10344
|
+
if (data.enable !== undefined) {
|
|
10345
|
+
this.enable = data.enable;
|
|
10346
|
+
} else {
|
|
10347
|
+
this.enable = this.type !== "none";
|
|
10348
|
+
}
|
|
10349
|
+
if (data.url !== undefined) {
|
|
10350
|
+
this.url = data.url;
|
|
10351
|
+
}
|
|
10352
|
+
if (data.data !== undefined) {
|
|
10353
|
+
if (typeof data.data === "string") {
|
|
10354
|
+
this.data = data.data;
|
|
10592
10355
|
} else {
|
|
10593
|
-
this.
|
|
10594
|
-
|
|
10595
|
-
if (data.url !== undefined) {
|
|
10596
|
-
this.url = data.url;
|
|
10597
|
-
}
|
|
10598
|
-
if (data.data !== undefined) {
|
|
10599
|
-
if (typeof data.data === "string") {
|
|
10600
|
-
this.data = data.data;
|
|
10601
|
-
} else {
|
|
10602
|
-
this.data = new LocalSvg;
|
|
10603
|
-
this.data.load(data.data);
|
|
10604
|
-
}
|
|
10605
|
-
}
|
|
10606
|
-
if (data.position !== undefined) {
|
|
10607
|
-
this.position = deepExtend({}, data.position);
|
|
10356
|
+
this.data = new PolygonMaskLocalSvg;
|
|
10357
|
+
this.data.load(data.data);
|
|
10608
10358
|
}
|
|
10609
10359
|
}
|
|
10360
|
+
if (data.position !== undefined) {
|
|
10361
|
+
this.position = deepExtend({}, data.position);
|
|
10362
|
+
}
|
|
10610
10363
|
}
|
|
10611
10364
|
}
|
|
10612
10365
|
function drawPolygonMask(context, rawData, stroke) {
|
|
@@ -10708,29 +10461,27 @@
|
|
|
10708
10461
|
const {dx: dx, dy: dy} = getDistances(pos, s1);
|
|
10709
10462
|
const {dx: dxx, dy: dyy} = getDistances(s2, s1);
|
|
10710
10463
|
const t = (dx * dxx + dy * dyy) / (dxx ** 2 + dyy ** 2);
|
|
10711
|
-
|
|
10712
|
-
|
|
10464
|
+
const res = {
|
|
10465
|
+
x: s1.x + dxx * t,
|
|
10466
|
+
y: s1.x + dyy * t,
|
|
10467
|
+
isOnSegment: t >= 0 && t <= 1
|
|
10468
|
+
};
|
|
10713
10469
|
if (t < 0) {
|
|
10714
|
-
x = s1.x;
|
|
10715
|
-
y = s1.y;
|
|
10470
|
+
res.x = s1.x;
|
|
10471
|
+
res.y = s1.y;
|
|
10716
10472
|
} else if (t > 1) {
|
|
10717
|
-
x = s2.x;
|
|
10718
|
-
y = s2.y;
|
|
10473
|
+
res.x = s2.x;
|
|
10474
|
+
res.y = s2.y;
|
|
10719
10475
|
}
|
|
10720
|
-
return
|
|
10721
|
-
x: x,
|
|
10722
|
-
y: y,
|
|
10723
|
-
isOnSegment: t >= 0 && t <= 1
|
|
10724
|
-
};
|
|
10476
|
+
return res;
|
|
10725
10477
|
}
|
|
10726
10478
|
function segmentBounce(start, stop, velocity) {
|
|
10727
10479
|
const {dx: dx, dy: dy} = getDistances(start, stop);
|
|
10728
10480
|
const wallAngle = Math.atan2(dy, dx);
|
|
10729
|
-
const
|
|
10730
|
-
const
|
|
10731
|
-
|
|
10732
|
-
velocity.
|
|
10733
|
-
velocity.y -= d * wallNormalY;
|
|
10481
|
+
const wallNormal = Vector.create(Math.sin(wallAngle), -Math.cos(wallAngle));
|
|
10482
|
+
const d = 2 * (velocity.x * wallNormal.x + velocity.y * wallNormal.y);
|
|
10483
|
+
wallNormal.multTo(d);
|
|
10484
|
+
velocity.subFrom(wallNormal);
|
|
10734
10485
|
}
|
|
10735
10486
|
class PolygonMaskInstance {
|
|
10736
10487
|
constructor(container) {
|
|
@@ -10754,7 +10505,7 @@
|
|
|
10754
10505
|
resize() {
|
|
10755
10506
|
const container = this.container;
|
|
10756
10507
|
const options = this.options;
|
|
10757
|
-
if (!(options.enable && options.type !==
|
|
10508
|
+
if (!(options.enable && options.type !== "none")) {
|
|
10758
10509
|
return;
|
|
10759
10510
|
}
|
|
10760
10511
|
if (this.redrawTimeout) {
|
|
@@ -10771,7 +10522,7 @@
|
|
|
10771
10522
|
}
|
|
10772
10523
|
particlesInitialization() {
|
|
10773
10524
|
const options = this.options;
|
|
10774
|
-
if (options.enable && options.type ===
|
|
10525
|
+
if (options.enable && options.type === "inline" && (options.inline.arrangement === "one-per-point" || options.inline.arrangement === "per-point")) {
|
|
10775
10526
|
this.drawPoints();
|
|
10776
10527
|
return true;
|
|
10777
10528
|
}
|
|
@@ -10790,7 +10541,7 @@
|
|
|
10790
10541
|
}
|
|
10791
10542
|
clickPositionValid(position) {
|
|
10792
10543
|
const options = this.options;
|
|
10793
|
-
return options.enable && options.type !==
|
|
10544
|
+
return options.enable && options.type !== "none" && options.type !== "inline" && this.checkInsidePolygon(position);
|
|
10794
10545
|
}
|
|
10795
10546
|
draw(context) {
|
|
10796
10547
|
var _a;
|
|
@@ -10818,10 +10569,10 @@
|
|
|
10818
10569
|
}
|
|
10819
10570
|
polygonBounce(particle, _delta, direction) {
|
|
10820
10571
|
const options = this.options;
|
|
10821
|
-
if (!this.raw || !options.enable || direction !==
|
|
10572
|
+
if (!this.raw || !options.enable || direction !== "top") {
|
|
10822
10573
|
return false;
|
|
10823
10574
|
}
|
|
10824
|
-
if (options.type ===
|
|
10575
|
+
if (options.type === "inside" || options.type === "outside") {
|
|
10825
10576
|
let closest, dx, dy;
|
|
10826
10577
|
const pos = particle.getPosition(), radius = particle.getRadius();
|
|
10827
10578
|
for (let i = 0, j = this.raw.length - 1; i < this.raw.length; j = i++) {
|
|
@@ -10850,7 +10601,7 @@
|
|
|
10850
10601
|
particle.velocity.mult(-1);
|
|
10851
10602
|
return true;
|
|
10852
10603
|
}
|
|
10853
|
-
} else if (options.type ===
|
|
10604
|
+
} else if (options.type === "inline" && particle.initialPosition) {
|
|
10854
10605
|
const dist = getDistance(particle.initialPosition, particle.getPosition());
|
|
10855
10606
|
if (dist > this.polygonMaskMoveRadius) {
|
|
10856
10607
|
particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
|
|
@@ -10864,7 +10615,7 @@
|
|
|
10864
10615
|
var _a, _b;
|
|
10865
10616
|
const container = this.container;
|
|
10866
10617
|
const options = this.options;
|
|
10867
|
-
if (!options.enable || options.type ===
|
|
10618
|
+
if (!options.enable || options.type === "none" || options.type === "inline") {
|
|
10868
10619
|
return true;
|
|
10869
10620
|
}
|
|
10870
10621
|
if (!this.raw) {
|
|
@@ -10882,7 +10633,7 @@
|
|
|
10882
10633
|
inside = !inside;
|
|
10883
10634
|
}
|
|
10884
10635
|
}
|
|
10885
|
-
return options.type ===
|
|
10636
|
+
return options.type === "inside" ? inside : options.type === "outside" ? !inside : false;
|
|
10886
10637
|
}
|
|
10887
10638
|
parseSvgPath(xml, force) {
|
|
10888
10639
|
var _a, _b, _c;
|
|
@@ -10951,22 +10702,22 @@
|
|
|
10951
10702
|
const container = this.container;
|
|
10952
10703
|
const options = this.options;
|
|
10953
10704
|
let position;
|
|
10954
|
-
if (options.type ===
|
|
10705
|
+
if (options.type === "inline") {
|
|
10955
10706
|
switch (options.inline.arrangement) {
|
|
10956
|
-
case
|
|
10707
|
+
case "random-point":
|
|
10957
10708
|
position = this.getRandomPoint();
|
|
10958
10709
|
break;
|
|
10959
10710
|
|
|
10960
|
-
case
|
|
10711
|
+
case "random-length":
|
|
10961
10712
|
position = this.getRandomPointByLength();
|
|
10962
10713
|
break;
|
|
10963
10714
|
|
|
10964
|
-
case
|
|
10715
|
+
case "equidistant":
|
|
10965
10716
|
position = this.getEquidistantPointByIndex(container.particles.count);
|
|
10966
10717
|
break;
|
|
10967
10718
|
|
|
10968
|
-
case
|
|
10969
|
-
case
|
|
10719
|
+
case "one-per-point":
|
|
10720
|
+
case "per-point":
|
|
10970
10721
|
default:
|
|
10971
10722
|
position = this.getPointByIndex(container.particles.count);
|
|
10972
10723
|
}
|
|
@@ -11094,7 +10845,7 @@
|
|
|
11094
10845
|
this.createPath2D();
|
|
11095
10846
|
}
|
|
11096
10847
|
}
|
|
11097
|
-
class
|
|
10848
|
+
class PolygonMaskPlugin {
|
|
11098
10849
|
constructor() {
|
|
11099
10850
|
this.id = "polygonMask";
|
|
11100
10851
|
}
|
|
@@ -11103,7 +10854,7 @@
|
|
|
11103
10854
|
}
|
|
11104
10855
|
needsPlugin(options) {
|
|
11105
10856
|
var _a, _b, _c;
|
|
11106
|
-
return (_b = (_a = options === null || options === void 0 ? void 0 : options.polygon) === null || _a === void 0 ? void 0 : _a.enable) !== null && _b !== void 0 ? _b : ((_c = options === null || options === void 0 ? void 0 : options.polygon) === null || _c === void 0 ? void 0 : _c.type) !== undefined && options.polygon.type !==
|
|
10857
|
+
return (_b = (_a = options === null || options === void 0 ? void 0 : options.polygon) === null || _a === void 0 ? void 0 : _a.enable) !== null && _b !== void 0 ? _b : ((_c = options === null || options === void 0 ? void 0 : options.polygon) === null || _c === void 0 ? void 0 : _c.type) !== undefined && options.polygon.type !== "none";
|
|
11107
10858
|
}
|
|
11108
10859
|
loadOptions(options, source) {
|
|
11109
10860
|
if (!this.needsPlugin(source)) {
|
|
@@ -11118,72 +10869,12 @@
|
|
|
11118
10869
|
}
|
|
11119
10870
|
}
|
|
11120
10871
|
async function loadPolygonMaskPlugin(tsParticles) {
|
|
11121
|
-
if (!isSsr() && !window
|
|
11122
|
-
await __webpack_require__.e(
|
|
10872
|
+
if (!isSsr() && !("SVGPathSeg" in window)) {
|
|
10873
|
+
await __webpack_require__.e(404).then(__webpack_require__.t.bind(__webpack_require__, 167, 23));
|
|
11123
10874
|
}
|
|
11124
|
-
const plugin = new
|
|
10875
|
+
const plugin = new PolygonMaskPlugin;
|
|
11125
10876
|
await tsParticles.addPlugin(plugin);
|
|
11126
10877
|
}
|
|
11127
|
-
function updateRoll(particle, delta) {
|
|
11128
|
-
const roll = particle.options.roll;
|
|
11129
|
-
if (!particle.roll || !roll.enable) {
|
|
11130
|
-
return;
|
|
11131
|
-
}
|
|
11132
|
-
const speed = particle.roll.speed * delta.factor;
|
|
11133
|
-
const max = 2 * Math.PI;
|
|
11134
|
-
particle.roll.angle += speed;
|
|
11135
|
-
if (particle.roll.angle > max) {
|
|
11136
|
-
particle.roll.angle -= max;
|
|
11137
|
-
}
|
|
11138
|
-
}
|
|
11139
|
-
class RollUpdater {
|
|
11140
|
-
init(particle) {
|
|
11141
|
-
const rollOpt = particle.options.roll;
|
|
11142
|
-
if (rollOpt.enable) {
|
|
11143
|
-
particle.roll = {
|
|
11144
|
-
angle: Math.random() * Math.PI * 2,
|
|
11145
|
-
speed: getRangeValue(rollOpt.speed) / 360
|
|
11146
|
-
};
|
|
11147
|
-
if (rollOpt.backColor) {
|
|
11148
|
-
particle.backColor = colorToHsl(rollOpt.backColor);
|
|
11149
|
-
} else if (rollOpt.darken.enable && rollOpt.enlighten.enable) {
|
|
11150
|
-
const alterType = Math.random() >= .5 ? AlterType.darken : AlterType.enlighten;
|
|
11151
|
-
particle.roll.alter = {
|
|
11152
|
-
type: alterType,
|
|
11153
|
-
value: alterType === AlterType.darken ? rollOpt.darken.value : rollOpt.enlighten.value
|
|
11154
|
-
};
|
|
11155
|
-
} else if (rollOpt.darken.enable) {
|
|
11156
|
-
particle.roll.alter = {
|
|
11157
|
-
type: AlterType.darken,
|
|
11158
|
-
value: rollOpt.darken.value
|
|
11159
|
-
};
|
|
11160
|
-
} else if (rollOpt.enlighten.enable) {
|
|
11161
|
-
particle.roll.alter = {
|
|
11162
|
-
type: AlterType.enlighten,
|
|
11163
|
-
value: rollOpt.enlighten.value
|
|
11164
|
-
};
|
|
11165
|
-
}
|
|
11166
|
-
} else {
|
|
11167
|
-
particle.roll = {
|
|
11168
|
-
angle: 0,
|
|
11169
|
-
speed: 0
|
|
11170
|
-
};
|
|
11171
|
-
}
|
|
11172
|
-
}
|
|
11173
|
-
isEnabled(particle) {
|
|
11174
|
-
const roll = particle.options.roll;
|
|
11175
|
-
return !particle.destroyed && !particle.spawning && roll.enable;
|
|
11176
|
-
}
|
|
11177
|
-
update(particle, delta) {
|
|
11178
|
-
if (!this.isEnabled(particle)) {
|
|
11179
|
-
return;
|
|
11180
|
-
}
|
|
11181
|
-
updateRoll(particle, delta);
|
|
11182
|
-
}
|
|
11183
|
-
}
|
|
11184
|
-
async function loadRollUpdater(tsParticles) {
|
|
11185
|
-
await tsParticles.addParticleUpdater("roll", (() => new RollUpdater));
|
|
11186
|
-
}
|
|
11187
10878
|
async function loadFull(tsParticles) {
|
|
11188
10879
|
await loadSlim(tsParticles);
|
|
11189
10880
|
await loadExternalTrailInteraction(tsParticles);
|
|
@@ -11194,7 +10885,7 @@
|
|
|
11194
10885
|
await loadEmittersPlugin(tsParticles);
|
|
11195
10886
|
await loadPolygonMaskPlugin(tsParticles);
|
|
11196
10887
|
}
|
|
11197
|
-
const tsParticles = new
|
|
10888
|
+
const tsParticles = new Engine;
|
|
11198
10889
|
tsParticles.init();
|
|
11199
10890
|
const {particlesJS: particlesJS, pJSDom: pJSDom} = initPjs(tsParticles);
|
|
11200
10891
|
loadFull(tsParticles);
|