@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,32 +4,25 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./Events/Events", "./Modes/Modes"], factory);
|
|
7
|
+
define(["require", "exports", "./Events/Events.js", "./Modes/Modes.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Interactivity = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const Events_js_1 = require("./Events/Events.js");
|
|
14
|
+
const Modes_js_1 = require("./Modes/Modes.js");
|
|
15
15
|
class Interactivity {
|
|
16
16
|
constructor(engine, container) {
|
|
17
17
|
this.detectsOn = "window";
|
|
18
|
-
this.events = new
|
|
19
|
-
this.modes = new
|
|
20
|
-
}
|
|
21
|
-
get detect_on() {
|
|
22
|
-
return this.detectsOn;
|
|
23
|
-
}
|
|
24
|
-
set detect_on(value) {
|
|
25
|
-
this.detectsOn = value;
|
|
18
|
+
this.events = new Events_js_1.Events();
|
|
19
|
+
this.modes = new Modes_js_1.Modes(engine, container);
|
|
26
20
|
}
|
|
27
21
|
load(data) {
|
|
28
|
-
var _a;
|
|
29
22
|
if (!data) {
|
|
30
23
|
return;
|
|
31
24
|
}
|
|
32
|
-
const detectsOn =
|
|
25
|
+
const detectsOn = data.detectsOn;
|
|
33
26
|
if (detectsOn !== undefined) {
|
|
34
27
|
this.detectsOn = detectsOn;
|
|
35
28
|
}
|
|
@@ -19,15 +19,18 @@
|
|
|
19
19
|
if (!data) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
if (this._container) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
if (!this._container) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const interactors = this._engine.interactors.get(this._container);
|
|
26
|
+
if (!interactors) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
for (const interactor of interactors) {
|
|
30
|
+
if (!interactor.loadModeOptions) {
|
|
31
|
+
continue;
|
|
30
32
|
}
|
|
33
|
+
interactor.loadModeOptions(this, data);
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
}
|
|
@@ -4,28 +4,27 @@
|
|
|
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.ManualParticle = void 0;
|
|
13
|
-
const
|
|
13
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
14
14
|
class ManualParticle {
|
|
15
15
|
load(data) {
|
|
16
|
-
var _a, _b, _c;
|
|
17
16
|
if (!data) {
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
|
-
if (data.position
|
|
19
|
+
if (data.position) {
|
|
21
20
|
this.position = {
|
|
22
|
-
x:
|
|
23
|
-
y:
|
|
24
|
-
mode:
|
|
21
|
+
x: data.position.x ?? 50,
|
|
22
|
+
y: data.position.y ?? 50,
|
|
23
|
+
mode: data.position.mode ?? "percent",
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
|
-
if (data.options
|
|
28
|
-
this.options = (0,
|
|
26
|
+
if (data.options) {
|
|
27
|
+
this.options = (0, Utils_js_1.deepExtend)({}, data.options);
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -4,39 +4,45 @@
|
|
|
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", "./Background/Background", "./BackgroundMask/BackgroundMask", "./FullScreen/FullScreen", "./Interactivity/Interactivity", "./ManualParticle", "./Responsive", "./Theme/Theme", "../../Utils/OptionsUtils", "../../Utils/NumberUtils"], factory);
|
|
7
|
+
define(["require", "exports", "../../Utils/Utils.js", "./Background/Background.js", "./BackgroundMask/BackgroundMask.js", "./FullScreen/FullScreen.js", "./Interactivity/Interactivity.js", "./ManualParticle.js", "./Responsive.js", "./Theme/Theme.js", "../../Utils/OptionsUtils.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.Options = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
13
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
14
|
+
const Background_js_1 = require("./Background/Background.js");
|
|
15
|
+
const BackgroundMask_js_1 = require("./BackgroundMask/BackgroundMask.js");
|
|
16
|
+
const FullScreen_js_1 = require("./FullScreen/FullScreen.js");
|
|
17
|
+
const Interactivity_js_1 = require("./Interactivity/Interactivity.js");
|
|
18
|
+
const ManualParticle_js_1 = require("./ManualParticle.js");
|
|
19
|
+
const Responsive_js_1 = require("./Responsive.js");
|
|
20
|
+
const Theme_js_1 = require("./Theme/Theme.js");
|
|
21
|
+
const OptionsUtils_js_1 = require("../../Utils/OptionsUtils.js");
|
|
22
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
23
23
|
class Options {
|
|
24
24
|
constructor(engine, container) {
|
|
25
|
+
this._findDefaultTheme = (mode) => {
|
|
26
|
+
return (this.themes.find((theme) => theme.default.value && theme.default.mode === mode) ??
|
|
27
|
+
this.themes.find((theme) => theme.default.value && theme.default.mode === "any"));
|
|
28
|
+
};
|
|
29
|
+
this._importPreset = (preset) => {
|
|
30
|
+
this.load(this._engine.getPreset(preset));
|
|
31
|
+
};
|
|
25
32
|
this._engine = engine;
|
|
26
33
|
this._container = container;
|
|
27
34
|
this.autoPlay = true;
|
|
28
|
-
this.background = new
|
|
29
|
-
this.backgroundMask = new
|
|
35
|
+
this.background = new Background_js_1.Background();
|
|
36
|
+
this.backgroundMask = new BackgroundMask_js_1.BackgroundMask();
|
|
30
37
|
this.defaultThemes = {};
|
|
31
38
|
this.delay = 0;
|
|
32
|
-
this.fullScreen = new
|
|
39
|
+
this.fullScreen = new FullScreen_js_1.FullScreen();
|
|
33
40
|
this.detectRetina = true;
|
|
34
41
|
this.duration = 0;
|
|
35
42
|
this.fpsLimit = 120;
|
|
36
|
-
this.interactivity = new
|
|
43
|
+
this.interactivity = new Interactivity_js_1.Interactivity(engine, container);
|
|
37
44
|
this.manualParticles = [];
|
|
38
|
-
this.
|
|
39
|
-
this.particles = (0, OptionsUtils_1.loadParticlesOptions)(this._engine, this._container);
|
|
45
|
+
this.particles = (0, OptionsUtils_js_1.loadParticlesOptions)(this._engine, this._container);
|
|
40
46
|
this.pauseOnBlur = true;
|
|
41
47
|
this.pauseOnOutsideViewport = true;
|
|
42
48
|
this.responsive = [];
|
|
@@ -45,46 +51,27 @@
|
|
|
45
51
|
this.themes = [];
|
|
46
52
|
this.zLayers = 100;
|
|
47
53
|
}
|
|
48
|
-
get backgroundMode() {
|
|
49
|
-
return this.fullScreen;
|
|
50
|
-
}
|
|
51
|
-
set backgroundMode(value) {
|
|
52
|
-
this.fullScreen.load(value);
|
|
53
|
-
}
|
|
54
|
-
get fps_limit() {
|
|
55
|
-
return this.fpsLimit;
|
|
56
|
-
}
|
|
57
|
-
set fps_limit(value) {
|
|
58
|
-
this.fpsLimit = value;
|
|
59
|
-
}
|
|
60
|
-
get retina_detect() {
|
|
61
|
-
return this.detectRetina;
|
|
62
|
-
}
|
|
63
|
-
set retina_detect(value) {
|
|
64
|
-
this.detectRetina = value;
|
|
65
|
-
}
|
|
66
54
|
load(data) {
|
|
67
|
-
var _a, _b, _c, _d, _e;
|
|
68
55
|
if (!data) {
|
|
69
56
|
return;
|
|
70
57
|
}
|
|
71
58
|
if (data.preset !== undefined) {
|
|
72
|
-
(0,
|
|
59
|
+
(0, Utils_js_1.executeOnSingleOrMultiple)(data.preset, (preset) => this._importPreset(preset));
|
|
73
60
|
}
|
|
74
61
|
if (data.autoPlay !== undefined) {
|
|
75
62
|
this.autoPlay = data.autoPlay;
|
|
76
63
|
}
|
|
77
64
|
if (data.delay !== undefined) {
|
|
78
|
-
this.delay = (0,
|
|
65
|
+
this.delay = (0, NumberUtils_js_1.setRangeValue)(data.delay);
|
|
79
66
|
}
|
|
80
|
-
const detectRetina =
|
|
67
|
+
const detectRetina = data.detectRetina;
|
|
81
68
|
if (detectRetina !== undefined) {
|
|
82
69
|
this.detectRetina = detectRetina;
|
|
83
70
|
}
|
|
84
71
|
if (data.duration !== undefined) {
|
|
85
|
-
this.duration = (0,
|
|
72
|
+
this.duration = (0, NumberUtils_js_1.setRangeValue)(data.duration);
|
|
86
73
|
}
|
|
87
|
-
const fpsLimit =
|
|
74
|
+
const fpsLimit = data.fpsLimit;
|
|
88
75
|
if (fpsLimit !== undefined) {
|
|
89
76
|
this.fpsLimit = fpsLimit;
|
|
90
77
|
}
|
|
@@ -98,8 +85,8 @@
|
|
|
98
85
|
this.zLayers = data.zLayers;
|
|
99
86
|
}
|
|
100
87
|
this.background.load(data.background);
|
|
101
|
-
const fullScreen =
|
|
102
|
-
if (
|
|
88
|
+
const fullScreen = data.fullScreen;
|
|
89
|
+
if ((0, Utils_js_1.isBoolean)(fullScreen)) {
|
|
103
90
|
this.fullScreen.enable = fullScreen;
|
|
104
91
|
}
|
|
105
92
|
else {
|
|
@@ -107,20 +94,20 @@
|
|
|
107
94
|
}
|
|
108
95
|
this.backgroundMask.load(data.backgroundMask);
|
|
109
96
|
this.interactivity.load(data.interactivity);
|
|
110
|
-
if (data.manualParticles
|
|
97
|
+
if (data.manualParticles) {
|
|
111
98
|
this.manualParticles = data.manualParticles.map((t) => {
|
|
112
|
-
const tmp = new
|
|
99
|
+
const tmp = new ManualParticle_js_1.ManualParticle();
|
|
113
100
|
tmp.load(t);
|
|
114
101
|
return tmp;
|
|
115
102
|
});
|
|
116
103
|
}
|
|
117
104
|
this.particles.load(data.particles);
|
|
118
|
-
this.style = (0,
|
|
119
|
-
this._engine.
|
|
105
|
+
this.style = (0, Utils_js_1.deepExtend)(this.style, data.style);
|
|
106
|
+
this._engine.loadOptions(this, data);
|
|
120
107
|
if (data.smooth !== undefined) {
|
|
121
108
|
this.smooth = data.smooth;
|
|
122
109
|
}
|
|
123
|
-
const interactors = this._engine.
|
|
110
|
+
const interactors = this._engine.interactors.get(this._container);
|
|
124
111
|
if (interactors) {
|
|
125
112
|
for (const interactor of interactors) {
|
|
126
113
|
if (interactor.loadOptions) {
|
|
@@ -130,7 +117,7 @@
|
|
|
130
117
|
}
|
|
131
118
|
if (data.responsive !== undefined) {
|
|
132
119
|
for (const responsive of data.responsive) {
|
|
133
|
-
const optResponsive = new
|
|
120
|
+
const optResponsive = new Responsive_js_1.Responsive();
|
|
134
121
|
optResponsive.load(responsive);
|
|
135
122
|
this.responsive.push(optResponsive);
|
|
136
123
|
}
|
|
@@ -140,7 +127,7 @@
|
|
|
140
127
|
for (const theme of data.themes) {
|
|
141
128
|
const existingTheme = this.themes.find((t) => t.name === theme.name);
|
|
142
129
|
if (!existingTheme) {
|
|
143
|
-
const optTheme = new
|
|
130
|
+
const optTheme = new Theme_js_1.Theme();
|
|
144
131
|
optTheme.load(theme);
|
|
145
132
|
this.themes.push(optTheme);
|
|
146
133
|
}
|
|
@@ -149,14 +136,14 @@
|
|
|
149
136
|
}
|
|
150
137
|
}
|
|
151
138
|
}
|
|
152
|
-
this.defaultThemes.dark =
|
|
153
|
-
this.defaultThemes.light =
|
|
139
|
+
this.defaultThemes.dark = this._findDefaultTheme("dark")?.name;
|
|
140
|
+
this.defaultThemes.light = this._findDefaultTheme("light")?.name;
|
|
154
141
|
}
|
|
155
142
|
setResponsive(width, pxRatio, defaultOptions) {
|
|
156
143
|
this.load(defaultOptions);
|
|
157
144
|
const responsiveOptions = this.responsive.find((t) => t.mode === "screen" && screen ? t.maxWidth > screen.availWidth : t.maxWidth * pxRatio > width);
|
|
158
|
-
this.load(responsiveOptions
|
|
159
|
-
return responsiveOptions
|
|
145
|
+
this.load(responsiveOptions?.options);
|
|
146
|
+
return responsiveOptions?.maxWidth;
|
|
160
147
|
}
|
|
161
148
|
setTheme(name) {
|
|
162
149
|
if (name) {
|
|
@@ -166,19 +153,12 @@
|
|
|
166
153
|
}
|
|
167
154
|
}
|
|
168
155
|
else {
|
|
169
|
-
const mediaMatch = (0,
|
|
156
|
+
const mediaMatch = (0, Utils_js_1.safeMatchMedia)("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = this._findDefaultTheme(clientDarkMode ? "dark" : "light");
|
|
170
157
|
if (defaultTheme) {
|
|
171
158
|
this.load(defaultTheme.options);
|
|
172
159
|
}
|
|
173
160
|
}
|
|
174
161
|
}
|
|
175
|
-
_findDefaultTheme(mode) {
|
|
176
|
-
var _a;
|
|
177
|
-
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"));
|
|
178
|
-
}
|
|
179
|
-
_importPreset(preset) {
|
|
180
|
-
this.load(this._engine.plugins.getPreset(preset));
|
|
181
|
-
}
|
|
182
162
|
}
|
|
183
163
|
exports.Options = Options;
|
|
184
164
|
});
|
|
@@ -4,12 +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"], 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.OptionsColor = void 0;
|
|
13
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
13
14
|
class OptionsColor {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.value = "";
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
const color = new OptionsColor();
|
|
19
20
|
color.load(source);
|
|
20
21
|
if (data !== undefined) {
|
|
21
|
-
if (
|
|
22
|
+
if ((0, Utils_js_1.isString)(data) || (0, Utils_js_1.isArray)(data)) {
|
|
22
23
|
color.load({ value: data });
|
|
23
24
|
}
|
|
24
25
|
else {
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
return color;
|
|
29
30
|
}
|
|
30
31
|
load(data) {
|
|
31
|
-
if (
|
|
32
|
+
if (data?.value === undefined) {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
35
|
this.value = data.value;
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./ParticlesBounceFactor"], factory);
|
|
7
|
+
define(["require", "exports", "./ParticlesBounceFactor.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ParticlesBounce = void 0;
|
|
13
|
-
const
|
|
13
|
+
const ParticlesBounceFactor_js_1 = require("./ParticlesBounceFactor.js");
|
|
14
14
|
class ParticlesBounce {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.horizontal = new
|
|
17
|
-
this.vertical = new
|
|
16
|
+
this.horizontal = new ParticlesBounceFactor_js_1.ParticlesBounceFactor();
|
|
17
|
+
this.vertical = new ParticlesBounceFactor_js_1.ParticlesBounceFactor();
|
|
18
18
|
}
|
|
19
19
|
load(data) {
|
|
20
20
|
if (!data) {
|
|
@@ -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.ParticlesBounceFactor = void 0;
|
|
13
|
-
const
|
|
14
|
-
class ParticlesBounceFactor extends
|
|
13
|
+
const ValueWithRandom_js_1 = require("../../ValueWithRandom.js");
|
|
14
|
+
class ParticlesBounceFactor extends ValueWithRandom_js_1.ValueWithRandom {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
this.random.minimumValue = 0.1;
|
|
@@ -4,22 +4,24 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./CollisionsAbsorb", "./CollisionsOverlap", "../Bounce/ParticlesBounce"], factory);
|
|
7
|
+
define(["require", "exports", "./CollisionsAbsorb.js", "./CollisionsOverlap.js", "../Bounce/ParticlesBounce.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.Collisions = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
13
|
+
const CollisionsAbsorb_js_1 = require("./CollisionsAbsorb.js");
|
|
14
|
+
const CollisionsOverlap_js_1 = require("./CollisionsOverlap.js");
|
|
15
|
+
const ParticlesBounce_js_1 = require("../Bounce/ParticlesBounce.js");
|
|
16
|
+
const NumberUtils_js_1 = require("../../../../Utils/NumberUtils.js");
|
|
16
17
|
class Collisions {
|
|
17
18
|
constructor() {
|
|
18
|
-
this.absorb = new
|
|
19
|
-
this.bounce = new
|
|
19
|
+
this.absorb = new CollisionsAbsorb_js_1.CollisionsAbsorb();
|
|
20
|
+
this.bounce = new ParticlesBounce_js_1.ParticlesBounce();
|
|
20
21
|
this.enable = false;
|
|
22
|
+
this.maxSpeed = 50;
|
|
21
23
|
this.mode = "bounce";
|
|
22
|
-
this.overlap = new
|
|
24
|
+
this.overlap = new CollisionsOverlap_js_1.CollisionsOverlap();
|
|
23
25
|
}
|
|
24
26
|
load(data) {
|
|
25
27
|
if (!data) {
|
|
@@ -30,6 +32,9 @@
|
|
|
30
32
|
if (data.enable !== undefined) {
|
|
31
33
|
this.enable = data.enable;
|
|
32
34
|
}
|
|
35
|
+
if (data.maxSpeed !== undefined) {
|
|
36
|
+
this.maxSpeed = (0, NumberUtils_js_1.setRangeValue)(data.maxSpeed);
|
|
37
|
+
}
|
|
33
38
|
if (data.mode !== undefined) {
|
|
34
39
|
this.mode = data.mode;
|
|
35
40
|
}
|
|
@@ -4,105 +4,75 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./MoveAngle", "./MoveAttract", "./MoveCenter", "./MoveGravity", "./Path/MovePath", "./MoveTrail", "./OutModes", "./Spin", "../../../../Utils/NumberUtils"], factory);
|
|
7
|
+
define(["require", "exports", "../../../../Utils/Utils.js", "./MoveAngle.js", "./MoveAttract.js", "./MoveCenter.js", "./MoveGravity.js", "./Path/MovePath.js", "./MoveTrail.js", "./OutModes.js", "./Spin.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.Move = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
13
|
+
const Utils_js_1 = require("../../../../Utils/Utils.js");
|
|
14
|
+
const MoveAngle_js_1 = require("./MoveAngle.js");
|
|
15
|
+
const MoveAttract_js_1 = require("./MoveAttract.js");
|
|
16
|
+
const MoveCenter_js_1 = require("./MoveCenter.js");
|
|
17
|
+
const MoveGravity_js_1 = require("./MoveGravity.js");
|
|
18
|
+
const MovePath_js_1 = require("./Path/MovePath.js");
|
|
19
|
+
const MoveTrail_js_1 = require("./MoveTrail.js");
|
|
20
|
+
const OutModes_js_1 = require("./OutModes.js");
|
|
21
|
+
const Spin_js_1 = require("./Spin.js");
|
|
22
|
+
const NumberUtils_js_1 = require("../../../../Utils/NumberUtils.js");
|
|
22
23
|
class Move {
|
|
23
24
|
constructor() {
|
|
24
|
-
this.angle = new
|
|
25
|
-
this.attract = new
|
|
26
|
-
this.center = new
|
|
25
|
+
this.angle = new MoveAngle_js_1.MoveAngle();
|
|
26
|
+
this.attract = new MoveAttract_js_1.MoveAttract();
|
|
27
|
+
this.center = new MoveCenter_js_1.MoveCenter();
|
|
27
28
|
this.decay = 0;
|
|
28
29
|
this.distance = {};
|
|
29
30
|
this.direction = "none";
|
|
30
31
|
this.drift = 0;
|
|
31
32
|
this.enable = false;
|
|
32
|
-
this.gravity = new
|
|
33
|
-
this.path = new
|
|
34
|
-
this.outModes = new
|
|
33
|
+
this.gravity = new MoveGravity_js_1.MoveGravity();
|
|
34
|
+
this.path = new MovePath_js_1.MovePath();
|
|
35
|
+
this.outModes = new OutModes_js_1.OutModes();
|
|
35
36
|
this.random = false;
|
|
36
37
|
this.size = false;
|
|
37
38
|
this.speed = 2;
|
|
38
|
-
this.spin = new
|
|
39
|
+
this.spin = new Spin_js_1.Spin();
|
|
39
40
|
this.straight = false;
|
|
40
|
-
this.trail = new
|
|
41
|
+
this.trail = new MoveTrail_js_1.MoveTrail();
|
|
41
42
|
this.vibrate = false;
|
|
42
43
|
this.warp = false;
|
|
43
44
|
}
|
|
44
|
-
get bounce() {
|
|
45
|
-
return this.collisions;
|
|
46
|
-
}
|
|
47
|
-
set bounce(value) {
|
|
48
|
-
this.collisions = value;
|
|
49
|
-
}
|
|
50
|
-
get collisions() {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
set collisions(_) {
|
|
54
|
-
}
|
|
55
|
-
get noise() {
|
|
56
|
-
return this.path;
|
|
57
|
-
}
|
|
58
|
-
set noise(value) {
|
|
59
|
-
this.path = value;
|
|
60
|
-
}
|
|
61
|
-
get outMode() {
|
|
62
|
-
return this.outModes.default;
|
|
63
|
-
}
|
|
64
|
-
set outMode(value) {
|
|
65
|
-
this.outModes.default = value;
|
|
66
|
-
}
|
|
67
|
-
get out_mode() {
|
|
68
|
-
return this.outMode;
|
|
69
|
-
}
|
|
70
|
-
set out_mode(value) {
|
|
71
|
-
this.outMode = value;
|
|
72
|
-
}
|
|
73
45
|
load(data) {
|
|
74
|
-
var _a, _b, _c;
|
|
75
46
|
if (!data) {
|
|
76
47
|
return;
|
|
77
48
|
}
|
|
78
|
-
this.angle.load(
|
|
49
|
+
this.angle.load((0, Utils_js_1.isNumber)(data.angle) ? { value: data.angle } : data.angle);
|
|
79
50
|
this.attract.load(data.attract);
|
|
80
51
|
this.center.load(data.center);
|
|
81
52
|
if (data.decay !== undefined) {
|
|
82
|
-
this.decay = (0,
|
|
53
|
+
this.decay = (0, NumberUtils_js_1.setRangeValue)(data.decay);
|
|
83
54
|
}
|
|
84
55
|
if (data.direction !== undefined) {
|
|
85
56
|
this.direction = data.direction;
|
|
86
57
|
}
|
|
87
58
|
if (data.distance !== undefined) {
|
|
88
|
-
this.distance =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
: Object.assign({}, data.distance);
|
|
59
|
+
this.distance = (0, Utils_js_1.isNumber)(data.distance)
|
|
60
|
+
? {
|
|
61
|
+
horizontal: data.distance,
|
|
62
|
+
vertical: data.distance,
|
|
63
|
+
}
|
|
64
|
+
: { ...data.distance };
|
|
95
65
|
}
|
|
96
66
|
if (data.drift !== undefined) {
|
|
97
|
-
this.drift = (0,
|
|
67
|
+
this.drift = (0, NumberUtils_js_1.setRangeValue)(data.drift);
|
|
98
68
|
}
|
|
99
69
|
if (data.enable !== undefined) {
|
|
100
70
|
this.enable = data.enable;
|
|
101
71
|
}
|
|
102
72
|
this.gravity.load(data.gravity);
|
|
103
|
-
const outModes =
|
|
73
|
+
const outModes = data.outModes;
|
|
104
74
|
if (outModes !== undefined) {
|
|
105
|
-
if (
|
|
75
|
+
if ((0, Utils_js_1.isObject)(outModes)) {
|
|
106
76
|
this.outModes.load(outModes);
|
|
107
77
|
}
|
|
108
78
|
else {
|
|
@@ -111,7 +81,7 @@
|
|
|
111
81
|
});
|
|
112
82
|
}
|
|
113
83
|
}
|
|
114
|
-
this.path.load(
|
|
84
|
+
this.path.load(data.path);
|
|
115
85
|
if (data.random !== undefined) {
|
|
116
86
|
this.random = data.random;
|
|
117
87
|
}
|
|
@@ -119,7 +89,7 @@
|
|
|
119
89
|
this.size = data.size;
|
|
120
90
|
}
|
|
121
91
|
if (data.speed !== undefined) {
|
|
122
|
-
this.speed = (0,
|
|
92
|
+
this.speed = (0, NumberUtils_js_1.setRangeValue)(data.speed);
|
|
123
93
|
}
|
|
124
94
|
this.spin.load(data.spin);
|
|
125
95
|
if (data.straight !== undefined) {
|
|
@@ -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/NumberUtils"], factory);
|
|
7
|
+
define(["require", "exports", "../../../../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.MoveAngle = void 0;
|
|
13
|
-
const
|
|
13
|
+
const NumberUtils_js_1 = require("../../../../Utils/NumberUtils.js");
|
|
14
14
|
class MoveAngle {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.offset = 0;
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
if (data.offset !== undefined) {
|
|
24
|
-
this.offset = (0,
|
|
24
|
+
this.offset = (0, NumberUtils_js_1.setRangeValue)(data.offset);
|
|
25
25
|
}
|
|
26
26
|
if (data.value !== undefined) {
|
|
27
|
-
this.value = (0,
|
|
27
|
+
this.value = (0, NumberUtils_js_1.setRangeValue)(data.value);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|