dune-react 0.0.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 +49 -0
- package/dist/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/sha1.js +4 -0
- package/dist/_virtual/util.js +4 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/ui-custom/background.d.ts +8 -0
- package/dist/components/ui-custom/background.js +51 -0
- package/dist/components/ui-custom/cover.d.ts +17 -0
- package/dist/components/ui-custom/cover.js +231 -0
- package/dist/components/ui-custom/sparkles.d.ts +13 -0
- package/dist/components/ui-custom/sparkles.js +418 -0
- package/dist/components/ui-custom/spotlight-new.d.ts +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -0
- package/dist/node_modules/.pnpm/@fluid-tailwind_tailwind-merge@0.0.3_tailwind-merge@3.3.1/node_modules/@fluid-tailwind/tailwind-merge/dist/index.js +50 -0
- package/dist/node_modules/.pnpm/@tsparticles_basic@3.9.1/node_modules/@tsparticles/basic/browser/index.js +25 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Canvas.js +510 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Container.js +463 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Engine.js +293 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Particle.js +355 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Particles.js +326 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Retina.js +37 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js +105 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/EventListeners.js +309 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/ExternalInteractorBase.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/InteractionManager.js +64 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/ParticlesInteractorBase.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Point.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/QuadTree.js +60 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Ranges.js +57 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Vectors.js +120 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/AnimationStatus.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Directions/MoveDirection.js +17 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Directions/OutModeDirection.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Directions/RotateDirection.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/InteractivityDetect.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/AnimationMode.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/CollisionMode.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/LimitMode.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/OutMode.js +11 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/PixelMode.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/ResponsiveMode.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/ThemeMode.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/AlterType.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/DestroyType.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/DivType.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/EasingType.js +33 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/EventType.js +18 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/GradientType.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/InteractorType.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/ParticleOutType.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/StartValueType.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/AnimatableColor.js +38 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/AnimationOptions.js +60 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Background/Background.js +39 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/BackgroundMask/BackgroundMask.js +27 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.js +24 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/ColorAnimation.js +22 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/FullScreen/FullScreen.js +21 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/HslAnimation.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/ClickEvent.js +21 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/DivEvent.js +30 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/Events.js +33 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/HoverEvent.js +24 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/Parallax.js +25 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Events/ResizeEvent.js +21 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Interactivity.js +25 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Interactivity/Modes/Modes.js +28 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/ManualParticle.js +24 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Options.js +163 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/OptionsColor.js +29 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Bounce/ParticlesBounce.js +18 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Collisions/Collisions.js +36 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Collisions/CollisionsAbsorb.js +17 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Collisions/CollisionsOverlap.js +21 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Effect/Effect.js +36 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/Move.js +95 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveAngle.js +22 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveAttract.js +36 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveCenter.js +30 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveGravity.js +30 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveTrail.js +26 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/MoveTrailFill.js +18 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/OutModes.js +22 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/Path/MovePath.js +30 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Move/Spin.js +26 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Number/ParticlesDensity.js +27 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Number/ParticlesNumber.js +23 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Number/ParticlesNumberLimit.js +22 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Opacity/Opacity.js +23 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +22 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/ParticlesOptions.js +97 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Shadow.js +38 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Shape/Shape.js +36 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Size/Size.js +23 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Size/SizeAnimation.js +22 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/Stroke.js +25 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Particles/ZIndex/ZIndex.js +28 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Responsive.js +31 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Theme/Theme.js +24 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/Theme/ThemeDefault.js +26 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Options/Classes/ValueWithRandom.js +46 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Types/RangeType.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/CanvasUtils.js +168 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/ColorUtils.js +316 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/EventDispatcher.js +47 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js +135 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/OptionsUtils.js +15 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/TypeUtils.js +26 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/Utils.js +475 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/index.js +82 -0
- package/dist/node_modules/.pnpm/@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/init.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-attract@3.9.1/node_modules/@tsparticles/interaction-external-attract/browser/Attractor.js +81 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-attract@3.9.1/node_modules/@tsparticles/interaction-external-attract/browser/Options/Classes/Attract.js +38 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-attract@3.9.1/node_modules/@tsparticles/interaction-external-attract/browser/Utils.js +50 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-attract@3.9.1/node_modules/@tsparticles/interaction-external-attract/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bounce@3.9.1/node_modules/@tsparticles/interaction-external-bounce/browser/Bouncer.js +45 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bounce@3.9.1/node_modules/@tsparticles/interaction-external-bounce/browser/Options/Classes/Bounce.js +17 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bounce@3.9.1/node_modules/@tsparticles/interaction-external-bounce/browser/Utils.js +47 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bounce@3.9.1/node_modules/@tsparticles/interaction-external-bounce/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bubble@3.9.1/node_modules/@tsparticles/interaction-external-bubble/browser/Bubbler.js +274 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bubble@3.9.1/node_modules/@tsparticles/interaction-external-bubble/browser/Enums.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bubble@3.9.1/node_modules/@tsparticles/interaction-external-bubble/browser/Options/Classes/Bubble.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bubble@3.9.1/node_modules/@tsparticles/interaction-external-bubble/browser/Options/Classes/BubbleBase.js +39 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bubble@3.9.1/node_modules/@tsparticles/interaction-external-bubble/browser/Options/Classes/BubbleDiv.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bubble@3.9.1/node_modules/@tsparticles/interaction-external-bubble/browser/Utils.js +13 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-bubble@3.9.1/node_modules/@tsparticles/interaction-external-bubble/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-connect@3.9.1/node_modules/@tsparticles/interaction-external-connect/browser/Connector.js +59 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-connect@3.9.1/node_modules/@tsparticles/interaction-external-connect/browser/Options/Classes/Connect.js +24 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-connect@3.9.1/node_modules/@tsparticles/interaction-external-connect/browser/Options/Classes/ConnectLinks.js +17 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-connect@3.9.1/node_modules/@tsparticles/interaction-external-connect/browser/Utils.js +44 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-connect@3.9.1/node_modules/@tsparticles/interaction-external-connect/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-grab@3.9.1/node_modules/@tsparticles/interaction-external-grab/browser/Grabber.js +76 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-grab@3.9.1/node_modules/@tsparticles/interaction-external-grab/browser/Options/Classes/Grab.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-grab@3.9.1/node_modules/@tsparticles/interaction-external-grab/browser/Options/Classes/GrabLinks.js +29 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-grab@3.9.1/node_modules/@tsparticles/interaction-external-grab/browser/Utils.js +19 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-grab@3.9.1/node_modules/@tsparticles/interaction-external-grab/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-pause@3.9.1/node_modules/@tsparticles/interaction-external-pause/browser/Pauser.js +32 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-pause@3.9.1/node_modules/@tsparticles/interaction-external-pause/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-push@3.9.1/node_modules/@tsparticles/interaction-external-push/browser/Options/Classes/Push.js +34 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-push@3.9.1/node_modules/@tsparticles/interaction-external-push/browser/Pusher.js +47 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-push@3.9.1/node_modules/@tsparticles/interaction-external-push/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-remove@3.9.1/node_modules/@tsparticles/interaction-external-remove/browser/Options/Classes/Remove.js +19 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-remove@3.9.1/node_modules/@tsparticles/interaction-external-remove/browser/Remover.js +39 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-remove@3.9.1/node_modules/@tsparticles/interaction-external-remove/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-repulse@3.9.1/node_modules/@tsparticles/interaction-external-repulse/browser/Options/Classes/Repulse.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-repulse@3.9.1/node_modules/@tsparticles/interaction-external-repulse/browser/Options/Classes/RepulseBase.js +38 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-repulse@3.9.1/node_modules/@tsparticles/interaction-external-repulse/browser/Options/Classes/RepulseDiv.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-repulse@3.9.1/node_modules/@tsparticles/interaction-external-repulse/browser/Repulser.js +160 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-repulse@3.9.1/node_modules/@tsparticles/interaction-external-repulse/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-slow@3.9.1/node_modules/@tsparticles/interaction-external-slow/browser/Options/Classes/Slow.js +21 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-slow@3.9.1/node_modules/@tsparticles/interaction-external-slow/browser/Slower.js +53 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-external-slow@3.9.1/node_modules/@tsparticles/interaction-external-slow/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-attract@3.9.1/node_modules/@tsparticles/interaction-particles-attract/browser/Attractor.js +37 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-attract@3.9.1/node_modules/@tsparticles/interaction-particles-attract/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-collisions@3.9.1/node_modules/@tsparticles/interaction-particles-collisions/browser/Absorb.js +28 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-collisions@3.9.1/node_modules/@tsparticles/interaction-particles-collisions/browser/Bounce.js +18 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-collisions@3.9.1/node_modules/@tsparticles/interaction-particles-collisions/browser/Collider.js +41 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-collisions@3.9.1/node_modules/@tsparticles/interaction-particles-collisions/browser/Destroy.js +17 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-collisions@3.9.1/node_modules/@tsparticles/interaction-particles-collisions/browser/ResolveCollision.js +23 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-collisions@3.9.1/node_modules/@tsparticles/interaction-particles-collisions/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/CircleWarp.js +33 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/LinkInstance.js +152 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/Linker.js +109 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/LinksPlugin.js +18 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/Options/Classes/Links.js +58 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/Options/Classes/LinksShadow.js +25 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/Options/Classes/LinksTriangle.js +28 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/Utils.js +106 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/interaction.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_interaction-particles-links@3.9.1/node_modules/@tsparticles/interaction-particles-links/browser/plugin.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_move-base@3.9.1/node_modules/@tsparticles/move-base/browser/BaseMover.js +37 -0
- package/dist/node_modules/.pnpm/@tsparticles_move-base@3.9.1/node_modules/@tsparticles/move-base/browser/Utils.js +128 -0
- package/dist/node_modules/.pnpm/@tsparticles_move-base@3.9.1/node_modules/@tsparticles/move-base/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_move-parallax@3.9.1/node_modules/@tsparticles/move-parallax/browser/ParallaxMover.js +31 -0
- package/dist/node_modules/.pnpm/@tsparticles_move-parallax@3.9.1/node_modules/@tsparticles/move-parallax/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_plugin-easing-quad@3.9.1/node_modules/@tsparticles/plugin-easing-quad/browser/index.js +11 -0
- package/dist/node_modules/.pnpm/@tsparticles_plugin-hex-color@3.9.1/node_modules/@tsparticles/plugin-hex-color/browser/HexColorManager.js +43 -0
- package/dist/node_modules/.pnpm/@tsparticles_plugin-hex-color@3.9.1/node_modules/@tsparticles/plugin-hex-color/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_plugin-hsl-color@3.9.1/node_modules/@tsparticles/plugin-hsl-color/browser/HslColorManager.js +46 -0
- package/dist/node_modules/.pnpm/@tsparticles_plugin-hsl-color@3.9.1/node_modules/@tsparticles/plugin-hsl-color/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_plugin-rgb-color@3.9.1/node_modules/@tsparticles/plugin-rgb-color/browser/RgbColorManager.js +45 -0
- package/dist/node_modules/.pnpm/@tsparticles_plugin-rgb-color@3.9.1/node_modules/@tsparticles/plugin-rgb-color/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_react@3.0.0_@tsparticles_engine@3.9.1_react-dom@18.3.1_react@18.3.1/node_modules/@tsparticles/react/dist/Particles.js +18 -0
- package/dist/node_modules/.pnpm/@tsparticles_react@3.0.0_@tsparticles_engine@3.9.1_react-dom@18.3.1_react@18.3.1/node_modules/@tsparticles/react/dist/index.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-circle@3.9.1/node_modules/@tsparticles/shape-circle/browser/CircleDrawer.js +28 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-circle@3.9.1/node_modules/@tsparticles/shape-circle/browser/Utils.js +12 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-circle@3.9.1/node_modules/@tsparticles/shape-circle/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-emoji@3.9.1/node_modules/@tsparticles/shape-emoji/browser/EmojiDrawer.js +103 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-emoji@3.9.1/node_modules/@tsparticles/shape-emoji/browser/Utils.js +13 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-emoji@3.9.1/node_modules/@tsparticles/shape-emoji/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/GifUtils/ByteStream.js +51 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/GifUtils/Constants.js +6 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/GifUtils/Enums/DisposalMethod.js +14 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/GifUtils/Types/GIFDataHeaders.js +13 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/GifUtils/Utils.js +419 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/ImageDrawer.js +130 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/ImagePreloader.js +36 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/Options/Classes/Preload.js +33 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/Utils.js +94 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-image@3.9.1/node_modules/@tsparticles/shape-image/browser/index.js +54 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-line@3.9.1/node_modules/@tsparticles/shape-line/browser/LineDrawer.js +16 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-line@3.9.1/node_modules/@tsparticles/shape-line/browser/Utils.js +9 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-line@3.9.1/node_modules/@tsparticles/shape-line/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-polygon@3.9.1/node_modules/@tsparticles/shape-polygon/browser/PolygonDrawer.js +27 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-polygon@3.9.1/node_modules/@tsparticles/shape-polygon/browser/PolygonDrawerBase.js +16 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-polygon@3.9.1/node_modules/@tsparticles/shape-polygon/browser/TriangleDrawer.js +30 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-polygon@3.9.1/node_modules/@tsparticles/shape-polygon/browser/Utils.js +19 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-polygon@3.9.1/node_modules/@tsparticles/shape-polygon/browser/index.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-square@3.9.1/node_modules/@tsparticles/shape-square/browser/SquareDrawer.js +16 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-square@3.9.1/node_modules/@tsparticles/shape-square/browser/Utils.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-square@3.9.1/node_modules/@tsparticles/shape-square/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-star@3.9.1/node_modules/@tsparticles/shape-star/browser/StarDrawer.js +22 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-star@3.9.1/node_modules/@tsparticles/shape-star/browser/Utils.js +14 -0
- package/dist/node_modules/.pnpm/@tsparticles_shape-star@3.9.1/node_modules/@tsparticles/shape-star/browser/index.js +8 -0
- package/dist/node_modules/.pnpm/@tsparticles_slim@3.9.1/node_modules/@tsparticles/slim/browser/index.js +56 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-color@3.9.1/node_modules/@tsparticles/updater-color/browser/ColorUpdater.js +23 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-color@3.9.1/node_modules/@tsparticles/updater-color/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-life@3.9.1/node_modules/@tsparticles/updater-life/browser/LifeUpdater.js +52 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-life@3.9.1/node_modules/@tsparticles/updater-life/browser/Options/Classes/Life.js +23 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-life@3.9.1/node_modules/@tsparticles/updater-life/browser/Options/Classes/LifeDelay.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-life@3.9.1/node_modules/@tsparticles/updater-life/browser/Options/Classes/LifeDuration.js +20 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-life@3.9.1/node_modules/@tsparticles/updater-life/browser/Utils.js +58 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-life@3.9.1/node_modules/@tsparticles/updater-life/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-opacity@3.9.1/node_modules/@tsparticles/updater-opacity/browser/OpacityUpdater.js +38 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-opacity@3.9.1/node_modules/@tsparticles/updater-opacity/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-out-modes@3.9.1/node_modules/@tsparticles/updater-out-modes/browser/BounceOutMode.js +36 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-out-modes@3.9.1/node_modules/@tsparticles/updater-out-modes/browser/DestroyOutMode.js +37 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-out-modes@3.9.1/node_modules/@tsparticles/updater-out-modes/browser/NoneOutMode.js +36 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-out-modes@3.9.1/node_modules/@tsparticles/updater-out-modes/browser/OutOfCanvasUpdater.js +45 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-out-modes@3.9.1/node_modules/@tsparticles/updater-out-modes/browser/OutOutMode.js +110 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-out-modes@3.9.1/node_modules/@tsparticles/updater-out-modes/browser/Utils.js +66 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-out-modes@3.9.1/node_modules/@tsparticles/updater-out-modes/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-rotate@3.9.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/Rotate.js +29 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-rotate@3.9.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/RotateAnimation.js +30 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-rotate@3.9.1/node_modules/@tsparticles/updater-rotate/browser/RotateUpdater.js +77 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-rotate@3.9.1/node_modules/@tsparticles/updater-rotate/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-size@3.9.1/node_modules/@tsparticles/updater-size/browser/SizeUpdater.js +30 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-size@3.9.1/node_modules/@tsparticles/updater-size/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-stroke-color@3.9.1/node_modules/@tsparticles/updater-stroke-color/browser/StrokeColorUpdater.js +35 -0
- package/dist/node_modules/.pnpm/@tsparticles_updater-stroke-color@3.9.1/node_modules/@tsparticles/updater-stroke-color/browser/index.js +10 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/.pnpm/file-type@12.4.1/node_modules/file-type/index.js +826 -0
- package/dist/node_modules/.pnpm/file-type@12.4.1/node_modules/file-type/supported.js +242 -0
- package/dist/node_modules/.pnpm/file-type@12.4.1/node_modules/file-type/util.js +64 -0
- package/dist/node_modules/.pnpm/js-sha1@0.6.0/node_modules/js-sha1/src/sha1.js +311 -0
- package/dist/node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/index.browser.js +22 -0
- package/dist/node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/dist/bundle-mjs.js +3007 -0
- package/dist/utils/css-utils.d.ts +10 -0
- package/dist/utils/css-utils.js +17 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/storage-qetag.d.ts +22 -0
- package/dist/utils/storage-qetag.js +3 -0
- package/dist/utils/utils-api.d.ts +17 -0
- package/dist/utils/utils-api.js +31 -0
- package/dist/utils/utils-canvas.d.ts +30 -0
- package/dist/utils/utils-canvas.js +54 -0
- package/dist/utils/utils-common.d.ts +6 -0
- package/dist/utils/utils-common.js +15 -0
- package/dist/utils/utils-image.d.ts +33 -0
- package/dist/utils/utils-image.js +57 -0
- package/dist/utils/utils-random.d.ts +1 -0
- package/dist/utils/utils-random.js +6 -0
- package/dist/utils/utils-time.d.ts +49 -0
- package/dist/utils/utils-time.js +112 -0
- package/package.json +81 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { removeDeleteCount, loadRandomFactor, loadMinIndex, one, none, errorPrefix, generatedTrue, generatedAttribute, canvasTag, generatedFalse, canvasFirstIndex } from "./Utils/Constants.js";
|
|
2
|
+
import { executeOnSingleOrMultiple, itemFromSingleOrMultiple, getLogger } from "../Utils/Utils.js";
|
|
3
|
+
import { Container } from "./Container.js";
|
|
4
|
+
import { EventDispatcher } from "../Utils/EventDispatcher.js";
|
|
5
|
+
import { EventType } from "../Enums/Types/EventType.js";
|
|
6
|
+
import { getRandom } from "../Utils/NumberUtils.js";
|
|
7
|
+
async function getItemsFromInitializer(container, map, initializers, force = false) {
|
|
8
|
+
let res = map.get(container);
|
|
9
|
+
if (!res || force) {
|
|
10
|
+
res = await Promise.all([...initializers.values()].map((t) => t(container)));
|
|
11
|
+
map.set(container, res);
|
|
12
|
+
}
|
|
13
|
+
return res;
|
|
14
|
+
}
|
|
15
|
+
async function getDataFromUrl(data) {
|
|
16
|
+
const url = itemFromSingleOrMultiple(data.url, data.index);
|
|
17
|
+
if (!url) {
|
|
18
|
+
return data.fallback;
|
|
19
|
+
}
|
|
20
|
+
const response = await fetch(url);
|
|
21
|
+
if (response.ok) {
|
|
22
|
+
return await response.json();
|
|
23
|
+
}
|
|
24
|
+
getLogger().error(`${errorPrefix} ${response.status} while retrieving config file`);
|
|
25
|
+
return data.fallback;
|
|
26
|
+
}
|
|
27
|
+
const getCanvasFromContainer = (domContainer) => {
|
|
28
|
+
let canvasEl;
|
|
29
|
+
if (domContainer instanceof HTMLCanvasElement || domContainer.tagName.toLowerCase() === canvasTag) {
|
|
30
|
+
canvasEl = domContainer;
|
|
31
|
+
if (!canvasEl.dataset[generatedAttribute]) {
|
|
32
|
+
canvasEl.dataset[generatedAttribute] = generatedFalse;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
const existingCanvases = domContainer.getElementsByTagName(canvasTag);
|
|
36
|
+
if (existingCanvases.length) {
|
|
37
|
+
canvasEl = existingCanvases[canvasFirstIndex];
|
|
38
|
+
canvasEl.dataset[generatedAttribute] = generatedFalse;
|
|
39
|
+
} else {
|
|
40
|
+
canvasEl = document.createElement(canvasTag);
|
|
41
|
+
canvasEl.dataset[generatedAttribute] = generatedTrue;
|
|
42
|
+
domContainer.appendChild(canvasEl);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const fullPercent = "100%";
|
|
46
|
+
if (!canvasEl.style.width) {
|
|
47
|
+
canvasEl.style.width = fullPercent;
|
|
48
|
+
}
|
|
49
|
+
if (!canvasEl.style.height) {
|
|
50
|
+
canvasEl.style.height = fullPercent;
|
|
51
|
+
}
|
|
52
|
+
return canvasEl;
|
|
53
|
+
}, getDomContainer = (id, source) => {
|
|
54
|
+
let domContainer = source ?? document.getElementById(id);
|
|
55
|
+
if (domContainer) {
|
|
56
|
+
return domContainer;
|
|
57
|
+
}
|
|
58
|
+
domContainer = document.createElement("div");
|
|
59
|
+
domContainer.id = id;
|
|
60
|
+
domContainer.dataset[generatedAttribute] = generatedTrue;
|
|
61
|
+
document.body.append(domContainer);
|
|
62
|
+
return domContainer;
|
|
63
|
+
};
|
|
64
|
+
class Engine {
|
|
65
|
+
constructor() {
|
|
66
|
+
this._configs = /* @__PURE__ */ new Map();
|
|
67
|
+
this._domArray = [];
|
|
68
|
+
this._eventDispatcher = new EventDispatcher();
|
|
69
|
+
this._initialized = false;
|
|
70
|
+
this.plugins = [];
|
|
71
|
+
this.colorManagers = /* @__PURE__ */ new Map();
|
|
72
|
+
this.easingFunctions = /* @__PURE__ */ new Map();
|
|
73
|
+
this._initializers = {
|
|
74
|
+
interactors: /* @__PURE__ */ new Map(),
|
|
75
|
+
movers: /* @__PURE__ */ new Map(),
|
|
76
|
+
updaters: /* @__PURE__ */ new Map()
|
|
77
|
+
};
|
|
78
|
+
this.interactors = /* @__PURE__ */ new Map();
|
|
79
|
+
this.movers = /* @__PURE__ */ new Map();
|
|
80
|
+
this.updaters = /* @__PURE__ */ new Map();
|
|
81
|
+
this.presets = /* @__PURE__ */ new Map();
|
|
82
|
+
this.effectDrawers = /* @__PURE__ */ new Map();
|
|
83
|
+
this.shapeDrawers = /* @__PURE__ */ new Map();
|
|
84
|
+
this.pathGenerators = /* @__PURE__ */ new Map();
|
|
85
|
+
}
|
|
86
|
+
get configs() {
|
|
87
|
+
const res = {};
|
|
88
|
+
for (const [name, config] of this._configs) {
|
|
89
|
+
res[name] = config;
|
|
90
|
+
}
|
|
91
|
+
return res;
|
|
92
|
+
}
|
|
93
|
+
get items() {
|
|
94
|
+
return this._domArray;
|
|
95
|
+
}
|
|
96
|
+
get version() {
|
|
97
|
+
return "3.9.1";
|
|
98
|
+
}
|
|
99
|
+
async addColorManager(manager, refresh = true) {
|
|
100
|
+
this.colorManagers.set(manager.key, manager);
|
|
101
|
+
await this.refresh(refresh);
|
|
102
|
+
}
|
|
103
|
+
addConfig(config) {
|
|
104
|
+
const key = config.key ?? config.name ?? "default";
|
|
105
|
+
this._configs.set(key, config);
|
|
106
|
+
this._eventDispatcher.dispatchEvent(EventType.configAdded, { data: { name: key, config } });
|
|
107
|
+
}
|
|
108
|
+
async addEasing(name, easing, refresh = true) {
|
|
109
|
+
if (this.getEasing(name)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.easingFunctions.set(name, easing);
|
|
113
|
+
await this.refresh(refresh);
|
|
114
|
+
}
|
|
115
|
+
async addEffect(effect, drawer, refresh = true) {
|
|
116
|
+
executeOnSingleOrMultiple(effect, (type) => {
|
|
117
|
+
if (!this.getEffectDrawer(type)) {
|
|
118
|
+
this.effectDrawers.set(type, drawer);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
await this.refresh(refresh);
|
|
122
|
+
}
|
|
123
|
+
addEventListener(type, listener) {
|
|
124
|
+
this._eventDispatcher.addEventListener(type, listener);
|
|
125
|
+
}
|
|
126
|
+
async addInteractor(name, interactorInitializer, refresh = true) {
|
|
127
|
+
this._initializers.interactors.set(name, interactorInitializer);
|
|
128
|
+
await this.refresh(refresh);
|
|
129
|
+
}
|
|
130
|
+
async addMover(name, moverInitializer, refresh = true) {
|
|
131
|
+
this._initializers.movers.set(name, moverInitializer);
|
|
132
|
+
await this.refresh(refresh);
|
|
133
|
+
}
|
|
134
|
+
async addParticleUpdater(name, updaterInitializer, refresh = true) {
|
|
135
|
+
this._initializers.updaters.set(name, updaterInitializer);
|
|
136
|
+
await this.refresh(refresh);
|
|
137
|
+
}
|
|
138
|
+
async addPathGenerator(name, generator, refresh = true) {
|
|
139
|
+
if (!this.getPathGenerator(name)) {
|
|
140
|
+
this.pathGenerators.set(name, generator);
|
|
141
|
+
}
|
|
142
|
+
await this.refresh(refresh);
|
|
143
|
+
}
|
|
144
|
+
async addPlugin(plugin, refresh = true) {
|
|
145
|
+
if (!this.getPlugin(plugin.id)) {
|
|
146
|
+
this.plugins.push(plugin);
|
|
147
|
+
}
|
|
148
|
+
await this.refresh(refresh);
|
|
149
|
+
}
|
|
150
|
+
async addPreset(preset, options, override = false, refresh = true) {
|
|
151
|
+
if (override || !this.getPreset(preset)) {
|
|
152
|
+
this.presets.set(preset, options);
|
|
153
|
+
}
|
|
154
|
+
await this.refresh(refresh);
|
|
155
|
+
}
|
|
156
|
+
async addShape(drawer, refresh = true) {
|
|
157
|
+
for (const validType of drawer.validTypes) {
|
|
158
|
+
if (this.getShapeDrawer(validType)) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
this.shapeDrawers.set(validType, drawer);
|
|
162
|
+
}
|
|
163
|
+
await this.refresh(refresh);
|
|
164
|
+
}
|
|
165
|
+
checkVersion(pluginVersion) {
|
|
166
|
+
if (this.version === pluginVersion) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${pluginVersion}`);
|
|
170
|
+
}
|
|
171
|
+
clearPlugins(container) {
|
|
172
|
+
this.updaters.delete(container);
|
|
173
|
+
this.movers.delete(container);
|
|
174
|
+
this.interactors.delete(container);
|
|
175
|
+
}
|
|
176
|
+
dispatchEvent(type, args) {
|
|
177
|
+
this._eventDispatcher.dispatchEvent(type, args);
|
|
178
|
+
}
|
|
179
|
+
dom() {
|
|
180
|
+
return this.items;
|
|
181
|
+
}
|
|
182
|
+
domItem(index) {
|
|
183
|
+
return this.item(index);
|
|
184
|
+
}
|
|
185
|
+
async getAvailablePlugins(container) {
|
|
186
|
+
const res = /* @__PURE__ */ new Map();
|
|
187
|
+
for (const plugin of this.plugins) {
|
|
188
|
+
if (plugin.needsPlugin(container.actualOptions)) {
|
|
189
|
+
res.set(plugin.id, await plugin.getPlugin(container));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return res;
|
|
193
|
+
}
|
|
194
|
+
getEasing(name) {
|
|
195
|
+
return this.easingFunctions.get(name) ?? ((value) => value);
|
|
196
|
+
}
|
|
197
|
+
getEffectDrawer(type) {
|
|
198
|
+
return this.effectDrawers.get(type);
|
|
199
|
+
}
|
|
200
|
+
async getInteractors(container, force = false) {
|
|
201
|
+
return getItemsFromInitializer(container, this.interactors, this._initializers.interactors, force);
|
|
202
|
+
}
|
|
203
|
+
async getMovers(container, force = false) {
|
|
204
|
+
return getItemsFromInitializer(container, this.movers, this._initializers.movers, force);
|
|
205
|
+
}
|
|
206
|
+
getPathGenerator(type) {
|
|
207
|
+
return this.pathGenerators.get(type);
|
|
208
|
+
}
|
|
209
|
+
getPlugin(plugin) {
|
|
210
|
+
return this.plugins.find((t) => t.id === plugin);
|
|
211
|
+
}
|
|
212
|
+
getPreset(preset) {
|
|
213
|
+
return this.presets.get(preset);
|
|
214
|
+
}
|
|
215
|
+
getShapeDrawer(type) {
|
|
216
|
+
return this.shapeDrawers.get(type);
|
|
217
|
+
}
|
|
218
|
+
getSupportedEffects() {
|
|
219
|
+
return this.effectDrawers.keys();
|
|
220
|
+
}
|
|
221
|
+
getSupportedShapes() {
|
|
222
|
+
return this.shapeDrawers.keys();
|
|
223
|
+
}
|
|
224
|
+
async getUpdaters(container, force = false) {
|
|
225
|
+
return getItemsFromInitializer(container, this.updaters, this._initializers.updaters, force);
|
|
226
|
+
}
|
|
227
|
+
init() {
|
|
228
|
+
if (this._initialized) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
this._initialized = true;
|
|
232
|
+
}
|
|
233
|
+
item(index) {
|
|
234
|
+
const { items } = this, item = items[index];
|
|
235
|
+
if (!item || item.destroyed) {
|
|
236
|
+
items.splice(index, removeDeleteCount);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
return item;
|
|
240
|
+
}
|
|
241
|
+
async load(params) {
|
|
242
|
+
var _a;
|
|
243
|
+
const id = params.id ?? ((_a = params.element) == null ? void 0 : _a.id) ?? `tsparticles${Math.floor(getRandom() * loadRandomFactor)}`, { index, url } = params, options = url ? await getDataFromUrl({ fallback: params.options, url, index }) : params.options, currentOptions = itemFromSingleOrMultiple(options, index), { items } = this, oldIndex = items.findIndex((v) => v.id.description === id), newItem = new Container(this, id, currentOptions);
|
|
244
|
+
if (oldIndex >= loadMinIndex) {
|
|
245
|
+
const old = this.item(oldIndex), deleteCount = old ? one : none;
|
|
246
|
+
if (old && !old.destroyed) {
|
|
247
|
+
old.destroy(false);
|
|
248
|
+
}
|
|
249
|
+
items.splice(oldIndex, deleteCount, newItem);
|
|
250
|
+
} else {
|
|
251
|
+
items.push(newItem);
|
|
252
|
+
}
|
|
253
|
+
const domContainer = getDomContainer(id, params.element), canvasEl = getCanvasFromContainer(domContainer);
|
|
254
|
+
newItem.canvas.loadCanvas(canvasEl);
|
|
255
|
+
await newItem.start();
|
|
256
|
+
return newItem;
|
|
257
|
+
}
|
|
258
|
+
loadOptions(options, sourceOptions) {
|
|
259
|
+
this.plugins.forEach((plugin) => {
|
|
260
|
+
var _a;
|
|
261
|
+
return (_a = plugin.loadOptions) == null ? void 0 : _a.call(plugin, options, sourceOptions);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
loadParticlesOptions(container, options, ...sourceOptions) {
|
|
265
|
+
const updaters = this.updaters.get(container);
|
|
266
|
+
if (!updaters) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
updaters.forEach((updater) => {
|
|
270
|
+
var _a;
|
|
271
|
+
return (_a = updater.loadOptions) == null ? void 0 : _a.call(updater, options, ...sourceOptions);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
async refresh(refresh = true) {
|
|
275
|
+
if (!refresh) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
await Promise.all(this.items.map((t) => t.refresh()));
|
|
279
|
+
}
|
|
280
|
+
removeEventListener(type, listener) {
|
|
281
|
+
this._eventDispatcher.removeEventListener(type, listener);
|
|
282
|
+
}
|
|
283
|
+
setOnClickHandler(callback) {
|
|
284
|
+
const { items } = this;
|
|
285
|
+
if (!items.length) {
|
|
286
|
+
throw new Error(`${errorPrefix} can only set click handlers after calling tsParticles.load()`);
|
|
287
|
+
}
|
|
288
|
+
items.forEach((item) => item.addClickHandler(callback));
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
export {
|
|
292
|
+
Engine
|
|
293
|
+
};
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { Vector3d, Vector } from "./Utils/Vectors.js";
|
|
2
|
+
import { calcExactPositionOrRandomFromSize, getParticleBaseVelocity, degToRad, getRangeValue, randomInRange, setRangeValue, getRandom, getDistance, clamp, getParticleDirectionAngle } from "../Utils/NumberUtils.js";
|
|
3
|
+
import { defaultRetryCount, tryCountIncrement, minRetries, errorPrefix, double, rollFactor, half, none, minZ, defaultRadius, squareExp, randomColorValue, millisecondsToSeconds, decayOffset } from "./Utils/Constants.js";
|
|
4
|
+
import { getPosition, itemFromSingleOrMultiple, initParticleNumericAnimationValue, deepExtend, isInArray } from "../Utils/Utils.js";
|
|
5
|
+
import { getHslFromAnimation, rangeColorToRgb } from "../Utils/ColorUtils.js";
|
|
6
|
+
import { EventType } from "../Enums/Types/EventType.js";
|
|
7
|
+
import { Interactivity } from "../Options/Classes/Interactivity/Interactivity.js";
|
|
8
|
+
import { MoveDirection } from "../Enums/Directions/MoveDirection.js";
|
|
9
|
+
import { OutMode } from "../Enums/Modes/OutMode.js";
|
|
10
|
+
import { ParticleOutType } from "../Enums/Types/ParticleOutType.js";
|
|
11
|
+
import { PixelMode } from "../Enums/Modes/PixelMode.js";
|
|
12
|
+
import { alterHsl } from "../Utils/CanvasUtils.js";
|
|
13
|
+
import { loadParticlesOptions } from "../Utils/OptionsUtils.js";
|
|
14
|
+
function loadEffectData(effect, effectOptions, id, reduceDuplicates) {
|
|
15
|
+
const effectData = effectOptions.options[effect];
|
|
16
|
+
if (!effectData) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
return deepExtend({
|
|
20
|
+
close: effectOptions.close,
|
|
21
|
+
fill: effectOptions.fill
|
|
22
|
+
}, itemFromSingleOrMultiple(effectData, id, reduceDuplicates));
|
|
23
|
+
}
|
|
24
|
+
function loadShapeData(shape, shapeOptions, id, reduceDuplicates) {
|
|
25
|
+
const shapeData = shapeOptions.options[shape];
|
|
26
|
+
if (!shapeData) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
return deepExtend({
|
|
30
|
+
close: shapeOptions.close,
|
|
31
|
+
fill: shapeOptions.fill
|
|
32
|
+
}, itemFromSingleOrMultiple(shapeData, id, reduceDuplicates));
|
|
33
|
+
}
|
|
34
|
+
function fixOutMode(data) {
|
|
35
|
+
if (!isInArray(data.outMode, data.checkModes)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const diameter = data.radius * double;
|
|
39
|
+
if (data.coord > data.maxCoord - diameter) {
|
|
40
|
+
data.setCb(-data.radius);
|
|
41
|
+
} else if (data.coord < diameter) {
|
|
42
|
+
data.setCb(data.radius);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class Particle {
|
|
46
|
+
constructor(engine, container) {
|
|
47
|
+
this.container = container;
|
|
48
|
+
this._calcPosition = (container2, position, zIndex, tryCount = defaultRetryCount) => {
|
|
49
|
+
for (const plugin of container2.plugins.values()) {
|
|
50
|
+
const pluginPos = plugin.particlePosition !== void 0 ? plugin.particlePosition(position, this) : void 0;
|
|
51
|
+
if (pluginPos) {
|
|
52
|
+
return Vector3d.create(pluginPos.x, pluginPos.y, zIndex);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const canvasSize = container2.canvas.size, exactPosition = calcExactPositionOrRandomFromSize({
|
|
56
|
+
size: canvasSize,
|
|
57
|
+
position
|
|
58
|
+
}), pos = Vector3d.create(exactPosition.x, exactPosition.y, zIndex), radius = this.getRadius(), outModes = this.options.move.outModes, fixHorizontal = (outMode) => {
|
|
59
|
+
fixOutMode({
|
|
60
|
+
outMode,
|
|
61
|
+
checkModes: [OutMode.bounce],
|
|
62
|
+
coord: pos.x,
|
|
63
|
+
maxCoord: container2.canvas.size.width,
|
|
64
|
+
setCb: (value) => pos.x += value,
|
|
65
|
+
radius
|
|
66
|
+
});
|
|
67
|
+
}, fixVertical = (outMode) => {
|
|
68
|
+
fixOutMode({
|
|
69
|
+
outMode,
|
|
70
|
+
checkModes: [OutMode.bounce],
|
|
71
|
+
coord: pos.y,
|
|
72
|
+
maxCoord: container2.canvas.size.height,
|
|
73
|
+
setCb: (value) => pos.y += value,
|
|
74
|
+
radius
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
fixHorizontal(outModes.left ?? outModes.default);
|
|
78
|
+
fixHorizontal(outModes.right ?? outModes.default);
|
|
79
|
+
fixVertical(outModes.top ?? outModes.default);
|
|
80
|
+
fixVertical(outModes.bottom ?? outModes.default);
|
|
81
|
+
if (this._checkOverlap(pos, tryCount)) {
|
|
82
|
+
return this._calcPosition(container2, void 0, zIndex, tryCount + tryCountIncrement);
|
|
83
|
+
}
|
|
84
|
+
return pos;
|
|
85
|
+
};
|
|
86
|
+
this._calculateVelocity = () => {
|
|
87
|
+
const baseVelocity = getParticleBaseVelocity(this.direction), res = baseVelocity.copy(), moveOptions = this.options.move;
|
|
88
|
+
if (moveOptions.direction === MoveDirection.inside || moveOptions.direction === MoveDirection.outside) {
|
|
89
|
+
return res;
|
|
90
|
+
}
|
|
91
|
+
const rad = degToRad(getRangeValue(moveOptions.angle.value)), radOffset = degToRad(getRangeValue(moveOptions.angle.offset)), range = {
|
|
92
|
+
left: radOffset - rad * half,
|
|
93
|
+
right: radOffset + rad * half
|
|
94
|
+
};
|
|
95
|
+
if (!moveOptions.straight) {
|
|
96
|
+
res.angle += randomInRange(setRangeValue(range.left, range.right));
|
|
97
|
+
}
|
|
98
|
+
if (moveOptions.random && typeof moveOptions.speed === "number") {
|
|
99
|
+
res.length *= getRandom();
|
|
100
|
+
}
|
|
101
|
+
return res;
|
|
102
|
+
};
|
|
103
|
+
this._checkOverlap = (pos, tryCount = defaultRetryCount) => {
|
|
104
|
+
const collisionsOptions = this.options.collisions, radius = this.getRadius();
|
|
105
|
+
if (!collisionsOptions.enable) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
const overlapOptions = collisionsOptions.overlap;
|
|
109
|
+
if (overlapOptions.enable) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
const retries = overlapOptions.retries;
|
|
113
|
+
if (retries >= minRetries && tryCount > retries) {
|
|
114
|
+
throw new Error(`${errorPrefix} particle is overlapping and can't be placed`);
|
|
115
|
+
}
|
|
116
|
+
return !!this.container.particles.find((particle) => getDistance(pos, particle.position) < radius + particle.getRadius());
|
|
117
|
+
};
|
|
118
|
+
this._getRollColor = (color) => {
|
|
119
|
+
if (!color || !this.roll || !this.backColor && !this.roll.alter) {
|
|
120
|
+
return color;
|
|
121
|
+
}
|
|
122
|
+
const backFactor = this.roll.horizontal && this.roll.vertical ? double * rollFactor : rollFactor, backSum = this.roll.horizontal ? Math.PI * half : none, rolled = Math.floor(((this.roll.angle ?? none) + backSum) / (Math.PI / backFactor)) % double;
|
|
123
|
+
if (!rolled) {
|
|
124
|
+
return color;
|
|
125
|
+
}
|
|
126
|
+
if (this.backColor) {
|
|
127
|
+
return this.backColor;
|
|
128
|
+
}
|
|
129
|
+
if (this.roll.alter) {
|
|
130
|
+
return alterHsl(color, this.roll.alter.type, this.roll.alter.value);
|
|
131
|
+
}
|
|
132
|
+
return color;
|
|
133
|
+
};
|
|
134
|
+
this._initPosition = (position) => {
|
|
135
|
+
const container2 = this.container, zIndexValue = getRangeValue(this.options.zIndex.value);
|
|
136
|
+
this.position = this._calcPosition(container2, position, clamp(zIndexValue, minZ, container2.zLayers));
|
|
137
|
+
this.initialPosition = this.position.copy();
|
|
138
|
+
const canvasSize = container2.canvas.size;
|
|
139
|
+
this.moveCenter = {
|
|
140
|
+
...getPosition(this.options.move.center, canvasSize),
|
|
141
|
+
radius: this.options.move.center.radius ?? defaultRadius,
|
|
142
|
+
mode: this.options.move.center.mode ?? PixelMode.percent
|
|
143
|
+
};
|
|
144
|
+
this.direction = getParticleDirectionAngle(this.options.move.direction, this.position, this.moveCenter);
|
|
145
|
+
switch (this.options.move.direction) {
|
|
146
|
+
case MoveDirection.inside:
|
|
147
|
+
this.outType = ParticleOutType.inside;
|
|
148
|
+
break;
|
|
149
|
+
case MoveDirection.outside:
|
|
150
|
+
this.outType = ParticleOutType.outside;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
this.offset = Vector.origin;
|
|
154
|
+
};
|
|
155
|
+
this._engine = engine;
|
|
156
|
+
}
|
|
157
|
+
destroy(override) {
|
|
158
|
+
var _a, _b, _c;
|
|
159
|
+
if (this.unbreakable || this.destroyed) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.destroyed = true;
|
|
163
|
+
this.bubble.inRange = false;
|
|
164
|
+
this.slow.inRange = false;
|
|
165
|
+
const container = this.container, pathGenerator = this.pathGenerator, shapeDrawer = container.shapeDrawers.get(this.shape);
|
|
166
|
+
(_a = shapeDrawer == null ? void 0 : shapeDrawer.particleDestroy) == null ? void 0 : _a.call(shapeDrawer, this);
|
|
167
|
+
for (const plugin of container.plugins.values()) {
|
|
168
|
+
(_b = plugin.particleDestroyed) == null ? void 0 : _b.call(plugin, this, override);
|
|
169
|
+
}
|
|
170
|
+
for (const updater of container.particles.updaters) {
|
|
171
|
+
(_c = updater.particleDestroyed) == null ? void 0 : _c.call(updater, this, override);
|
|
172
|
+
}
|
|
173
|
+
pathGenerator == null ? void 0 : pathGenerator.reset(this);
|
|
174
|
+
this._engine.dispatchEvent(EventType.particleDestroyed, {
|
|
175
|
+
container: this.container,
|
|
176
|
+
data: {
|
|
177
|
+
particle: this
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
draw(delta) {
|
|
182
|
+
const container = this.container, canvas = container.canvas;
|
|
183
|
+
for (const plugin of container.plugins.values()) {
|
|
184
|
+
canvas.drawParticlePlugin(plugin, this, delta);
|
|
185
|
+
}
|
|
186
|
+
canvas.drawParticle(this, delta);
|
|
187
|
+
}
|
|
188
|
+
getFillColor() {
|
|
189
|
+
return this._getRollColor(this.bubble.color ?? getHslFromAnimation(this.color));
|
|
190
|
+
}
|
|
191
|
+
getMass() {
|
|
192
|
+
return this.getRadius() ** squareExp * Math.PI * half;
|
|
193
|
+
}
|
|
194
|
+
getPosition() {
|
|
195
|
+
return {
|
|
196
|
+
x: this.position.x + this.offset.x,
|
|
197
|
+
y: this.position.y + this.offset.y,
|
|
198
|
+
z: this.position.z
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
getRadius() {
|
|
202
|
+
return this.bubble.radius ?? this.size.value;
|
|
203
|
+
}
|
|
204
|
+
getStrokeColor() {
|
|
205
|
+
return this._getRollColor(this.bubble.color ?? getHslFromAnimation(this.strokeColor));
|
|
206
|
+
}
|
|
207
|
+
init(id, position, overrideOptions, group) {
|
|
208
|
+
var _a, _b, _c, _d, _e, _f;
|
|
209
|
+
const container = this.container, engine = this._engine;
|
|
210
|
+
this.id = id;
|
|
211
|
+
this.group = group;
|
|
212
|
+
this.effectClose = true;
|
|
213
|
+
this.effectFill = true;
|
|
214
|
+
this.shapeClose = true;
|
|
215
|
+
this.shapeFill = true;
|
|
216
|
+
this.pathRotation = false;
|
|
217
|
+
this.lastPathTime = 0;
|
|
218
|
+
this.destroyed = false;
|
|
219
|
+
this.unbreakable = false;
|
|
220
|
+
this.isRotating = false;
|
|
221
|
+
this.rotation = 0;
|
|
222
|
+
this.misplaced = false;
|
|
223
|
+
this.retina = {
|
|
224
|
+
maxDistance: {}
|
|
225
|
+
};
|
|
226
|
+
this.outType = ParticleOutType.normal;
|
|
227
|
+
this.ignoresResizeRatio = true;
|
|
228
|
+
const pxRatio = container.retina.pixelRatio, mainOptions = container.actualOptions, particlesOptions = loadParticlesOptions(this._engine, container, mainOptions.particles), { reduceDuplicates } = particlesOptions, effectType = particlesOptions.effect.type, shapeType = particlesOptions.shape.type;
|
|
229
|
+
this.effect = itemFromSingleOrMultiple(effectType, this.id, reduceDuplicates);
|
|
230
|
+
this.shape = itemFromSingleOrMultiple(shapeType, this.id, reduceDuplicates);
|
|
231
|
+
const effectOptions = particlesOptions.effect, shapeOptions = particlesOptions.shape;
|
|
232
|
+
if (overrideOptions) {
|
|
233
|
+
if ((_a = overrideOptions.effect) == null ? void 0 : _a.type) {
|
|
234
|
+
const overrideEffectType = overrideOptions.effect.type, effect = itemFromSingleOrMultiple(overrideEffectType, this.id, reduceDuplicates);
|
|
235
|
+
if (effect) {
|
|
236
|
+
this.effect = effect;
|
|
237
|
+
effectOptions.load(overrideOptions.effect);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if ((_b = overrideOptions.shape) == null ? void 0 : _b.type) {
|
|
241
|
+
const overrideShapeType = overrideOptions.shape.type, shape = itemFromSingleOrMultiple(overrideShapeType, this.id, reduceDuplicates);
|
|
242
|
+
if (shape) {
|
|
243
|
+
this.shape = shape;
|
|
244
|
+
shapeOptions.load(overrideOptions.shape);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (this.effect === randomColorValue) {
|
|
249
|
+
const availableEffects = [...this.container.effectDrawers.keys()];
|
|
250
|
+
this.effect = availableEffects[Math.floor(getRandom() * availableEffects.length)];
|
|
251
|
+
}
|
|
252
|
+
if (this.shape === randomColorValue) {
|
|
253
|
+
const availableShapes = [...this.container.shapeDrawers.keys()];
|
|
254
|
+
this.shape = availableShapes[Math.floor(getRandom() * availableShapes.length)];
|
|
255
|
+
}
|
|
256
|
+
this.effectData = loadEffectData(this.effect, effectOptions, this.id, reduceDuplicates);
|
|
257
|
+
this.shapeData = loadShapeData(this.shape, shapeOptions, this.id, reduceDuplicates);
|
|
258
|
+
particlesOptions.load(overrideOptions);
|
|
259
|
+
const effectData = this.effectData;
|
|
260
|
+
if (effectData) {
|
|
261
|
+
particlesOptions.load(effectData.particles);
|
|
262
|
+
}
|
|
263
|
+
const shapeData = this.shapeData;
|
|
264
|
+
if (shapeData) {
|
|
265
|
+
particlesOptions.load(shapeData.particles);
|
|
266
|
+
}
|
|
267
|
+
const interactivity = new Interactivity(engine, container);
|
|
268
|
+
interactivity.load(container.actualOptions.interactivity);
|
|
269
|
+
interactivity.load(particlesOptions.interactivity);
|
|
270
|
+
this.interactivity = interactivity;
|
|
271
|
+
this.effectFill = (effectData == null ? void 0 : effectData.fill) ?? particlesOptions.effect.fill;
|
|
272
|
+
this.effectClose = (effectData == null ? void 0 : effectData.close) ?? particlesOptions.effect.close;
|
|
273
|
+
this.shapeFill = (shapeData == null ? void 0 : shapeData.fill) ?? particlesOptions.shape.fill;
|
|
274
|
+
this.shapeClose = (shapeData == null ? void 0 : shapeData.close) ?? particlesOptions.shape.close;
|
|
275
|
+
this.options = particlesOptions;
|
|
276
|
+
const pathOptions = this.options.move.path;
|
|
277
|
+
this.pathDelay = getRangeValue(pathOptions.delay.value) * millisecondsToSeconds;
|
|
278
|
+
if (pathOptions.generator) {
|
|
279
|
+
this.pathGenerator = this._engine.getPathGenerator(pathOptions.generator);
|
|
280
|
+
if (this.pathGenerator && container.addPath(pathOptions.generator, this.pathGenerator)) {
|
|
281
|
+
this.pathGenerator.init(container);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
container.retina.initParticle(this);
|
|
285
|
+
this.size = initParticleNumericAnimationValue(this.options.size, pxRatio);
|
|
286
|
+
this.bubble = {
|
|
287
|
+
inRange: false
|
|
288
|
+
};
|
|
289
|
+
this.slow = {
|
|
290
|
+
inRange: false,
|
|
291
|
+
factor: 1
|
|
292
|
+
};
|
|
293
|
+
this._initPosition(position);
|
|
294
|
+
this.initialVelocity = this._calculateVelocity();
|
|
295
|
+
this.velocity = this.initialVelocity.copy();
|
|
296
|
+
this.moveDecay = decayOffset - getRangeValue(this.options.move.decay);
|
|
297
|
+
const particles = container.particles;
|
|
298
|
+
particles.setLastZIndex(this.position.z);
|
|
299
|
+
this.zIndexFactor = this.position.z / container.zLayers;
|
|
300
|
+
this.sides = 24;
|
|
301
|
+
let effectDrawer = container.effectDrawers.get(this.effect);
|
|
302
|
+
if (!effectDrawer) {
|
|
303
|
+
effectDrawer = this._engine.getEffectDrawer(this.effect);
|
|
304
|
+
if (effectDrawer) {
|
|
305
|
+
container.effectDrawers.set(this.effect, effectDrawer);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (effectDrawer == null ? void 0 : effectDrawer.loadEffect) {
|
|
309
|
+
effectDrawer.loadEffect(this);
|
|
310
|
+
}
|
|
311
|
+
let shapeDrawer = container.shapeDrawers.get(this.shape);
|
|
312
|
+
if (!shapeDrawer) {
|
|
313
|
+
shapeDrawer = this._engine.getShapeDrawer(this.shape);
|
|
314
|
+
if (shapeDrawer) {
|
|
315
|
+
container.shapeDrawers.set(this.shape, shapeDrawer);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (shapeDrawer == null ? void 0 : shapeDrawer.loadShape) {
|
|
319
|
+
shapeDrawer.loadShape(this);
|
|
320
|
+
}
|
|
321
|
+
const sideCountFunc = shapeDrawer == null ? void 0 : shapeDrawer.getSidesCount;
|
|
322
|
+
if (sideCountFunc) {
|
|
323
|
+
this.sides = sideCountFunc(this);
|
|
324
|
+
}
|
|
325
|
+
this.spawning = false;
|
|
326
|
+
this.shadowColor = rangeColorToRgb(this._engine, this.options.shadow.color);
|
|
327
|
+
for (const updater of particles.updaters) {
|
|
328
|
+
updater.init(this);
|
|
329
|
+
}
|
|
330
|
+
for (const mover of particles.movers) {
|
|
331
|
+
(_c = mover.init) == null ? void 0 : _c.call(mover, this);
|
|
332
|
+
}
|
|
333
|
+
(_d = effectDrawer == null ? void 0 : effectDrawer.particleInit) == null ? void 0 : _d.call(effectDrawer, container, this);
|
|
334
|
+
(_e = shapeDrawer == null ? void 0 : shapeDrawer.particleInit) == null ? void 0 : _e.call(shapeDrawer, container, this);
|
|
335
|
+
for (const plugin of container.plugins.values()) {
|
|
336
|
+
(_f = plugin.particleCreated) == null ? void 0 : _f.call(plugin, this);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
isInsideCanvas() {
|
|
340
|
+
const radius = this.getRadius(), canvasSize = this.container.canvas.size, position = this.position;
|
|
341
|
+
return position.x >= -radius && position.y >= -radius && position.y <= canvasSize.height + radius && position.x <= canvasSize.width + radius;
|
|
342
|
+
}
|
|
343
|
+
isVisible() {
|
|
344
|
+
return !this.destroyed && !this.spawning && this.isInsideCanvas();
|
|
345
|
+
}
|
|
346
|
+
reset() {
|
|
347
|
+
var _a;
|
|
348
|
+
for (const updater of this.container.particles.updaters) {
|
|
349
|
+
(_a = updater.reset) == null ? void 0 : _a.call(updater, this);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
export {
|
|
354
|
+
Particle
|
|
355
|
+
};
|