@tsparticles/interaction-particles-links 3.2.1 → 3.2.2
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/292.min.js +2 -0
- package/292.min.js.LICENSE.txt +1 -0
- package/356.min.js.LICENSE.txt +1 -1
- package/45.min.js +2 -0
- package/45.min.js.LICENSE.txt +1 -0
- package/806.min.js.LICENSE.txt +1 -1
- package/838.min.js +1 -1
- package/838.min.js.LICENSE.txt +1 -1
- package/97.min.js +2 -0
- package/97.min.js.LICENSE.txt +1 -0
- package/browser/CircleWarp.js +1 -2
- package/browser/LinkInstance.js +4 -2
- package/browser/LinksPlugin.js +14 -0
- package/browser/index.js +1 -2
- package/browser/plugin.js +1 -15
- package/cjs/CircleWarp.js +1 -2
- package/cjs/LinkInstance.js +4 -2
- package/cjs/LinksPlugin.js +41 -0
- package/cjs/index.js +15 -4
- package/cjs/plugin.js +1 -15
- package/dist_browser_CircleWarp_js.js +2 -2
- package/dist_browser_LinkInstance_js.js +2 -2
- package/dist_browser_Linker_js.js +1 -1
- package/dist_browser_LinksPlugin_js.js +30 -0
- package/dist_browser_interaction_js.js +30 -0
- package/dist_browser_plugin_js.js +30 -0
- package/esm/CircleWarp.js +1 -2
- package/esm/LinkInstance.js +4 -2
- package/esm/LinksPlugin.js +14 -0
- package/esm/index.js +1 -2
- package/esm/plugin.js +1 -15
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.interaction.particles.links.js +2 -22
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.interaction.particles.links.min.js.LICENSE.txt +1 -1
- package/types/CircleWarp.d.ts +2 -2
- package/types/LinksPlugin.d.ts +10 -0
- package/umd/CircleWarp.js +1 -2
- package/umd/LinkInstance.js +4 -2
- package/umd/LinksPlugin.js +52 -0
- package/umd/index.js +17 -5
- package/umd/plugin.js +1 -15
package/292.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 292.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[]).push([[292],{292:(n,t,i)=>{async function a(n,t=!0){await n.addInteractor("particlesLinks",(async n=>{const{Linker:t}=await i.e(806).then(i.bind(i,806));return new t(n)}),t)}i.d(t,{loadLinksInteraction:()=>a})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.2 by Matteo Bruni */
|
package/356.min.js.LICENSE.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Links Particles Interaction v3.2.
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.2 by Matteo Bruni */
|
package/45.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 45.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[]).push([[45],{45:(n,i,t)=>{t.d(i,{LinksPlugin:()=>s});class s{constructor(){this.id="links"}async getPlugin(n){const{LinkInstance:i}=await t.e(838).then(t.bind(t,838));return new i(n)}loadOptions(){}needsPlugin(){return!0}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.2 by Matteo Bruni */
|
package/806.min.js.LICENSE.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Links Particles Interaction v3.2.
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.2 by Matteo Bruni */
|
package/838.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 838.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[]).push([[838],{838:(i,n,t)=>{t.d(n,{LinkInstance:()=>o});var e=t(533);function s(i,n){const t=((s=i.map((i=>i.id))).sort(((i,n)=>i-n)),s.join("_"));var s;let o=n.get(t);return void 0===o&&(o=(0,e.getRandom)(),n.set(t,o)),o}class o{constructor(i){this.container=i,this._drawLinkLine=(i,n)=>{const t=i.options.links;if(!t?.enable)return;const s=this.container,o=s.actualOptions,a=n.destination,r=i.getPosition(),l=a.getPosition();let c=n.opacity;s.canvas.draw((n=>{let d;const g=i.options.twinkle?.lines;if(g?.enable){const i=g.frequency,n=(0,e.rangeColorToRgb)(g.color);(0,e.getRandom)()<i&&n&&(d=n,c=(0,e.getRangeValue)(g.opacity))}if(!d){const n=void 0!==t.id?s.particles.linksColors.get(t.id):s.particles.linksColor;d=(0,e.getLinkColor)(i,a,n)}if(!d)return;const k=i.retina.linksWidth??0,p=i.retina.linksDistance??0,{backgroundMask:
|
|
2
|
+
(this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[]).push([[838],{838:(i,n,t)=>{t.d(n,{LinkInstance:()=>o});var e=t(533);function s(i,n){const t=((s=i.map((i=>i.id))).sort(((i,n)=>i-n)),s.join("_"));var s;let o=n.get(t);return void 0===o&&(o=(0,e.getRandom)(),n.set(t,o)),o}class o{constructor(i){this.container=i,this._drawLinkLine=(i,n)=>{const t=i.options.links;if(!t?.enable)return;const s=this.container,o=s.actualOptions,a=n.destination,r=i.getPosition(),l=a.getPosition();let c=n.opacity;s.canvas.draw((n=>{let d;const g=i.options.twinkle?.lines;if(g?.enable){const i=g.frequency,n=(0,e.rangeColorToRgb)(g.color);(0,e.getRandom)()<i&&n&&(d=n,c=(0,e.getRangeValue)(g.opacity))}if(!d){const n=void 0!==t.id?s.particles.linksColors.get(t.id):s.particles.linksColor;d=(0,e.getLinkColor)(i,a,n)}if(!d)return;const k=i.retina.linksWidth??0,p=i.retina.linksDistance??0,{backgroundMask:y}=o;!function(i){let n=!1;const{begin:t,end:s,maxDistance:o,context:a,canvasSize:r,width:l,backgroundMask:c,colorLine:d,opacity:g,links:k}=i;if((0,e.getDistance)(t,s)<=o)(0,e.drawLine)(a,t,s),n=!0;else if(k.warp){let i,l;const c={x:s.x-r.width,y:s.y},d=(0,e.getDistances)(t,c);if(d.distance<=o){const n=t.y-d.dy/d.dx*t.x;i={x:0,y:n},l={x:r.width,y:n}}else{const n={x:s.x,y:s.y-r.height},a=(0,e.getDistances)(t,n);if(a.distance<=o){const n=-(t.y-a.dy/a.dx*t.x)/(a.dy/a.dx);i={x:n,y:0},l={x:n,y:r.height}}else{const n={x:s.x-r.width,y:s.y-r.height},a=(0,e.getDistances)(t,n);if(a.distance<=o){const n=t.y-a.dy/a.dx*t.x;i={x:-n/(a.dy/a.dx),y:n},l={x:i.x+r.width,y:i.y+r.height}}}}i&&l&&((0,e.drawLine)(a,t,i),(0,e.drawLine)(a,s,l),n=!0)}if(!n)return;a.lineWidth=l,c.enable&&(a.globalCompositeOperation=c.composite),a.strokeStyle=(0,e.getStyleFromRgb)(d,g);const{shadow:p}=k;if(p.enable){const i=(0,e.rangeColorToRgb)(p.color);i&&(a.shadowBlur=p.blur,a.shadowColor=(0,e.getStyleFromRgb)(i))}a.stroke()}({context:n,width:k,begin:r,end:l,maxDistance:p,canvasSize:s.canvas.size,links:t,backgroundMask:y,colorLine:d,opacity:c})}))},this._drawLinkTriangle=(i,n,t)=>{const s=i.options.links;if(!s?.enable)return;const o=s.triangles;if(!o.enable)return;const a=this.container,r=a.actualOptions,l=n.destination,c=t.destination,d=o.opacity??.5*(n.opacity+t.opacity);d<=0||a.canvas.draw((n=>{const t=i.getPosition(),g=l.getPosition(),k=c.getPosition(),p=i.retina.linksDistance??0;if((0,e.getDistance)(t,g)>p||(0,e.getDistance)(k,g)>p||(0,e.getDistance)(k,t)>p)return;let y=(0,e.rangeColorToRgb)(o.color);if(!y){const n=void 0!==s.id?a.particles.linksColors.get(s.id):a.particles.linksColor;y=(0,e.getLinkColor)(i,l,n)}y&&function(i){const{context:n,pos1:t,pos2:s,pos3:o,backgroundMask:a,colorTriangle:r,opacityTriangle:l}=i;!function(i,n,t,e){i.beginPath(),i.moveTo(n.x,n.y),i.lineTo(t.x,t.y),i.lineTo(e.x,e.y),i.closePath()}(n,t,s,o),a.enable&&(n.globalCompositeOperation=a.composite),n.fillStyle=(0,e.getStyleFromRgb)(r,l),n.fill()}({context:n,pos1:t,pos2:g,pos3:k,backgroundMask:r.backgroundMask,colorTriangle:y,opacityTriangle:d})}))},this._drawTriangles=(i,n,t,e)=>{const s=t.destination;if(!i.links?.triangles.enable||!s.options.links?.triangles.enable)return;const o=s.links?.filter((i=>{const n=this._getLinkFrequency(s,i.destination);return s.options.links&&n<=s.options.links.frequency&&e.findIndex((n=>n.destination===i.destination))>=0}));if(o?.length)for(const e of o){const o=e.destination;this._getTriangleFrequency(n,s,o)>i.links.triangles.frequency||this._drawLinkTriangle(n,t,e)}},this._getLinkFrequency=(i,n)=>s([i,n],this._freqs.links),this._getTriangleFrequency=(i,n,t)=>s([i,n,t],this._freqs.triangles),this._freqs={links:new Map,triangles:new Map}}async drawParticle(i,n){const{links:t,options:e}=n;if(!t?.length)return;const s=t.filter((i=>e.links&&(e.links.frequency>=1||this._getLinkFrequency(n,i.destination)<=e.links.frequency)));for(const i of s)this._drawTriangles(e,n,i,s),i.opacity>0&&(n.retina.linksWidth??0)>0&&this._drawLinkLine(n,i);await Promise.resolve()}async init(){this._freqs.links=new Map,this._freqs.triangles=new Map,await Promise.resolve()}particleCreated(i){if(i.links=[],!i.options.links)return;const n=this.container.retina.pixelRatio,{retina:t}=i,{distance:e,width:s}=i.options.links;t.linksDistance=e*n,t.linksWidth=s*n}particleDestroyed(i){i.links=[]}}}}]);
|
package/838.min.js.LICENSE.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Links Particles Interaction v3.2.
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.2 by Matteo Bruni */
|
package/97.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 97.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[]).push([[97],{97:(i,n,t)=>{async function a(i,n=!0){const{LinksPlugin:a}=await t.e(45).then(t.bind(t,45)),s=new a;await i.addPlugin(s,n)}t.d(n,{loadLinksPlugin:()=>a})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.2 by Matteo Bruni */
|
package/browser/CircleWarp.js
CHANGED
|
@@ -7,8 +7,7 @@ export class CircleWarp extends Circle {
|
|
|
7
7
|
this.canvasSize = { ...canvasSize };
|
|
8
8
|
}
|
|
9
9
|
contains(point) {
|
|
10
|
-
const { width, height } = this.canvasSize;
|
|
11
|
-
const { x, y } = point;
|
|
10
|
+
const { width, height } = this.canvasSize, { x, y } = point;
|
|
12
11
|
return (super.contains(point) ||
|
|
13
12
|
super.contains({ x: x - width, y }) ||
|
|
14
13
|
super.contains({ x: x - width, y: y - height }) ||
|
package/browser/LinkInstance.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getDistance, getLinkColor, getRandom, getRangeValue, rangeColorToRgb, } from "@tsparticles/engine";
|
|
2
2
|
import { drawLinkLine, drawLinkTriangle, setLinkFrequency } from "./Utils.js";
|
|
3
|
-
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5;
|
|
3
|
+
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5, maxFrequency = 1;
|
|
4
4
|
export class LinkInstance {
|
|
5
5
|
constructor(container) {
|
|
6
6
|
this.container = container;
|
|
@@ -124,7 +124,9 @@ export class LinkInstance {
|
|
|
124
124
|
if (!links?.length) {
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
const p1Links = links.filter((l) => options.links &&
|
|
127
|
+
const p1Links = links.filter((l) => options.links &&
|
|
128
|
+
(options.links.frequency >= maxFrequency ||
|
|
129
|
+
this._getLinkFrequency(particle, l.destination) <= options.links.frequency));
|
|
128
130
|
for (const link of p1Links) {
|
|
129
131
|
this._drawTriangles(options, particle, link, p1Links);
|
|
130
132
|
if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class LinksPlugin {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.id = "links";
|
|
4
|
+
}
|
|
5
|
+
async getPlugin(container) {
|
|
6
|
+
const { LinkInstance } = await import("./LinkInstance.js");
|
|
7
|
+
return new LinkInstance(container);
|
|
8
|
+
}
|
|
9
|
+
loadOptions() {
|
|
10
|
+
}
|
|
11
|
+
needsPlugin() {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { loadLinksInteraction } from "./interaction.js";
|
|
2
|
-
import { loadLinksPlugin } from "./plugin.js";
|
|
3
1
|
export async function loadParticlesLinksInteraction(engine, refresh = true) {
|
|
2
|
+
const { loadLinksInteraction } = await import("./interaction.js"), { loadLinksPlugin } = await import("./plugin.js");
|
|
4
3
|
await loadLinksInteraction(engine, refresh);
|
|
5
4
|
await loadLinksPlugin(engine, refresh);
|
|
6
5
|
}
|
package/browser/plugin.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
class LinksPlugin {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.id = "links";
|
|
4
|
-
}
|
|
5
|
-
async getPlugin(container) {
|
|
6
|
-
const { LinkInstance } = await import("./LinkInstance.js");
|
|
7
|
-
return new LinkInstance(container);
|
|
8
|
-
}
|
|
9
|
-
loadOptions() {
|
|
10
|
-
}
|
|
11
|
-
needsPlugin() {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
1
|
export async function loadLinksPlugin(engine, refresh = true) {
|
|
16
|
-
const plugin = new LinksPlugin();
|
|
2
|
+
const { LinksPlugin } = await import("./LinksPlugin.js"), plugin = new LinksPlugin();
|
|
17
3
|
await engine.addPlugin(plugin, refresh);
|
|
18
4
|
}
|
package/cjs/CircleWarp.js
CHANGED
|
@@ -10,8 +10,7 @@ class CircleWarp extends engine_1.Circle {
|
|
|
10
10
|
this.canvasSize = { ...canvasSize };
|
|
11
11
|
}
|
|
12
12
|
contains(point) {
|
|
13
|
-
const { width, height } = this.canvasSize;
|
|
14
|
-
const { x, y } = point;
|
|
13
|
+
const { width, height } = this.canvasSize, { x, y } = point;
|
|
15
14
|
return (super.contains(point) ||
|
|
16
15
|
super.contains({ x: x - width, y }) ||
|
|
17
16
|
super.contains({ x: x - width, y: y - height }) ||
|
package/cjs/LinkInstance.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LinkInstance = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
5
|
const Utils_js_1 = require("./Utils.js");
|
|
6
|
-
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5;
|
|
6
|
+
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5, maxFrequency = 1;
|
|
7
7
|
class LinkInstance {
|
|
8
8
|
constructor(container) {
|
|
9
9
|
this.container = container;
|
|
@@ -127,7 +127,9 @@ class LinkInstance {
|
|
|
127
127
|
if (!links?.length) {
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
const p1Links = links.filter((l) => options.links &&
|
|
130
|
+
const p1Links = links.filter((l) => options.links &&
|
|
131
|
+
(options.links.frequency >= maxFrequency ||
|
|
132
|
+
this._getLinkFrequency(particle, l.destination) <= options.links.frequency));
|
|
131
133
|
for (const link of p1Links) {
|
|
132
134
|
this._drawTriangles(options, particle, link, p1Links);
|
|
133
135
|
if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.LinksPlugin = void 0;
|
|
27
|
+
class LinksPlugin {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.id = "links";
|
|
30
|
+
}
|
|
31
|
+
async getPlugin(container) {
|
|
32
|
+
const { LinkInstance } = await Promise.resolve().then(() => __importStar(require("./LinkInstance.js")));
|
|
33
|
+
return new LinkInstance(container);
|
|
34
|
+
}
|
|
35
|
+
loadOptions() {
|
|
36
|
+
}
|
|
37
|
+
needsPlugin() {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.LinksPlugin = LinksPlugin;
|
package/cjs/index.js
CHANGED
|
@@ -10,16 +10,27 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
13
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
27
|
};
|
|
16
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
29
|
exports.loadParticlesLinksInteraction = void 0;
|
|
18
|
-
const interaction_js_1 = require("./interaction.js");
|
|
19
|
-
const plugin_js_1 = require("./plugin.js");
|
|
20
30
|
async function loadParticlesLinksInteraction(engine, refresh = true) {
|
|
21
|
-
await (
|
|
22
|
-
await (
|
|
31
|
+
const { loadLinksInteraction } = await Promise.resolve().then(() => __importStar(require("./interaction.js"))), { loadLinksPlugin } = await Promise.resolve().then(() => __importStar(require("./plugin.js")));
|
|
32
|
+
await loadLinksInteraction(engine, refresh);
|
|
33
|
+
await loadLinksPlugin(engine, refresh);
|
|
23
34
|
}
|
|
24
35
|
exports.loadParticlesLinksInteraction = loadParticlesLinksInteraction;
|
|
25
36
|
__exportStar(require("./Options/Classes/Links.js"), exports);
|
package/cjs/plugin.js
CHANGED
|
@@ -24,22 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.loadLinksPlugin = void 0;
|
|
27
|
-
class LinksPlugin {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.id = "links";
|
|
30
|
-
}
|
|
31
|
-
async getPlugin(container) {
|
|
32
|
-
const { LinkInstance } = await Promise.resolve().then(() => __importStar(require("./LinkInstance.js")));
|
|
33
|
-
return new LinkInstance(container);
|
|
34
|
-
}
|
|
35
|
-
loadOptions() {
|
|
36
|
-
}
|
|
37
|
-
needsPlugin() {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
27
|
async function loadLinksPlugin(engine, refresh = true) {
|
|
42
|
-
const plugin = new LinksPlugin();
|
|
28
|
+
const { LinksPlugin } = await Promise.resolve().then(() => __importStar(require("./LinksPlugin.js"))), plugin = new LinksPlugin();
|
|
43
29
|
await engine.addPlugin(plugin, refresh);
|
|
44
30
|
}
|
|
45
31
|
exports.loadLinksPlugin = loadLinksPlugin;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.
|
|
7
|
+
* v3.2.2
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\************************************/
|
|
24
24
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
25
|
|
|
26
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CircleWarp: () => (/* binding */ CircleWarp)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst double = 2;\nclass CircleWarp extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Circle {\n constructor(x, y, radius, canvasSize) {\n super(x, y, radius);\n this.canvasSize = canvasSize;\n this.canvasSize = {\n ...canvasSize\n };\n }\n contains(point) {\n const {\n
|
|
26
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CircleWarp: () => (/* binding */ CircleWarp)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst double = 2;\nclass CircleWarp extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Circle {\n constructor(x, y, radius, canvasSize) {\n super(x, y, radius);\n this.canvasSize = canvasSize;\n this.canvasSize = {\n ...canvasSize\n };\n }\n contains(point) {\n const {\n width,\n height\n } = this.canvasSize,\n {\n x,\n y\n } = point;\n return super.contains(point) || super.contains({\n x: x - width,\n y\n }) || super.contains({\n x: x - width,\n y: y - height\n }) || super.contains({\n x,\n y: y - height\n });\n }\n intersects(range) {\n if (super.intersects(range)) {\n return true;\n }\n const rect = range,\n circle = range,\n newPos = {\n x: range.position.x - this.canvasSize.width,\n y: range.position.y - this.canvasSize.height\n };\n if (circle.radius !== undefined) {\n const biggerCircle = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Circle(newPos.x, newPos.y, circle.radius * double);\n return super.intersects(biggerCircle);\n } else if (rect.size !== undefined) {\n const rectSW = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Rectangle(newPos.x, newPos.y, rect.size.width * double, rect.size.height * double);\n return super.intersects(rectSW);\n }\n return false;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/CircleWarp.js?");
|
|
27
27
|
|
|
28
28
|
/***/ })
|
|
29
29
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.
|
|
7
|
+
* v3.2.2
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\**************************************/
|
|
24
24
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
25
|
|
|
26
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LinkInstance: () => (/* binding */ LinkInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\nconst minOpacity = 0,\n minWidth = 0,\n minDistance = 0,\n half = 0.5;\nclass LinkInstance {\n constructor(container) {\n this.container = container;\n this._drawLinkLine = (p1, link) => {\n const p1LinksOptions = p1.options.links;\n if (!p1LinksOptions?.enable) {\n return;\n }\n const container = this.container,\n options = container.actualOptions,\n p2 = link.destination,\n pos1 = p1.getPosition(),\n pos2 = p2.getPosition();\n let opacity = link.opacity;\n container.canvas.draw(ctx => {\n let colorLine;\n const twinkle = p1.options.twinkle?.lines;\n if (twinkle?.enable) {\n const twinkleFreq = twinkle.frequency,\n twinkleRgb = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(twinkle.color),\n twinkling = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() < twinkleFreq;\n if (twinkling && twinkleRgb) {\n colorLine = twinkleRgb;\n opacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(twinkle.opacity);\n }\n }\n if (!colorLine) {\n const linkColor = p1LinksOptions.id !== undefined ? container.particles.linksColors.get(p1LinksOptions.id) : container.particles.linksColor;\n colorLine = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getLinkColor)(p1, p2, linkColor);\n }\n if (!colorLine) {\n return;\n }\n const width = p1.retina.linksWidth ?? minWidth,\n maxDistance = p1.retina.linksDistance ?? minDistance,\n {\n backgroundMask\n } = options;\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawLinkLine)({\n context: ctx,\n width,\n begin: pos1,\n end: pos2,\n maxDistance,\n canvasSize: container.canvas.size,\n links: p1LinksOptions,\n backgroundMask: backgroundMask,\n colorLine,\n opacity\n });\n });\n };\n this._drawLinkTriangle = (p1, link1, link2) => {\n const linksOptions = p1.options.links;\n if (!linksOptions?.enable) {\n return;\n }\n const triangleOptions = linksOptions.triangles;\n if (!triangleOptions.enable) {\n return;\n }\n const container = this.container,\n options = container.actualOptions,\n p2 = link1.destination,\n p3 = link2.destination,\n opacityTriangle = triangleOptions.opacity ?? (link1.opacity + link2.opacity) * half;\n if (opacityTriangle <= minOpacity) {\n return;\n }\n container.canvas.draw(ctx => {\n const pos1 = p1.getPosition(),\n pos2 = p2.getPosition(),\n pos3 = p3.getPosition(),\n linksDistance = p1.retina.linksDistance ?? minDistance;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos1, pos2) > linksDistance || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos3, pos2) > linksDistance || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos3, pos1) > linksDistance) {\n return;\n }\n let colorTriangle = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(triangleOptions.color);\n if (!colorTriangle) {\n const linkColor = linksOptions.id !== undefined ? container.particles.linksColors.get(linksOptions.id) : container.particles.linksColor;\n colorTriangle = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getLinkColor)(p1, p2, linkColor);\n }\n if (!colorTriangle) {\n return;\n }\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawLinkTriangle)({\n context: ctx,\n pos1,\n pos2,\n pos3,\n backgroundMask: options.backgroundMask,\n colorTriangle,\n opacityTriangle\n });\n });\n };\n this._drawTriangles = (options, p1, link, p1Links) => {\n const p2 = link.destination;\n if (!(options.links?.triangles.enable && p2.options.links?.triangles.enable)) {\n return;\n }\n const vertices = p2.links?.filter(t => {\n const linkFreq = this._getLinkFrequency(p2, t.destination),\n minCount = 0;\n return p2.options.links && linkFreq <= p2.options.links.frequency && p1Links.findIndex(l => l.destination === t.destination) >= minCount;\n });\n if (!vertices?.length) {\n return;\n }\n for (const vertex of vertices) {\n const p3 = vertex.destination,\n triangleFreq = this._getTriangleFrequency(p1, p2, p3);\n if (triangleFreq > options.links.triangles.frequency) {\n continue;\n }\n this._drawLinkTriangle(p1, link, vertex);\n }\n };\n this._getLinkFrequency = (p1, p2) => {\n return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.setLinkFrequency)([p1, p2], this._freqs.links);\n };\n this._getTriangleFrequency = (p1, p2, p3) => {\n return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.setLinkFrequency)([p1, p2, p3], this._freqs.triangles);\n };\n this._freqs = {\n links: new Map(),\n triangles: new Map()\n };\n }\n async drawParticle(context, particle) {\n const {\n links,\n options\n } = particle;\n if (!links?.length) {\n return;\n }\n const p1Links = links.filter(l => options.links && this._getLinkFrequency(particle, l.destination) <= options.links.frequency);\n for (const link of p1Links) {\n this._drawTriangles(options, particle, link, p1Links);\n if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {\n this._drawLinkLine(particle, link);\n }\n }\n await Promise.resolve();\n }\n async init() {\n this._freqs.links = new Map();\n this._freqs.triangles = new Map();\n await Promise.resolve();\n }\n particleCreated(particle) {\n particle.links = [];\n if (!particle.options.links) {\n return;\n }\n const ratio = this.container.retina.pixelRatio,\n {\n retina\n } = particle,\n {\n distance,\n width\n } = particle.options.links;\n retina.linksDistance = distance * ratio;\n retina.linksWidth = width * ratio;\n }\n particleDestroyed(particle) {\n particle.links = [];\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/LinkInstance.js?");
|
|
26
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LinkInstance: () => (/* binding */ LinkInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\nconst minOpacity = 0,\n minWidth = 0,\n minDistance = 0,\n half = 0.5,\n maxFrequency = 1;\nclass LinkInstance {\n constructor(container) {\n this.container = container;\n this._drawLinkLine = (p1, link) => {\n const p1LinksOptions = p1.options.links;\n if (!p1LinksOptions?.enable) {\n return;\n }\n const container = this.container,\n options = container.actualOptions,\n p2 = link.destination,\n pos1 = p1.getPosition(),\n pos2 = p2.getPosition();\n let opacity = link.opacity;\n container.canvas.draw(ctx => {\n let colorLine;\n const twinkle = p1.options.twinkle?.lines;\n if (twinkle?.enable) {\n const twinkleFreq = twinkle.frequency,\n twinkleRgb = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(twinkle.color),\n twinkling = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() < twinkleFreq;\n if (twinkling && twinkleRgb) {\n colorLine = twinkleRgb;\n opacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(twinkle.opacity);\n }\n }\n if (!colorLine) {\n const linkColor = p1LinksOptions.id !== undefined ? container.particles.linksColors.get(p1LinksOptions.id) : container.particles.linksColor;\n colorLine = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getLinkColor)(p1, p2, linkColor);\n }\n if (!colorLine) {\n return;\n }\n const width = p1.retina.linksWidth ?? minWidth,\n maxDistance = p1.retina.linksDistance ?? minDistance,\n {\n backgroundMask\n } = options;\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawLinkLine)({\n context: ctx,\n width,\n begin: pos1,\n end: pos2,\n maxDistance,\n canvasSize: container.canvas.size,\n links: p1LinksOptions,\n backgroundMask: backgroundMask,\n colorLine,\n opacity\n });\n });\n };\n this._drawLinkTriangle = (p1, link1, link2) => {\n const linksOptions = p1.options.links;\n if (!linksOptions?.enable) {\n return;\n }\n const triangleOptions = linksOptions.triangles;\n if (!triangleOptions.enable) {\n return;\n }\n const container = this.container,\n options = container.actualOptions,\n p2 = link1.destination,\n p3 = link2.destination,\n opacityTriangle = triangleOptions.opacity ?? (link1.opacity + link2.opacity) * half;\n if (opacityTriangle <= minOpacity) {\n return;\n }\n container.canvas.draw(ctx => {\n const pos1 = p1.getPosition(),\n pos2 = p2.getPosition(),\n pos3 = p3.getPosition(),\n linksDistance = p1.retina.linksDistance ?? minDistance;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos1, pos2) > linksDistance || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos3, pos2) > linksDistance || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos3, pos1) > linksDistance) {\n return;\n }\n let colorTriangle = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(triangleOptions.color);\n if (!colorTriangle) {\n const linkColor = linksOptions.id !== undefined ? container.particles.linksColors.get(linksOptions.id) : container.particles.linksColor;\n colorTriangle = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getLinkColor)(p1, p2, linkColor);\n }\n if (!colorTriangle) {\n return;\n }\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawLinkTriangle)({\n context: ctx,\n pos1,\n pos2,\n pos3,\n backgroundMask: options.backgroundMask,\n colorTriangle,\n opacityTriangle\n });\n });\n };\n this._drawTriangles = (options, p1, link, p1Links) => {\n const p2 = link.destination;\n if (!(options.links?.triangles.enable && p2.options.links?.triangles.enable)) {\n return;\n }\n const vertices = p2.links?.filter(t => {\n const linkFreq = this._getLinkFrequency(p2, t.destination),\n minCount = 0;\n return p2.options.links && linkFreq <= p2.options.links.frequency && p1Links.findIndex(l => l.destination === t.destination) >= minCount;\n });\n if (!vertices?.length) {\n return;\n }\n for (const vertex of vertices) {\n const p3 = vertex.destination,\n triangleFreq = this._getTriangleFrequency(p1, p2, p3);\n if (triangleFreq > options.links.triangles.frequency) {\n continue;\n }\n this._drawLinkTriangle(p1, link, vertex);\n }\n };\n this._getLinkFrequency = (p1, p2) => {\n return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.setLinkFrequency)([p1, p2], this._freqs.links);\n };\n this._getTriangleFrequency = (p1, p2, p3) => {\n return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.setLinkFrequency)([p1, p2, p3], this._freqs.triangles);\n };\n this._freqs = {\n links: new Map(),\n triangles: new Map()\n };\n }\n async drawParticle(context, particle) {\n const {\n links,\n options\n } = particle;\n if (!links?.length) {\n return;\n }\n const p1Links = links.filter(l => options.links && (options.links.frequency >= maxFrequency || this._getLinkFrequency(particle, l.destination) <= options.links.frequency));\n for (const link of p1Links) {\n this._drawTriangles(options, particle, link, p1Links);\n if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {\n this._drawLinkLine(particle, link);\n }\n }\n await Promise.resolve();\n }\n async init() {\n this._freqs.links = new Map();\n this._freqs.triangles = new Map();\n await Promise.resolve();\n }\n particleCreated(particle) {\n particle.links = [];\n if (!particle.options.links) {\n return;\n }\n const ratio = this.container.retina.pixelRatio,\n {\n retina\n } = particle,\n {\n distance,\n width\n } = particle.options.links;\n retina.linksDistance = distance * ratio;\n retina.linksWidth = width * ratio;\n }\n particleDestroyed(particle) {\n particle.links = [];\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/LinkInstance.js?");
|
|
27
27
|
|
|
28
28
|
/***/ }),
|
|
29
29
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v3.2.2
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_interaction_particles_links"] = this["webpackChunk_tsparticles_interaction_particles_links"] || []).push([["dist_browser_LinksPlugin_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/LinksPlugin.js":
|
|
21
|
+
/*!*************************************!*\
|
|
22
|
+
!*** ./dist/browser/LinksPlugin.js ***!
|
|
23
|
+
\*************************************/
|
|
24
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
+
|
|
26
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LinksPlugin: () => (/* binding */ LinksPlugin)\n/* harmony export */ });\nclass LinksPlugin {\n constructor() {\n this.id = \"links\";\n }\n async getPlugin(container) {\n const {\n LinkInstance\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_LinkInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./LinkInstance.js */ \"./dist/browser/LinkInstance.js\"));\n return new LinkInstance(container);\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/LinksPlugin.js?");
|
|
27
|
+
|
|
28
|
+
/***/ })
|
|
29
|
+
|
|
30
|
+
}]);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v3.2.2
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_interaction_particles_links"] = this["webpackChunk_tsparticles_interaction_particles_links"] || []).push([["dist_browser_interaction_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/interaction.js":
|
|
21
|
+
/*!*************************************!*\
|
|
22
|
+
!*** ./dist/browser/interaction.js ***!
|
|
23
|
+
\*************************************/
|
|
24
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
+
|
|
26
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLinksInteraction: () => (/* binding */ loadLinksInteraction)\n/* harmony export */ });\nasync function loadLinksInteraction(engine, refresh = true) {\n await engine.addInteractor(\"particlesLinks\", async container => {\n const {\n Linker\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Linker_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Linker.js */ \"./dist/browser/Linker.js\"));\n return new Linker(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/interaction.js?");
|
|
27
|
+
|
|
28
|
+
/***/ })
|
|
29
|
+
|
|
30
|
+
}]);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v3.2.2
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_interaction_particles_links"] = this["webpackChunk_tsparticles_interaction_particles_links"] || []).push([["dist_browser_plugin_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/plugin.js":
|
|
21
|
+
/*!********************************!*\
|
|
22
|
+
!*** ./dist/browser/plugin.js ***!
|
|
23
|
+
\********************************/
|
|
24
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
+
|
|
26
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLinksPlugin: () => (/* binding */ loadLinksPlugin)\n/* harmony export */ });\nasync function loadLinksPlugin(engine, refresh = true) {\n const {\n LinksPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_LinksPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./LinksPlugin.js */ \"./dist/browser/LinksPlugin.js\")),\n plugin = new LinksPlugin();\n await engine.addPlugin(plugin, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/plugin.js?");
|
|
27
|
+
|
|
28
|
+
/***/ })
|
|
29
|
+
|
|
30
|
+
}]);
|
package/esm/CircleWarp.js
CHANGED
|
@@ -7,8 +7,7 @@ export class CircleWarp extends Circle {
|
|
|
7
7
|
this.canvasSize = { ...canvasSize };
|
|
8
8
|
}
|
|
9
9
|
contains(point) {
|
|
10
|
-
const { width, height } = this.canvasSize;
|
|
11
|
-
const { x, y } = point;
|
|
10
|
+
const { width, height } = this.canvasSize, { x, y } = point;
|
|
12
11
|
return (super.contains(point) ||
|
|
13
12
|
super.contains({ x: x - width, y }) ||
|
|
14
13
|
super.contains({ x: x - width, y: y - height }) ||
|
package/esm/LinkInstance.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getDistance, getLinkColor, getRandom, getRangeValue, rangeColorToRgb, } from "@tsparticles/engine";
|
|
2
2
|
import { drawLinkLine, drawLinkTriangle, setLinkFrequency } from "./Utils.js";
|
|
3
|
-
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5;
|
|
3
|
+
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5, maxFrequency = 1;
|
|
4
4
|
export class LinkInstance {
|
|
5
5
|
constructor(container) {
|
|
6
6
|
this.container = container;
|
|
@@ -124,7 +124,9 @@ export class LinkInstance {
|
|
|
124
124
|
if (!links?.length) {
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
const p1Links = links.filter((l) => options.links &&
|
|
127
|
+
const p1Links = links.filter((l) => options.links &&
|
|
128
|
+
(options.links.frequency >= maxFrequency ||
|
|
129
|
+
this._getLinkFrequency(particle, l.destination) <= options.links.frequency));
|
|
128
130
|
for (const link of p1Links) {
|
|
129
131
|
this._drawTriangles(options, particle, link, p1Links);
|
|
130
132
|
if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class LinksPlugin {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.id = "links";
|
|
4
|
+
}
|
|
5
|
+
async getPlugin(container) {
|
|
6
|
+
const { LinkInstance } = await import("./LinkInstance.js");
|
|
7
|
+
return new LinkInstance(container);
|
|
8
|
+
}
|
|
9
|
+
loadOptions() {
|
|
10
|
+
}
|
|
11
|
+
needsPlugin() {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { loadLinksInteraction } from "./interaction.js";
|
|
2
|
-
import { loadLinksPlugin } from "./plugin.js";
|
|
3
1
|
export async function loadParticlesLinksInteraction(engine, refresh = true) {
|
|
2
|
+
const { loadLinksInteraction } = await import("./interaction.js"), { loadLinksPlugin } = await import("./plugin.js");
|
|
4
3
|
await loadLinksInteraction(engine, refresh);
|
|
5
4
|
await loadLinksPlugin(engine, refresh);
|
|
6
5
|
}
|
package/esm/plugin.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
class LinksPlugin {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.id = "links";
|
|
4
|
-
}
|
|
5
|
-
async getPlugin(container) {
|
|
6
|
-
const { LinkInstance } = await import("./LinkInstance.js");
|
|
7
|
-
return new LinkInstance(container);
|
|
8
|
-
}
|
|
9
|
-
loadOptions() {
|
|
10
|
-
}
|
|
11
|
-
needsPlugin() {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
1
|
export async function loadLinksPlugin(engine, refresh = true) {
|
|
16
|
-
const plugin = new LinksPlugin();
|
|
2
|
+
const { LinksPlugin } = await import("./LinksPlugin.js"), plugin = new LinksPlugin();
|
|
17
3
|
await engine.addPlugin(plugin, refresh);
|
|
18
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-particles-links",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "tsParticles links particles interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "^3.2.
|
|
90
|
+
"@tsparticles/engine": "^3.2.2"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/interaction-particles-links [
|
|
6
|
+
<title>@tsparticles/interaction-particles-links [20 Feb 2024 at 01:33]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.
|
|
7
|
+
* v3.2.2
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -64,27 +64,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
64
64
|
\*******************************/
|
|
65
65
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
66
66
|
|
|
67
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Links: () => (/* reexport safe */
|
|
68
|
-
|
|
69
|
-
/***/ }),
|
|
70
|
-
|
|
71
|
-
/***/ "./dist/browser/interaction.js":
|
|
72
|
-
/*!*************************************!*\
|
|
73
|
-
!*** ./dist/browser/interaction.js ***!
|
|
74
|
-
\*************************************/
|
|
75
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
76
|
-
|
|
77
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLinksInteraction: () => (/* binding */ loadLinksInteraction)\n/* harmony export */ });\nasync function loadLinksInteraction(engine, refresh = true) {\n await engine.addInteractor(\"particlesLinks\", async container => {\n const {\n Linker\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Linker_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Linker.js */ \"./dist/browser/Linker.js\"));\n return new Linker(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/interaction.js?");
|
|
78
|
-
|
|
79
|
-
/***/ }),
|
|
80
|
-
|
|
81
|
-
/***/ "./dist/browser/plugin.js":
|
|
82
|
-
/*!********************************!*\
|
|
83
|
-
!*** ./dist/browser/plugin.js ***!
|
|
84
|
-
\********************************/
|
|
85
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
86
|
-
|
|
87
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLinksPlugin: () => (/* binding */ loadLinksPlugin)\n/* harmony export */ });\nclass LinksPlugin {\n constructor() {\n this.id = \"links\";\n }\n async getPlugin(container) {\n const {\n LinkInstance\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_LinkInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./LinkInstance.js */ \"./dist/browser/LinkInstance.js\"));\n return new LinkInstance(container);\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\nasync function loadLinksPlugin(engine, refresh = true) {\n const plugin = new LinksPlugin();\n await engine.addPlugin(plugin, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/plugin.js?");
|
|
67
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Links: () => (/* reexport safe */ _Options_Classes_Links_js__WEBPACK_IMPORTED_MODULE_0__.Links),\n/* harmony export */ LinksShadow: () => (/* reexport safe */ _Options_Classes_LinksShadow_js__WEBPACK_IMPORTED_MODULE_1__.LinksShadow),\n/* harmony export */ LinksTriangle: () => (/* reexport safe */ _Options_Classes_LinksTriangle_js__WEBPACK_IMPORTED_MODULE_2__.LinksTriangle),\n/* harmony export */ loadParticlesLinksInteraction: () => (/* binding */ loadParticlesLinksInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Links_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Links.js */ \"./dist/browser/Options/Classes/Links.js\");\n/* harmony import */ var _Options_Classes_LinksShadow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/LinksShadow.js */ \"./dist/browser/Options/Classes/LinksShadow.js\");\n/* harmony import */ var _Options_Classes_LinksTriangle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/LinksTriangle.js */ \"./dist/browser/Options/Classes/LinksTriangle.js\");\nasync function loadParticlesLinksInteraction(engine, refresh = true) {\n const {\n loadLinksInteraction\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_interaction_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./interaction.js */ \"./dist/browser/interaction.js\")),\n {\n loadLinksPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_plugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./plugin.js */ \"./dist/browser/plugin.js\"));\n await loadLinksInteraction(engine, refresh);\n await loadLinksPlugin(engine, refresh);\n}\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-particles-links/./dist/browser/index.js?");
|
|
88
68
|
|
|
89
69
|
/***/ }),
|
|
90
70
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.interaction.particles.links.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}}(this,(e=>(()=>{var t,i,o={515:(e,t,i)=>{i.d(t,{y:()=>a});var o=i(533),r=i(470),n=i(597);class a{constructor(){this.blink=!1,this.color=new o.OptionsColor,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new r.u,this.triangles=new n.e,this.width=1,this.warp=!1}load(e){e&&(void 0!==e.id&&(this.id=e.id),void 0!==e.blink&&(this.blink=e.blink),this.color=o.OptionsColor.create(this.color,e.color),void 0!==e.consent&&(this.consent=e.consent),void 0!==e.distance&&(this.distance=e.distance),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=e.opacity),this.shadow.load(e.shadow),this.triangles.load(e.triangles),void 0!==e.width&&(this.width=e.width),void 0!==e.warp&&(this.warp=e.warp))}}},470:(e,t,i)=>{i.d(t,{u:()=>r});var o=i(533);class r{constructor(){this.blur=5,this.color=new o.OptionsColor,this.color.value="#000",this.enable=!1}load(e){e&&(void 0!==e.blur&&(this.blur=e.blur),this.color=o.OptionsColor.create(this.color,e.color),void 0!==e.enable&&(this.enable=e.enable))}}},597:(e,t,i)=>{i.d(t,{e:()=>r});var o=i(533);class r{constructor(){this.enable=!1,this.frequency=1}load(e){e&&(void 0!==e.color&&(this.color=o.OptionsColor.create(this.color,e.color)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=e.opacity))}}},533:t=>{t.exports=e}},r={};function n(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return o[e](i,i.exports,n),i.exports}n.m=o,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,i)=>(n.f[i](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},i="@tsparticles/interaction-particles-links:",n.l=(e,o,r,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+r){s=u;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",i+r),s.src=e),t[e]=[o];var h=(i,o)=>{s.onerror=s.onload=null,clearTimeout(p);var r=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach((e=>e(o))),i)return i(o)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var o=i.length-1;o>-1&&!e;)e=i[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={71:0};n.f.j=(t,i)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)i.push(o[2]);else{var r=new Promise(((i,r)=>o=e[t]=[i,r]));i.push(o[2]=r);var a=n.p+n.u(t),s=new Error;n.l(a,(i=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var r=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+a+")",s.name="ChunkLoadError",s.type=r,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,i)=>{var o,r,a=i[0],s=i[1],l=i[2],c=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(i);c<a.length;c++)r=a[c],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0},i=this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var a={};return(()=>{n.r(a),n.d(a,{Links:()=>e.y,LinksShadow:()=>t.u,LinksTriangle:()=>i.e,loadParticlesLinksInteraction:()=>o});var e=n(515),t=n(470),i=n(597);async function o(e,t=!0){const{loadLinksInteraction:i}=await n.e(292).then(n.bind(n,292)),{loadLinksPlugin:o}=await n.e(97).then(n.bind(n,97));await i(e,t),await o(e,t)}})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Links Particles Interaction v3.2.
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.2 by Matteo Bruni */
|
package/types/CircleWarp.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Circle, type ICoordinates, type IDimension
|
|
1
|
+
import { type BaseRange, Circle, type ICoordinates, type IDimension } from "@tsparticles/engine";
|
|
2
2
|
export declare class CircleWarp extends Circle {
|
|
3
3
|
private readonly canvasSize;
|
|
4
4
|
constructor(x: number, y: number, radius: number, canvasSize: IDimension);
|
|
5
5
|
contains(point: ICoordinates): boolean;
|
|
6
|
-
intersects(range:
|
|
6
|
+
intersects(range: BaseRange): boolean;
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IPlugin } from "@tsparticles/engine";
|
|
2
|
+
import type { LinkContainer } from "./Types.js";
|
|
3
|
+
import type { LinkInstance } from "./LinkInstance.js";
|
|
4
|
+
export declare class LinksPlugin implements IPlugin {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
constructor();
|
|
7
|
+
getPlugin(container: LinkContainer): Promise<LinkInstance>;
|
|
8
|
+
loadOptions(): void;
|
|
9
|
+
needsPlugin(): boolean;
|
|
10
|
+
}
|
package/umd/CircleWarp.js
CHANGED
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
this.canvasSize = { ...canvasSize };
|
|
20
20
|
}
|
|
21
21
|
contains(point) {
|
|
22
|
-
const { width, height } = this.canvasSize;
|
|
23
|
-
const { x, y } = point;
|
|
22
|
+
const { width, height } = this.canvasSize, { x, y } = point;
|
|
24
23
|
return (super.contains(point) ||
|
|
25
24
|
super.contains({ x: x - width, y }) ||
|
|
26
25
|
super.contains({ x: x - width, y: y - height }) ||
|
package/umd/LinkInstance.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
exports.LinkInstance = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const Utils_js_1 = require("./Utils.js");
|
|
15
|
-
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5;
|
|
15
|
+
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5, maxFrequency = 1;
|
|
16
16
|
class LinkInstance {
|
|
17
17
|
constructor(container) {
|
|
18
18
|
this.container = container;
|
|
@@ -136,7 +136,9 @@
|
|
|
136
136
|
if (!links?.length) {
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
const p1Links = links.filter((l) => options.links &&
|
|
139
|
+
const p1Links = links.filter((l) => options.links &&
|
|
140
|
+
(options.links.frequency >= maxFrequency ||
|
|
141
|
+
this._getLinkFrequency(particle, l.destination) <= options.links.frequency));
|
|
140
142
|
for (const link of p1Links) {
|
|
141
143
|
this._drawTriangles(options, particle, link, p1Links);
|
|
142
144
|
if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
+
}
|
|
7
|
+
Object.defineProperty(o, k2, desc);
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
(function (factory) {
|
|
25
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
26
|
+
var v = factory(require, exports);
|
|
27
|
+
if (v !== undefined) module.exports = v;
|
|
28
|
+
}
|
|
29
|
+
else if (typeof define === "function" && define.amd) {
|
|
30
|
+
define(["require", "exports"], factory);
|
|
31
|
+
}
|
|
32
|
+
})(function (require, exports) {
|
|
33
|
+
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.LinksPlugin = void 0;
|
|
37
|
+
class LinksPlugin {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.id = "links";
|
|
40
|
+
}
|
|
41
|
+
async getPlugin(container) {
|
|
42
|
+
const { LinkInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./LinkInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./LinkInstance.js"], resolve_1, reject_1); }).then(__importStar));
|
|
43
|
+
return new LinkInstance(container);
|
|
44
|
+
}
|
|
45
|
+
loadOptions() {
|
|
46
|
+
}
|
|
47
|
+
needsPlugin() {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.LinksPlugin = LinksPlugin;
|
|
52
|
+
});
|
package/umd/index.js
CHANGED
|
@@ -9,6 +9,18 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
|
10
10
|
o[k2] = m[k];
|
|
11
11
|
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
12
24
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
13
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
14
26
|
};
|
|
@@ -18,17 +30,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
30
|
if (v !== undefined) module.exports = v;
|
|
19
31
|
}
|
|
20
32
|
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./
|
|
33
|
+
define(["require", "exports", "./Options/Classes/Links.js", "./Options/Classes/LinksShadow.js", "./Options/Classes/LinksTriangle.js", "./Options/Interfaces/ILinks.js", "./Options/Interfaces/ILinksShadow.js", "./Options/Interfaces/ILinksTriangle.js"], factory);
|
|
22
34
|
}
|
|
23
35
|
})(function (require, exports) {
|
|
24
36
|
"use strict";
|
|
37
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
25
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
39
|
exports.loadParticlesLinksInteraction = void 0;
|
|
27
|
-
const interaction_js_1 = require("./interaction.js");
|
|
28
|
-
const plugin_js_1 = require("./plugin.js");
|
|
29
40
|
async function loadParticlesLinksInteraction(engine, refresh = true) {
|
|
30
|
-
await (
|
|
31
|
-
await (
|
|
41
|
+
const { loadLinksInteraction } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./interaction.js"))) : new Promise((resolve_1, reject_1) => { require(["./interaction.js"], resolve_1, reject_1); }).then(__importStar)), { loadLinksPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./plugin.js"))) : new Promise((resolve_2, reject_2) => { require(["./plugin.js"], resolve_2, reject_2); }).then(__importStar));
|
|
42
|
+
await loadLinksInteraction(engine, refresh);
|
|
43
|
+
await loadLinksPlugin(engine, refresh);
|
|
32
44
|
}
|
|
33
45
|
exports.loadParticlesLinksInteraction = loadParticlesLinksInteraction;
|
|
34
46
|
__exportStar(require("./Options/Classes/Links.js"), exports);
|
package/umd/plugin.js
CHANGED
|
@@ -34,22 +34,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
34
34
|
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.loadLinksPlugin = void 0;
|
|
37
|
-
class LinksPlugin {
|
|
38
|
-
constructor() {
|
|
39
|
-
this.id = "links";
|
|
40
|
-
}
|
|
41
|
-
async getPlugin(container) {
|
|
42
|
-
const { LinkInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./LinkInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./LinkInstance.js"], resolve_1, reject_1); }).then(__importStar));
|
|
43
|
-
return new LinkInstance(container);
|
|
44
|
-
}
|
|
45
|
-
loadOptions() {
|
|
46
|
-
}
|
|
47
|
-
needsPlugin() {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
37
|
async function loadLinksPlugin(engine, refresh = true) {
|
|
52
|
-
const plugin = new LinksPlugin();
|
|
38
|
+
const { LinksPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./LinksPlugin.js"))) : new Promise((resolve_1, reject_1) => { require(["./LinksPlugin.js"], resolve_1, reject_1); }).then(__importStar)), plugin = new LinksPlugin();
|
|
53
39
|
await engine.addPlugin(plugin, refresh);
|
|
54
40
|
}
|
|
55
41
|
exports.loadLinksPlugin = loadLinksPlugin;
|