@tsparticles/interaction-particles-links 4.0.3 → 4.0.5
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/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +4 -4
- package/tsparticles.interaction.particles.links.js +2 -2
- package/tsparticles.interaction.particles.links.min.js +1 -1
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Linker } from "./Linker.js";
|
|
3
3
|
import { LinksPlugin } from "./LinksPlugin.js";
|
|
4
4
|
export async function loadParticlesLinksInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.5");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
const pluginManager = e.pluginManager;
|
|
8
8
|
ensureInteractivityPluginLoaded(e);
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesLinksInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.5");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Linker } from "./Linker.js";
|
|
3
3
|
import { LinksPlugin } from "./LinksPlugin.js";
|
|
4
4
|
export async function loadParticlesLinksInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.5");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
const pluginManager = e.pluginManager;
|
|
8
8
|
ensureInteractivityPluginLoaded(e);
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesLinksInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.5");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { Linker } from "./Linker.js";
|
|
3
3
|
import { LinksPlugin } from "./LinksPlugin.js";
|
|
4
4
|
export async function loadParticlesLinksInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.5");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
const pluginManager = e.pluginManager;
|
|
8
8
|
ensureInteractivityPluginLoaded(e);
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadParticlesLinksInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.5");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
|
|
5
5
|
import("@tsparticles/plugin-interactivity/lazy"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-particles-links",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "tsParticles links particles interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -97,10 +97,10 @@
|
|
|
97
97
|
},
|
|
98
98
|
"type": "module",
|
|
99
99
|
"peerDependencies": {
|
|
100
|
-
"@tsparticles/engine": "4.0.
|
|
101
|
-
"@tsparticles/plugin-interactivity": "4.0.
|
|
100
|
+
"@tsparticles/engine": "4.0.5",
|
|
101
|
+
"@tsparticles/plugin-interactivity": "4.0.5"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@tsparticles/canvas-utils": "4.0.
|
|
104
|
+
"@tsparticles/canvas-utils": "4.0.5"
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Particles Interaction v4.0.
|
|
2
|
+
/* Particles Interaction v4.0.5 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
async function loadParticlesLinksInteraction(engine) {
|
|
302
|
-
engine.checkVersion("4.0.
|
|
302
|
+
engine.checkVersion("4.0.5");
|
|
303
303
|
await engine.pluginManager.register((e) => {
|
|
304
304
|
const pluginManager = e.pluginManager;
|
|
305
305
|
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,s,n){"use strict";class e extends n.Circle{canvasSize;constructor(t,s,n,e){super(t,s,n),this.canvasSize=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.canvasSize,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.canvasSize,i=t.position,a=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of a){const e={x:i.x+s.x,y:i.y+s.y};let a;if(t instanceof n.Circle)a=new n.Circle(e.x,e.y,t.radius);else{const s=t;a=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(a))return!0}return!1}}class i{blur;color;enable;constructor(){this.blur=5,this.color=new n.OptionsColor,this.color.value="#000",this.enable=!1}load(t){n.isNull(t)||(void 0!==t.blur&&(this.blur=t.blur),this.color=n.OptionsColor.create(this.color,t.color),void 0!==t.enable&&(this.enable=t.enable))}}class a{color;enable;frequency;opacity;constructor(){this.enable=!1,this.frequency=1}load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.frequency&&(this.frequency=t.frequency),void 0!==t.opacity&&(this.opacity=t.opacity))}}class r{blink;color;consent;distance;enable;frequency;id;opacity;shadow;triangles;warp;width;constructor(){this.blink=!1,this.color=new n.OptionsColor,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new i,this.triangles=new a,this.width=1,this.warp=!1}load(t){n.isNull(t)||(void 0!==t.id&&(this.id=t.id),void 0!==t.blink&&(this.blink=t.blink),this.color=n.OptionsColor.create(this.color,t.color),void 0!==t.consent&&(this.consent=t.consent),void 0!==t.distance&&(this.distance=t.distance),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.frequency&&(this.frequency=t.frequency),void 0!==t.opacity&&(this.opacity=t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),void 0!==t.width&&(this.width=t.width),void 0!==t.warp&&(this.warp=t.warp))}}function l(t,s,e){const{dx:i,dy:a}=n.getDistances(t,s),r={x:Math.abs(i),y:Math.abs(a)},l={x:Math.min(r.x,e.width-r.x),y:Math.min(r.y,e.height-r.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{_maxDistance;_pluginManager;constructor(t,s){super(s),this._pluginManager=t,this._maxDistance=0}get maxDistance(){return this._maxDistance}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this._maxDistance&&(this._maxDistance=t.linksDistance);const s=t.getPosition(),i=this.container,a=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>a.width||s.y>a.height)return;const r=t.options.links,o=r.opacity,c=t.retina.linksDistance??0,_=r.warp,h=_?new e(s.x,s.y,c,a):new n.Circle(s.x,s.y,c),p=i.particles.grid.query(h);for(const e of p){const i=e.options.links;if(t===e||!i?.enable||r.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const h=e.getPosition();if(h.x<n.originPoint.x||h.y<n.originPoint.y||h.x>a.width||h.y>a.height)continue;const p=n.getDistances(s,h).distance,u=_&&i.warp?l(s,h,a):p,d=Math.min(p,u);if(d>c)continue;const g=(1-d/c)*o;this._setColor(t),t.links.push({destination:e,opacity:g,color:this._getLinkColor(t,e),isWarped:u<p})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){t.links??=new r;for(const n of s)t.links.load(n?.links)}reset(){}_getLinkColor(t,s){const e=this.container,i=t.options.links;if(!i)return;const a=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,a)}_setColor(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this._pluginManager,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";_pluginManager;constructor(t){this._pluginManager=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return u});return new s(this._pluginManager,t)}loadOptions(){}needsPlugin(){return!0}}async function _(t){t.checkVersion("4.0.3"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const h=globalThis;function p(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let a=s.get(e);return void 0===a&&(a=n.getRandom(),s.set(e,a)),a}h.__tsParticlesInternals=h.__tsParticlesInternals??{},h.loadParticlesLinksInteraction=_;var u=Object.freeze({__proto__:null,LinkInstance:class{_colorCache=new Map;_container;_freqs;_pluginManager;constructor(t,s){this._pluginManager=t,this._container=s,this._freqs={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const a=i.links,r=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=a.triangles.enable,_=c?new Set(e.map(t=>t.destination.id)):null,h=t.globalAlpha;let p="",u=-1,d=-1,g=!1;const y=()=>{g&&(t.stroke(),g=!1)};for(const h of e){if(a.frequency<1&&this._getLinkFrequency(s,h.destination)>a.frequency)continue;const e=h.destination.getPosition();if(c&&!h.isWarped&&_&&(y(),this._drawTriangles(i,s,h,_,l,e,t)),h.opacity<=0||r<=0)continue;if(!a.enable)continue;let P=h.opacity,f=h.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this._pluginManager,o.color):void 0;if(o&&I&&(f=I,P=n.getRangeValue(o.opacity)),!f){const t=void 0!==a.id?this._container.particles.linksColors.get(a.id):this._container.particles.linksColor;f=n.getLinkColor(s,h.destination,t)}if(!f)continue;const k=this._getCachedStyle(f);if(k===p&&r===u&&P===d||(y(),t.strokeStyle=k,t.lineWidth=r,t.globalAlpha=P,p=k,u=r,d=P,t.beginPath(),g=!0),h.isWarped){const s=this._container.canvas.size,i=e.x-l.x,a=e.y-l.y;let r=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(r=i>0?-s.width:s.width),Math.abs(a)>s.height*n.half&&(o=a>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+r,e.y+o),t.moveTo(l.x-r,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}y(),t.globalAlpha=h}init(){return this._freqs.links.clear(),this._freqs.triangles.clear(),this._colorCache.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this._container.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}_drawTriangles(t,s,e,i,a,r,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const _=o.links;if(_?.length)for(const h of _){if(h.isWarped||this._getLinkFrequency(o,h.destination)>o.options.links.frequency||!i.has(h.destination.id))continue;const _=h.destination;if(this._getTriangleFrequency(s,o,_)>(t.links?.triangles.frequency??0))continue;const p=c.opacity??(e.opacity+h.opacity)*n.half,u=n.rangeColorToRgb(this._pluginManager,c.color)??e.color;if(!u||p<=0)continue;const d=_.getPosition();l.save(),l.fillStyle=this._getCachedStyle(u),l.globalAlpha=p,l.beginPath(),l.moveTo(a.x,a.y),l.lineTo(r.x,r.y),l.lineTo(d.x,d.y),l.closePath(),l.fill(),l.restore()}}_getCachedStyle(t){const s=`${t.r},${t.g},${t.b}`;let e=this._colorCache.get(s);return e||(e=n.getStyleFromRgb(t,this._container.hdr),this._colorCache.set(s,e)),e}_getLinkFrequency(t,s){return p([t,s],this._freqs.links)}_getTriangleFrequency(t,s,n){return p([t,s,n],this._freqs.triangles)}}});t.Links=r,t.LinksShadow=i,t.LinksTriangle=a,t.loadParticlesLinksInteraction=_}),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,s,n){"use strict";class e extends n.Circle{canvasSize;constructor(t,s,n,e){super(t,s,n),this.canvasSize=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.canvasSize,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.canvasSize,i=t.position,a=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of a){const e={x:i.x+s.x,y:i.y+s.y};let a;if(t instanceof n.Circle)a=new n.Circle(e.x,e.y,t.radius);else{const s=t;a=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(a))return!0}return!1}}class i{blur;color;enable;constructor(){this.blur=5,this.color=new n.OptionsColor,this.color.value="#000",this.enable=!1}load(t){n.isNull(t)||(void 0!==t.blur&&(this.blur=t.blur),this.color=n.OptionsColor.create(this.color,t.color),void 0!==t.enable&&(this.enable=t.enable))}}class a{color;enable;frequency;opacity;constructor(){this.enable=!1,this.frequency=1}load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.frequency&&(this.frequency=t.frequency),void 0!==t.opacity&&(this.opacity=t.opacity))}}class r{blink;color;consent;distance;enable;frequency;id;opacity;shadow;triangles;warp;width;constructor(){this.blink=!1,this.color=new n.OptionsColor,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new i,this.triangles=new a,this.width=1,this.warp=!1}load(t){n.isNull(t)||(void 0!==t.id&&(this.id=t.id),void 0!==t.blink&&(this.blink=t.blink),this.color=n.OptionsColor.create(this.color,t.color),void 0!==t.consent&&(this.consent=t.consent),void 0!==t.distance&&(this.distance=t.distance),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.frequency&&(this.frequency=t.frequency),void 0!==t.opacity&&(this.opacity=t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),void 0!==t.width&&(this.width=t.width),void 0!==t.warp&&(this.warp=t.warp))}}function l(t,s,e){const{dx:i,dy:a}=n.getDistances(t,s),r={x:Math.abs(i),y:Math.abs(a)},l={x:Math.min(r.x,e.width-r.x),y:Math.min(r.y,e.height-r.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{_maxDistance;_pluginManager;constructor(t,s){super(s),this._pluginManager=t,this._maxDistance=0}get maxDistance(){return this._maxDistance}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this._maxDistance&&(this._maxDistance=t.linksDistance);const s=t.getPosition(),i=this.container,a=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>a.width||s.y>a.height)return;const r=t.options.links,o=r.opacity,c=t.retina.linksDistance??0,_=r.warp,h=_?new e(s.x,s.y,c,a):new n.Circle(s.x,s.y,c),p=i.particles.grid.query(h);for(const e of p){const i=e.options.links;if(t===e||!i?.enable||r.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const h=e.getPosition();if(h.x<n.originPoint.x||h.y<n.originPoint.y||h.x>a.width||h.y>a.height)continue;const p=n.getDistances(s,h).distance,u=_&&i.warp?l(s,h,a):p,d=Math.min(p,u);if(d>c)continue;const g=(1-d/c)*o;this._setColor(t),t.links.push({destination:e,opacity:g,color:this._getLinkColor(t,e),isWarped:u<p})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){t.links??=new r;for(const n of s)t.links.load(n?.links)}reset(){}_getLinkColor(t,s){const e=this.container,i=t.options.links;if(!i)return;const a=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,a)}_setColor(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this._pluginManager,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";_pluginManager;constructor(t){this._pluginManager=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return u});return new s(this._pluginManager,t)}loadOptions(){}needsPlugin(){return!0}}async function _(t){t.checkVersion("4.0.5"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const h=globalThis;function p(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let a=s.get(e);return void 0===a&&(a=n.getRandom(),s.set(e,a)),a}h.__tsParticlesInternals=h.__tsParticlesInternals??{},h.loadParticlesLinksInteraction=_;var u=Object.freeze({__proto__:null,LinkInstance:class{_colorCache=new Map;_container;_freqs;_pluginManager;constructor(t,s){this._pluginManager=t,this._container=s,this._freqs={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const a=i.links,r=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=a.triangles.enable,_=c?new Set(e.map(t=>t.destination.id)):null,h=t.globalAlpha;let p="",u=-1,d=-1,g=!1;const y=()=>{g&&(t.stroke(),g=!1)};for(const h of e){if(a.frequency<1&&this._getLinkFrequency(s,h.destination)>a.frequency)continue;const e=h.destination.getPosition();if(c&&!h.isWarped&&_&&(y(),this._drawTriangles(i,s,h,_,l,e,t)),h.opacity<=0||r<=0)continue;if(!a.enable)continue;let P=h.opacity,f=h.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this._pluginManager,o.color):void 0;if(o&&I&&(f=I,P=n.getRangeValue(o.opacity)),!f){const t=void 0!==a.id?this._container.particles.linksColors.get(a.id):this._container.particles.linksColor;f=n.getLinkColor(s,h.destination,t)}if(!f)continue;const k=this._getCachedStyle(f);if(k===p&&r===u&&P===d||(y(),t.strokeStyle=k,t.lineWidth=r,t.globalAlpha=P,p=k,u=r,d=P,t.beginPath(),g=!0),h.isWarped){const s=this._container.canvas.size,i=e.x-l.x,a=e.y-l.y;let r=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(r=i>0?-s.width:s.width),Math.abs(a)>s.height*n.half&&(o=a>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+r,e.y+o),t.moveTo(l.x-r,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}y(),t.globalAlpha=h}init(){return this._freqs.links.clear(),this._freqs.triangles.clear(),this._colorCache.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this._container.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}_drawTriangles(t,s,e,i,a,r,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const _=o.links;if(_?.length)for(const h of _){if(h.isWarped||this._getLinkFrequency(o,h.destination)>o.options.links.frequency||!i.has(h.destination.id))continue;const _=h.destination;if(this._getTriangleFrequency(s,o,_)>(t.links?.triangles.frequency??0))continue;const p=c.opacity??(e.opacity+h.opacity)*n.half,u=n.rangeColorToRgb(this._pluginManager,c.color)??e.color;if(!u||p<=0)continue;const d=_.getPosition();l.save(),l.fillStyle=this._getCachedStyle(u),l.globalAlpha=p,l.beginPath(),l.moveTo(a.x,a.y),l.lineTo(r.x,r.y),l.lineTo(d.x,d.y),l.closePath(),l.fill(),l.restore()}}_getCachedStyle(t){const s=`${t.r},${t.g},${t.b}`;let e=this._colorCache.get(s);return e||(e=n.getStyleFromRgb(t,this._container.hdr),this._colorCache.set(s,e)),e}_getLinkFrequency(t,s){return p([t,s],this._freqs.links)}_getTriangleFrequency(t,s,n){return p([t,s,n],this._freqs.triangles)}}});t.Links=r,t.LinksShadow=i,t.LinksTriangle=a,t.loadParticlesLinksInteraction=_}),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|