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,160 @@
|
|
|
1
|
+
import { Repulse } from "./Options/Classes/Repulse.js";
|
|
2
|
+
import { ExternalInteractorBase } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/ExternalInteractorBase.js";
|
|
3
|
+
import { Circle, Rectangle } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Ranges.js";
|
|
4
|
+
import { getDistances, clamp } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js";
|
|
5
|
+
import { Vector } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Vectors.js";
|
|
6
|
+
import { DivType } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Types/DivType.js";
|
|
7
|
+
import { divMode, isInArray, divModeExecute, isDivModeEnabled } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/Utils.js";
|
|
8
|
+
import { millisecondsToSeconds, mouseMoveEvent } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js";
|
|
9
|
+
const repulseMode = "repulse", minDistance = 0, repulseRadiusFactor = 6, repulseRadiusPower = 3, squarePower = 2, minRadius = 0, minSpeed = 0, easingOffset = 1, half = 0.5;
|
|
10
|
+
class Repulser extends ExternalInteractorBase {
|
|
11
|
+
constructor(engine, container) {
|
|
12
|
+
super(container);
|
|
13
|
+
this._clickRepulse = () => {
|
|
14
|
+
const container2 = this.container, repulseOptions = container2.actualOptions.interactivity.modes.repulse;
|
|
15
|
+
if (!repulseOptions) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const repulse = container2.repulse ?? { particles: [] };
|
|
19
|
+
if (!repulse.finish) {
|
|
20
|
+
if (!repulse.count) {
|
|
21
|
+
repulse.count = 0;
|
|
22
|
+
}
|
|
23
|
+
repulse.count++;
|
|
24
|
+
if (repulse.count === container2.particles.count) {
|
|
25
|
+
repulse.finish = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (repulse.clicking) {
|
|
29
|
+
const repulseDistance = container2.retina.repulseModeDistance;
|
|
30
|
+
if (!repulseDistance || repulseDistance < minDistance) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const repulseRadius = Math.pow(repulseDistance / repulseRadiusFactor, repulseRadiusPower), mouseClickPos = container2.interactivity.mouse.clickPosition;
|
|
34
|
+
if (mouseClickPos === void 0) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const range = new Circle(mouseClickPos.x, mouseClickPos.y, repulseRadius), query = container2.particles.quadTree.query(range, (p) => this.isEnabled(p));
|
|
38
|
+
for (const particle of query) {
|
|
39
|
+
const { dx, dy, distance } = getDistances(mouseClickPos, particle.position), d = distance ** squarePower, velocity = repulseOptions.speed, force = -repulseRadius * velocity / d;
|
|
40
|
+
if (d <= repulseRadius) {
|
|
41
|
+
repulse.particles.push(particle);
|
|
42
|
+
const vect = Vector.create(dx, dy);
|
|
43
|
+
vect.length = force;
|
|
44
|
+
particle.velocity.setTo(vect);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
} else if (repulse.clicking === false) {
|
|
48
|
+
for (const particle of repulse.particles) {
|
|
49
|
+
particle.velocity.setTo(particle.initialVelocity);
|
|
50
|
+
}
|
|
51
|
+
repulse.particles = [];
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
this._hoverRepulse = () => {
|
|
55
|
+
const container2 = this.container, mousePos = container2.interactivity.mouse.position, repulseRadius = container2.retina.repulseModeDistance;
|
|
56
|
+
if (!repulseRadius || repulseRadius < minRadius || !mousePos) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this._processRepulse(mousePos, repulseRadius, new Circle(mousePos.x, mousePos.y, repulseRadius));
|
|
60
|
+
};
|
|
61
|
+
this._processRepulse = (position, repulseRadius, area, divRepulse) => {
|
|
62
|
+
const container2 = this.container, query = container2.particles.quadTree.query(area, (p) => this.isEnabled(p)), repulseOptions = container2.actualOptions.interactivity.modes.repulse;
|
|
63
|
+
if (!repulseOptions) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const { easing, speed, factor, maxSpeed } = repulseOptions, easingFunc = this._engine.getEasing(easing), velocity = ((divRepulse == null ? void 0 : divRepulse.speed) ?? speed) * factor;
|
|
67
|
+
for (const particle of query) {
|
|
68
|
+
const { dx, dy, distance } = getDistances(particle.position, position), repulseFactor = clamp(easingFunc(easingOffset - distance / repulseRadius) * velocity, minSpeed, maxSpeed), normVec = Vector.create(!distance ? velocity : dx / distance * repulseFactor, !distance ? velocity : dy / distance * repulseFactor);
|
|
69
|
+
particle.position.addTo(normVec);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
this._singleSelectorRepulse = (selector, div) => {
|
|
73
|
+
const container2 = this.container, repulse = container2.actualOptions.interactivity.modes.repulse;
|
|
74
|
+
if (!repulse) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const query = document.querySelectorAll(selector);
|
|
78
|
+
if (!query.length) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
query.forEach((item) => {
|
|
82
|
+
const elem = item, pxRatio = container2.retina.pixelRatio, pos = {
|
|
83
|
+
x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,
|
|
84
|
+
y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio
|
|
85
|
+
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === DivType.circle ? new Circle(pos.x, pos.y, repulseRadius) : new Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), divs = repulse.divs, divRepulse = divMode(divs, elem);
|
|
86
|
+
this._processRepulse(pos, repulseRadius, area, divRepulse);
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
this._engine = engine;
|
|
90
|
+
if (!container.repulse) {
|
|
91
|
+
container.repulse = { particles: [] };
|
|
92
|
+
}
|
|
93
|
+
this.handleClickMode = (mode) => {
|
|
94
|
+
const options = this.container.actualOptions, repulseOpts = options.interactivity.modes.repulse;
|
|
95
|
+
if (!repulseOpts || mode !== repulseMode) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!container.repulse) {
|
|
99
|
+
container.repulse = { particles: [] };
|
|
100
|
+
}
|
|
101
|
+
const repulse = container.repulse;
|
|
102
|
+
repulse.clicking = true;
|
|
103
|
+
repulse.count = 0;
|
|
104
|
+
for (const particle of container.repulse.particles) {
|
|
105
|
+
if (!this.isEnabled(particle)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
particle.velocity.setTo(particle.initialVelocity);
|
|
109
|
+
}
|
|
110
|
+
repulse.particles = [];
|
|
111
|
+
repulse.finish = false;
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
if (container.destroyed) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
repulse.clicking = false;
|
|
117
|
+
}, repulseOpts.duration * millisecondsToSeconds);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
clear() {
|
|
121
|
+
}
|
|
122
|
+
init() {
|
|
123
|
+
const container = this.container, repulse = container.actualOptions.interactivity.modes.repulse;
|
|
124
|
+
if (!repulse) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
container.retina.repulseModeDistance = repulse.distance * container.retina.pixelRatio;
|
|
128
|
+
}
|
|
129
|
+
interact() {
|
|
130
|
+
const container = this.container, options = container.actualOptions, mouseMoveStatus = container.interactivity.status === mouseMoveEvent, events = options.interactivity.events, hover = events.onHover, hoverEnabled = hover.enable, hoverMode = hover.mode, click = events.onClick, clickEnabled = click.enable, clickMode = click.mode, divs = events.onDiv;
|
|
131
|
+
if (mouseMoveStatus && hoverEnabled && isInArray(repulseMode, hoverMode)) {
|
|
132
|
+
this._hoverRepulse();
|
|
133
|
+
} else if (clickEnabled && isInArray(repulseMode, clickMode)) {
|
|
134
|
+
this._clickRepulse();
|
|
135
|
+
} else {
|
|
136
|
+
divModeExecute(repulseMode, divs, (selector, div) => this._singleSelectorRepulse(selector, div));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
isEnabled(particle) {
|
|
140
|
+
const container = this.container, options = container.actualOptions, mouse = container.interactivity.mouse, events = ((particle == null ? void 0 : particle.interactivity) ?? options.interactivity).events, divs = events.onDiv, hover = events.onHover, click = events.onClick, divRepulse = isDivModeEnabled(repulseMode, divs);
|
|
141
|
+
if (!(divRepulse || hover.enable && !!mouse.position || click.enable && mouse.clickPosition)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
const hoverMode = hover.mode, clickMode = click.mode;
|
|
145
|
+
return isInArray(repulseMode, hoverMode) || isInArray(repulseMode, clickMode) || divRepulse;
|
|
146
|
+
}
|
|
147
|
+
loadModeOptions(options, ...sources) {
|
|
148
|
+
if (!options.repulse) {
|
|
149
|
+
options.repulse = new Repulse();
|
|
150
|
+
}
|
|
151
|
+
for (const source of sources) {
|
|
152
|
+
options.repulse.load(source == null ? void 0 : source.repulse);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
reset() {
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export {
|
|
159
|
+
Repulser
|
|
160
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Repulser } from "./Repulser.js";
|
|
2
|
+
async function loadExternalRepulseInteraction(engine, refresh = true) {
|
|
3
|
+
engine.checkVersion("3.9.1");
|
|
4
|
+
await engine.addInteractor("externalRepulse", (container) => {
|
|
5
|
+
return Promise.resolve(new Repulser(engine, container));
|
|
6
|
+
}, refresh);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
loadExternalRepulseInteraction
|
|
10
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isNull } from "../../../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/TypeUtils.js";
|
|
2
|
+
class Slow {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.factor = 3;
|
|
5
|
+
this.radius = 200;
|
|
6
|
+
}
|
|
7
|
+
load(data) {
|
|
8
|
+
if (isNull(data)) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (data.factor !== void 0) {
|
|
12
|
+
this.factor = data.factor;
|
|
13
|
+
}
|
|
14
|
+
if (data.radius !== void 0) {
|
|
15
|
+
this.radius = data.radius;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
Slow
|
|
21
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Slow } from "./Options/Classes/Slow.js";
|
|
2
|
+
import { ExternalInteractorBase } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/ExternalInteractorBase.js";
|
|
3
|
+
import { isInArray } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/Utils.js";
|
|
4
|
+
import { getDistance } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js";
|
|
5
|
+
const slowMode = "slow", minRadius = 0;
|
|
6
|
+
class Slower extends ExternalInteractorBase {
|
|
7
|
+
constructor(container) {
|
|
8
|
+
super(container);
|
|
9
|
+
}
|
|
10
|
+
clear(particle, delta, force) {
|
|
11
|
+
if (particle.slow.inRange && !force) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
particle.slow.factor = 1;
|
|
15
|
+
}
|
|
16
|
+
init() {
|
|
17
|
+
const container = this.container, slow = container.actualOptions.interactivity.modes.slow;
|
|
18
|
+
if (!slow) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
container.retina.slowModeRadius = slow.radius * container.retina.pixelRatio;
|
|
22
|
+
}
|
|
23
|
+
interact() {
|
|
24
|
+
}
|
|
25
|
+
isEnabled(particle) {
|
|
26
|
+
const container = this.container, mouse = container.interactivity.mouse, events = ((particle == null ? void 0 : particle.interactivity) ?? container.actualOptions.interactivity).events;
|
|
27
|
+
return events.onHover.enable && !!mouse.position && isInArray(slowMode, events.onHover.mode);
|
|
28
|
+
}
|
|
29
|
+
loadModeOptions(options, ...sources) {
|
|
30
|
+
if (!options.slow) {
|
|
31
|
+
options.slow = new Slow();
|
|
32
|
+
}
|
|
33
|
+
for (const source of sources) {
|
|
34
|
+
options.slow.load(source == null ? void 0 : source.slow);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
reset(particle) {
|
|
38
|
+
particle.slow.inRange = false;
|
|
39
|
+
const container = this.container, options = container.actualOptions, mousePos = container.interactivity.mouse.position, radius = container.retina.slowModeRadius, slowOptions = options.interactivity.modes.slow;
|
|
40
|
+
if (!slowOptions || !radius || radius < minRadius || !mousePos) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const particlePos = particle.getPosition(), dist = getDistance(mousePos, particlePos), proximityFactor = dist / radius, slowFactor = slowOptions.factor, { slow } = particle;
|
|
44
|
+
if (dist > radius) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
slow.inRange = true;
|
|
48
|
+
slow.factor = proximityFactor / slowFactor;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
Slower
|
|
53
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Slower } from "./Slower.js";
|
|
2
|
+
async function loadExternalSlowInteraction(engine, refresh = true) {
|
|
3
|
+
engine.checkVersion("3.9.1");
|
|
4
|
+
await engine.addInteractor("externalSlow", (container) => {
|
|
5
|
+
return Promise.resolve(new Slower(container));
|
|
6
|
+
}, refresh);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
loadExternalSlowInteraction
|
|
10
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ParticlesInteractorBase } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/ParticlesInteractorBase.js";
|
|
2
|
+
import { getRangeValue, getDistances } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js";
|
|
3
|
+
const attractFactor = 1e3, identity = 1;
|
|
4
|
+
class Attractor extends ParticlesInteractorBase {
|
|
5
|
+
constructor(container) {
|
|
6
|
+
super(container);
|
|
7
|
+
}
|
|
8
|
+
clear() {
|
|
9
|
+
}
|
|
10
|
+
init() {
|
|
11
|
+
}
|
|
12
|
+
interact(p1) {
|
|
13
|
+
const container = this.container;
|
|
14
|
+
if (p1.attractDistance === void 0) {
|
|
15
|
+
p1.attractDistance = getRangeValue(p1.options.move.attract.distance) * container.retina.pixelRatio;
|
|
16
|
+
}
|
|
17
|
+
const distance = p1.attractDistance, pos1 = p1.getPosition(), query = container.particles.quadTree.queryCircle(pos1, distance);
|
|
18
|
+
for (const p2 of query) {
|
|
19
|
+
if (p1 === p2 || !p2.options.move.attract.enable || p2.destroyed || p2.spawning) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const pos2 = p2.getPosition(), { dx, dy } = getDistances(pos1, pos2), rotate = p1.options.move.attract.rotate, ax = dx / (rotate.x * attractFactor), ay = dy / (rotate.y * attractFactor), p1Factor = p2.size.value / p1.size.value, p2Factor = identity / p1Factor;
|
|
23
|
+
p1.velocity.x -= ax * p1Factor;
|
|
24
|
+
p1.velocity.y -= ay * p1Factor;
|
|
25
|
+
p2.velocity.x += ax * p2Factor;
|
|
26
|
+
p2.velocity.y += ay * p2Factor;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
isEnabled(particle) {
|
|
30
|
+
return particle.options.move.attract.enable;
|
|
31
|
+
}
|
|
32
|
+
reset() {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
Attractor
|
|
37
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Attractor } from "./Attractor.js";
|
|
2
|
+
async function loadParticlesAttractInteraction(engine, refresh = true) {
|
|
3
|
+
engine.checkVersion("3.9.1");
|
|
4
|
+
await engine.addInteractor("particlesAttract", (container) => {
|
|
5
|
+
return Promise.resolve(new Attractor(container));
|
|
6
|
+
}, refresh);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
loadParticlesAttractInteraction
|
|
10
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { clamp } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js";
|
|
2
|
+
const half = 0.5, absorbFactor = 10, minAbsorbFactor = 0;
|
|
3
|
+
function updateAbsorb(p1, r1, p2, r2, delta, pixelRatio) {
|
|
4
|
+
const factor = clamp(p1.options.collisions.absorb.speed * delta.factor / absorbFactor, minAbsorbFactor, r2);
|
|
5
|
+
p1.size.value += factor * half;
|
|
6
|
+
p2.size.value -= factor;
|
|
7
|
+
if (r2 <= pixelRatio) {
|
|
8
|
+
p2.size.value = 0;
|
|
9
|
+
p2.destroy();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function absorb(p1, p2, delta, pixelRatio) {
|
|
13
|
+
const r1 = p1.getRadius(), r2 = p2.getRadius();
|
|
14
|
+
if (r1 === void 0 && r2 !== void 0) {
|
|
15
|
+
p1.destroy();
|
|
16
|
+
} else if (r1 !== void 0 && r2 === void 0) {
|
|
17
|
+
p2.destroy();
|
|
18
|
+
} else if (r1 !== void 0 && r2 !== void 0) {
|
|
19
|
+
if (r1 >= r2) {
|
|
20
|
+
updateAbsorb(p1, r1, p2, r2, delta, pixelRatio);
|
|
21
|
+
} else {
|
|
22
|
+
updateAbsorb(p2, r2, p1, r1, delta, pixelRatio);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
absorb
|
|
28
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { circleBounce, circleBounceDataFromParticle } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/Utils.js";
|
|
2
|
+
import { getRangeValue } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js";
|
|
3
|
+
const fixBounceSpeed = (p) => {
|
|
4
|
+
if (p.collisionMaxSpeed === void 0) {
|
|
5
|
+
p.collisionMaxSpeed = getRangeValue(p.options.collisions.maxSpeed);
|
|
6
|
+
}
|
|
7
|
+
if (p.velocity.length > p.collisionMaxSpeed) {
|
|
8
|
+
p.velocity.length = p.collisionMaxSpeed;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
function bounce(p1, p2) {
|
|
12
|
+
circleBounce(circleBounceDataFromParticle(p1), circleBounceDataFromParticle(p2));
|
|
13
|
+
fixBounceSpeed(p1);
|
|
14
|
+
fixBounceSpeed(p2);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
bounce
|
|
18
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { resolveCollision } from "./ResolveCollision.js";
|
|
2
|
+
import { ParticlesInteractorBase } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/ParticlesInteractorBase.js";
|
|
3
|
+
import { getDistance } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js";
|
|
4
|
+
const double = 2;
|
|
5
|
+
class Collider extends ParticlesInteractorBase {
|
|
6
|
+
constructor(container) {
|
|
7
|
+
super(container);
|
|
8
|
+
}
|
|
9
|
+
clear() {
|
|
10
|
+
}
|
|
11
|
+
init() {
|
|
12
|
+
}
|
|
13
|
+
interact(p1, delta) {
|
|
14
|
+
if (p1.destroyed || p1.spawning) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const container = this.container, pos1 = p1.getPosition(), radius1 = p1.getRadius(), query = container.particles.quadTree.queryCircle(pos1, radius1 * double);
|
|
18
|
+
for (const p2 of query) {
|
|
19
|
+
if (p1 === p2 || !p2.options.collisions.enable || p1.options.collisions.mode !== p2.options.collisions.mode || p2.destroyed || p2.spawning) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const pos2 = p2.getPosition(), radius2 = p2.getRadius();
|
|
23
|
+
if (Math.abs(Math.round(pos1.z) - Math.round(pos2.z)) > radius1 + radius2) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const dist = getDistance(pos1, pos2), distP = radius1 + radius2;
|
|
27
|
+
if (dist > distP) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
resolveCollision(p1, p2, delta, container.retina.pixelRatio);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
isEnabled(particle) {
|
|
34
|
+
return particle.options.collisions.enable;
|
|
35
|
+
}
|
|
36
|
+
reset() {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
Collider
|
|
41
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { bounce } from "./Bounce.js";
|
|
2
|
+
function destroy(p1, p2) {
|
|
3
|
+
if (!p1.unbreakable && !p2.unbreakable) {
|
|
4
|
+
bounce(p1, p2);
|
|
5
|
+
}
|
|
6
|
+
if (p1.getRadius() === void 0 && p2.getRadius() !== void 0) {
|
|
7
|
+
p1.destroy();
|
|
8
|
+
} else if (p1.getRadius() !== void 0 && p2.getRadius() === void 0) {
|
|
9
|
+
p2.destroy();
|
|
10
|
+
} else if (p1.getRadius() !== void 0 && p2.getRadius() !== void 0) {
|
|
11
|
+
const deleteP = p1.getRadius() >= p2.getRadius() ? p2 : p1;
|
|
12
|
+
deleteP.destroy();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
destroy
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { absorb } from "./Absorb.js";
|
|
2
|
+
import { bounce } from "./Bounce.js";
|
|
3
|
+
import { destroy } from "./Destroy.js";
|
|
4
|
+
import { CollisionMode } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Enums/Modes/CollisionMode.js";
|
|
5
|
+
function resolveCollision(p1, p2, delta, pixelRatio) {
|
|
6
|
+
switch (p1.options.collisions.mode) {
|
|
7
|
+
case CollisionMode.absorb: {
|
|
8
|
+
absorb(p1, p2, delta, pixelRatio);
|
|
9
|
+
break;
|
|
10
|
+
}
|
|
11
|
+
case CollisionMode.bounce: {
|
|
12
|
+
bounce(p1, p2);
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
case CollisionMode.destroy: {
|
|
16
|
+
destroy(p1, p2);
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
resolveCollision
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Collider } from "./Collider.js";
|
|
2
|
+
async function loadParticlesCollisionsInteraction(engine, refresh = true) {
|
|
3
|
+
engine.checkVersion("3.9.1");
|
|
4
|
+
await engine.addInteractor("particlesCollisions", (container) => {
|
|
5
|
+
return Promise.resolve(new Collider(container));
|
|
6
|
+
}, refresh);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
loadParticlesCollisionsInteraction
|
|
10
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Circle, Rectangle } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Core/Utils/Ranges.js";
|
|
2
|
+
const double = 2;
|
|
3
|
+
class CircleWarp extends Circle {
|
|
4
|
+
constructor(x, y, radius, canvasSize) {
|
|
5
|
+
super(x, y, radius);
|
|
6
|
+
this.canvasSize = canvasSize;
|
|
7
|
+
this.canvasSize = { ...canvasSize };
|
|
8
|
+
}
|
|
9
|
+
contains(point) {
|
|
10
|
+
const { width, height } = this.canvasSize, { x, y } = point;
|
|
11
|
+
return super.contains(point) || super.contains({ x: x - width, y }) || super.contains({ x: x - width, y: y - height }) || super.contains({ x, y: y - height });
|
|
12
|
+
}
|
|
13
|
+
intersects(range) {
|
|
14
|
+
if (super.intersects(range)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
const rect = range, circle = range, newPos = {
|
|
18
|
+
x: range.position.x - this.canvasSize.width,
|
|
19
|
+
y: range.position.y - this.canvasSize.height
|
|
20
|
+
};
|
|
21
|
+
if (circle.radius !== void 0) {
|
|
22
|
+
const biggerCircle = new Circle(newPos.x, newPos.y, circle.radius * double);
|
|
23
|
+
return super.intersects(biggerCircle);
|
|
24
|
+
} else if (rect.size !== void 0) {
|
|
25
|
+
const rectSW = new Rectangle(newPos.x, newPos.y, rect.size.width * double, rect.size.height * double);
|
|
26
|
+
return super.intersects(rectSW);
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
CircleWarp
|
|
33
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { drawLinkLine, drawLinkTriangle, setLinkFrequency } from "./Utils.js";
|
|
2
|
+
import { rangeColorToRgb, getLinkColor } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/ColorUtils.js";
|
|
3
|
+
import { getRangeValue, getDistance, getRandom } from "../../../../../@tsparticles_engine@3.9.1/node_modules/@tsparticles/engine/browser/Utils/NumberUtils.js";
|
|
4
|
+
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5, maxFrequency = 1;
|
|
5
|
+
class LinkInstance {
|
|
6
|
+
constructor(container, engine) {
|
|
7
|
+
this._drawLinkLine = (p1, link) => {
|
|
8
|
+
const p1LinksOptions = p1.options.links;
|
|
9
|
+
if (!(p1LinksOptions == null ? void 0 : p1LinksOptions.enable)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const container2 = this._container, options = container2.actualOptions, p2 = link.destination, pos1 = p1.getPosition(), pos2 = p2.getPosition();
|
|
13
|
+
let opacity = link.opacity;
|
|
14
|
+
container2.canvas.draw((ctx) => {
|
|
15
|
+
var _a;
|
|
16
|
+
let colorLine;
|
|
17
|
+
const twinkle = (_a = p1.options.twinkle) == null ? void 0 : _a.lines;
|
|
18
|
+
if (twinkle == null ? void 0 : twinkle.enable) {
|
|
19
|
+
const twinkleFreq = twinkle.frequency, twinkleRgb = rangeColorToRgb(this._engine, twinkle.color), twinkling = getRandom() < twinkleFreq;
|
|
20
|
+
if (twinkling && twinkleRgb) {
|
|
21
|
+
colorLine = twinkleRgb;
|
|
22
|
+
opacity = getRangeValue(twinkle.opacity);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (!colorLine) {
|
|
26
|
+
const linkColor = p1LinksOptions.id !== void 0 ? container2.particles.linksColors.get(p1LinksOptions.id) : container2.particles.linksColor;
|
|
27
|
+
colorLine = getLinkColor(p1, p2, linkColor);
|
|
28
|
+
}
|
|
29
|
+
if (!colorLine) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const width = p1.retina.linksWidth ?? minWidth, maxDistance = p1.retina.linksDistance ?? minDistance, { backgroundMask } = options;
|
|
33
|
+
drawLinkLine({
|
|
34
|
+
context: ctx,
|
|
35
|
+
width,
|
|
36
|
+
begin: pos1,
|
|
37
|
+
end: pos2,
|
|
38
|
+
engine: this._engine,
|
|
39
|
+
maxDistance,
|
|
40
|
+
canvasSize: container2.canvas.size,
|
|
41
|
+
links: p1LinksOptions,
|
|
42
|
+
backgroundMask,
|
|
43
|
+
colorLine,
|
|
44
|
+
opacity
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
this._drawLinkTriangle = (p1, link1, link2) => {
|
|
49
|
+
const linksOptions = p1.options.links;
|
|
50
|
+
if (!(linksOptions == null ? void 0 : linksOptions.enable)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const triangleOptions = linksOptions.triangles;
|
|
54
|
+
if (!triangleOptions.enable) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const container2 = this._container, options = container2.actualOptions, p2 = link1.destination, p3 = link2.destination, opacityTriangle = triangleOptions.opacity ?? (link1.opacity + link2.opacity) * half;
|
|
58
|
+
if (opacityTriangle <= minOpacity) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
container2.canvas.draw((ctx) => {
|
|
62
|
+
const pos1 = p1.getPosition(), pos2 = p2.getPosition(), pos3 = p3.getPosition(), linksDistance = p1.retina.linksDistance ?? minDistance;
|
|
63
|
+
if (getDistance(pos1, pos2) > linksDistance || getDistance(pos3, pos2) > linksDistance || getDistance(pos3, pos1) > linksDistance) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
let colorTriangle = rangeColorToRgb(this._engine, triangleOptions.color);
|
|
67
|
+
if (!colorTriangle) {
|
|
68
|
+
const linkColor = linksOptions.id !== void 0 ? container2.particles.linksColors.get(linksOptions.id) : container2.particles.linksColor;
|
|
69
|
+
colorTriangle = getLinkColor(p1, p2, linkColor);
|
|
70
|
+
}
|
|
71
|
+
if (!colorTriangle) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
drawLinkTriangle({
|
|
75
|
+
context: ctx,
|
|
76
|
+
pos1,
|
|
77
|
+
pos2,
|
|
78
|
+
pos3,
|
|
79
|
+
backgroundMask: options.backgroundMask,
|
|
80
|
+
colorTriangle,
|
|
81
|
+
opacityTriangle
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
this._drawTriangles = (options, p1, link, p1Links) => {
|
|
86
|
+
var _a, _b, _c;
|
|
87
|
+
const p2 = link.destination;
|
|
88
|
+
if (!(((_a = options.links) == null ? void 0 : _a.triangles.enable) && ((_b = p2.options.links) == null ? void 0 : _b.triangles.enable))) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const vertices = (_c = p2.links) == null ? void 0 : _c.filter((t) => {
|
|
92
|
+
const linkFreq = this._getLinkFrequency(p2, t.destination), minCount = 0;
|
|
93
|
+
return p2.options.links && linkFreq <= p2.options.links.frequency && p1Links.findIndex((l) => l.destination === t.destination) >= minCount;
|
|
94
|
+
});
|
|
95
|
+
if (!(vertices == null ? void 0 : vertices.length)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
for (const vertex of vertices) {
|
|
99
|
+
const p3 = vertex.destination, triangleFreq = this._getTriangleFrequency(p1, p2, p3);
|
|
100
|
+
if (triangleFreq > options.links.triangles.frequency) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
this._drawLinkTriangle(p1, link, vertex);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
this._getLinkFrequency = (p1, p2) => {
|
|
107
|
+
return setLinkFrequency([p1, p2], this._freqs.links);
|
|
108
|
+
};
|
|
109
|
+
this._getTriangleFrequency = (p1, p2, p3) => {
|
|
110
|
+
return setLinkFrequency([p1, p2, p3], this._freqs.triangles);
|
|
111
|
+
};
|
|
112
|
+
this._container = container;
|
|
113
|
+
this._engine = engine;
|
|
114
|
+
this._freqs = {
|
|
115
|
+
links: /* @__PURE__ */ new Map(),
|
|
116
|
+
triangles: /* @__PURE__ */ new Map()
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
drawParticle(context, particle) {
|
|
120
|
+
const { links, options } = particle;
|
|
121
|
+
if (!(links == null ? void 0 : links.length)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const p1Links = links.filter((l) => options.links && (options.links.frequency >= maxFrequency || this._getLinkFrequency(particle, l.destination) <= options.links.frequency));
|
|
125
|
+
for (const link of p1Links) {
|
|
126
|
+
this._drawTriangles(options, particle, link, p1Links);
|
|
127
|
+
if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {
|
|
128
|
+
this._drawLinkLine(particle, link);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async init() {
|
|
133
|
+
this._freqs.links = /* @__PURE__ */ new Map();
|
|
134
|
+
this._freqs.triangles = /* @__PURE__ */ new Map();
|
|
135
|
+
await Promise.resolve();
|
|
136
|
+
}
|
|
137
|
+
particleCreated(particle) {
|
|
138
|
+
particle.links = [];
|
|
139
|
+
if (!particle.options.links) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const ratio = this._container.retina.pixelRatio, { retina } = particle, { distance, width } = particle.options.links;
|
|
143
|
+
retina.linksDistance = distance * ratio;
|
|
144
|
+
retina.linksWidth = width * ratio;
|
|
145
|
+
}
|
|
146
|
+
particleDestroyed(particle) {
|
|
147
|
+
particle.links = [];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export {
|
|
151
|
+
LinkInstance
|
|
152
|
+
};
|