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,168 @@
|
|
|
1
|
+
import { originPoint, defaultAngle, defaultTransform, identity, minStrokeWidth, lFactor } from "../Core/Utils/Constants.js";
|
|
2
|
+
import { AlterType } from "../Enums/Types/AlterType.js";
|
|
3
|
+
import { getStyleFromRgb } from "./ColorUtils.js";
|
|
4
|
+
function drawLine(context, begin, end) {
|
|
5
|
+
context.beginPath();
|
|
6
|
+
context.moveTo(begin.x, begin.y);
|
|
7
|
+
context.lineTo(end.x, end.y);
|
|
8
|
+
context.closePath();
|
|
9
|
+
}
|
|
10
|
+
function paintBase(context, dimension, baseColor) {
|
|
11
|
+
context.fillStyle = baseColor ?? "rgba(0,0,0,0)";
|
|
12
|
+
context.fillRect(originPoint.x, originPoint.y, dimension.width, dimension.height);
|
|
13
|
+
}
|
|
14
|
+
function paintImage(context, dimension, image, opacity) {
|
|
15
|
+
if (!image) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
context.globalAlpha = opacity;
|
|
19
|
+
context.drawImage(image, originPoint.x, originPoint.y, dimension.width, dimension.height);
|
|
20
|
+
context.globalAlpha = 1;
|
|
21
|
+
}
|
|
22
|
+
function clear(context, dimension) {
|
|
23
|
+
context.clearRect(originPoint.x, originPoint.y, dimension.width, dimension.height);
|
|
24
|
+
}
|
|
25
|
+
function drawParticle(data) {
|
|
26
|
+
const { container, context, particle, delta, colorStyles, backgroundMask, composite, radius, opacity, shadow, transform } = data, pos = particle.getPosition(), angle = particle.rotation + (particle.pathRotation ? particle.velocity.angle : defaultAngle), rotateData = {
|
|
27
|
+
sin: Math.sin(angle),
|
|
28
|
+
cos: Math.cos(angle)
|
|
29
|
+
}, rotating = !!angle, transformData = {
|
|
30
|
+
a: rotateData.cos * (transform.a ?? defaultTransform.a),
|
|
31
|
+
b: rotating ? rotateData.sin * (transform.b ?? identity) : transform.b ?? defaultTransform.b,
|
|
32
|
+
c: rotating ? -rotateData.sin * (transform.c ?? identity) : transform.c ?? defaultTransform.c,
|
|
33
|
+
d: rotateData.cos * (transform.d ?? defaultTransform.d)
|
|
34
|
+
};
|
|
35
|
+
context.setTransform(transformData.a, transformData.b, transformData.c, transformData.d, pos.x, pos.y);
|
|
36
|
+
if (backgroundMask) {
|
|
37
|
+
context.globalCompositeOperation = composite;
|
|
38
|
+
}
|
|
39
|
+
const shadowColor = particle.shadowColor;
|
|
40
|
+
if (shadow.enable && shadowColor) {
|
|
41
|
+
context.shadowBlur = shadow.blur;
|
|
42
|
+
context.shadowColor = getStyleFromRgb(shadowColor);
|
|
43
|
+
context.shadowOffsetX = shadow.offset.x;
|
|
44
|
+
context.shadowOffsetY = shadow.offset.y;
|
|
45
|
+
}
|
|
46
|
+
if (colorStyles.fill) {
|
|
47
|
+
context.fillStyle = colorStyles.fill;
|
|
48
|
+
}
|
|
49
|
+
const strokeWidth = particle.strokeWidth ?? minStrokeWidth;
|
|
50
|
+
context.lineWidth = strokeWidth;
|
|
51
|
+
if (colorStyles.stroke) {
|
|
52
|
+
context.strokeStyle = colorStyles.stroke;
|
|
53
|
+
}
|
|
54
|
+
const drawData = {
|
|
55
|
+
container,
|
|
56
|
+
context,
|
|
57
|
+
particle,
|
|
58
|
+
radius,
|
|
59
|
+
opacity,
|
|
60
|
+
delta,
|
|
61
|
+
transformData,
|
|
62
|
+
strokeWidth
|
|
63
|
+
};
|
|
64
|
+
drawShape(drawData);
|
|
65
|
+
drawShapeAfterDraw(drawData);
|
|
66
|
+
drawEffect(drawData);
|
|
67
|
+
context.globalCompositeOperation = "source-over";
|
|
68
|
+
context.resetTransform();
|
|
69
|
+
}
|
|
70
|
+
function drawEffect(data) {
|
|
71
|
+
const { container, context, particle, radius, opacity, delta, transformData } = data;
|
|
72
|
+
if (!particle.effect) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const drawer = container.effectDrawers.get(particle.effect);
|
|
76
|
+
if (!drawer) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
drawer.draw({
|
|
80
|
+
context,
|
|
81
|
+
particle,
|
|
82
|
+
radius,
|
|
83
|
+
opacity,
|
|
84
|
+
delta,
|
|
85
|
+
pixelRatio: container.retina.pixelRatio,
|
|
86
|
+
transformData: { ...transformData }
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function drawShape(data) {
|
|
90
|
+
const { container, context, particle, radius, opacity, delta, strokeWidth, transformData } = data;
|
|
91
|
+
if (!particle.shape) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const drawer = container.shapeDrawers.get(particle.shape);
|
|
95
|
+
if (!drawer) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
context.beginPath();
|
|
99
|
+
drawer.draw({
|
|
100
|
+
context,
|
|
101
|
+
particle,
|
|
102
|
+
radius,
|
|
103
|
+
opacity,
|
|
104
|
+
delta,
|
|
105
|
+
pixelRatio: container.retina.pixelRatio,
|
|
106
|
+
transformData: { ...transformData }
|
|
107
|
+
});
|
|
108
|
+
if (particle.shapeClose) {
|
|
109
|
+
context.closePath();
|
|
110
|
+
}
|
|
111
|
+
if (strokeWidth > minStrokeWidth) {
|
|
112
|
+
context.stroke();
|
|
113
|
+
}
|
|
114
|
+
if (particle.shapeFill) {
|
|
115
|
+
context.fill();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function drawShapeAfterDraw(data) {
|
|
119
|
+
const { container, context, particle, radius, opacity, delta, transformData } = data;
|
|
120
|
+
if (!particle.shape) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const drawer = container.shapeDrawers.get(particle.shape);
|
|
124
|
+
if (!(drawer == null ? void 0 : drawer.afterDraw)) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
drawer.afterDraw({
|
|
128
|
+
context,
|
|
129
|
+
particle,
|
|
130
|
+
radius,
|
|
131
|
+
opacity,
|
|
132
|
+
delta,
|
|
133
|
+
pixelRatio: container.retina.pixelRatio,
|
|
134
|
+
transformData: { ...transformData }
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function drawPlugin(context, plugin, delta) {
|
|
138
|
+
if (!plugin.draw) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
plugin.draw(context, delta);
|
|
142
|
+
}
|
|
143
|
+
function drawParticlePlugin(context, plugin, particle, delta) {
|
|
144
|
+
if (!plugin.drawParticle) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
plugin.drawParticle(context, particle, delta);
|
|
148
|
+
}
|
|
149
|
+
function alterHsl(color, type, value) {
|
|
150
|
+
return {
|
|
151
|
+
h: color.h,
|
|
152
|
+
s: color.s,
|
|
153
|
+
l: color.l + (type === AlterType.darken ? -lFactor : lFactor) * value
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export {
|
|
157
|
+
alterHsl,
|
|
158
|
+
clear,
|
|
159
|
+
drawEffect,
|
|
160
|
+
drawLine,
|
|
161
|
+
drawParticle,
|
|
162
|
+
drawParticlePlugin,
|
|
163
|
+
drawPlugin,
|
|
164
|
+
drawShape,
|
|
165
|
+
drawShapeAfterDraw,
|
|
166
|
+
paintBase,
|
|
167
|
+
paintImage
|
|
168
|
+
};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { randomInRange, setRangeValue, mix, getRangeValue, getRandom, getRangeMax, getRangeMin, clamp } from "./NumberUtils.js";
|
|
2
|
+
import { defaultOpacity, rgbMax, sMin, half, double, hMin, lMax, sMax, hPhase, hMax, randomColorValue, defaultRgbMin, identity, midColorValue, lMin, percentDenominator, decayOffset, defaultLoops, defaultTime, millisecondsToSeconds, defaultVelocity, rgbFactor, sextuple, triple, phaseNumerator, sNormalizedOffset } from "../Core/Utils/Constants.js";
|
|
3
|
+
import { isString, isArray } from "./TypeUtils.js";
|
|
4
|
+
import { AnimationStatus } from "../Enums/AnimationStatus.js";
|
|
5
|
+
import { itemFromArray } from "./Utils.js";
|
|
6
|
+
function stringToRgba(engine, input) {
|
|
7
|
+
if (!input) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
for (const manager of engine.colorManagers.values()) {
|
|
11
|
+
if (input.startsWith(manager.stringPrefix)) {
|
|
12
|
+
return manager.parseString(input);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function rangeColorToRgb(engine, input, index, useIndex = true) {
|
|
17
|
+
if (!input) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const color = isString(input) ? { value: input } : input;
|
|
21
|
+
if (isString(color.value)) {
|
|
22
|
+
return colorToRgb(engine, color.value, index, useIndex);
|
|
23
|
+
}
|
|
24
|
+
if (isArray(color.value)) {
|
|
25
|
+
return rangeColorToRgb(engine, {
|
|
26
|
+
value: itemFromArray(color.value, index, useIndex)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
for (const manager of engine.colorManagers.values()) {
|
|
30
|
+
const res = manager.handleRangeColor(color);
|
|
31
|
+
if (res) {
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function colorToRgb(engine, input, index, useIndex = true) {
|
|
37
|
+
if (!input) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const color = isString(input) ? { value: input } : input;
|
|
41
|
+
if (isString(color.value)) {
|
|
42
|
+
return color.value === randomColorValue ? getRandomRgbColor() : stringToRgb(engine, color.value);
|
|
43
|
+
}
|
|
44
|
+
if (isArray(color.value)) {
|
|
45
|
+
return colorToRgb(engine, {
|
|
46
|
+
value: itemFromArray(color.value, index, useIndex)
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
for (const manager of engine.colorManagers.values()) {
|
|
50
|
+
const res = manager.handleColor(color);
|
|
51
|
+
if (res) {
|
|
52
|
+
return res;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function rangeColorToHsl(engine, color, index, useIndex = true) {
|
|
57
|
+
const rgb = rangeColorToRgb(engine, color, index, useIndex);
|
|
58
|
+
return rgb ? rgbToHsl(rgb) : void 0;
|
|
59
|
+
}
|
|
60
|
+
function rgbToHsl(color) {
|
|
61
|
+
const r1 = color.r / rgbMax, g1 = color.g / rgbMax, b1 = color.b / rgbMax, max = Math.max(r1, g1, b1), min = Math.min(r1, g1, b1), res = {
|
|
62
|
+
h: hMin,
|
|
63
|
+
l: (max + min) * half,
|
|
64
|
+
s: sMin
|
|
65
|
+
};
|
|
66
|
+
if (max !== min) {
|
|
67
|
+
res.s = res.l < half ? (max - min) / (max + min) : (max - min) / (double - max - min);
|
|
68
|
+
res.h = r1 === max ? (g1 - b1) / (max - min) : res.h = g1 === max ? double + (b1 - r1) / (max - min) : double * double + (r1 - g1) / (max - min);
|
|
69
|
+
}
|
|
70
|
+
res.l *= lMax;
|
|
71
|
+
res.s *= sMax;
|
|
72
|
+
res.h *= hPhase;
|
|
73
|
+
if (res.h < hMin) {
|
|
74
|
+
res.h += hMax;
|
|
75
|
+
}
|
|
76
|
+
if (res.h >= hMax) {
|
|
77
|
+
res.h -= hMax;
|
|
78
|
+
}
|
|
79
|
+
return res;
|
|
80
|
+
}
|
|
81
|
+
function stringToRgb(engine, input) {
|
|
82
|
+
return stringToRgba(engine, input);
|
|
83
|
+
}
|
|
84
|
+
function hslToRgb(hsl) {
|
|
85
|
+
const h = (hsl.h % hMax + hMax) % hMax, s = Math.max(sMin, Math.min(sMax, hsl.s)), l = Math.max(lMin, Math.min(lMax, hsl.l)), hNormalized = h / hMax, sNormalized = s / sMax, lNormalized = l / lMax;
|
|
86
|
+
if (s === sMin) {
|
|
87
|
+
const grayscaleValue = Math.round(lNormalized * rgbFactor);
|
|
88
|
+
return { r: grayscaleValue, g: grayscaleValue, b: grayscaleValue };
|
|
89
|
+
}
|
|
90
|
+
const channel = (temp12, temp22, temp3) => {
|
|
91
|
+
const temp3Min = 0, temp3Max = 1;
|
|
92
|
+
if (temp3 < temp3Min) {
|
|
93
|
+
temp3++;
|
|
94
|
+
}
|
|
95
|
+
if (temp3 > temp3Max) {
|
|
96
|
+
temp3--;
|
|
97
|
+
}
|
|
98
|
+
if (temp3 * sextuple < temp3Max) {
|
|
99
|
+
return temp12 + (temp22 - temp12) * sextuple * temp3;
|
|
100
|
+
}
|
|
101
|
+
if (temp3 * double < temp3Max) {
|
|
102
|
+
return temp22;
|
|
103
|
+
}
|
|
104
|
+
if (temp3 * triple < temp3Max * double) {
|
|
105
|
+
const temp3Offset = double / triple;
|
|
106
|
+
return temp12 + (temp22 - temp12) * (temp3Offset - temp3) * sextuple;
|
|
107
|
+
}
|
|
108
|
+
return temp12;
|
|
109
|
+
}, temp1 = lNormalized < half ? lNormalized * (sNormalizedOffset + sNormalized) : lNormalized + sNormalized - lNormalized * sNormalized, temp2 = double * lNormalized - temp1, phaseThird = phaseNumerator / triple, red = Math.min(rgbFactor, rgbFactor * channel(temp2, temp1, hNormalized + phaseThird)), green = Math.min(rgbFactor, rgbFactor * channel(temp2, temp1, hNormalized)), blue = Math.min(rgbFactor, rgbFactor * channel(temp2, temp1, hNormalized - phaseThird));
|
|
110
|
+
return { r: Math.round(red), g: Math.round(green), b: Math.round(blue) };
|
|
111
|
+
}
|
|
112
|
+
function hslaToRgba(hsla) {
|
|
113
|
+
const rgbResult = hslToRgb(hsla);
|
|
114
|
+
return {
|
|
115
|
+
a: hsla.a,
|
|
116
|
+
b: rgbResult.b,
|
|
117
|
+
g: rgbResult.g,
|
|
118
|
+
r: rgbResult.r
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function getRandomRgbColor(min) {
|
|
122
|
+
const fixedMin = defaultRgbMin, fixedMax = rgbMax + identity;
|
|
123
|
+
return {
|
|
124
|
+
b: Math.floor(randomInRange(setRangeValue(fixedMin, fixedMax))),
|
|
125
|
+
g: Math.floor(randomInRange(setRangeValue(fixedMin, fixedMax))),
|
|
126
|
+
r: Math.floor(randomInRange(setRangeValue(fixedMin, fixedMax)))
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function getStyleFromRgb(color, opacity) {
|
|
130
|
+
return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity ?? defaultOpacity})`;
|
|
131
|
+
}
|
|
132
|
+
function getStyleFromHsl(color, opacity) {
|
|
133
|
+
return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity ?? defaultOpacity})`;
|
|
134
|
+
}
|
|
135
|
+
function colorMix(color1, color2, size1, size2) {
|
|
136
|
+
let rgb1 = color1, rgb2 = color2;
|
|
137
|
+
if (rgb1.r === void 0) {
|
|
138
|
+
rgb1 = hslToRgb(color1);
|
|
139
|
+
}
|
|
140
|
+
if (rgb2.r === void 0) {
|
|
141
|
+
rgb2 = hslToRgb(color2);
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
b: mix(rgb1.b, rgb2.b, size1, size2),
|
|
145
|
+
g: mix(rgb1.g, rgb2.g, size1, size2),
|
|
146
|
+
r: mix(rgb1.r, rgb2.r, size1, size2)
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function getLinkColor(p1, p2, linkColor) {
|
|
150
|
+
if (linkColor === randomColorValue) {
|
|
151
|
+
return getRandomRgbColor();
|
|
152
|
+
} else if (linkColor === midColorValue) {
|
|
153
|
+
const sourceColor = p1.getFillColor() ?? p1.getStrokeColor(), destColor = (p2 == null ? void 0 : p2.getFillColor()) ?? (p2 == null ? void 0 : p2.getStrokeColor());
|
|
154
|
+
if (sourceColor && destColor && p2) {
|
|
155
|
+
return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
|
|
156
|
+
} else {
|
|
157
|
+
const hslColor = sourceColor ?? destColor;
|
|
158
|
+
if (hslColor) {
|
|
159
|
+
return hslToRgb(hslColor);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
return linkColor;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function getLinkRandomColor(engine, optColor, blink, consent) {
|
|
167
|
+
const color = isString(optColor) ? optColor : optColor.value;
|
|
168
|
+
if (color === randomColorValue) {
|
|
169
|
+
if (consent) {
|
|
170
|
+
return rangeColorToRgb(engine, {
|
|
171
|
+
value: color
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
if (blink) {
|
|
175
|
+
return randomColorValue;
|
|
176
|
+
}
|
|
177
|
+
return midColorValue;
|
|
178
|
+
} else if (color === midColorValue) {
|
|
179
|
+
return midColorValue;
|
|
180
|
+
} else {
|
|
181
|
+
return rangeColorToRgb(engine, {
|
|
182
|
+
value: color
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function getHslFromAnimation(animation) {
|
|
187
|
+
return animation !== void 0 ? {
|
|
188
|
+
h: animation.h.value,
|
|
189
|
+
s: animation.s.value,
|
|
190
|
+
l: animation.l.value
|
|
191
|
+
} : void 0;
|
|
192
|
+
}
|
|
193
|
+
function getHslAnimationFromHsl(hsl, animationOptions, reduceFactor) {
|
|
194
|
+
const resColor = {
|
|
195
|
+
h: {
|
|
196
|
+
enable: false,
|
|
197
|
+
value: hsl.h
|
|
198
|
+
},
|
|
199
|
+
s: {
|
|
200
|
+
enable: false,
|
|
201
|
+
value: hsl.s
|
|
202
|
+
},
|
|
203
|
+
l: {
|
|
204
|
+
enable: false,
|
|
205
|
+
value: hsl.l
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
if (animationOptions) {
|
|
209
|
+
setColorAnimation(resColor.h, animationOptions.h, reduceFactor);
|
|
210
|
+
setColorAnimation(resColor.s, animationOptions.s, reduceFactor);
|
|
211
|
+
setColorAnimation(resColor.l, animationOptions.l, reduceFactor);
|
|
212
|
+
}
|
|
213
|
+
return resColor;
|
|
214
|
+
}
|
|
215
|
+
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
216
|
+
colorValue.enable = colorAnimation.enable;
|
|
217
|
+
if (colorValue.enable) {
|
|
218
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / percentDenominator * reduceFactor;
|
|
219
|
+
colorValue.decay = decayOffset - getRangeValue(colorAnimation.decay);
|
|
220
|
+
colorValue.status = AnimationStatus.increasing;
|
|
221
|
+
colorValue.loops = defaultLoops;
|
|
222
|
+
colorValue.maxLoops = getRangeValue(colorAnimation.count);
|
|
223
|
+
colorValue.time = defaultTime;
|
|
224
|
+
colorValue.delayTime = getRangeValue(colorAnimation.delay) * millisecondsToSeconds;
|
|
225
|
+
if (!colorAnimation.sync) {
|
|
226
|
+
colorValue.velocity *= getRandom();
|
|
227
|
+
colorValue.value *= getRandom();
|
|
228
|
+
}
|
|
229
|
+
colorValue.initialValue = colorValue.value;
|
|
230
|
+
colorValue.offset = setRangeValue(colorAnimation.offset);
|
|
231
|
+
} else {
|
|
232
|
+
colorValue.velocity = defaultVelocity;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function updateColorValue(data, range, decrease, delta) {
|
|
236
|
+
const minLoops = 0, minDelay = 0, identity2 = 1, minVelocity = 0, minOffset = 0, velocityFactor = 3.6;
|
|
237
|
+
if (!data || !data.enable || (data.maxLoops ?? minLoops) > minLoops && (data.loops ?? minLoops) > (data.maxLoops ?? minLoops)) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (!data.time) {
|
|
241
|
+
data.time = 0;
|
|
242
|
+
}
|
|
243
|
+
if ((data.delayTime ?? minDelay) > minDelay && data.time < (data.delayTime ?? minDelay)) {
|
|
244
|
+
data.time += delta.value;
|
|
245
|
+
}
|
|
246
|
+
if ((data.delayTime ?? minDelay) > minDelay && data.time < (data.delayTime ?? minDelay)) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const offset = data.offset ? randomInRange(data.offset) : minOffset, velocity = (data.velocity ?? minVelocity) * delta.factor + offset * velocityFactor, decay = data.decay ?? identity2, max = getRangeMax(range), min = getRangeMin(range);
|
|
250
|
+
if (!decrease || data.status === AnimationStatus.increasing) {
|
|
251
|
+
data.value += velocity;
|
|
252
|
+
if (data.value > max) {
|
|
253
|
+
if (!data.loops) {
|
|
254
|
+
data.loops = 0;
|
|
255
|
+
}
|
|
256
|
+
data.loops++;
|
|
257
|
+
if (decrease) {
|
|
258
|
+
data.status = AnimationStatus.decreasing;
|
|
259
|
+
} else {
|
|
260
|
+
data.value -= max;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
data.value -= velocity;
|
|
265
|
+
const minValue = 0;
|
|
266
|
+
if (data.value < minValue) {
|
|
267
|
+
if (!data.loops) {
|
|
268
|
+
data.loops = 0;
|
|
269
|
+
}
|
|
270
|
+
data.loops++;
|
|
271
|
+
data.status = AnimationStatus.increasing;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (data.velocity && decay !== identity2) {
|
|
275
|
+
data.velocity *= decay;
|
|
276
|
+
}
|
|
277
|
+
data.value = clamp(data.value, min, max);
|
|
278
|
+
}
|
|
279
|
+
function updateColor(color, delta) {
|
|
280
|
+
if (!color) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const { h, s, l } = color, ranges = {
|
|
284
|
+
h: { min: 0, max: 360 },
|
|
285
|
+
s: { min: 0, max: 100 },
|
|
286
|
+
l: { min: 0, max: 100 }
|
|
287
|
+
};
|
|
288
|
+
if (h) {
|
|
289
|
+
updateColorValue(h, ranges.h, false, delta);
|
|
290
|
+
}
|
|
291
|
+
if (s) {
|
|
292
|
+
updateColorValue(s, ranges.s, true, delta);
|
|
293
|
+
}
|
|
294
|
+
if (l) {
|
|
295
|
+
updateColorValue(l, ranges.l, true, delta);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export {
|
|
299
|
+
colorMix,
|
|
300
|
+
colorToRgb,
|
|
301
|
+
getHslAnimationFromHsl,
|
|
302
|
+
getHslFromAnimation,
|
|
303
|
+
getLinkColor,
|
|
304
|
+
getLinkRandomColor,
|
|
305
|
+
getRandomRgbColor,
|
|
306
|
+
getStyleFromHsl,
|
|
307
|
+
getStyleFromRgb,
|
|
308
|
+
hslToRgb,
|
|
309
|
+
hslaToRgba,
|
|
310
|
+
rangeColorToHsl,
|
|
311
|
+
rangeColorToRgb,
|
|
312
|
+
rgbToHsl,
|
|
313
|
+
stringToRgb,
|
|
314
|
+
updateColor,
|
|
315
|
+
updateColorValue
|
|
316
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { minIndex, deleteCount } from "../Core/Utils/Constants.js";
|
|
2
|
+
class EventDispatcher {
|
|
3
|
+
constructor() {
|
|
4
|
+
this._listeners = /* @__PURE__ */ new Map();
|
|
5
|
+
}
|
|
6
|
+
addEventListener(type, listener) {
|
|
7
|
+
this.removeEventListener(type, listener);
|
|
8
|
+
let arr = this._listeners.get(type);
|
|
9
|
+
if (!arr) {
|
|
10
|
+
arr = [];
|
|
11
|
+
this._listeners.set(type, arr);
|
|
12
|
+
}
|
|
13
|
+
arr.push(listener);
|
|
14
|
+
}
|
|
15
|
+
dispatchEvent(type, args) {
|
|
16
|
+
const listeners = this._listeners.get(type);
|
|
17
|
+
listeners == null ? void 0 : listeners.forEach((handler) => handler(args));
|
|
18
|
+
}
|
|
19
|
+
hasEventListener(type) {
|
|
20
|
+
return !!this._listeners.get(type);
|
|
21
|
+
}
|
|
22
|
+
removeAllEventListeners(type) {
|
|
23
|
+
if (!type) {
|
|
24
|
+
this._listeners = /* @__PURE__ */ new Map();
|
|
25
|
+
} else {
|
|
26
|
+
this._listeners.delete(type);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
removeEventListener(type, listener) {
|
|
30
|
+
const arr = this._listeners.get(type);
|
|
31
|
+
if (!arr) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const length = arr.length, idx = arr.indexOf(listener);
|
|
35
|
+
if (idx < minIndex) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (length === deleteCount) {
|
|
39
|
+
this._listeners.delete(type);
|
|
40
|
+
} else {
|
|
41
|
+
arr.splice(idx, deleteCount);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
EventDispatcher
|
|
47
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { MoveDirection } from "../Enums/Directions/MoveDirection.js";
|
|
2
|
+
import { doublePI, threeQuarter, half, quarter, empty, percentDenominator, double } from "../Core/Utils/Constants.js";
|
|
3
|
+
import { Vector } from "../Core/Utils/Vectors.js";
|
|
4
|
+
import { isNumber } from "./TypeUtils.js";
|
|
5
|
+
let _random = Math.random;
|
|
6
|
+
const _animationLoop = {
|
|
7
|
+
nextFrame: (cb) => requestAnimationFrame(cb),
|
|
8
|
+
cancel: (idx) => cancelAnimationFrame(idx)
|
|
9
|
+
};
|
|
10
|
+
function getRandom() {
|
|
11
|
+
const min = 0, max = 1;
|
|
12
|
+
return clamp(_random(), min, max - Number.EPSILON);
|
|
13
|
+
}
|
|
14
|
+
function animate(fn) {
|
|
15
|
+
return _animationLoop.nextFrame(fn);
|
|
16
|
+
}
|
|
17
|
+
function cancelAnimation(handle) {
|
|
18
|
+
_animationLoop.cancel(handle);
|
|
19
|
+
}
|
|
20
|
+
function clamp(num, min, max) {
|
|
21
|
+
return Math.min(Math.max(num, min), max);
|
|
22
|
+
}
|
|
23
|
+
function mix(comp1, comp2, weight1, weight2) {
|
|
24
|
+
return Math.floor((comp1 * weight1 + comp2 * weight2) / (weight1 + weight2));
|
|
25
|
+
}
|
|
26
|
+
function randomInRange(r) {
|
|
27
|
+
const max = getRangeMax(r), minOffset = 0;
|
|
28
|
+
let min = getRangeMin(r);
|
|
29
|
+
if (max === min) {
|
|
30
|
+
min = minOffset;
|
|
31
|
+
}
|
|
32
|
+
return getRandom() * (max - min) + min;
|
|
33
|
+
}
|
|
34
|
+
function getRangeValue(value) {
|
|
35
|
+
return isNumber(value) ? value : randomInRange(value);
|
|
36
|
+
}
|
|
37
|
+
function getRangeMin(value) {
|
|
38
|
+
return isNumber(value) ? value : value.min;
|
|
39
|
+
}
|
|
40
|
+
function getRangeMax(value) {
|
|
41
|
+
return isNumber(value) ? value : value.max;
|
|
42
|
+
}
|
|
43
|
+
function setRangeValue(source, value) {
|
|
44
|
+
if (source === value || value === void 0 && isNumber(source)) {
|
|
45
|
+
return source;
|
|
46
|
+
}
|
|
47
|
+
const min = getRangeMin(source), max = getRangeMax(source);
|
|
48
|
+
return value !== void 0 ? {
|
|
49
|
+
min: Math.min(min, value),
|
|
50
|
+
max: Math.max(max, value)
|
|
51
|
+
} : setRangeValue(min, max);
|
|
52
|
+
}
|
|
53
|
+
function getDistances(pointA, pointB) {
|
|
54
|
+
const dx = pointA.x - pointB.x, dy = pointA.y - pointB.y, squareExp = 2;
|
|
55
|
+
return { dx, dy, distance: Math.sqrt(dx ** squareExp + dy ** squareExp) };
|
|
56
|
+
}
|
|
57
|
+
function getDistance(pointA, pointB) {
|
|
58
|
+
return getDistances(pointA, pointB).distance;
|
|
59
|
+
}
|
|
60
|
+
function degToRad(degrees) {
|
|
61
|
+
const PIDeg = 180;
|
|
62
|
+
return degrees * Math.PI / PIDeg;
|
|
63
|
+
}
|
|
64
|
+
function getParticleDirectionAngle(direction, position, center) {
|
|
65
|
+
if (isNumber(direction)) {
|
|
66
|
+
return degToRad(direction);
|
|
67
|
+
}
|
|
68
|
+
switch (direction) {
|
|
69
|
+
case MoveDirection.top:
|
|
70
|
+
return -Math.PI * half;
|
|
71
|
+
case MoveDirection.topRight:
|
|
72
|
+
return -Math.PI * quarter;
|
|
73
|
+
case MoveDirection.right:
|
|
74
|
+
return empty;
|
|
75
|
+
case MoveDirection.bottomRight:
|
|
76
|
+
return Math.PI * quarter;
|
|
77
|
+
case MoveDirection.bottom:
|
|
78
|
+
return Math.PI * half;
|
|
79
|
+
case MoveDirection.bottomLeft:
|
|
80
|
+
return Math.PI * threeQuarter;
|
|
81
|
+
case MoveDirection.left:
|
|
82
|
+
return Math.PI;
|
|
83
|
+
case MoveDirection.topLeft:
|
|
84
|
+
return -Math.PI * threeQuarter;
|
|
85
|
+
case MoveDirection.inside:
|
|
86
|
+
return Math.atan2(center.y - position.y, center.x - position.x);
|
|
87
|
+
case MoveDirection.outside:
|
|
88
|
+
return Math.atan2(position.y - center.y, position.x - center.x);
|
|
89
|
+
default:
|
|
90
|
+
return getRandom() * doublePI;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function getParticleBaseVelocity(direction) {
|
|
94
|
+
const baseVelocity = Vector.origin;
|
|
95
|
+
baseVelocity.length = 1;
|
|
96
|
+
baseVelocity.angle = direction;
|
|
97
|
+
return baseVelocity;
|
|
98
|
+
}
|
|
99
|
+
function collisionVelocity(v1, v2, m1, m2) {
|
|
100
|
+
return Vector.create(v1.x * (m1 - m2) / (m1 + m2) + v2.x * double * m2 / (m1 + m2), v1.y);
|
|
101
|
+
}
|
|
102
|
+
function calcExactPositionOrRandomFromSize(data) {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
return {
|
|
105
|
+
x: ((_a = data.position) == null ? void 0 : _a.x) ?? getRandom() * data.size.width,
|
|
106
|
+
y: ((_b = data.position) == null ? void 0 : _b.y) ?? getRandom() * data.size.height
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function parseAlpha(input) {
|
|
110
|
+
const defaultAlpha = 1;
|
|
111
|
+
if (!input) {
|
|
112
|
+
return defaultAlpha;
|
|
113
|
+
}
|
|
114
|
+
return input.endsWith("%") ? parseFloat(input) / percentDenominator : parseFloat(input);
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
animate,
|
|
118
|
+
calcExactPositionOrRandomFromSize,
|
|
119
|
+
cancelAnimation,
|
|
120
|
+
clamp,
|
|
121
|
+
collisionVelocity,
|
|
122
|
+
degToRad,
|
|
123
|
+
getDistance,
|
|
124
|
+
getDistances,
|
|
125
|
+
getParticleBaseVelocity,
|
|
126
|
+
getParticleDirectionAngle,
|
|
127
|
+
getRandom,
|
|
128
|
+
getRangeMax,
|
|
129
|
+
getRangeMin,
|
|
130
|
+
getRangeValue,
|
|
131
|
+
mix,
|
|
132
|
+
parseAlpha,
|
|
133
|
+
randomInRange,
|
|
134
|
+
setRangeValue
|
|
135
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ParticlesOptions } from "../Options/Classes/Particles/ParticlesOptions.js";
|
|
2
|
+
function loadOptions(options, ...sourceOptionsArr) {
|
|
3
|
+
for (const sourceOptions of sourceOptionsArr) {
|
|
4
|
+
options.load(sourceOptions);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
function loadParticlesOptions(engine, container, ...sourceOptionsArr) {
|
|
8
|
+
const options = new ParticlesOptions(engine, container);
|
|
9
|
+
loadOptions(options, ...sourceOptionsArr);
|
|
10
|
+
return options;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
loadOptions,
|
|
14
|
+
loadParticlesOptions
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function isBoolean(arg) {
|
|
2
|
+
return typeof arg === "boolean";
|
|
3
|
+
}
|
|
4
|
+
function isString(arg) {
|
|
5
|
+
return typeof arg === "string";
|
|
6
|
+
}
|
|
7
|
+
function isNumber(arg) {
|
|
8
|
+
return typeof arg === "number";
|
|
9
|
+
}
|
|
10
|
+
function isObject(arg) {
|
|
11
|
+
return typeof arg === "object" && arg !== null;
|
|
12
|
+
}
|
|
13
|
+
function isArray(arg) {
|
|
14
|
+
return Array.isArray(arg);
|
|
15
|
+
}
|
|
16
|
+
function isNull(arg) {
|
|
17
|
+
return arg === null || arg === void 0;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
isArray,
|
|
21
|
+
isBoolean,
|
|
22
|
+
isNull,
|
|
23
|
+
isNumber,
|
|
24
|
+
isObject,
|
|
25
|
+
isString
|
|
26
|
+
};
|