@tsparticles/engine 3.0.0-alpha.1 → 3.0.0-beta.1
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/README.md +244 -188
- package/browser/Core/Canvas.js +273 -243
- package/browser/Core/Container.js +97 -113
- package/browser/Core/Engine.js +271 -0
- package/browser/Core/Particle.js +165 -172
- package/browser/Core/Particles.js +153 -148
- package/browser/Core/Retina.js +17 -15
- package/browser/Core/Utils/Circle.js +12 -8
- package/browser/Core/Utils/Constants.js +4 -3
- package/browser/Core/Utils/EventListeners.js +259 -235
- package/browser/Core/Utils/InteractionManager.js +6 -16
- package/browser/Core/Utils/QuadTree.js +17 -23
- package/browser/Core/Utils/Rectangle.js +2 -2
- package/browser/Core/Utils/Vector.js +1 -1
- package/browser/Core/Utils/Vector3d.js +17 -9
- package/browser/Options/Classes/AnimatableColor.js +4 -3
- package/browser/Options/Classes/AnimationOptions.js +5 -4
- package/browser/Options/Classes/Background/Background.js +1 -1
- package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +3 -2
- package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.js +1 -1
- package/browser/Options/Classes/ColorAnimation.js +5 -1
- package/browser/Options/Classes/HslAnimation.js +1 -1
- package/browser/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
- package/browser/Options/Classes/Interactivity/Events/Events.js +9 -28
- package/browser/Options/Classes/Interactivity/Events/HoverEvent.js +1 -1
- package/browser/Options/Classes/Interactivity/Interactivity.js +3 -10
- package/browser/Options/Classes/Interactivity/Modes/Modes.js +11 -8
- package/browser/Options/Classes/ManualParticle.js +6 -7
- package/browser/Options/Classes/Options.js +28 -48
- package/browser/Options/Classes/OptionsColor.js +3 -2
- package/browser/Options/Classes/Particles/Bounce/ParticlesBounce.js +1 -1
- package/browser/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +1 -1
- package/browser/Options/Classes/Particles/Collisions/Collisions.js +8 -3
- package/browser/Options/Classes/Particles/Move/Move.js +20 -50
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +1 -1
- package/browser/Options/Classes/Particles/Move/MoveAttract.js +10 -21
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +1 -1
- package/browser/Options/Classes/Particles/Move/MoveTrail.js +3 -9
- package/browser/Options/Classes/Particles/Move/MoveTrailFill.js +1 -1
- package/browser/Options/Classes/Particles/Move/OutModes.js +4 -5
- package/browser/Options/Classes/Particles/Move/Path/MovePath.js +2 -2
- package/browser/Options/Classes/Particles/Move/Spin.js +5 -3
- package/browser/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
- package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +3 -10
- package/browser/Options/Classes/Particles/Opacity/Opacity.js +12 -8
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -10
- package/browser/Options/Classes/Particles/ParticlesOptions.js +18 -23
- package/browser/Options/Classes/Particles/Shadow.js +1 -1
- package/browser/Options/Classes/Particles/Shape/Shape.js +10 -11
- package/browser/Options/Classes/Particles/Size/Size.js +12 -8
- package/browser/Options/Classes/Particles/Size/SizeAnimation.js +1 -10
- package/browser/Options/Classes/Particles/Stroke.js +2 -2
- package/browser/Options/Classes/Particles/ZIndex/ZIndex.js +1 -1
- package/browser/Options/Classes/Responsive.js +1 -1
- package/browser/Options/Classes/Theme/Theme.js +2 -2
- package/browser/Options/Classes/ValueWithRandom.js +6 -19
- package/browser/Utils/CanvasUtils.js +19 -55
- package/browser/Utils/ColorUtils.js +18 -20
- package/browser/Utils/EventDispatcher.js +7 -6
- package/browser/Utils/HslColorManager.js +4 -6
- package/browser/Utils/NumberUtils.js +42 -46
- package/browser/Utils/OptionsUtils.js +1 -1
- package/browser/Utils/RgbColorManager.js +3 -5
- package/browser/Utils/Utils.js +135 -64
- package/browser/bundle.js +4 -97
- package/browser/export-types.js +97 -0
- package/browser/exports.js +89 -0
- package/browser/index.js +8 -199
- package/browser/init.js +12 -0
- package/browser/package.json +1 -0
- package/cjs/Core/Canvas.js +278 -248
- package/cjs/Core/Container.js +104 -120
- package/cjs/Core/Engine.js +275 -0
- package/cjs/Core/Particle.js +173 -180
- package/cjs/Core/Particles.js +154 -149
- package/cjs/Core/Retina.js +20 -18
- package/cjs/Core/Utils/Circle.js +14 -10
- package/cjs/Core/Utils/Constants.js +5 -4
- package/cjs/Core/Utils/EventListeners.js +267 -243
- package/cjs/Core/Utils/InteractionManager.js +6 -16
- package/cjs/Core/Utils/QuadTree.js +20 -26
- package/cjs/Core/Utils/Rectangle.js +4 -4
- package/cjs/Core/Utils/Vector.js +2 -2
- package/cjs/Core/Utils/Vector3d.js +17 -9
- package/cjs/Options/Classes/AnimatableColor.js +6 -5
- package/cjs/Options/Classes/AnimationOptions.js +8 -7
- package/cjs/Options/Classes/Background/Background.js +3 -3
- package/cjs/Options/Classes/BackgroundMask/BackgroundMask.js +4 -3
- package/cjs/Options/Classes/BackgroundMask/BackgroundMaskCover.js +3 -3
- package/cjs/Options/Classes/ColorAnimation.js +9 -5
- package/cjs/Options/Classes/HslAnimation.js +4 -4
- package/cjs/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
- package/cjs/Options/Classes/Interactivity/Events/Events.js +15 -34
- package/cjs/Options/Classes/Interactivity/Events/HoverEvent.js +2 -2
- package/cjs/Options/Classes/Interactivity/Interactivity.js +5 -12
- package/cjs/Options/Classes/Interactivity/Modes/Modes.js +11 -8
- package/cjs/Options/Classes/ManualParticle.js +7 -8
- package/cjs/Options/Classes/Options.js +41 -61
- package/cjs/Options/Classes/OptionsColor.js +3 -2
- package/cjs/Options/Classes/Particles/Bounce/ParticlesBounce.js +3 -3
- package/cjs/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +2 -2
- package/cjs/Options/Classes/Particles/Collisions/Collisions.js +11 -6
- package/cjs/Options/Classes/Particles/Move/Move.js +31 -61
- package/cjs/Options/Classes/Particles/Move/MoveAngle.js +3 -3
- package/cjs/Options/Classes/Particles/Move/MoveAttract.js +11 -22
- package/cjs/Options/Classes/Particles/Move/MoveGravity.js +3 -3
- package/cjs/Options/Classes/Particles/Move/MoveTrail.js +4 -10
- package/cjs/Options/Classes/Particles/Move/MoveTrailFill.js +2 -2
- package/cjs/Options/Classes/Particles/Move/OutModes.js +4 -5
- package/cjs/Options/Classes/Particles/Move/Path/MovePath.js +4 -4
- package/cjs/Options/Classes/Particles/Move/Spin.js +6 -4
- package/cjs/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
- package/cjs/Options/Classes/Particles/Number/ParticlesNumber.js +4 -11
- package/cjs/Options/Classes/Particles/Opacity/Opacity.js +13 -9
- package/cjs/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -11
- package/cjs/Options/Classes/Particles/ParticlesOptions.js +32 -37
- package/cjs/Options/Classes/Particles/Shadow.js +3 -3
- package/cjs/Options/Classes/Particles/Shape/Shape.js +10 -11
- package/cjs/Options/Classes/Particles/Size/Size.js +13 -9
- package/cjs/Options/Classes/Particles/Size/SizeAnimation.js +2 -11
- package/cjs/Options/Classes/Particles/Stroke.js +5 -5
- package/cjs/Options/Classes/Particles/ZIndex/ZIndex.js +2 -2
- package/cjs/Options/Classes/Responsive.js +2 -2
- package/cjs/Options/Classes/Theme/Theme.js +4 -4
- package/cjs/Options/Classes/ValueWithRandom.js +10 -23
- package/cjs/Utils/CanvasUtils.js +23 -60
- package/cjs/Utils/ColorUtils.js +31 -33
- package/cjs/Utils/EventDispatcher.js +7 -6
- package/cjs/Utils/HslColorManager.js +11 -13
- package/cjs/Utils/NumberUtils.js +44 -48
- package/cjs/Utils/OptionsUtils.js +2 -2
- package/cjs/Utils/RgbColorManager.js +7 -9
- package/cjs/Utils/Utils.js +157 -77
- package/cjs/bundle.js +4 -97
- package/cjs/export-types.js +113 -0
- package/cjs/exports.js +105 -0
- package/cjs/index.js +8 -199
- package/cjs/init.js +16 -0
- package/cjs/package.json +1 -0
- package/esm/Core/Canvas.js +273 -243
- package/esm/Core/Container.js +97 -113
- package/esm/Core/Engine.js +271 -0
- package/esm/Core/Particle.js +165 -172
- package/esm/Core/Particles.js +153 -148
- package/esm/Core/Retina.js +17 -15
- package/esm/Core/Utils/Circle.js +12 -8
- package/esm/Core/Utils/Constants.js +4 -3
- package/esm/Core/Utils/EventListeners.js +259 -235
- package/esm/Core/Utils/InteractionManager.js +6 -16
- package/esm/Core/Utils/QuadTree.js +17 -23
- package/esm/Core/Utils/Rectangle.js +2 -2
- package/esm/Core/Utils/Vector.js +1 -1
- package/esm/Core/Utils/Vector3d.js +17 -9
- package/esm/Options/Classes/AnimatableColor.js +4 -3
- package/esm/Options/Classes/AnimationOptions.js +5 -4
- package/esm/Options/Classes/Background/Background.js +1 -1
- package/esm/Options/Classes/BackgroundMask/BackgroundMask.js +3 -2
- package/esm/Options/Classes/BackgroundMask/BackgroundMaskCover.js +1 -1
- package/esm/Options/Classes/ColorAnimation.js +5 -1
- package/esm/Options/Classes/HslAnimation.js +1 -1
- package/esm/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
- package/esm/Options/Classes/Interactivity/Events/Events.js +9 -28
- package/esm/Options/Classes/Interactivity/Events/HoverEvent.js +1 -1
- package/esm/Options/Classes/Interactivity/Interactivity.js +3 -10
- package/esm/Options/Classes/Interactivity/Modes/Modes.js +11 -8
- package/esm/Options/Classes/ManualParticle.js +6 -7
- package/esm/Options/Classes/Options.js +28 -48
- package/esm/Options/Classes/OptionsColor.js +3 -2
- package/esm/Options/Classes/Particles/Bounce/ParticlesBounce.js +1 -1
- package/esm/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +1 -1
- package/esm/Options/Classes/Particles/Collisions/Collisions.js +8 -3
- package/esm/Options/Classes/Particles/Move/Move.js +20 -50
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +1 -1
- package/esm/Options/Classes/Particles/Move/MoveAttract.js +10 -21
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +1 -1
- package/esm/Options/Classes/Particles/Move/MoveTrail.js +3 -9
- package/esm/Options/Classes/Particles/Move/MoveTrailFill.js +1 -1
- package/esm/Options/Classes/Particles/Move/OutModes.js +4 -5
- package/esm/Options/Classes/Particles/Move/Path/MovePath.js +2 -2
- package/esm/Options/Classes/Particles/Move/Spin.js +5 -3
- package/esm/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
- package/esm/Options/Classes/Particles/Number/ParticlesNumber.js +3 -10
- package/esm/Options/Classes/Particles/Opacity/Opacity.js +12 -8
- package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -10
- package/esm/Options/Classes/Particles/ParticlesOptions.js +18 -23
- package/esm/Options/Classes/Particles/Shadow.js +1 -1
- package/esm/Options/Classes/Particles/Shape/Shape.js +10 -11
- package/esm/Options/Classes/Particles/Size/Size.js +12 -8
- package/esm/Options/Classes/Particles/Size/SizeAnimation.js +1 -10
- package/esm/Options/Classes/Particles/Stroke.js +2 -2
- package/esm/Options/Classes/Particles/ZIndex/ZIndex.js +1 -1
- package/esm/Options/Classes/Responsive.js +1 -1
- package/esm/Options/Classes/Theme/Theme.js +2 -2
- package/esm/Options/Classes/ValueWithRandom.js +6 -19
- package/esm/Utils/CanvasUtils.js +19 -55
- package/esm/Utils/ColorUtils.js +18 -20
- package/esm/Utils/EventDispatcher.js +7 -6
- package/esm/Utils/HslColorManager.js +4 -6
- package/esm/Utils/NumberUtils.js +42 -46
- package/esm/Utils/OptionsUtils.js +1 -1
- package/esm/Utils/RgbColorManager.js +3 -5
- package/esm/Utils/Utils.js +135 -64
- package/esm/bundle.js +4 -97
- package/esm/export-types.js +97 -0
- package/esm/exports.js +89 -0
- package/esm/index.js +8 -199
- package/esm/init.js +12 -0
- package/esm/package.json +1 -0
- package/package.json +21 -4
- package/report.html +4 -4
- package/scripts/install.js +90 -33
- package/tsparticles.engine.js +1832 -2007
- package/tsparticles.engine.min.js +1 -1
- package/tsparticles.engine.min.js.LICENSE.txt +1 -10
- package/types/Core/Canvas.d.ts +25 -21
- package/types/Core/Container.d.ts +21 -25
- package/types/Core/Engine.d.ts +71 -0
- package/types/Core/Interfaces/Colors.d.ts +2 -2
- package/types/Core/Interfaces/IBubbleParticleData.d.ts +1 -1
- package/types/Core/Interfaces/ICircleBouncer.d.ts +2 -2
- package/types/Core/Interfaces/IColorManager.d.ts +1 -1
- package/types/Core/Interfaces/IContainerInteractivity.d.ts +1 -1
- package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -6
- package/types/Core/Interfaces/ICoordinates.d.ts +3 -3
- package/types/Core/Interfaces/IDimension.d.ts +2 -2
- package/types/Core/Interfaces/IDrawParticleParams.d.ts +6 -6
- package/types/Core/Interfaces/IExternalInteractor.d.ts +7 -7
- package/types/Core/Interfaces/IInteractor.d.ts +8 -8
- package/types/Core/Interfaces/ILoadParams.d.ts +2 -2
- package/types/Core/Interfaces/IMouseData.d.ts +1 -1
- package/types/Core/Interfaces/IMovePathGenerator.d.ts +5 -4
- package/types/Core/Interfaces/IParticle.d.ts +11 -11
- package/types/Core/Interfaces/IParticleHslAnimation.d.ts +1 -1
- package/types/Core/Interfaces/IParticleMover.d.ts +2 -2
- package/types/Core/Interfaces/IParticleRetinaProps.d.ts +1 -1
- package/types/Core/Interfaces/IParticleRoll.d.ts +1 -1
- package/types/Core/Interfaces/IParticleUpdater.d.ts +7 -9
- package/types/Core/Interfaces/IParticleValueAnimation.d.ts +3 -1
- package/types/Core/Interfaces/IParticlesInteractor.d.ts +3 -3
- package/types/Core/Interfaces/IPlugin.d.ts +7 -6
- package/types/Core/Interfaces/IPositionFromSizeParams.d.ts +2 -2
- package/types/Core/Interfaces/IShapeDrawer.d.ts +1 -1
- package/types/Core/Interfaces/IShapeValues.d.ts +2 -2
- package/types/Core/Interfaces/ITrailFillData.d.ts +1 -1
- package/types/Core/Particle.d.ts +27 -27
- package/types/Core/Particles.d.ts +24 -21
- package/types/Core/Retina.d.ts +2 -2
- package/types/Core/Utils/Circle.d.ts +2 -2
- package/types/Core/Utils/Constants.d.ts +4 -3
- package/types/Core/Utils/EventListeners.d.ts +21 -19
- package/types/Core/Utils/ExternalInteractorBase.d.ts +5 -5
- package/types/Core/Utils/InteractionManager.d.ts +5 -5
- package/types/Core/Utils/ParticlesInteractorBase.d.ts +5 -5
- package/types/Core/Utils/Point.d.ts +2 -2
- package/types/Core/Utils/QuadTree.d.ts +8 -11
- package/types/Core/Utils/Range.d.ts +1 -1
- package/types/Core/Utils/Rectangle.d.ts +3 -3
- package/types/Core/Utils/Vector.d.ts +2 -2
- package/types/Core/Utils/Vector3d.d.ts +3 -2
- package/types/Enums/Modes/{SizeMode.d.ts → PixelMode.d.ts} +1 -1
- package/types/Options/Classes/AnimatableColor.d.ts +6 -6
- package/types/Options/Classes/AnimationOptions.d.ts +7 -7
- package/types/Options/Classes/Background/Background.d.ts +4 -4
- package/types/Options/Classes/BackgroundMask/BackgroundMask.d.ts +4 -4
- package/types/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +4 -4
- package/types/Options/Classes/ColorAnimation.d.ts +5 -4
- package/types/Options/Classes/FullScreen/FullScreen.d.ts +3 -3
- package/types/Options/Classes/HslAnimation.d.ts +4 -4
- package/types/Options/Classes/Interactivity/Events/ClickEvent.d.ts +5 -5
- package/types/Options/Classes/Interactivity/Events/DivEvent.d.ts +6 -12
- package/types/Options/Classes/Interactivity/Events/Events.d.ts +8 -14
- package/types/Options/Classes/Interactivity/Events/HoverEvent.d.ts +6 -6
- package/types/Options/Classes/Interactivity/Events/Parallax.d.ts +3 -3
- package/types/Options/Classes/Interactivity/Events/ResizeEvent.d.ts +3 -3
- package/types/Options/Classes/Interactivity/Interactivity.d.ts +8 -10
- package/types/Options/Classes/Interactivity/Modes/Modes.d.ts +5 -5
- package/types/Options/Classes/ManualParticle.d.ts +5 -5
- package/types/Options/Classes/Options.d.ts +19 -26
- package/types/Options/Classes/OptionsColor.d.ts +5 -5
- package/types/Options/Classes/Particles/Bounce/ParticlesBounce.d.ts +4 -4
- package/types/Options/Classes/Particles/Bounce/ParticlesBounceFactor.d.ts +1 -1
- package/types/Options/Classes/Particles/Collisions/Collisions.d.ts +9 -7
- package/types/Options/Classes/Particles/Collisions/CollisionsAbsorb.d.ts +3 -3
- package/types/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +3 -3
- package/types/Options/Classes/Particles/Move/Move.d.ts +15 -26
- package/types/Options/Classes/Particles/Move/MoveAngle.d.ts +4 -4
- package/types/Options/Classes/Particles/Move/MoveAttract.d.ts +5 -9
- package/types/Options/Classes/Particles/Move/MoveCenter.d.ts +5 -5
- package/types/Options/Classes/Particles/Move/MoveGravity.d.ts +4 -4
- package/types/Options/Classes/Particles/Move/MoveTrail.d.ts +4 -7
- package/types/Options/Classes/Particles/Move/MoveTrailFill.d.ts +4 -4
- package/types/Options/Classes/Particles/Move/OutModes.d.ts +5 -5
- package/types/Options/Classes/Particles/Move/Path/MovePath.d.ts +5 -5
- package/types/Options/Classes/Particles/Move/Spin.d.ts +5 -5
- package/types/Options/Classes/Particles/Number/ParticlesDensity.d.ts +3 -9
- package/types/Options/Classes/Particles/Number/ParticlesNumber.d.ts +4 -6
- package/types/Options/Classes/Particles/Opacity/Opacity.d.ts +7 -7
- package/types/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +5 -7
- package/types/Options/Classes/Particles/ParticlesOptions.d.ts +19 -19
- package/types/Options/Classes/Particles/Shadow.d.ts +5 -5
- package/types/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
- package/types/Options/Classes/Particles/Size/Size.d.ts +7 -7
- package/types/Options/Classes/Particles/Size/SizeAnimation.d.ts +5 -7
- package/types/Options/Classes/Particles/Stroke.d.ts +5 -5
- package/types/Options/Classes/Particles/ZIndex/ZIndex.d.ts +4 -4
- package/types/Options/Classes/Random.d.ts +3 -3
- package/types/Options/Classes/Responsive.d.ts +7 -7
- package/types/Options/Classes/Theme/Theme.d.ts +6 -6
- package/types/Options/Classes/Theme/ThemeDefault.d.ts +4 -4
- package/types/Options/Classes/ValueWithRandom.d.ts +7 -11
- package/types/Options/Interfaces/Background/IBackground.d.ts +1 -1
- package/types/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +2 -2
- package/types/Options/Interfaces/BackgroundMask/IBackgroundMaskCover.d.ts +1 -1
- package/types/Options/Interfaces/IAnimatable.d.ts +1 -1
- package/types/Options/Interfaces/IAnimatableColor.d.ts +3 -3
- package/types/Options/Interfaces/IAnimation.d.ts +4 -4
- package/types/Options/Interfaces/IColorAnimation.d.ts +2 -2
- package/types/Options/Interfaces/IHslAnimation.d.ts +1 -1
- package/types/Options/Interfaces/IManualParticle.d.ts +3 -3
- package/types/Options/Interfaces/IOptionLoader.d.ts +1 -1
- package/types/Options/Interfaces/IOptions.d.ts +12 -15
- package/types/Options/Interfaces/IOptionsColor.d.ts +1 -1
- package/types/Options/Interfaces/IResponsive.d.ts +5 -4
- package/types/Options/Interfaces/IValueWithRandom.d.ts +3 -3
- package/types/Options/Interfaces/Interactivity/Events/IClickEvent.d.ts +2 -2
- package/types/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +3 -6
- package/types/Options/Interfaces/Interactivity/Events/IEvents.d.ts +5 -8
- package/types/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +3 -3
- package/types/Options/Interfaces/Interactivity/IInteractivity.d.ts +3 -4
- package/types/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +1 -2
- package/types/Options/Interfaces/Particles/Bounce/IParticlesBounce.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Collisions/ICollisions.d.ts +6 -4
- package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +15 -15
- package/types/Options/Interfaces/Particles/IShadow.d.ts +2 -2
- package/types/Options/Interfaces/Particles/IStroke.d.ts +5 -4
- package/types/Options/Interfaces/Particles/Move/IMove.d.ts +12 -17
- package/types/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Move/IMoveAttract.d.ts +2 -4
- package/types/Options/Interfaces/Particles/Move/IMoveCenter.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Move/IMoveTrail.d.ts +1 -3
- package/types/Options/Interfaces/Particles/Move/IMoveTrailFill.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Move/IOutModes.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Move/ISpin.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Move/Path/IMovePath.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Number/IParticlesDensity.d.ts +0 -3
- package/types/Options/Interfaces/Particles/Number/IParticlesNumber.d.ts +1 -2
- package/types/Options/Interfaces/Particles/Opacity/IOpacity.d.ts +2 -3
- package/types/Options/Interfaces/Particles/Opacity/IOpacityAnimation.d.ts +2 -3
- package/types/Options/Interfaces/Particles/Shape/IShape.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Size/ISize.d.ts +2 -3
- package/types/Options/Interfaces/Particles/Size/ISizeAnimation.d.ts +2 -3
- package/types/Options/Interfaces/Particles/ZIndex/IZIndex.d.ts +1 -1
- package/types/Options/Interfaces/Theme/ITheme.d.ts +4 -3
- package/types/Options/Interfaces/Theme/IThemeDefault.d.ts +1 -1
- package/types/Types/CustomEventArgs.d.ts +1 -1
- package/types/Types/CustomEventListener.d.ts +1 -1
- package/types/Types/ExportResult.d.ts +5 -0
- package/types/Types/ISourceOptions.d.ts +2 -2
- package/types/Types/ParticlesGroups.d.ts +1 -1
- package/types/Types/RangeValue.d.ts +1 -1
- package/types/Types/ShapeData.d.ts +2 -2
- package/types/Types/ShapeDrawerFunctions.d.ts +3 -3
- package/types/Utils/CanvasUtils.d.ts +11 -14
- package/types/Utils/ColorUtils.d.ts +6 -6
- package/types/Utils/EventDispatcher.d.ts +2 -2
- package/types/Utils/HslColorManager.d.ts +2 -2
- package/types/Utils/NumberUtils.d.ts +8 -8
- package/types/Utils/OptionsUtils.d.ts +6 -6
- package/types/Utils/RgbColorManager.d.ts +2 -2
- package/types/Utils/Utils.d.ts +32 -14
- package/types/bundle.d.ts +2 -91
- package/types/export-types.d.ts +107 -0
- package/types/exports.d.ts +89 -0
- package/types/index.d.ts +3 -204
- package/types/init.d.ts +2 -0
- package/umd/Core/Canvas.js +279 -249
- package/umd/Core/Container.js +105 -121
- package/umd/Core/Engine.js +285 -0
- package/umd/Core/Particle.js +174 -181
- package/umd/Core/Particles.js +155 -150
- package/umd/Core/Retina.js +21 -19
- package/umd/Core/Utils/Circle.js +15 -11
- package/umd/Core/Utils/Constants.js +5 -4
- package/umd/Core/Utils/EventListeners.js +268 -244
- package/umd/Core/Utils/InteractionManager.js +6 -16
- package/umd/Core/Utils/QuadTree.js +21 -27
- package/umd/Core/Utils/Rectangle.js +5 -5
- package/umd/Core/Utils/Vector.js +3 -3
- package/umd/Core/Utils/Vector3d.js +18 -10
- package/umd/Options/Classes/AnimatableColor.js +7 -6
- package/umd/Options/Classes/AnimationOptions.js +9 -8
- package/umd/Options/Classes/Background/Background.js +4 -4
- package/umd/Options/Classes/BackgroundMask/BackgroundMask.js +5 -4
- package/umd/Options/Classes/BackgroundMask/BackgroundMaskCover.js +4 -4
- package/umd/Options/Classes/ColorAnimation.js +10 -6
- package/umd/Options/Classes/HslAnimation.js +5 -5
- package/umd/Options/Classes/Interactivity/Events/DivEvent.js +1 -25
- package/umd/Options/Classes/Interactivity/Events/Events.js +16 -35
- package/umd/Options/Classes/Interactivity/Events/HoverEvent.js +3 -3
- package/umd/Options/Classes/Interactivity/Interactivity.js +6 -13
- package/umd/Options/Classes/Interactivity/Modes/Modes.js +11 -8
- package/umd/Options/Classes/ManualParticle.js +8 -9
- package/umd/Options/Classes/Options.js +42 -62
- package/umd/Options/Classes/OptionsColor.js +4 -3
- package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +4 -4
- package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +3 -3
- package/umd/Options/Classes/Particles/Collisions/Collisions.js +12 -7
- package/umd/Options/Classes/Particles/Move/Move.js +32 -62
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -4
- package/umd/Options/Classes/Particles/Move/MoveAttract.js +12 -23
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -4
- package/umd/Options/Classes/Particles/Move/MoveTrail.js +5 -11
- package/umd/Options/Classes/Particles/Move/MoveTrailFill.js +3 -3
- package/umd/Options/Classes/Particles/Move/OutModes.js +4 -5
- package/umd/Options/Classes/Particles/Move/Path/MovePath.js +5 -5
- package/umd/Options/Classes/Particles/Move/Spin.js +7 -5
- package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
- package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +5 -12
- package/umd/Options/Classes/Particles/Opacity/Opacity.js +14 -10
- package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +3 -12
- package/umd/Options/Classes/Particles/ParticlesOptions.js +33 -38
- package/umd/Options/Classes/Particles/Shadow.js +4 -4
- package/umd/Options/Classes/Particles/Shape/Shape.js +11 -12
- package/umd/Options/Classes/Particles/Size/Size.js +14 -10
- package/umd/Options/Classes/Particles/Size/SizeAnimation.js +3 -12
- package/umd/Options/Classes/Particles/Stroke.js +6 -6
- package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +3 -3
- package/umd/Options/Classes/Responsive.js +3 -3
- package/umd/Options/Classes/Theme/Theme.js +5 -5
- package/umd/Options/Classes/ValueWithRandom.js +11 -24
- package/umd/Utils/CanvasUtils.js +24 -61
- package/umd/Utils/ColorUtils.js +32 -34
- package/umd/Utils/EventDispatcher.js +7 -6
- package/umd/Utils/HslColorManager.js +12 -14
- package/umd/Utils/NumberUtils.js +45 -49
- package/umd/Utils/OptionsUtils.js +3 -3
- package/umd/Utils/RgbColorManager.js +8 -10
- package/umd/Utils/Utils.js +158 -78
- package/umd/bundle.js +5 -98
- package/umd/export-types.js +123 -0
- package/umd/exports.js +115 -0
- package/umd/index.js +9 -200
- package/umd/init.js +26 -0
- package/browser/Core/Utils/FrameManager.js +0 -42
- package/browser/Core/Utils/Plugins.js +0 -112
- package/browser/Options/Interfaces/Particles/Shape/IImageShape.js +0 -1
- package/browser/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -1
- package/browser/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -1
- package/browser/Options/Interfaces/Particles/Shape/IStarShape.js +0 -1
- package/browser/engine.js +0 -175
- package/cjs/Core/Utils/FrameManager.js +0 -46
- package/cjs/Core/Utils/Plugins.js +0 -116
- package/cjs/Enums/Modes/SizeMode.js +0 -2
- package/cjs/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -2
- package/cjs/Options/Interfaces/Particles/Shape/IImageShape.js +0 -2
- package/cjs/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -2
- package/cjs/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -17
- package/cjs/Options/Interfaces/Particles/Shape/IStarShape.js +0 -2
- package/cjs/engine.js +0 -179
- package/esm/Core/Interfaces/IParticleOverride.js +0 -1
- package/esm/Core/Interfaces/IParticlesMover.js +0 -1
- package/esm/Core/Utils/FrameManager.js +0 -42
- package/esm/Core/Utils/Plugins.js +0 -112
- package/esm/Enums/Modes/SizeMode.js +0 -1
- package/esm/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -1
- package/esm/Options/Interfaces/Particles/Shape/IImageShape.js +0 -1
- package/esm/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -1
- package/esm/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -1
- package/esm/Options/Interfaces/Particles/Shape/IStarShape.js +0 -1
- package/esm/engine.js +0 -175
- package/types/Core/Interfaces/IParticleOverride.d.ts +0 -6
- package/types/Core/Interfaces/IParticlesMover.d.ts +0 -7
- package/types/Core/Utils/FrameManager.d.ts +0 -6
- package/types/Core/Utils/Plugins.d.ts +0 -51
- package/types/Options/Interfaces/Particles/Shape/ICharacterShape.d.ts +0 -8
- package/types/Options/Interfaces/Particles/Shape/IImageShape.d.ts +0 -8
- package/types/Options/Interfaces/Particles/Shape/IPolygonShape.d.ts +0 -5
- package/types/Options/Interfaces/Particles/Shape/IShapeValues.d.ts +0 -1
- package/types/Options/Interfaces/Particles/Shape/IStarShape.d.ts +0 -6
- package/types/engine.d.ts +0 -39
- package/umd/Core/Utils/FrameManager.js +0 -56
- package/umd/Core/Utils/Plugins.js +0 -126
- package/umd/Enums/Modes/SizeMode.js +0 -12
- package/umd/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -12
- package/umd/Options/Interfaces/Particles/Shape/IImageShape.js +0 -12
- package/umd/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -12
- package/umd/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -27
- package/umd/Options/Interfaces/Particles/Shape/IStarShape.js +0 -12
- package/umd/engine.js +0 -189
- /package/browser/{Core/Interfaces/IParticleOverride.js → Enums/Modes/PixelMode.js} +0 -0
- /package/browser/{Core/Interfaces/IParticlesMover.js → Types/ExportResult.js} +0 -0
- /package/cjs/{Core/Interfaces/IParticleOverride.js → Enums/Modes/PixelMode.js} +0 -0
- /package/cjs/{Core/Interfaces/IParticlesMover.js → Types/ExportResult.js} +0 -0
- /package/{browser/Enums/Modes/SizeMode.js → esm/Enums/Modes/PixelMode.js} +0 -0
- /package/{browser/Options/Interfaces/Particles/Shape/ICharacterShape.js → esm/Types/ExportResult.js} +0 -0
- /package/umd/{Core/Interfaces/IParticleOverride.js → Enums/Modes/PixelMode.js} +0 -0
- /package/umd/{Core/Interfaces/IParticlesMover.js → Types/ExportResult.js} +0 -0
|
@@ -4,26 +4,30 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "
|
|
7
|
+
define(["require", "exports", "./SizeAnimation.js", "../../ValueWithRandom.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Size = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
class Size extends
|
|
13
|
+
const SizeAnimation_js_1 = require("./SizeAnimation.js");
|
|
14
|
+
const ValueWithRandom_js_1 = require("../../ValueWithRandom.js");
|
|
15
|
+
class Size extends ValueWithRandom_js_1.ValueWithRandom {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
|
-
this.animation = new
|
|
18
|
+
this.animation = new SizeAnimation_js_1.SizeAnimation();
|
|
19
19
|
this.random.minimumValue = 1;
|
|
20
20
|
this.value = 3;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
load(data) {
|
|
23
|
+
super.load(data);
|
|
24
|
+
if (!data) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const animation = data.animation;
|
|
28
|
+
if (animation !== undefined) {
|
|
29
|
+
this.animation.load(animation);
|
|
30
|
+
}
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
exports.Size = Size;
|
|
@@ -4,29 +4,20 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../AnimationOptions"], factory);
|
|
7
|
+
define(["require", "exports", "../../AnimationOptions.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SizeAnimation = void 0;
|
|
13
|
-
const
|
|
14
|
-
class SizeAnimation extends
|
|
13
|
+
const AnimationOptions_js_1 = require("../../AnimationOptions.js");
|
|
14
|
+
class SizeAnimation extends AnimationOptions_js_1.RangedAnimationOptions {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
this.destroy = "none";
|
|
18
18
|
this.speed = 5;
|
|
19
19
|
}
|
|
20
|
-
get size_min() {
|
|
21
|
-
return this.minimumValue;
|
|
22
|
-
}
|
|
23
|
-
set size_min(value) {
|
|
24
|
-
this.minimumValue = value;
|
|
25
|
-
}
|
|
26
20
|
load(data) {
|
|
27
|
-
if ((data === null || data === void 0 ? void 0 : data.size_min) !== undefined && data.minimumValue === undefined) {
|
|
28
|
-
data.minimumValue = data.size_min;
|
|
29
|
-
}
|
|
30
21
|
super.load(data);
|
|
31
22
|
if (!data) {
|
|
32
23
|
return;
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../AnimatableColor", "../../../Utils/NumberUtils"], factory);
|
|
7
|
+
define(["require", "exports", "../AnimatableColor.js", "../../../Utils/NumberUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Stroke = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const AnimatableColor_js_1 = require("../AnimatableColor.js");
|
|
14
|
+
const NumberUtils_js_1 = require("../../../Utils/NumberUtils.js");
|
|
15
15
|
class Stroke {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.width = 0;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
if (data.color !== undefined) {
|
|
24
|
-
this.color =
|
|
24
|
+
this.color = AnimatableColor_js_1.AnimatableColor.create(this.color, data.color);
|
|
25
25
|
}
|
|
26
26
|
if (data.width !== undefined) {
|
|
27
|
-
this.width = (0,
|
|
27
|
+
this.width = (0, NumberUtils_js_1.setRangeValue)(data.width);
|
|
28
28
|
}
|
|
29
29
|
if (data.opacity !== undefined) {
|
|
30
|
-
this.opacity = (0,
|
|
30
|
+
this.opacity = (0, NumberUtils_js_1.setRangeValue)(data.opacity);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../ValueWithRandom"], factory);
|
|
7
|
+
define(["require", "exports", "../../ValueWithRandom.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ZIndex = void 0;
|
|
13
|
-
const
|
|
14
|
-
class ZIndex extends
|
|
13
|
+
const ValueWithRandom_js_1 = require("../../ValueWithRandom.js");
|
|
14
|
+
class ZIndex extends ValueWithRandom_js_1.ValueWithRandom {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
this.opacityRate = 1;
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../Utils/Utils"], factory);
|
|
7
|
+
define(["require", "exports", "../../Utils/Utils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Responsive = void 0;
|
|
13
|
-
const
|
|
13
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
14
14
|
class Responsive {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.maxWidth = Infinity;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
if (data.options !== undefined) {
|
|
36
|
-
this.options = (0,
|
|
36
|
+
this.options = (0, Utils_js_1.deepExtend)({}, data.options);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./ThemeDefault", "../../../Utils/Utils"], factory);
|
|
7
|
+
define(["require", "exports", "./ThemeDefault.js", "../../../Utils/Utils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Theme = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const ThemeDefault_js_1 = require("./ThemeDefault.js");
|
|
14
|
+
const Utils_js_1 = require("../../../Utils/Utils.js");
|
|
15
15
|
class Theme {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.name = "";
|
|
18
|
-
this.default = new
|
|
18
|
+
this.default = new ThemeDefault_js_1.ThemeDefault();
|
|
19
19
|
}
|
|
20
20
|
load(data) {
|
|
21
21
|
if (!data) {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
this.default.load(data.default);
|
|
28
28
|
if (data.options !== undefined) {
|
|
29
|
-
this.options = (0,
|
|
29
|
+
this.options = (0, Utils_js_1.deepExtend)({}, data.options);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -4,33 +4,33 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./AnimationOptions", "./Random", "
|
|
7
|
+
define(["require", "exports", "./AnimationOptions.js", "./Random.js", "../../Utils/Utils.js", "../../Utils/NumberUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RangedAnimationValueWithRandom = exports.AnimationValueWithRandom = exports.ValueWithRandom = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
13
|
+
const AnimationOptions_js_1 = require("./AnimationOptions.js");
|
|
14
|
+
const Random_js_1 = require("./Random.js");
|
|
15
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
16
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
17
17
|
class ValueWithRandom {
|
|
18
18
|
constructor() {
|
|
19
|
-
this.random = new
|
|
19
|
+
this.random = new Random_js_1.Random();
|
|
20
20
|
this.value = 0;
|
|
21
21
|
}
|
|
22
22
|
load(data) {
|
|
23
23
|
if (!data) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
if (
|
|
26
|
+
if ((0, Utils_js_1.isBoolean)(data.random)) {
|
|
27
27
|
this.random.enable = data.random;
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
this.random.load(data.random);
|
|
31
31
|
}
|
|
32
32
|
if (data.value !== undefined) {
|
|
33
|
-
this.value = (0,
|
|
33
|
+
this.value = (0, NumberUtils_js_1.setRangeValue)(data.value, this.random.enable ? this.random.minimumValue : undefined);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -38,21 +38,14 @@
|
|
|
38
38
|
class AnimationValueWithRandom extends ValueWithRandom {
|
|
39
39
|
constructor() {
|
|
40
40
|
super();
|
|
41
|
-
this.animation = new
|
|
42
|
-
}
|
|
43
|
-
get anim() {
|
|
44
|
-
return this.animation;
|
|
45
|
-
}
|
|
46
|
-
set anim(value) {
|
|
47
|
-
this.animation = value;
|
|
41
|
+
this.animation = new AnimationOptions_js_1.AnimationOptions();
|
|
48
42
|
}
|
|
49
43
|
load(data) {
|
|
50
|
-
var _a;
|
|
51
44
|
super.load(data);
|
|
52
45
|
if (!data) {
|
|
53
46
|
return;
|
|
54
47
|
}
|
|
55
|
-
const animation =
|
|
48
|
+
const animation = data.animation;
|
|
56
49
|
if (animation !== undefined) {
|
|
57
50
|
this.animation.load(animation);
|
|
58
51
|
}
|
|
@@ -62,16 +55,10 @@
|
|
|
62
55
|
class RangedAnimationValueWithRandom extends AnimationValueWithRandom {
|
|
63
56
|
constructor() {
|
|
64
57
|
super();
|
|
65
|
-
this.animation = new
|
|
58
|
+
this.animation = new AnimationOptions_js_1.RangedAnimationOptions();
|
|
66
59
|
}
|
|
67
60
|
load(data) {
|
|
68
61
|
super.load(data);
|
|
69
|
-
if (!data) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (data.animation !== undefined) {
|
|
73
|
-
this.value = (0, NumberUtils_1.setRangeValue)(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
|
|
74
|
-
}
|
|
75
62
|
}
|
|
76
63
|
}
|
|
77
64
|
exports.RangedAnimationValueWithRandom = RangedAnimationValueWithRandom;
|
package/umd/Utils/CanvasUtils.js
CHANGED
|
@@ -4,63 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./ColorUtils"], factory);
|
|
7
|
+
define(["require", "exports", "./ColorUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.alterHsl = exports.drawParticlePlugin = exports.drawPlugin = exports.drawShapeAfterEffect = exports.drawShape = exports.drawParticle = exports.clear = exports.
|
|
13
|
-
const
|
|
14
|
-
function paintBase(context, dimension, baseColor) {
|
|
15
|
-
context.fillStyle = baseColor !== null && baseColor !== void 0 ? baseColor : "rgba(0,0,0,0)";
|
|
16
|
-
context.fillRect(0, 0, dimension.width, dimension.height);
|
|
17
|
-
}
|
|
18
|
-
function paintImage(context, dimension, image, opacity) {
|
|
19
|
-
if (!image) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
context.globalAlpha = opacity;
|
|
23
|
-
context.drawImage(image, 0, 0, dimension.width, dimension.height);
|
|
24
|
-
context.globalAlpha = 1;
|
|
25
|
-
}
|
|
26
|
-
function getContext(canvas) {
|
|
27
|
-
const context = canvas.getContext("2d");
|
|
28
|
-
if (!context) {
|
|
29
|
-
throw new Error("Error tsParticles - No canvas context found");
|
|
30
|
-
}
|
|
31
|
-
return context;
|
|
32
|
-
}
|
|
33
|
-
exports.getContext = getContext;
|
|
34
|
-
function clearCanvas(context, size, options, trailFill, coverColorStyle) {
|
|
35
|
-
if (options.backgroundMask.enable) {
|
|
36
|
-
paintCanvas(context, size, options, coverColorStyle);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const trail = options.particles.move.trail;
|
|
40
|
-
if (trail.enable && trail.length > 0 && trailFill) {
|
|
41
|
-
if (trailFill.color) {
|
|
42
|
-
paintBase(context, size, (0, ColorUtils_1.getStyleFromRgb)(trailFill.color, trailFill.opacity));
|
|
43
|
-
}
|
|
44
|
-
else if (trailFill.image) {
|
|
45
|
-
paintImage(context, size, trailFill.image, trailFill.opacity);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
clear(context, size);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.clearCanvas = clearCanvas;
|
|
54
|
-
function paintCanvas(context, size, options, coverColorStyle) {
|
|
55
|
-
if (options.backgroundMask.enable && coverColorStyle) {
|
|
56
|
-
clear(context, size);
|
|
57
|
-
paintBase(context, size, coverColorStyle);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
paintBase(context, size);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.paintCanvas = paintCanvas;
|
|
12
|
+
exports.alterHsl = exports.drawParticlePlugin = exports.drawPlugin = exports.drawShapeAfterEffect = exports.drawShape = exports.drawParticle = exports.clear = exports.paintImage = exports.paintBase = exports.drawTriangle = exports.drawLine = void 0;
|
|
13
|
+
const ColorUtils_js_1 = require("./ColorUtils.js");
|
|
64
14
|
function drawLine(context, begin, end) {
|
|
65
15
|
context.beginPath();
|
|
66
16
|
context.moveTo(begin.x, begin.y);
|
|
@@ -76,21 +26,34 @@
|
|
|
76
26
|
context.closePath();
|
|
77
27
|
}
|
|
78
28
|
exports.drawTriangle = drawTriangle;
|
|
29
|
+
function paintBase(context, dimension, baseColor) {
|
|
30
|
+
context.fillStyle = baseColor ?? "rgba(0,0,0,0)";
|
|
31
|
+
context.fillRect(0, 0, dimension.width, dimension.height);
|
|
32
|
+
}
|
|
33
|
+
exports.paintBase = paintBase;
|
|
34
|
+
function paintImage(context, dimension, image, opacity) {
|
|
35
|
+
if (!image) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
context.globalAlpha = opacity;
|
|
39
|
+
context.drawImage(image, 0, 0, dimension.width, dimension.height);
|
|
40
|
+
context.globalAlpha = 1;
|
|
41
|
+
}
|
|
42
|
+
exports.paintImage = paintImage;
|
|
79
43
|
function clear(context, dimension) {
|
|
80
44
|
context.clearRect(0, 0, dimension.width, dimension.height);
|
|
81
45
|
}
|
|
82
46
|
exports.clear = clear;
|
|
83
47
|
function drawParticle(data) {
|
|
84
|
-
var _a, _b, _c, _d, _e;
|
|
85
48
|
const { container, context, particle, delta, colorStyles, backgroundMask, composite, radius, opacity, shadow, transform, } = data;
|
|
86
49
|
const pos = particle.getPosition(), angle = particle.rotation + (particle.pathRotation ? particle.velocity.angle : 0), rotateData = {
|
|
87
50
|
sin: Math.sin(angle),
|
|
88
51
|
cos: Math.cos(angle),
|
|
89
52
|
}, transformData = {
|
|
90
|
-
a: rotateData.cos * (
|
|
91
|
-
b: rotateData.sin * (
|
|
92
|
-
c: -rotateData.sin * (
|
|
93
|
-
d: rotateData.cos * (
|
|
53
|
+
a: rotateData.cos * (transform.a ?? 1),
|
|
54
|
+
b: rotateData.sin * (transform.b ?? 1),
|
|
55
|
+
c: -rotateData.sin * (transform.c ?? 1),
|
|
56
|
+
d: rotateData.cos * (transform.d ?? 1),
|
|
94
57
|
};
|
|
95
58
|
context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, pos.x, pos.y);
|
|
96
59
|
context.beginPath();
|
|
@@ -100,14 +63,14 @@
|
|
|
100
63
|
const shadowColor = particle.shadowColor;
|
|
101
64
|
if (shadow.enable && shadowColor) {
|
|
102
65
|
context.shadowBlur = shadow.blur;
|
|
103
|
-
context.shadowColor = (0,
|
|
66
|
+
context.shadowColor = (0, ColorUtils_js_1.getStyleFromRgb)(shadowColor);
|
|
104
67
|
context.shadowOffsetX = shadow.offset.x;
|
|
105
68
|
context.shadowOffsetY = shadow.offset.y;
|
|
106
69
|
}
|
|
107
70
|
if (colorStyles.fill) {
|
|
108
71
|
context.fillStyle = colorStyles.fill;
|
|
109
72
|
}
|
|
110
|
-
const strokeWidth =
|
|
73
|
+
const strokeWidth = particle.strokeWidth ?? 0;
|
|
111
74
|
context.lineWidth = strokeWidth;
|
|
112
75
|
if (colorStyles.stroke) {
|
|
113
76
|
context.strokeStyle = colorStyles.stroke;
|
|
@@ -143,7 +106,7 @@
|
|
|
143
106
|
return;
|
|
144
107
|
}
|
|
145
108
|
const drawer = container.drawers.get(particle.shape);
|
|
146
|
-
if (!
|
|
109
|
+
if (!drawer || !drawer.afterEffect) {
|
|
147
110
|
return;
|
|
148
111
|
}
|
|
149
112
|
drawer.afterEffect(context, particle, radius, opacity, delta, container.retina.pixelRatio);
|
package/umd/Utils/ColorUtils.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./NumberUtils", "./Utils"], factory);
|
|
7
|
+
define(["require", "exports", "./NumberUtils.js", "./Utils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getHslAnimationFromHsl = exports.getHslFromAnimation = exports.getLinkRandomColor = exports.getLinkColor = exports.colorMix = exports.getStyleFromHsl = exports.getStyleFromRgb = exports.getRandomRgbColor = exports.hslaToRgba = exports.hslToRgb = exports.stringToRgb = exports.stringToAlpha = exports.rgbToHsl = exports.rangeColorToHsl = exports.colorToHsl = exports.colorToRgb = exports.rangeColorToRgb = exports.addColorManager = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const NumberUtils_js_1 = require("./NumberUtils.js");
|
|
14
|
+
const Utils_js_1 = require("./Utils.js");
|
|
15
15
|
const randomColorValue = "random", midColorValue = "mid", colorManagers = new Map();
|
|
16
16
|
function addColorManager(manager) {
|
|
17
17
|
colorManagers.set(manager.key, manager);
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
if (!input) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
const color =
|
|
61
|
-
if (
|
|
60
|
+
const color = (0, Utils_js_1.isString)(input) ? { value: input } : input;
|
|
61
|
+
if ((0, Utils_js_1.isString)(color.value)) {
|
|
62
62
|
return colorToRgb(color.value, index, useIndex);
|
|
63
63
|
}
|
|
64
|
-
if (color.value
|
|
64
|
+
if ((0, Utils_js_1.isArray)(color.value)) {
|
|
65
65
|
return rangeColorToRgb({
|
|
66
|
-
value: (0,
|
|
66
|
+
value: (0, Utils_js_1.itemFromArray)(color.value, index, useIndex),
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
for (const [, manager] of colorManagers) {
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
if (!input) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const color =
|
|
82
|
-
if (
|
|
81
|
+
const color = (0, Utils_js_1.isString)(input) ? { value: input } : input;
|
|
82
|
+
if ((0, Utils_js_1.isString)(color.value)) {
|
|
83
83
|
return color.value === randomColorValue ? getRandomRgbColor() : stringToRgb(color.value);
|
|
84
84
|
}
|
|
85
|
-
if (color.value
|
|
85
|
+
if ((0, Utils_js_1.isArray)(color.value)) {
|
|
86
86
|
return colorToRgb({
|
|
87
|
-
value: (0,
|
|
87
|
+
value: (0, Utils_js_1.itemFromArray)(color.value, index, useIndex),
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
for (const [, manager] of colorManagers) {
|
|
@@ -131,8 +131,7 @@
|
|
|
131
131
|
}
|
|
132
132
|
exports.rgbToHsl = rgbToHsl;
|
|
133
133
|
function stringToAlpha(input) {
|
|
134
|
-
|
|
135
|
-
return (_a = stringToRgba(input)) === null || _a === void 0 ? void 0 : _a.a;
|
|
134
|
+
return stringToRgba(input)?.a;
|
|
136
135
|
}
|
|
137
136
|
exports.stringToAlpha = stringToAlpha;
|
|
138
137
|
function stringToRgb(input) {
|
|
@@ -146,9 +145,7 @@
|
|
|
146
145
|
s: hsl.s / 100,
|
|
147
146
|
};
|
|
148
147
|
if (!hslPercent.s) {
|
|
149
|
-
result.b = hslPercent.l;
|
|
150
|
-
result.g = hslPercent.l;
|
|
151
|
-
result.r = hslPercent.l;
|
|
148
|
+
result.r = result.g = result.b = hslPercent.l;
|
|
152
149
|
}
|
|
153
150
|
else {
|
|
154
151
|
const q = hslPercent.l < 0.5
|
|
@@ -175,20 +172,20 @@
|
|
|
175
172
|
}
|
|
176
173
|
exports.hslaToRgba = hslaToRgba;
|
|
177
174
|
function getRandomRgbColor(min) {
|
|
178
|
-
const fixedMin = min
|
|
175
|
+
const fixedMin = min ?? 0;
|
|
179
176
|
return {
|
|
180
|
-
b: Math.floor((0,
|
|
181
|
-
g: Math.floor((0,
|
|
182
|
-
r: Math.floor((0,
|
|
177
|
+
b: Math.floor((0, NumberUtils_js_1.randomInRange)((0, NumberUtils_js_1.setRangeValue)(fixedMin, 256))),
|
|
178
|
+
g: Math.floor((0, NumberUtils_js_1.randomInRange)((0, NumberUtils_js_1.setRangeValue)(fixedMin, 256))),
|
|
179
|
+
r: Math.floor((0, NumberUtils_js_1.randomInRange)((0, NumberUtils_js_1.setRangeValue)(fixedMin, 256))),
|
|
183
180
|
};
|
|
184
181
|
}
|
|
185
182
|
exports.getRandomRgbColor = getRandomRgbColor;
|
|
186
183
|
function getStyleFromRgb(color, opacity) {
|
|
187
|
-
return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity
|
|
184
|
+
return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity ?? 1})`;
|
|
188
185
|
}
|
|
189
186
|
exports.getStyleFromRgb = getStyleFromRgb;
|
|
190
187
|
function getStyleFromHsl(color, opacity) {
|
|
191
|
-
return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity
|
|
188
|
+
return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity ?? 1})`;
|
|
192
189
|
}
|
|
193
190
|
exports.getStyleFromHsl = getStyleFromHsl;
|
|
194
191
|
function colorMix(color1, color2, size1, size2) {
|
|
@@ -200,24 +197,23 @@
|
|
|
200
197
|
rgb2 = hslToRgb(color2);
|
|
201
198
|
}
|
|
202
199
|
return {
|
|
203
|
-
b: (0,
|
|
204
|
-
g: (0,
|
|
205
|
-
r: (0,
|
|
200
|
+
b: (0, NumberUtils_js_1.mix)(rgb1.b, rgb2.b, size1, size2),
|
|
201
|
+
g: (0, NumberUtils_js_1.mix)(rgb1.g, rgb2.g, size1, size2),
|
|
202
|
+
r: (0, NumberUtils_js_1.mix)(rgb1.r, rgb2.r, size1, size2),
|
|
206
203
|
};
|
|
207
204
|
}
|
|
208
205
|
exports.colorMix = colorMix;
|
|
209
206
|
function getLinkColor(p1, p2, linkColor) {
|
|
210
|
-
var _a, _b;
|
|
211
207
|
if (linkColor === randomColorValue) {
|
|
212
208
|
return getRandomRgbColor();
|
|
213
209
|
}
|
|
214
210
|
else if (linkColor === midColorValue) {
|
|
215
|
-
const sourceColor =
|
|
211
|
+
const sourceColor = p1.getFillColor() ?? p1.getStrokeColor(), destColor = p2?.getFillColor() ?? p2?.getStrokeColor();
|
|
216
212
|
if (sourceColor && destColor && p2) {
|
|
217
213
|
return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
|
|
218
214
|
}
|
|
219
215
|
else {
|
|
220
|
-
const hslColor = sourceColor
|
|
216
|
+
const hslColor = sourceColor ?? destColor;
|
|
221
217
|
if (hslColor) {
|
|
222
218
|
return hslToRgb(hslColor);
|
|
223
219
|
}
|
|
@@ -229,7 +225,7 @@
|
|
|
229
225
|
}
|
|
230
226
|
exports.getLinkColor = getLinkColor;
|
|
231
227
|
function getLinkRandomColor(optColor, blink, consent) {
|
|
232
|
-
const color =
|
|
228
|
+
const color = (0, Utils_js_1.isString)(optColor) ? optColor : optColor.value;
|
|
233
229
|
if (color === randomColorValue) {
|
|
234
230
|
if (consent) {
|
|
235
231
|
return rangeColorToRgb({
|
|
@@ -287,14 +283,16 @@
|
|
|
287
283
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
288
284
|
colorValue.enable = colorAnimation.enable;
|
|
289
285
|
if (colorValue.enable) {
|
|
290
|
-
colorValue.velocity = ((0,
|
|
291
|
-
colorValue.decay = 1 - (0,
|
|
286
|
+
colorValue.velocity = ((0, NumberUtils_js_1.getRangeValue)(colorAnimation.speed) / 100) * reduceFactor;
|
|
287
|
+
colorValue.decay = 1 - (0, NumberUtils_js_1.getRangeValue)(colorAnimation.decay);
|
|
292
288
|
colorValue.status = "increasing";
|
|
293
289
|
colorValue.loops = 0;
|
|
294
|
-
colorValue.maxLoops = (0,
|
|
290
|
+
colorValue.maxLoops = (0, NumberUtils_js_1.getRangeValue)(colorAnimation.count);
|
|
291
|
+
colorValue.time = 0;
|
|
292
|
+
colorValue.delayTime = (0, NumberUtils_js_1.getRangeValue)(colorAnimation.delay) * 1000;
|
|
295
293
|
if (!colorAnimation.sync) {
|
|
296
|
-
colorValue.velocity *= (0,
|
|
297
|
-
colorValue.value *= (0,
|
|
294
|
+
colorValue.velocity *= (0, NumberUtils_js_1.getRandom)();
|
|
295
|
+
colorValue.value *= (0, NumberUtils_js_1.getRandom)();
|
|
298
296
|
}
|
|
299
297
|
colorValue.initialValue = colorValue.value;
|
|
300
298
|
}
|
|
@@ -15,16 +15,17 @@
|
|
|
15
15
|
this._listeners = new Map();
|
|
16
16
|
}
|
|
17
17
|
addEventListener(type, listener) {
|
|
18
|
-
var _a;
|
|
19
18
|
this.removeEventListener(type, listener);
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
let arr = this._listeners.get(type);
|
|
20
|
+
if (!arr) {
|
|
21
|
+
arr = [];
|
|
22
|
+
this._listeners.set(type, arr);
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
arr.push(listener);
|
|
24
25
|
}
|
|
25
26
|
dispatchEvent(type, args) {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
const listeners = this._listeners.get(type);
|
|
28
|
+
listeners && listeners.forEach((handler) => handler(args));
|
|
28
29
|
}
|
|
29
30
|
hasEventListener(type) {
|
|
30
31
|
return !!this._listeners.get(type);
|
|
@@ -4,34 +4,32 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./NumberUtils", "./ColorUtils"], factory);
|
|
7
|
+
define(["require", "exports", "./NumberUtils.js", "./ColorUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.HslColorManager = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const NumberUtils_js_1 = require("./NumberUtils.js");
|
|
14
|
+
const ColorUtils_js_1 = require("./ColorUtils.js");
|
|
15
15
|
class HslColorManager {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.key = "hsl";
|
|
18
18
|
this.stringPrefix = "hsl";
|
|
19
19
|
}
|
|
20
20
|
handleColor(color) {
|
|
21
|
-
|
|
22
|
-
const colorValue = color.value, hslColor = (_a = colorValue.hsl) !== null && _a !== void 0 ? _a : color.value;
|
|
21
|
+
const colorValue = color.value, hslColor = colorValue.hsl ?? color.value;
|
|
23
22
|
if (hslColor.h !== undefined && hslColor.s !== undefined && hslColor.l !== undefined) {
|
|
24
|
-
return (0,
|
|
23
|
+
return (0, ColorUtils_js_1.hslToRgb)(hslColor);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
handleRangeColor(color) {
|
|
28
|
-
|
|
29
|
-
const colorValue = color.value, hslColor = (_a = colorValue.hsl) !== null && _a !== void 0 ? _a : color.value;
|
|
27
|
+
const colorValue = color.value, hslColor = colorValue.hsl ?? color.value;
|
|
30
28
|
if (hslColor.h !== undefined && hslColor.l !== undefined) {
|
|
31
|
-
return (0,
|
|
32
|
-
h: (0,
|
|
33
|
-
l: (0,
|
|
34
|
-
s: (0,
|
|
29
|
+
return (0, ColorUtils_js_1.hslToRgb)({
|
|
30
|
+
h: (0, NumberUtils_js_1.getRangeValue)(hslColor.h),
|
|
31
|
+
l: (0, NumberUtils_js_1.getRangeValue)(hslColor.l),
|
|
32
|
+
s: (0, NumberUtils_js_1.getRangeValue)(hslColor.s),
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
35
|
}
|
|
@@ -41,8 +39,8 @@
|
|
|
41
39
|
}
|
|
42
40
|
const regex = /hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i, result = regex.exec(input);
|
|
43
41
|
return result
|
|
44
|
-
? (0,
|
|
45
|
-
a: result.length > 4 ? (0,
|
|
42
|
+
? (0, ColorUtils_js_1.hslaToRgba)({
|
|
43
|
+
a: result.length > 4 ? (0, NumberUtils_js_1.parseAlpha)(result[5]) : 1,
|
|
46
44
|
h: parseInt(result[1], 10),
|
|
47
45
|
l: parseInt(result[3], 10),
|
|
48
46
|
s: parseInt(result[2], 10),
|