@tsparticles/engine 3.0.0-beta.0 → 3.0.0-beta.2
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 +8 -8
- package/browser/Core/Canvas.js +4 -4
- package/browser/Core/Container.js +9 -9
- package/browser/Core/Engine.js +6 -6
- package/browser/Core/Particle.js +9 -9
- package/browser/Core/Particles.js +10 -9
- package/browser/Core/Retina.js +2 -2
- package/browser/Core/Utils/Circle.js +3 -3
- package/browser/Core/Utils/EventListeners.js +2 -2
- package/browser/Core/Utils/QuadTree.js +3 -3
- package/browser/Core/Utils/Rectangle.js +2 -2
- package/browser/Core/Utils/Vector.js +1 -1
- package/browser/Core/Utils/Vector3d.js +2 -2
- package/browser/Options/Classes/AnimatableColor.js +3 -3
- package/browser/Options/Classes/AnimationOptions.js +1 -1
- package/browser/Options/Classes/Background/Background.js +1 -1
- package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +2 -2
- package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.js +1 -1
- package/browser/Options/Classes/ColorAnimation.js +1 -1
- package/browser/Options/Classes/HslAnimation.js +1 -1
- package/browser/Options/Classes/Interactivity/Events/Events.js +5 -5
- package/browser/Options/Classes/Interactivity/Events/HoverEvent.js +1 -1
- package/browser/Options/Classes/Interactivity/Interactivity.js +2 -2
- package/browser/Options/Classes/ManualParticle.js +1 -1
- package/browser/Options/Classes/Options.js +10 -10
- package/browser/Options/Classes/OptionsColor.js +1 -1
- 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 +4 -4
- package/browser/Options/Classes/Particles/Move/Move.js +10 -10
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +1 -1
- package/browser/Options/Classes/Particles/Move/MoveAttract.js +1 -1
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +1 -1
- package/browser/Options/Classes/Particles/Move/MoveTrail.js +1 -1
- package/browser/Options/Classes/Particles/Move/MoveTrailFill.js +1 -1
- package/browser/Options/Classes/Particles/Move/Path/MovePath.js +2 -2
- package/browser/Options/Classes/Particles/Move/Spin.js +2 -2
- package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +1 -1
- package/browser/Options/Classes/Particles/Opacity/Opacity.js +2 -2
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -1
- package/browser/Options/Classes/Particles/ParticlesOptions.js +12 -12
- package/browser/Options/Classes/Particles/Shadow.js +1 -1
- package/browser/Options/Classes/Particles/Shape/Shape.js +1 -1
- package/browser/Options/Classes/Particles/Size/Size.js +2 -2
- package/browser/Options/Classes/Particles/Size/SizeAnimation.js +1 -1
- 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 +4 -4
- package/browser/Utils/CanvasUtils.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/browser/Utils/HslColorManager.js +2 -2
- package/browser/Utils/NumberUtils.js +2 -2
- package/browser/Utils/OptionsUtils.js +1 -1
- package/browser/Utils/RgbColorManager.js +1 -1
- package/browser/Utils/Utils.js +2 -2
- package/browser/bundle.js +2 -2
- package/browser/export-types.js +97 -97
- package/browser/exports.js +89 -89
- package/browser/index.js +4 -4
- package/browser/init.js +4 -4
- package/browser/package.json +1 -0
- package/cjs/Core/Canvas.js +28 -28
- package/cjs/Core/Container.js +19 -19
- package/cjs/Core/Engine.js +22 -22
- package/cjs/Core/Particle.js +37 -37
- package/cjs/Core/Particles.js +18 -17
- package/cjs/Core/Retina.js +11 -11
- package/cjs/Core/Utils/Circle.js +6 -6
- package/cjs/Core/Utils/EventListeners.js +19 -19
- package/cjs/Core/Utils/QuadTree.js +7 -7
- package/cjs/Core/Utils/Rectangle.js +4 -4
- package/cjs/Core/Utils/Vector.js +2 -2
- package/cjs/Core/Utils/Vector3d.js +4 -4
- package/cjs/Options/Classes/AnimatableColor.js +6 -6
- package/cjs/Options/Classes/AnimationOptions.js +5 -5
- package/cjs/Options/Classes/Background/Background.js +3 -3
- package/cjs/Options/Classes/BackgroundMask/BackgroundMask.js +4 -4
- package/cjs/Options/Classes/BackgroundMask/BackgroundMaskCover.js +3 -3
- package/cjs/Options/Classes/ColorAnimation.js +6 -6
- package/cjs/Options/Classes/HslAnimation.js +4 -4
- package/cjs/Options/Classes/Interactivity/Events/Events.js +12 -12
- package/cjs/Options/Classes/Interactivity/Events/HoverEvent.js +2 -2
- package/cjs/Options/Classes/Interactivity/Interactivity.js +4 -4
- package/cjs/Options/Classes/ManualParticle.js +2 -2
- package/cjs/Options/Classes/Options.js +24 -24
- package/cjs/Options/Classes/OptionsColor.js +2 -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 +8 -8
- package/cjs/Options/Classes/Particles/Move/Move.js +24 -24
- package/cjs/Options/Classes/Particles/Move/MoveAngle.js +3 -3
- package/cjs/Options/Classes/Particles/Move/MoveAttract.js +2 -2
- package/cjs/Options/Classes/Particles/Move/MoveGravity.js +3 -3
- package/cjs/Options/Classes/Particles/Move/MoveTrail.js +2 -2
- package/cjs/Options/Classes/Particles/Move/MoveTrailFill.js +2 -2
- package/cjs/Options/Classes/Particles/Move/Path/MovePath.js +4 -4
- package/cjs/Options/Classes/Particles/Move/Spin.js +4 -4
- package/cjs/Options/Classes/Particles/Number/ParticlesNumber.js +2 -2
- package/cjs/Options/Classes/Particles/Opacity/Opacity.js +4 -4
- package/cjs/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -2
- package/cjs/Options/Classes/Particles/ParticlesOptions.js +28 -28
- package/cjs/Options/Classes/Particles/Shadow.js +3 -3
- package/cjs/Options/Classes/Particles/Shape/Shape.js +2 -2
- package/cjs/Options/Classes/Particles/Size/Size.js +4 -4
- package/cjs/Options/Classes/Particles/Size/SizeAnimation.js +2 -2
- 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 +9 -9
- package/cjs/Utils/CanvasUtils.js +2 -2
- package/cjs/Utils/ColorUtils.js +23 -23
- package/cjs/Utils/HslColorManager.js +9 -9
- package/cjs/Utils/NumberUtils.js +10 -10
- package/cjs/Utils/OptionsUtils.js +2 -2
- package/cjs/Utils/RgbColorManager.js +5 -5
- package/cjs/Utils/Utils.js +17 -17
- package/cjs/bundle.js +3 -3
- package/cjs/export-types.js +97 -97
- package/cjs/exports.js +89 -89
- package/cjs/index.js +6 -6
- package/cjs/init.js +8 -8
- package/cjs/package.json +1 -0
- package/esm/Core/Canvas.js +4 -4
- package/esm/Core/Container.js +9 -9
- package/esm/Core/Engine.js +6 -6
- package/esm/Core/Particle.js +9 -9
- package/esm/Core/Particles.js +10 -9
- package/esm/Core/Retina.js +2 -2
- package/esm/Core/Utils/Circle.js +3 -3
- package/esm/Core/Utils/EventListeners.js +2 -2
- package/esm/Core/Utils/QuadTree.js +3 -3
- package/esm/Core/Utils/Rectangle.js +2 -2
- package/esm/Core/Utils/Vector.js +1 -1
- package/esm/Core/Utils/Vector3d.js +2 -2
- package/esm/Options/Classes/AnimatableColor.js +3 -3
- package/esm/Options/Classes/AnimationOptions.js +1 -1
- package/esm/Options/Classes/Background/Background.js +1 -1
- package/esm/Options/Classes/BackgroundMask/BackgroundMask.js +2 -2
- package/esm/Options/Classes/BackgroundMask/BackgroundMaskCover.js +1 -1
- package/esm/Options/Classes/ColorAnimation.js +1 -1
- package/esm/Options/Classes/HslAnimation.js +1 -1
- package/esm/Options/Classes/Interactivity/Events/Events.js +5 -5
- package/esm/Options/Classes/Interactivity/Events/HoverEvent.js +1 -1
- package/esm/Options/Classes/Interactivity/Interactivity.js +2 -2
- package/esm/Options/Classes/ManualParticle.js +1 -1
- package/esm/Options/Classes/Options.js +10 -10
- package/esm/Options/Classes/OptionsColor.js +1 -1
- 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 +4 -4
- package/esm/Options/Classes/Particles/Move/Move.js +10 -10
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +1 -1
- package/esm/Options/Classes/Particles/Move/MoveAttract.js +1 -1
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +1 -1
- package/esm/Options/Classes/Particles/Move/MoveTrail.js +1 -1
- package/esm/Options/Classes/Particles/Move/MoveTrailFill.js +1 -1
- package/esm/Options/Classes/Particles/Move/Path/MovePath.js +2 -2
- package/esm/Options/Classes/Particles/Move/Spin.js +2 -2
- package/esm/Options/Classes/Particles/Number/ParticlesNumber.js +1 -1
- package/esm/Options/Classes/Particles/Opacity/Opacity.js +2 -2
- package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +1 -1
- package/esm/Options/Classes/Particles/ParticlesOptions.js +12 -12
- package/esm/Options/Classes/Particles/Shadow.js +1 -1
- package/esm/Options/Classes/Particles/Shape/Shape.js +1 -1
- package/esm/Options/Classes/Particles/Size/Size.js +2 -2
- package/esm/Options/Classes/Particles/Size/SizeAnimation.js +1 -1
- 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 +4 -4
- package/esm/Utils/CanvasUtils.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/esm/Utils/HslColorManager.js +2 -2
- package/esm/Utils/NumberUtils.js +2 -2
- package/esm/Utils/OptionsUtils.js +1 -1
- package/esm/Utils/RgbColorManager.js +1 -1
- package/esm/Utils/Utils.js +2 -2
- package/esm/bundle.js +2 -2
- package/esm/export-types.js +97 -97
- package/esm/exports.js +89 -89
- package/esm/index.js +4 -4
- package/esm/init.js +4 -4
- package/esm/package.json +1 -0
- package/package.json +8 -6
- package/report.html +23 -5
- package/scripts/install.js +8 -8
- package/tsparticles.engine.js +5 -4
- package/tsparticles.engine.min.js +1 -1
- package/tsparticles.engine.min.js.LICENSE.txt +1 -1
- package/types/Core/Canvas.d.ts +5 -5
- package/types/Core/Container.d.ts +12 -12
- package/types/Core/Engine.d.ts +20 -20
- 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 +7 -7
- package/types/Core/Interfaces/ICoordinates.d.ts +2 -2
- package/types/Core/Interfaces/IDimension.d.ts +1 -1
- 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 +4 -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 -7
- package/types/Core/Interfaces/IParticleValueAnimation.d.ts +1 -1
- package/types/Core/Interfaces/IParticlesInteractor.d.ts +3 -3
- package/types/Core/Interfaces/IPlugin.d.ts +5 -5
- 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 +21 -21
- package/types/Core/Particles.d.ts +12 -12
- package/types/Core/Retina.d.ts +2 -2
- package/types/Core/Utils/Circle.d.ts +2 -2
- package/types/Core/Utils/EventListeners.d.ts +1 -1
- 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 +6 -6
- 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 +1 -1
- package/types/Options/Classes/AnimatableColor.d.ts +6 -6
- package/types/Options/Classes/AnimationOptions.d.ts +6 -6
- 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 +4 -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 -6
- package/types/Options/Classes/Interactivity/Events/Events.d.ts +8 -8
- 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 -8
- 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 +15 -15
- 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 +8 -8
- 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 -15
- package/types/Options/Classes/Particles/Move/MoveAngle.d.ts +4 -4
- package/types/Options/Classes/Particles/Move/MoveAttract.d.ts +5 -5
- package/types/Options/Classes/Particles/Move/MoveCenter.d.ts +4 -4
- package/types/Options/Classes/Particles/Move/MoveGravity.d.ts +4 -4
- package/types/Options/Classes/Particles/Move/MoveTrail.d.ts +4 -4
- 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 -3
- package/types/Options/Classes/Particles/Number/ParticlesNumber.d.ts +4 -4
- package/types/Options/Classes/Particles/Opacity/Opacity.d.ts +5 -5
- package/types/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +5 -5
- 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 +5 -5
- package/types/Options/Classes/Particles/Size/SizeAnimation.d.ts +5 -5
- 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 +5 -5
- package/types/Options/Classes/Theme/Theme.d.ts +5 -5
- package/types/Options/Classes/Theme/ThemeDefault.d.ts +4 -4
- package/types/Options/Classes/ValueWithRandom.d.ts +6 -6
- 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 +3 -3
- 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 +11 -11
- package/types/Options/Interfaces/IOptionsColor.d.ts +1 -1
- package/types/Options/Interfaces/IResponsive.d.ts +3 -3
- 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 -3
- package/types/Options/Interfaces/Interactivity/Events/IEvents.d.ts +5 -5
- package/types/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +3 -3
- package/types/Options/Interfaces/Interactivity/IInteractivity.d.ts +3 -3
- package/types/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Bounce/IParticlesBounce.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Collisions/ICollisions.d.ts +5 -5
- 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 +4 -4
- package/types/Options/Interfaces/Particles/Move/IMove.d.ts +12 -12
- package/types/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Move/IMoveAttract.d.ts +2 -2
- 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 -1
- 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/IParticlesNumber.d.ts +1 -1
- package/types/Options/Interfaces/Particles/Opacity/IOpacity.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Opacity/IOpacityAnimation.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Shape/IShape.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Size/ISize.d.ts +2 -2
- package/types/Options/Interfaces/Particles/Size/ISizeAnimation.d.ts +2 -2
- package/types/Options/Interfaces/Particles/ZIndex/IZIndex.d.ts +1 -1
- package/types/Options/Interfaces/Theme/ITheme.d.ts +3 -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/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 +9 -9
- 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 +12 -12
- package/types/bundle.d.ts +2 -2
- package/types/export-types.d.ts +106 -106
- package/types/exports.d.ts +89 -89
- package/types/index.d.ts +3 -3
- package/types/init.d.ts +1 -1
- package/umd/Core/Canvas.js +29 -29
- package/umd/Core/Container.js +20 -20
- package/umd/Core/Engine.js +23 -23
- package/umd/Core/Particle.js +38 -38
- package/umd/Core/Particles.js +19 -18
- package/umd/Core/Retina.js +12 -12
- package/umd/Core/Utils/Circle.js +7 -7
- package/umd/Core/Utils/EventListeners.js +20 -20
- package/umd/Core/Utils/QuadTree.js +8 -8
- package/umd/Core/Utils/Rectangle.js +5 -5
- package/umd/Core/Utils/Vector.js +3 -3
- package/umd/Core/Utils/Vector3d.js +5 -5
- package/umd/Options/Classes/AnimatableColor.js +7 -7
- package/umd/Options/Classes/AnimationOptions.js +6 -6
- package/umd/Options/Classes/Background/Background.js +4 -4
- package/umd/Options/Classes/BackgroundMask/BackgroundMask.js +5 -5
- package/umd/Options/Classes/BackgroundMask/BackgroundMaskCover.js +4 -4
- package/umd/Options/Classes/ColorAnimation.js +7 -7
- package/umd/Options/Classes/HslAnimation.js +5 -5
- package/umd/Options/Classes/Interactivity/Events/Events.js +13 -13
- package/umd/Options/Classes/Interactivity/Events/HoverEvent.js +3 -3
- package/umd/Options/Classes/Interactivity/Interactivity.js +5 -5
- package/umd/Options/Classes/ManualParticle.js +3 -3
- package/umd/Options/Classes/Options.js +25 -25
- package/umd/Options/Classes/OptionsColor.js +3 -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 +9 -9
- package/umd/Options/Classes/Particles/Move/Move.js +25 -25
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -4
- package/umd/Options/Classes/Particles/Move/MoveAttract.js +3 -3
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -4
- package/umd/Options/Classes/Particles/Move/MoveTrail.js +3 -3
- package/umd/Options/Classes/Particles/Move/MoveTrailFill.js +3 -3
- package/umd/Options/Classes/Particles/Move/Path/MovePath.js +5 -5
- package/umd/Options/Classes/Particles/Move/Spin.js +5 -5
- package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +3 -3
- package/umd/Options/Classes/Particles/Opacity/Opacity.js +5 -5
- package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +3 -3
- package/umd/Options/Classes/Particles/ParticlesOptions.js +29 -29
- package/umd/Options/Classes/Particles/Shadow.js +4 -4
- package/umd/Options/Classes/Particles/Shape/Shape.js +3 -3
- package/umd/Options/Classes/Particles/Size/Size.js +5 -5
- package/umd/Options/Classes/Particles/Size/SizeAnimation.js +3 -3
- 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 +10 -10
- package/umd/Utils/CanvasUtils.js +3 -3
- package/umd/Utils/ColorUtils.js +24 -24
- package/umd/Utils/HslColorManager.js +10 -10
- package/umd/Utils/NumberUtils.js +11 -11
- package/umd/Utils/OptionsUtils.js +3 -3
- package/umd/Utils/RgbColorManager.js +6 -6
- package/umd/Utils/Utils.js +18 -18
- package/umd/bundle.js +4 -4
- package/umd/export-types.js +98 -98
- package/umd/exports.js +90 -90
- package/umd/index.js +7 -7
- package/umd/init.js +9 -9
package/cjs/Core/Particles.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Particles = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
4
|
+
const Utils_js_1 = require("../Utils/Utils.js");
|
|
5
|
+
const InteractionManager_js_1 = require("./Utils/InteractionManager.js");
|
|
6
|
+
const Particle_js_1 = require("./Particle.js");
|
|
7
|
+
const Point_js_1 = require("./Utils/Point.js");
|
|
8
|
+
const QuadTree_js_1 = require("./Utils/QuadTree.js");
|
|
9
|
+
const Rectangle_js_1 = require("./Utils/Rectangle.js");
|
|
10
|
+
const Constants_js_1 = require("./Utils/Constants.js");
|
|
11
11
|
const qTreeCapacity = 4;
|
|
12
12
|
const qTreeRectangle = (canvasSize) => {
|
|
13
|
-
return new
|
|
13
|
+
return new Rectangle_js_1.Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2);
|
|
14
14
|
};
|
|
15
15
|
class Particles {
|
|
16
16
|
constructor(engine, container) {
|
|
@@ -42,7 +42,7 @@ class Particles {
|
|
|
42
42
|
particle.init(this._nextId, position, overrideOptions, group);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
particle = new
|
|
45
|
+
particle = new Particle_js_1.Particle(this._engine, this._nextId, this._container, position, overrideOptions, group);
|
|
46
46
|
}
|
|
47
47
|
let canAdd = true;
|
|
48
48
|
if (initializer) {
|
|
@@ -63,7 +63,7 @@ class Particles {
|
|
|
63
63
|
return particle;
|
|
64
64
|
}
|
|
65
65
|
catch (e) {
|
|
66
|
-
(0,
|
|
66
|
+
(0, Utils_js_1.getLogger)().warning(`${Constants_js_1.errorPrefix} adding particle: ${e}`);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
};
|
|
@@ -73,8 +73,9 @@ class Particles {
|
|
|
73
73
|
return false;
|
|
74
74
|
}
|
|
75
75
|
particle.destroy(override);
|
|
76
|
+
const zIdx = this._zArray.indexOf(particle);
|
|
76
77
|
this._array.splice(index, 1);
|
|
77
|
-
this._zArray
|
|
78
|
+
this._zArray.splice(zIdx, 1);
|
|
78
79
|
this.pool.push(particle);
|
|
79
80
|
this._engine.dispatchEvent("particleRemoved", {
|
|
80
81
|
container: this._container,
|
|
@@ -93,9 +94,9 @@ class Particles {
|
|
|
93
94
|
this.limit = 0;
|
|
94
95
|
this.needsSort = false;
|
|
95
96
|
this.lastZIndex = 0;
|
|
96
|
-
this._interactionManager = new
|
|
97
|
+
this._interactionManager = new InteractionManager_js_1.InteractionManager(engine, container);
|
|
97
98
|
const canvasSize = container.canvas.size;
|
|
98
|
-
this.quadTree = new
|
|
99
|
+
this.quadTree = new QuadTree_js_1.QuadTree(qTreeRectangle(canvasSize), qTreeCapacity);
|
|
99
100
|
this.movers = this._engine.getMovers(container, true);
|
|
100
101
|
this.updaters = this._engine.getUpdaters(container, true);
|
|
101
102
|
}
|
|
@@ -105,7 +106,7 @@ class Particles {
|
|
|
105
106
|
addManualParticles() {
|
|
106
107
|
const container = this._container, options = container.actualOptions;
|
|
107
108
|
for (const particle of options.manualParticles) {
|
|
108
|
-
this.addParticle(particle.position ? (0,
|
|
109
|
+
this.addParticle(particle.position ? (0, Utils_js_1.getPosition)(particle.position, container.canvas.size) : undefined, particle.options);
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
addParticle(position, overrideOptions, group, initializer) {
|
|
@@ -175,7 +176,7 @@ class Particles {
|
|
|
175
176
|
}
|
|
176
177
|
this.addManualParticles();
|
|
177
178
|
if (!handled) {
|
|
178
|
-
const particlesOptions = options.particles, groups =
|
|
179
|
+
const particlesOptions = options.particles, groups = particlesOptions.groups;
|
|
179
180
|
for (const group in groups) {
|
|
180
181
|
const groupOptions = groups[group];
|
|
181
182
|
for (let i = this.count, j = 0; j < groupOptions.number?.value && i < particlesOptions.number.value; i++, j++) {
|
|
@@ -221,7 +222,7 @@ class Particles {
|
|
|
221
222
|
}
|
|
222
223
|
async update(delta) {
|
|
223
224
|
const container = this._container, particlesToDelete = new Set();
|
|
224
|
-
this.quadTree = new
|
|
225
|
+
this.quadTree = new QuadTree_js_1.QuadTree(qTreeRectangle(container.canvas.size), qTreeCapacity);
|
|
225
226
|
for (const [, pathGenerator] of container.pathGenerators) {
|
|
226
227
|
pathGenerator.update();
|
|
227
228
|
}
|
|
@@ -251,7 +252,7 @@ class Particles {
|
|
|
251
252
|
particlesToDelete.add(particle);
|
|
252
253
|
continue;
|
|
253
254
|
}
|
|
254
|
-
this.quadTree.insert(new
|
|
255
|
+
this.quadTree.insert(new Point_js_1.Point(particle.getPosition(), particle));
|
|
255
256
|
}
|
|
256
257
|
if (particlesToDelete.size) {
|
|
257
258
|
const checkDelete = (p) => !particlesToDelete.has(p);
|
package/cjs/Core/Retina.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Retina = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const NumberUtils_js_1 = require("../Utils/NumberUtils.js");
|
|
5
|
+
const Utils_js_1 = require("../Utils/Utils.js");
|
|
6
6
|
class Retina {
|
|
7
7
|
constructor(container) {
|
|
8
8
|
this.container = container;
|
|
@@ -11,7 +11,7 @@ class Retina {
|
|
|
11
11
|
}
|
|
12
12
|
init() {
|
|
13
13
|
const container = this.container, options = container.actualOptions;
|
|
14
|
-
this.pixelRatio = !options.detectRetina || (0,
|
|
14
|
+
this.pixelRatio = !options.detectRetina || (0, Utils_js_1.isSsr)() ? 1 : window.devicePixelRatio;
|
|
15
15
|
this.reduceFactor = 1;
|
|
16
16
|
const ratio = this.pixelRatio, canvas = container.canvas;
|
|
17
17
|
if (canvas.element) {
|
|
@@ -20,20 +20,20 @@ class Retina {
|
|
|
20
20
|
canvas.size.height = element.offsetHeight * ratio;
|
|
21
21
|
}
|
|
22
22
|
const particles = options.particles, moveOptions = particles.move;
|
|
23
|
-
this.attractDistance = (0,
|
|
24
|
-
this.maxSpeed = (0,
|
|
25
|
-
this.sizeAnimationSpeed = (0,
|
|
23
|
+
this.attractDistance = (0, NumberUtils_js_1.getRangeValue)(moveOptions.attract.distance) * ratio;
|
|
24
|
+
this.maxSpeed = (0, NumberUtils_js_1.getRangeValue)(moveOptions.gravity.maxSpeed) * ratio;
|
|
25
|
+
this.sizeAnimationSpeed = (0, NumberUtils_js_1.getRangeValue)(particles.size.animation.speed) * ratio;
|
|
26
26
|
}
|
|
27
27
|
initParticle(particle) {
|
|
28
28
|
const options = particle.options, ratio = this.pixelRatio, moveOptions = options.move, moveDistance = moveOptions.distance, props = particle.retina;
|
|
29
|
-
props.attractDistance = (0,
|
|
30
|
-
props.moveDrift = (0,
|
|
31
|
-
props.moveSpeed = (0,
|
|
32
|
-
props.sizeAnimationSpeed = (0,
|
|
29
|
+
props.attractDistance = (0, NumberUtils_js_1.getRangeValue)(moveOptions.attract.distance) * ratio;
|
|
30
|
+
props.moveDrift = (0, NumberUtils_js_1.getRangeValue)(moveOptions.drift) * ratio;
|
|
31
|
+
props.moveSpeed = (0, NumberUtils_js_1.getRangeValue)(moveOptions.speed) * ratio;
|
|
32
|
+
props.sizeAnimationSpeed = (0, NumberUtils_js_1.getRangeValue)(options.size.animation.speed) * ratio;
|
|
33
33
|
const maxDistance = props.maxDistance;
|
|
34
34
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
35
35
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
36
|
-
props.maxSpeed = (0,
|
|
36
|
+
props.maxSpeed = (0, NumberUtils_js_1.getRangeValue)(moveOptions.gravity.maxSpeed) * ratio;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.Retina = Retina;
|
package/cjs/Core/Utils/Circle.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Circle = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
class Circle extends
|
|
4
|
+
const Range_js_1 = require("./Range.js");
|
|
5
|
+
const Rectangle_js_1 = require("./Rectangle.js");
|
|
6
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
7
|
+
class Circle extends Range_js_1.Range {
|
|
8
8
|
constructor(x, y, radius) {
|
|
9
9
|
super(x, y);
|
|
10
10
|
this.radius = radius;
|
|
11
11
|
}
|
|
12
12
|
contains(point) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, NumberUtils_js_1.getDistance)(point, this.position) <= this.radius;
|
|
14
14
|
}
|
|
15
15
|
intersects(range) {
|
|
16
16
|
const pos1 = this.position, pos2 = range.position, distPos = { x: Math.abs(pos2.x - pos1.x), y: Math.abs(pos2.y - pos1.y) }, r = this.radius;
|
|
@@ -18,7 +18,7 @@ class Circle extends Range_1.Range {
|
|
|
18
18
|
const rSum = r + range.radius, dist = Math.sqrt(distPos.x ** 2 + distPos.y ** 2);
|
|
19
19
|
return rSum > dist;
|
|
20
20
|
}
|
|
21
|
-
else if (range instanceof
|
|
21
|
+
else if (range instanceof Rectangle_js_1.Rectangle) {
|
|
22
22
|
const { width, height } = range.size, edges = Math.pow(distPos.x - width, 2) + Math.pow(distPos.y - height, 2);
|
|
23
23
|
return (edges <= r ** 2 ||
|
|
24
24
|
(distPos.x <= r + width && distPos.y <= r + height) ||
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventListeners = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
5
|
+
const Constants_js_1 = require("./Constants.js");
|
|
6
6
|
function manageListener(element, event, handler, add, options) {
|
|
7
7
|
if (add) {
|
|
8
8
|
let addOptions = { passive: true };
|
|
9
|
-
if ((0,
|
|
9
|
+
if ((0, Utils_js_1.isBoolean)(options)) {
|
|
10
10
|
addOptions.capture = options;
|
|
11
11
|
}
|
|
12
12
|
else if (options !== undefined) {
|
|
@@ -32,7 +32,7 @@ class EventListeners {
|
|
|
32
32
|
mouseInteractivity.clickPosition = { ...mousePos };
|
|
33
33
|
mouseInteractivity.clickTime = new Date().getTime();
|
|
34
34
|
const onClick = options.interactivity.events.onClick;
|
|
35
|
-
(0,
|
|
35
|
+
(0, Utils_js_1.executeOnSingleOrMultiple)(onClick.mode, (mode) => this.container.handleClickMode(mode));
|
|
36
36
|
}
|
|
37
37
|
if (e.type === "touchend") {
|
|
38
38
|
setTimeout(() => this._mouseTouchFinish(), 500);
|
|
@@ -87,26 +87,26 @@ class EventListeners {
|
|
|
87
87
|
if (!(options.interactivity.events.onHover.enable || options.interactivity.events.onClick.enable)) {
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
manageListener(interactivityEl,
|
|
91
|
-
manageListener(interactivityEl,
|
|
92
|
-
manageListener(interactivityEl,
|
|
90
|
+
manageListener(interactivityEl, Constants_js_1.mouseMoveEvent, handlers.mouseMove, add);
|
|
91
|
+
manageListener(interactivityEl, Constants_js_1.touchStartEvent, handlers.touchStart, add);
|
|
92
|
+
manageListener(interactivityEl, Constants_js_1.touchMoveEvent, handlers.touchMove, add);
|
|
93
93
|
if (!options.interactivity.events.onClick.enable) {
|
|
94
|
-
manageListener(interactivityEl,
|
|
94
|
+
manageListener(interactivityEl, Constants_js_1.touchEndEvent, handlers.touchEnd, add);
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
|
-
manageListener(interactivityEl,
|
|
98
|
-
manageListener(interactivityEl,
|
|
99
|
-
manageListener(interactivityEl,
|
|
97
|
+
manageListener(interactivityEl, Constants_js_1.touchEndEvent, handlers.touchEndClick, add);
|
|
98
|
+
manageListener(interactivityEl, Constants_js_1.mouseUpEvent, handlers.mouseUp, add);
|
|
99
|
+
manageListener(interactivityEl, Constants_js_1.mouseDownEvent, handlers.mouseDown, add);
|
|
100
100
|
}
|
|
101
101
|
manageListener(interactivityEl, mouseLeaveTmpEvent, handlers.mouseLeave, add);
|
|
102
|
-
manageListener(interactivityEl,
|
|
102
|
+
manageListener(interactivityEl, Constants_js_1.touchCancelEvent, handlers.touchCancel, add);
|
|
103
103
|
};
|
|
104
104
|
this._manageListeners = (add) => {
|
|
105
105
|
const handlers = this._handlers, container = this.container, options = container.actualOptions, detectType = options.interactivity.detectsOn, canvasEl = container.canvas.element;
|
|
106
|
-
let mouseLeaveTmpEvent =
|
|
106
|
+
let mouseLeaveTmpEvent = Constants_js_1.mouseLeaveEvent;
|
|
107
107
|
if (detectType === "window") {
|
|
108
108
|
container.interactivity.element = window;
|
|
109
|
-
mouseLeaveTmpEvent =
|
|
109
|
+
mouseLeaveTmpEvent = Constants_js_1.mouseOutEvent;
|
|
110
110
|
}
|
|
111
111
|
else if (detectType === "parent" && canvasEl) {
|
|
112
112
|
container.interactivity.element = canvasEl.parentElement ?? canvasEl.parentNode;
|
|
@@ -118,11 +118,11 @@ class EventListeners {
|
|
|
118
118
|
this._manageResize(add);
|
|
119
119
|
this._manageInteractivityListeners(mouseLeaveTmpEvent, add);
|
|
120
120
|
if (document) {
|
|
121
|
-
manageListener(document,
|
|
121
|
+
manageListener(document, Constants_js_1.visibilityChangeEvent, handlers.visibilityChange, add, false);
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
this._manageMediaMatch = (add) => {
|
|
125
|
-
const handlers = this._handlers, mediaMatch = (0,
|
|
125
|
+
const handlers = this._handlers, mediaMatch = (0, Utils_js_1.safeMatchMedia)("(prefers-color-scheme: dark)");
|
|
126
126
|
if (!mediaMatch) {
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
@@ -146,7 +146,7 @@ class EventListeners {
|
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
if (typeof ResizeObserver === "undefined") {
|
|
149
|
-
manageListener(window,
|
|
149
|
+
manageListener(window, Constants_js_1.resizeEvent, handlers.resize, add);
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
152
|
const canvasEl = container.canvas.element;
|
|
@@ -208,7 +208,7 @@ class EventListeners {
|
|
|
208
208
|
delete mouse.position;
|
|
209
209
|
delete mouse.clickPosition;
|
|
210
210
|
delete mouse.downPosition;
|
|
211
|
-
interactivity.status =
|
|
211
|
+
interactivity.status = Constants_js_1.mouseLeaveEvent;
|
|
212
212
|
mouse.inside = false;
|
|
213
213
|
mouse.clicking = false;
|
|
214
214
|
};
|
|
@@ -270,7 +270,7 @@ class EventListeners {
|
|
|
270
270
|
pos.y *= pxRatio;
|
|
271
271
|
}
|
|
272
272
|
interactivity.mouse.position = pos;
|
|
273
|
-
interactivity.status =
|
|
273
|
+
interactivity.status = Constants_js_1.mouseMoveEvent;
|
|
274
274
|
};
|
|
275
275
|
this._touchEnd = (e) => {
|
|
276
276
|
const evt = e, touches = Array.from(evt.changedTouches);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QuadTree = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const Circle_js_1 = require("./Circle.js");
|
|
5
|
+
const Rectangle_js_1 = require("./Rectangle.js");
|
|
6
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
7
7
|
class QuadTree {
|
|
8
8
|
constructor(rectangle, capacity) {
|
|
9
9
|
this.rectangle = rectangle;
|
|
@@ -11,7 +11,7 @@ class QuadTree {
|
|
|
11
11
|
this._subdivide = () => {
|
|
12
12
|
const { x, y } = this.rectangle.position, { width, height } = this.rectangle.size, { capacity } = this;
|
|
13
13
|
for (let i = 0; i < 4; i++) {
|
|
14
|
-
this._subs.push(new QuadTree(new
|
|
14
|
+
this._subs.push(new QuadTree(new Rectangle_js_1.Rectangle(x + (width / 2) * (i % 2), y + (height / 2) * (Math.round(i / 2) - (i % 2)), width / 2, height / 2), capacity));
|
|
15
15
|
}
|
|
16
16
|
this._divided = true;
|
|
17
17
|
};
|
|
@@ -39,7 +39,7 @@ class QuadTree {
|
|
|
39
39
|
}
|
|
40
40
|
for (const p of this._points) {
|
|
41
41
|
if (!range.contains(p.position) &&
|
|
42
|
-
(0,
|
|
42
|
+
(0, NumberUtils_js_1.getDistance)(range.position, p.position) > p.particle.getRadius() &&
|
|
43
43
|
(!check || check(p.particle))) {
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
@@ -53,10 +53,10 @@ class QuadTree {
|
|
|
53
53
|
return res;
|
|
54
54
|
}
|
|
55
55
|
queryCircle(position, radius, check) {
|
|
56
|
-
return this.query(new
|
|
56
|
+
return this.query(new Circle_js_1.Circle(position.x, position.y, radius), check);
|
|
57
57
|
}
|
|
58
58
|
queryRectangle(position, size, check) {
|
|
59
|
-
return this.query(new
|
|
59
|
+
return this.query(new Rectangle_js_1.Rectangle(position.x, position.y, size.width, size.height), check);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
exports.QuadTree = QuadTree;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Rectangle = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
class Rectangle extends
|
|
4
|
+
const Circle_js_1 = require("./Circle.js");
|
|
5
|
+
const Range_js_1 = require("./Range.js");
|
|
6
|
+
class Rectangle extends Range_js_1.Range {
|
|
7
7
|
constructor(x, y, width, height) {
|
|
8
8
|
super(x, y);
|
|
9
9
|
this.size = {
|
|
@@ -16,7 +16,7 @@ class Rectangle extends Range_1.Range {
|
|
|
16
16
|
return point.x >= pos.x && point.x <= pos.x + w && point.y >= pos.y && point.y <= pos.y + h;
|
|
17
17
|
}
|
|
18
18
|
intersects(range) {
|
|
19
|
-
if (range instanceof
|
|
19
|
+
if (range instanceof Circle_js_1.Circle) {
|
|
20
20
|
range.intersects(this);
|
|
21
21
|
}
|
|
22
22
|
const w = this.size.width, h = this.size.height, pos1 = this.position, pos2 = range.position, size2 = range instanceof Rectangle ? range.size : { width: 0, height: 0 }, w2 = size2.width, h2 = size2.height;
|
package/cjs/Core/Utils/Vector.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Vector = void 0;
|
|
4
|
-
const
|
|
5
|
-
class Vector extends
|
|
4
|
+
const Vector3d_js_1 = require("./Vector3d.js");
|
|
5
|
+
class Vector extends Vector3d_js_1.Vector3d {
|
|
6
6
|
constructor(xOrCoords, y) {
|
|
7
7
|
super(xOrCoords, y, 0);
|
|
8
8
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Vector3d = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const Constants_js_1 = require("./Constants.js");
|
|
5
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
6
6
|
class Vector3d {
|
|
7
7
|
constructor(xOrCoords, y, z) {
|
|
8
8
|
this._updateFromAngle = (angle, length) => {
|
|
9
9
|
this.x = Math.cos(angle) * length;
|
|
10
10
|
this.y = Math.sin(angle) * length;
|
|
11
11
|
};
|
|
12
|
-
if (!(0,
|
|
12
|
+
if (!(0, Utils_js_1.isNumber)(xOrCoords) && xOrCoords) {
|
|
13
13
|
this.x = xOrCoords.x;
|
|
14
14
|
this.y = xOrCoords.y;
|
|
15
15
|
const coords3d = xOrCoords;
|
|
@@ -21,7 +21,7 @@ class Vector3d {
|
|
|
21
21
|
this.z = z ?? 0;
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
throw new Error(`${
|
|
24
|
+
throw new Error(`${Constants_js_1.errorPrefix} Vector3d not initialized correctly`);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
static get origin() {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnimatableColor = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
class AnimatableColor extends
|
|
4
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
5
|
+
const HslAnimation_js_1 = require("./HslAnimation.js");
|
|
6
|
+
const OptionsColor_js_1 = require("./OptionsColor.js");
|
|
7
|
+
class AnimatableColor extends OptionsColor_js_1.OptionsColor {
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
|
-
this.animation = new
|
|
10
|
+
this.animation = new HslAnimation_js_1.HslAnimation();
|
|
11
11
|
}
|
|
12
12
|
static create(source, data) {
|
|
13
13
|
const color = new AnimatableColor();
|
|
14
14
|
color.load(source);
|
|
15
15
|
if (data !== undefined) {
|
|
16
|
-
if ((0,
|
|
16
|
+
if ((0, Utils_js_1.isString)(data) || (0, Utils_js_1.isArray)(data)) {
|
|
17
17
|
color.load({ value: data });
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RangedAnimationOptions = exports.AnimationOptions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
5
5
|
class AnimationOptions {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.count = 0;
|
|
@@ -16,19 +16,19 @@ class AnimationOptions {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
if (data.count !== undefined) {
|
|
19
|
-
this.count = (0,
|
|
19
|
+
this.count = (0, NumberUtils_js_1.setRangeValue)(data.count);
|
|
20
20
|
}
|
|
21
21
|
if (data.enable !== undefined) {
|
|
22
22
|
this.enable = data.enable;
|
|
23
23
|
}
|
|
24
24
|
if (data.speed !== undefined) {
|
|
25
|
-
this.speed = (0,
|
|
25
|
+
this.speed = (0, NumberUtils_js_1.setRangeValue)(data.speed);
|
|
26
26
|
}
|
|
27
27
|
if (data.decay !== undefined) {
|
|
28
|
-
this.decay = (0,
|
|
28
|
+
this.decay = (0, NumberUtils_js_1.setRangeValue)(data.decay);
|
|
29
29
|
}
|
|
30
30
|
if (data.delay !== undefined) {
|
|
31
|
-
this.delay = (0,
|
|
31
|
+
this.delay = (0, NumberUtils_js_1.setRangeValue)(data.delay);
|
|
32
32
|
}
|
|
33
33
|
if (data.sync !== undefined) {
|
|
34
34
|
this.sync = data.sync;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Background = void 0;
|
|
4
|
-
const
|
|
4
|
+
const OptionsColor_js_1 = require("../OptionsColor.js");
|
|
5
5
|
class Background {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.color = new
|
|
7
|
+
this.color = new OptionsColor_js_1.OptionsColor();
|
|
8
8
|
this.color.value = "";
|
|
9
9
|
this.image = "";
|
|
10
10
|
this.position = "";
|
|
@@ -17,7 +17,7 @@ class Background {
|
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
if (data.color !== undefined) {
|
|
20
|
-
this.color =
|
|
20
|
+
this.color = OptionsColor_js_1.OptionsColor.create(this.color, data.color);
|
|
21
21
|
}
|
|
22
22
|
if (data.image !== undefined) {
|
|
23
23
|
this.image = data.image;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BackgroundMask = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const BackgroundMaskCover_js_1 = require("./BackgroundMaskCover.js");
|
|
5
|
+
const Utils_js_1 = require("../../../Utils/Utils.js");
|
|
6
6
|
class BackgroundMask {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.composite = "destination-out";
|
|
9
|
-
this.cover = new
|
|
9
|
+
this.cover = new BackgroundMaskCover_js_1.BackgroundMaskCover();
|
|
10
10
|
this.enable = false;
|
|
11
11
|
}
|
|
12
12
|
load(data) {
|
|
@@ -18,7 +18,7 @@ class BackgroundMask {
|
|
|
18
18
|
}
|
|
19
19
|
if (data.cover !== undefined) {
|
|
20
20
|
const cover = data.cover;
|
|
21
|
-
const color = ((0,
|
|
21
|
+
const color = ((0, Utils_js_1.isString)(data.cover) ? { color: data.cover } : data.cover);
|
|
22
22
|
this.cover.load(cover.color !== undefined ? cover : { color: color });
|
|
23
23
|
}
|
|
24
24
|
if (data.enable !== undefined) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BackgroundMaskCover = void 0;
|
|
4
|
-
const
|
|
4
|
+
const OptionsColor_js_1 = require("../OptionsColor.js");
|
|
5
5
|
class BackgroundMaskCover {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.color = new
|
|
7
|
+
this.color = new OptionsColor_js_1.OptionsColor();
|
|
8
8
|
this.color.value = "#fff";
|
|
9
9
|
this.opacity = 1;
|
|
10
10
|
}
|
|
@@ -13,7 +13,7 @@ class BackgroundMaskCover {
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
if (data.color !== undefined) {
|
|
16
|
-
this.color =
|
|
16
|
+
this.color = OptionsColor_js_1.OptionsColor.create(this.color, data.color);
|
|
17
17
|
}
|
|
18
18
|
if (data.opacity !== undefined) {
|
|
19
19
|
this.opacity = data.opacity;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ColorAnimation = void 0;
|
|
4
|
-
const
|
|
4
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
5
5
|
class ColorAnimation {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.count = 0;
|
|
@@ -17,22 +17,22 @@ class ColorAnimation {
|
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
if (data.count !== undefined) {
|
|
20
|
-
this.count = (0,
|
|
20
|
+
this.count = (0, NumberUtils_js_1.setRangeValue)(data.count);
|
|
21
21
|
}
|
|
22
22
|
if (data.enable !== undefined) {
|
|
23
23
|
this.enable = data.enable;
|
|
24
24
|
}
|
|
25
25
|
if (data.offset !== undefined) {
|
|
26
|
-
this.offset = (0,
|
|
26
|
+
this.offset = (0, NumberUtils_js_1.setRangeValue)(data.offset);
|
|
27
27
|
}
|
|
28
28
|
if (data.speed !== undefined) {
|
|
29
|
-
this.speed = (0,
|
|
29
|
+
this.speed = (0, NumberUtils_js_1.setRangeValue)(data.speed);
|
|
30
30
|
}
|
|
31
31
|
if (data.decay !== undefined) {
|
|
32
|
-
this.decay = (0,
|
|
32
|
+
this.decay = (0, NumberUtils_js_1.setRangeValue)(data.decay);
|
|
33
33
|
}
|
|
34
34
|
if (data.delay !== undefined) {
|
|
35
|
-
this.delay = (0,
|
|
35
|
+
this.delay = (0, NumberUtils_js_1.setRangeValue)(data.delay);
|
|
36
36
|
}
|
|
37
37
|
if (data.sync !== undefined) {
|
|
38
38
|
this.sync = data.sync;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HslAnimation = void 0;
|
|
4
|
-
const
|
|
4
|
+
const ColorAnimation_js_1 = require("./ColorAnimation.js");
|
|
5
5
|
class HslAnimation {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.h = new
|
|
8
|
-
this.s = new
|
|
9
|
-
this.l = new
|
|
7
|
+
this.h = new ColorAnimation_js_1.ColorAnimation();
|
|
8
|
+
this.s = new ColorAnimation_js_1.ColorAnimation();
|
|
9
|
+
this.l = new ColorAnimation_js_1.ColorAnimation();
|
|
10
10
|
}
|
|
11
11
|
load(data) {
|
|
12
12
|
if (!data) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Events = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
4
|
+
const Utils_js_1 = require("../../../../Utils/Utils.js");
|
|
5
|
+
const ClickEvent_js_1 = require("./ClickEvent.js");
|
|
6
|
+
const DivEvent_js_1 = require("./DivEvent.js");
|
|
7
|
+
const HoverEvent_js_1 = require("./HoverEvent.js");
|
|
8
|
+
const ResizeEvent_js_1 = require("./ResizeEvent.js");
|
|
9
9
|
class Events {
|
|
10
10
|
constructor() {
|
|
11
|
-
this.onClick = new
|
|
12
|
-
this.onDiv = new
|
|
13
|
-
this.onHover = new
|
|
14
|
-
this.resize = new
|
|
11
|
+
this.onClick = new ClickEvent_js_1.ClickEvent();
|
|
12
|
+
this.onDiv = new DivEvent_js_1.DivEvent();
|
|
13
|
+
this.onHover = new HoverEvent_js_1.HoverEvent();
|
|
14
|
+
this.resize = new ResizeEvent_js_1.ResizeEvent();
|
|
15
15
|
}
|
|
16
16
|
load(data) {
|
|
17
17
|
if (!data) {
|
|
@@ -20,14 +20,14 @@ class Events {
|
|
|
20
20
|
this.onClick.load(data.onClick);
|
|
21
21
|
const onDiv = data.onDiv;
|
|
22
22
|
if (onDiv !== undefined) {
|
|
23
|
-
this.onDiv = (0,
|
|
24
|
-
const tmp = new
|
|
23
|
+
this.onDiv = (0, Utils_js_1.executeOnSingleOrMultiple)(onDiv, (t) => {
|
|
24
|
+
const tmp = new DivEvent_js_1.DivEvent();
|
|
25
25
|
tmp.load(t);
|
|
26
26
|
return tmp;
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
this.onHover.load(data.onHover);
|
|
30
|
-
if ((0,
|
|
30
|
+
if ((0, Utils_js_1.isBoolean)(data.resize)) {
|
|
31
31
|
this.resize.enable = data.resize;
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HoverEvent = void 0;
|
|
4
|
-
const
|
|
4
|
+
const Parallax_js_1 = require("./Parallax.js");
|
|
5
5
|
class HoverEvent {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.enable = false;
|
|
8
8
|
this.mode = [];
|
|
9
|
-
this.parallax = new
|
|
9
|
+
this.parallax = new Parallax_js_1.Parallax();
|
|
10
10
|
}
|
|
11
11
|
load(data) {
|
|
12
12
|
if (!data) {
|