@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,24 +4,31 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./Circle", "./Rectangle", "../../Utils/NumberUtils"], factory);
|
|
7
|
+
define(["require", "exports", "./Circle.js", "./Rectangle.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.QuadTree = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
13
|
+
const Circle_js_1 = require("./Circle.js");
|
|
14
|
+
const Rectangle_js_1 = require("./Rectangle.js");
|
|
15
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
16
16
|
class QuadTree {
|
|
17
17
|
constructor(rectangle, capacity) {
|
|
18
18
|
this.rectangle = rectangle;
|
|
19
19
|
this.capacity = capacity;
|
|
20
|
+
this._subdivide = () => {
|
|
21
|
+
const { x, y } = this.rectangle.position, { width, height } = this.rectangle.size, { capacity } = this;
|
|
22
|
+
for (let i = 0; i < 4; i++) {
|
|
23
|
+
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));
|
|
24
|
+
}
|
|
25
|
+
this._divided = true;
|
|
26
|
+
};
|
|
20
27
|
this._points = [];
|
|
21
28
|
this._divided = false;
|
|
29
|
+
this._subs = [];
|
|
22
30
|
}
|
|
23
31
|
insert(point) {
|
|
24
|
-
var _a, _b, _c, _d, _e;
|
|
25
32
|
if (!this.rectangle.contains(point.position)) {
|
|
26
33
|
return false;
|
|
27
34
|
}
|
|
@@ -30,48 +37,35 @@
|
|
|
30
37
|
return true;
|
|
31
38
|
}
|
|
32
39
|
if (!this._divided) {
|
|
33
|
-
this.
|
|
40
|
+
this._subdivide();
|
|
34
41
|
}
|
|
35
|
-
return ((
|
|
36
|
-
((_b = this._NW) === null || _b === void 0 ? void 0 : _b.insert(point)) ||
|
|
37
|
-
((_c = this._SE) === null || _c === void 0 ? void 0 : _c.insert(point)) ||
|
|
38
|
-
((_d = this._SW) === null || _d === void 0 ? void 0 : _d.insert(point)))) !== null && _e !== void 0 ? _e : false);
|
|
42
|
+
return this._subs.some((sub) => sub.insert(point));
|
|
39
43
|
}
|
|
40
44
|
query(range, check, found) {
|
|
41
|
-
|
|
42
|
-
const res = found !== null && found !== void 0 ? found : [];
|
|
45
|
+
const res = found || [];
|
|
43
46
|
if (!range.intersects(this.rectangle)) {
|
|
44
47
|
return [];
|
|
45
48
|
}
|
|
46
49
|
for (const p of this._points) {
|
|
47
50
|
if (!range.contains(p.position) &&
|
|
48
|
-
(0,
|
|
51
|
+
(0, NumberUtils_js_1.getDistance)(range.position, p.position) > p.particle.getRadius() &&
|
|
49
52
|
(!check || check(p.particle))) {
|
|
50
53
|
continue;
|
|
51
54
|
}
|
|
52
55
|
res.push(p.particle);
|
|
53
56
|
}
|
|
54
57
|
if (this._divided) {
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
(_d = this._SW) === null || _d === void 0 ? void 0 : _d.query(range, check, res);
|
|
58
|
+
for (const sub of this._subs) {
|
|
59
|
+
sub.query(range, check, res);
|
|
60
|
+
}
|
|
59
61
|
}
|
|
60
62
|
return res;
|
|
61
63
|
}
|
|
62
64
|
queryCircle(position, radius, check) {
|
|
63
|
-
return this.query(new
|
|
65
|
+
return this.query(new Circle_js_1.Circle(position.x, position.y, radius), check);
|
|
64
66
|
}
|
|
65
67
|
queryRectangle(position, size, check) {
|
|
66
|
-
return this.query(new
|
|
67
|
-
}
|
|
68
|
-
subdivide() {
|
|
69
|
-
const x = this.rectangle.position.x, y = this.rectangle.position.y, w = this.rectangle.size.width, h = this.rectangle.size.height, capacity = this.capacity;
|
|
70
|
-
this._NE = new QuadTree(new Rectangle_1.Rectangle(x, y, w / 2, h / 2), capacity);
|
|
71
|
-
this._NW = new QuadTree(new Rectangle_1.Rectangle(x + w / 2, y, w / 2, h / 2), capacity);
|
|
72
|
-
this._SE = new QuadTree(new Rectangle_1.Rectangle(x, y + h / 2, w / 2, h / 2), capacity);
|
|
73
|
-
this._SW = new QuadTree(new Rectangle_1.Rectangle(x + w / 2, y + h / 2, w / 2, h / 2), capacity);
|
|
74
|
-
this._divided = true;
|
|
68
|
+
return this.query(new Rectangle_js_1.Rectangle(position.x, position.y, size.width, size.height), check);
|
|
75
69
|
}
|
|
76
70
|
}
|
|
77
71
|
exports.QuadTree = QuadTree;
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./Circle", "./Range"], factory);
|
|
7
|
+
define(["require", "exports", "./Circle.js", "./Range.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Rectangle = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
class Rectangle extends
|
|
13
|
+
const Circle_js_1 = require("./Circle.js");
|
|
14
|
+
const Range_js_1 = require("./Range.js");
|
|
15
|
+
class Rectangle extends Range_js_1.Range {
|
|
16
16
|
constructor(x, y, width, height) {
|
|
17
17
|
super(x, y);
|
|
18
18
|
this.size = {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
return point.x >= pos.x && point.x <= pos.x + w && point.y >= pos.y && point.y <= pos.y + h;
|
|
26
26
|
}
|
|
27
27
|
intersects(range) {
|
|
28
|
-
if (range instanceof
|
|
28
|
+
if (range instanceof Circle_js_1.Circle) {
|
|
29
29
|
range.intersects(this);
|
|
30
30
|
}
|
|
31
31
|
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/umd/Core/Utils/Vector.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./Vector3d"], factory);
|
|
7
|
+
define(["require", "exports", "./Vector3d.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Vector = void 0;
|
|
13
|
-
const
|
|
14
|
-
class Vector extends
|
|
13
|
+
const Vector3d_js_1 = require("./Vector3d.js");
|
|
14
|
+
class Vector extends Vector3d_js_1.Vector3d {
|
|
15
15
|
constructor(xOrCoords, y) {
|
|
16
16
|
super(xOrCoords, y, 0);
|
|
17
17
|
}
|
|
@@ -4,15 +4,21 @@
|
|
|
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", "./Constants.js", "../../Utils/Utils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Vector3d = void 0;
|
|
13
|
+
const Constants_js_1 = require("./Constants.js");
|
|
14
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
13
15
|
class Vector3d {
|
|
14
16
|
constructor(xOrCoords, y, z) {
|
|
15
|
-
|
|
17
|
+
this._updateFromAngle = (angle, length) => {
|
|
18
|
+
this.x = Math.cos(angle) * length;
|
|
19
|
+
this.y = Math.sin(angle) * length;
|
|
20
|
+
};
|
|
21
|
+
if (!(0, Utils_js_1.isNumber)(xOrCoords) && xOrCoords) {
|
|
16
22
|
this.x = xOrCoords.x;
|
|
17
23
|
this.y = xOrCoords.y;
|
|
18
24
|
const coords3d = xOrCoords;
|
|
@@ -21,10 +27,10 @@
|
|
|
21
27
|
else if (xOrCoords !== undefined && y !== undefined) {
|
|
22
28
|
this.x = xOrCoords;
|
|
23
29
|
this.y = y;
|
|
24
|
-
this.z = z
|
|
30
|
+
this.z = z ?? 0;
|
|
25
31
|
}
|
|
26
32
|
else {
|
|
27
|
-
throw new Error(
|
|
33
|
+
throw new Error(`${Constants_js_1.errorPrefix} Vector3d not initialized correctly`);
|
|
28
34
|
}
|
|
29
35
|
}
|
|
30
36
|
static get origin() {
|
|
@@ -34,13 +40,13 @@
|
|
|
34
40
|
return Math.atan2(this.y, this.x);
|
|
35
41
|
}
|
|
36
42
|
set angle(angle) {
|
|
37
|
-
this.
|
|
43
|
+
this._updateFromAngle(angle, this.length);
|
|
38
44
|
}
|
|
39
45
|
get length() {
|
|
40
46
|
return Math.sqrt(this.getLengthSq());
|
|
41
47
|
}
|
|
42
48
|
set length(length) {
|
|
43
|
-
this.
|
|
49
|
+
this._updateFromAngle(this.angle, length);
|
|
44
50
|
}
|
|
45
51
|
static clone(source) {
|
|
46
52
|
return Vector3d.create(source.x, source.y, source.z);
|
|
@@ -84,6 +90,12 @@
|
|
|
84
90
|
this.y *= n;
|
|
85
91
|
this.z *= n;
|
|
86
92
|
}
|
|
93
|
+
normalize() {
|
|
94
|
+
const length = this.length;
|
|
95
|
+
if (length != 0) {
|
|
96
|
+
this.multTo(1.0 / length);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
87
99
|
rotate(angle) {
|
|
88
100
|
return Vector3d.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle), 0);
|
|
89
101
|
}
|
|
@@ -101,10 +113,6 @@
|
|
|
101
113
|
this.y -= v.y;
|
|
102
114
|
this.z -= v.z;
|
|
103
115
|
}
|
|
104
|
-
updateFromAngle(angle, length) {
|
|
105
|
-
this.x = Math.cos(angle) * length;
|
|
106
|
-
this.y = Math.sin(angle) * length;
|
|
107
|
-
}
|
|
108
116
|
}
|
|
109
117
|
exports.Vector3d = Vector3d;
|
|
110
118
|
});
|
|
@@ -4,24 +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", "./HslAnimation", "./OptionsColor"], factory);
|
|
7
|
+
define(["require", "exports", "../../Utils/Utils.js", "./HslAnimation.js", "./OptionsColor.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AnimatableColor = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
13
|
+
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
14
|
+
const HslAnimation_js_1 = require("./HslAnimation.js");
|
|
15
|
+
const OptionsColor_js_1 = require("./OptionsColor.js");
|
|
16
|
+
class AnimatableColor extends OptionsColor_js_1.OptionsColor {
|
|
16
17
|
constructor() {
|
|
17
18
|
super();
|
|
18
|
-
this.animation = new
|
|
19
|
+
this.animation = new HslAnimation_js_1.HslAnimation();
|
|
19
20
|
}
|
|
20
21
|
static create(source, data) {
|
|
21
22
|
const color = new AnimatableColor();
|
|
22
23
|
color.load(source);
|
|
23
24
|
if (data !== undefined) {
|
|
24
|
-
if (
|
|
25
|
+
if ((0, Utils_js_1.isString)(data) || (0, Utils_js_1.isArray)(data)) {
|
|
25
26
|
color.load({ value: data });
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../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.RangedAnimationOptions = exports.AnimationOptions = void 0;
|
|
13
|
-
const
|
|
13
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
14
14
|
class AnimationOptions {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.count = 0;
|
|
17
17
|
this.enable = false;
|
|
18
18
|
this.speed = 1;
|
|
19
19
|
this.decay = 0;
|
|
20
|
+
this.delay = 0;
|
|
20
21
|
this.sync = false;
|
|
21
22
|
}
|
|
22
23
|
load(data) {
|
|
@@ -24,16 +25,19 @@
|
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
if (data.count !== undefined) {
|
|
27
|
-
this.count = (0,
|
|
28
|
+
this.count = (0, NumberUtils_js_1.setRangeValue)(data.count);
|
|
28
29
|
}
|
|
29
30
|
if (data.enable !== undefined) {
|
|
30
31
|
this.enable = data.enable;
|
|
31
32
|
}
|
|
32
33
|
if (data.speed !== undefined) {
|
|
33
|
-
this.speed = (0,
|
|
34
|
+
this.speed = (0, NumberUtils_js_1.setRangeValue)(data.speed);
|
|
34
35
|
}
|
|
35
36
|
if (data.decay !== undefined) {
|
|
36
|
-
this.decay = (0,
|
|
37
|
+
this.decay = (0, NumberUtils_js_1.setRangeValue)(data.decay);
|
|
38
|
+
}
|
|
39
|
+
if (data.delay !== undefined) {
|
|
40
|
+
this.delay = (0, NumberUtils_js_1.setRangeValue)(data.delay);
|
|
37
41
|
}
|
|
38
42
|
if (data.sync !== undefined) {
|
|
39
43
|
this.sync = data.sync;
|
|
@@ -52,9 +56,6 @@
|
|
|
52
56
|
if (!data) {
|
|
53
57
|
return;
|
|
54
58
|
}
|
|
55
|
-
if (data.minimumValue !== undefined) {
|
|
56
|
-
this.minimumValue = data.minimumValue;
|
|
57
|
-
}
|
|
58
59
|
if (data.mode !== undefined) {
|
|
59
60
|
this.mode = data.mode;
|
|
60
61
|
}
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../OptionsColor"], factory);
|
|
7
|
+
define(["require", "exports", "../OptionsColor.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Background = void 0;
|
|
13
|
-
const
|
|
13
|
+
const OptionsColor_js_1 = require("../OptionsColor.js");
|
|
14
14
|
class Background {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.color = new
|
|
16
|
+
this.color = new OptionsColor_js_1.OptionsColor();
|
|
17
17
|
this.color.value = "";
|
|
18
18
|
this.image = "";
|
|
19
19
|
this.position = "";
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
if (data.color !== undefined) {
|
|
29
|
-
this.color =
|
|
29
|
+
this.color = OptionsColor_js_1.OptionsColor.create(this.color, data.color);
|
|
30
30
|
}
|
|
31
31
|
if (data.image !== undefined) {
|
|
32
32
|
this.image = data.image;
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./BackgroundMaskCover"], factory);
|
|
7
|
+
define(["require", "exports", "./BackgroundMaskCover.js", "../../../Utils/Utils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.BackgroundMask = void 0;
|
|
13
|
-
const
|
|
13
|
+
const BackgroundMaskCover_js_1 = require("./BackgroundMaskCover.js");
|
|
14
|
+
const Utils_js_1 = require("../../../Utils/Utils.js");
|
|
14
15
|
class BackgroundMask {
|
|
15
16
|
constructor() {
|
|
16
17
|
this.composite = "destination-out";
|
|
17
|
-
this.cover = new
|
|
18
|
+
this.cover = new BackgroundMaskCover_js_1.BackgroundMaskCover();
|
|
18
19
|
this.enable = false;
|
|
19
20
|
}
|
|
20
21
|
load(data) {
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
}
|
|
27
28
|
if (data.cover !== undefined) {
|
|
28
29
|
const cover = data.cover;
|
|
29
|
-
const color = (
|
|
30
|
+
const color = ((0, Utils_js_1.isString)(data.cover) ? { color: data.cover } : data.cover);
|
|
30
31
|
this.cover.load(cover.color !== undefined ? cover : { color: color });
|
|
31
32
|
}
|
|
32
33
|
if (data.enable !== undefined) {
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../OptionsColor"], factory);
|
|
7
|
+
define(["require", "exports", "../OptionsColor.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.BackgroundMaskCover = void 0;
|
|
13
|
-
const
|
|
13
|
+
const OptionsColor_js_1 = require("../OptionsColor.js");
|
|
14
14
|
class BackgroundMaskCover {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.color = new
|
|
16
|
+
this.color = new OptionsColor_js_1.OptionsColor();
|
|
17
17
|
this.color.value = "#fff";
|
|
18
18
|
this.opacity = 1;
|
|
19
19
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
if (data.color !== undefined) {
|
|
25
|
-
this.color =
|
|
25
|
+
this.color = OptionsColor_js_1.OptionsColor.create(this.color, data.color);
|
|
26
26
|
}
|
|
27
27
|
if (data.opacity !== undefined) {
|
|
28
28
|
this.opacity = data.opacity;
|
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../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.ColorAnimation = void 0;
|
|
13
|
-
const
|
|
13
|
+
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
14
14
|
class ColorAnimation {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.count = 0;
|
|
17
17
|
this.enable = false;
|
|
18
18
|
this.offset = 0;
|
|
19
19
|
this.speed = 1;
|
|
20
|
+
this.delay = 0;
|
|
20
21
|
this.decay = 0;
|
|
21
22
|
this.sync = true;
|
|
22
23
|
}
|
|
@@ -25,19 +26,22 @@
|
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
if (data.count !== undefined) {
|
|
28
|
-
this.count = (0,
|
|
29
|
+
this.count = (0, NumberUtils_js_1.setRangeValue)(data.count);
|
|
29
30
|
}
|
|
30
31
|
if (data.enable !== undefined) {
|
|
31
32
|
this.enable = data.enable;
|
|
32
33
|
}
|
|
33
34
|
if (data.offset !== undefined) {
|
|
34
|
-
this.offset = (0,
|
|
35
|
+
this.offset = (0, NumberUtils_js_1.setRangeValue)(data.offset);
|
|
35
36
|
}
|
|
36
37
|
if (data.speed !== undefined) {
|
|
37
|
-
this.speed = (0,
|
|
38
|
+
this.speed = (0, NumberUtils_js_1.setRangeValue)(data.speed);
|
|
38
39
|
}
|
|
39
40
|
if (data.decay !== undefined) {
|
|
40
|
-
this.decay = (0,
|
|
41
|
+
this.decay = (0, NumberUtils_js_1.setRangeValue)(data.decay);
|
|
42
|
+
}
|
|
43
|
+
if (data.delay !== undefined) {
|
|
44
|
+
this.delay = (0, NumberUtils_js_1.setRangeValue)(data.delay);
|
|
41
45
|
}
|
|
42
46
|
if (data.sync !== undefined) {
|
|
43
47
|
this.sync = data.sync;
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./ColorAnimation"], factory);
|
|
7
|
+
define(["require", "exports", "./ColorAnimation.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.HslAnimation = void 0;
|
|
13
|
-
const
|
|
13
|
+
const ColorAnimation_js_1 = require("./ColorAnimation.js");
|
|
14
14
|
class HslAnimation {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.h = new
|
|
17
|
-
this.s = new
|
|
18
|
-
this.l = new
|
|
16
|
+
this.h = new ColorAnimation_js_1.ColorAnimation();
|
|
17
|
+
this.s = new ColorAnimation_js_1.ColorAnimation();
|
|
18
|
+
this.l = new ColorAnimation_js_1.ColorAnimation();
|
|
19
19
|
}
|
|
20
20
|
load(data) {
|
|
21
21
|
if (!data) {
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DivEvent = void 0;
|
|
13
|
-
const Utils_1 = require("../../../../Utils/Utils");
|
|
14
13
|
class DivEvent {
|
|
15
14
|
constructor() {
|
|
16
15
|
this.selectors = [];
|
|
@@ -18,33 +17,10 @@
|
|
|
18
17
|
this.mode = [];
|
|
19
18
|
this.type = "circle";
|
|
20
19
|
}
|
|
21
|
-
get el() {
|
|
22
|
-
return this.elementId;
|
|
23
|
-
}
|
|
24
|
-
set el(value) {
|
|
25
|
-
this.elementId = value;
|
|
26
|
-
}
|
|
27
|
-
get elementId() {
|
|
28
|
-
return this.ids;
|
|
29
|
-
}
|
|
30
|
-
set elementId(value) {
|
|
31
|
-
this.ids = value;
|
|
32
|
-
}
|
|
33
|
-
get ids() {
|
|
34
|
-
return (0, Utils_1.executeOnSingleOrMultiple)(this.selectors, (t) => t.replace("#", ""));
|
|
35
|
-
}
|
|
36
|
-
set ids(value) {
|
|
37
|
-
this.selectors = (0, Utils_1.executeOnSingleOrMultiple)(value, (t) => `#${t}`);
|
|
38
|
-
}
|
|
39
20
|
load(data) {
|
|
40
|
-
var _a, _b;
|
|
41
21
|
if (!data) {
|
|
42
22
|
return;
|
|
43
23
|
}
|
|
44
|
-
const ids = (_b = (_a = data.ids) !== null && _a !== void 0 ? _a : data.elementId) !== null && _b !== void 0 ? _b : data.el;
|
|
45
|
-
if (ids !== undefined) {
|
|
46
|
-
this.ids = ids;
|
|
47
|
-
}
|
|
48
24
|
if (data.selectors !== undefined) {
|
|
49
25
|
this.selectors = data.selectors;
|
|
50
26
|
}
|
|
@@ -4,58 +4,39 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./ClickEvent", "./DivEvent", "./HoverEvent", "./ResizeEvent"
|
|
7
|
+
define(["require", "exports", "../../../../Utils/Utils.js", "./ClickEvent.js", "./DivEvent.js", "./HoverEvent.js", "./ResizeEvent.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Events = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
13
|
+
const Utils_js_1 = require("../../../../Utils/Utils.js");
|
|
14
|
+
const ClickEvent_js_1 = require("./ClickEvent.js");
|
|
15
|
+
const DivEvent_js_1 = require("./DivEvent.js");
|
|
16
|
+
const HoverEvent_js_1 = require("./HoverEvent.js");
|
|
17
|
+
const ResizeEvent_js_1 = require("./ResizeEvent.js");
|
|
18
18
|
class Events {
|
|
19
19
|
constructor() {
|
|
20
|
-
this.onClick = new
|
|
21
|
-
this.onDiv = new
|
|
22
|
-
this.onHover = new
|
|
23
|
-
this.resize = new
|
|
24
|
-
}
|
|
25
|
-
get onclick() {
|
|
26
|
-
return this.onClick;
|
|
27
|
-
}
|
|
28
|
-
set onclick(value) {
|
|
29
|
-
this.onClick = value;
|
|
30
|
-
}
|
|
31
|
-
get ondiv() {
|
|
32
|
-
return this.onDiv;
|
|
33
|
-
}
|
|
34
|
-
set ondiv(value) {
|
|
35
|
-
this.onDiv = value;
|
|
36
|
-
}
|
|
37
|
-
get onhover() {
|
|
38
|
-
return this.onHover;
|
|
39
|
-
}
|
|
40
|
-
set onhover(value) {
|
|
41
|
-
this.onHover = value;
|
|
20
|
+
this.onClick = new ClickEvent_js_1.ClickEvent();
|
|
21
|
+
this.onDiv = new DivEvent_js_1.DivEvent();
|
|
22
|
+
this.onHover = new HoverEvent_js_1.HoverEvent();
|
|
23
|
+
this.resize = new ResizeEvent_js_1.ResizeEvent();
|
|
42
24
|
}
|
|
43
25
|
load(data) {
|
|
44
|
-
var _a, _b, _c;
|
|
45
26
|
if (!data) {
|
|
46
27
|
return;
|
|
47
28
|
}
|
|
48
|
-
this.onClick.load(
|
|
49
|
-
const onDiv =
|
|
29
|
+
this.onClick.load(data.onClick);
|
|
30
|
+
const onDiv = data.onDiv;
|
|
50
31
|
if (onDiv !== undefined) {
|
|
51
|
-
this.onDiv = (0,
|
|
52
|
-
const tmp = new
|
|
32
|
+
this.onDiv = (0, Utils_js_1.executeOnSingleOrMultiple)(onDiv, (t) => {
|
|
33
|
+
const tmp = new DivEvent_js_1.DivEvent();
|
|
53
34
|
tmp.load(t);
|
|
54
35
|
return tmp;
|
|
55
36
|
});
|
|
56
37
|
}
|
|
57
|
-
this.onHover.load(
|
|
58
|
-
if (
|
|
38
|
+
this.onHover.load(data.onHover);
|
|
39
|
+
if ((0, Utils_js_1.isBoolean)(data.resize)) {
|
|
59
40
|
this.resize.enable = data.resize;
|
|
60
41
|
}
|
|
61
42
|
else {
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./Parallax"], factory);
|
|
7
|
+
define(["require", "exports", "./Parallax.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.HoverEvent = void 0;
|
|
13
|
-
const
|
|
13
|
+
const Parallax_js_1 = require("./Parallax.js");
|
|
14
14
|
class HoverEvent {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.enable = false;
|
|
17
17
|
this.mode = [];
|
|
18
|
-
this.parallax = new
|
|
18
|
+
this.parallax = new Parallax_js_1.Parallax();
|
|
19
19
|
}
|
|
20
20
|
load(data) {
|
|
21
21
|
if (!data) {
|