@tsparticles/all 3.0.0-beta.2 → 3.0.0-beta.3
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/package.json +38 -38
- package/report.html +2 -2
- package/tsparticles.all.bundle.js +226 -122
- package/tsparticles.all.bundle.min.js +1 -1
- package/tsparticles.all.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.all.js +38 -18
- package/tsparticles.all.min.js +1 -1
- package/tsparticles.all.min.js.LICENSE.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles All v3.0.0-beta.
|
|
1
|
+
/*! tsParticles All v3.0.0-beta.3 by Matteo Bruni */
|
package/tsparticles.all.js
CHANGED
|
@@ -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.0.0-beta.
|
|
7
|
+
* v3.0.0-beta.3
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -302,8 +302,13 @@ var engine_root_window_ = __webpack_require__(533);
|
|
|
302
302
|
;// CONCATENATED MODULE: ../../shapes/arrow/dist/browser/ArrowDrawer.js
|
|
303
303
|
|
|
304
304
|
class ArrowDrawer {
|
|
305
|
-
draw(
|
|
306
|
-
const
|
|
305
|
+
draw(data) {
|
|
306
|
+
const {
|
|
307
|
+
context,
|
|
308
|
+
particle,
|
|
309
|
+
radius
|
|
310
|
+
} = data,
|
|
311
|
+
width = radius * 2,
|
|
307
312
|
heightFactor = particle.heightFactor ?? 0.5,
|
|
308
313
|
headWidthFactor = particle.headWidthFactor ?? 0.2,
|
|
309
314
|
bodyHeightFactor = particle.bodyHeightFactor ?? 0.5,
|
|
@@ -341,21 +346,31 @@ var shape_cards_root_window_ = __webpack_require__(686);
|
|
|
341
346
|
;// CONCATENATED MODULE: ../../shapes/cog/dist/browser/CogDrawer.js
|
|
342
347
|
|
|
343
348
|
class CogDrawer {
|
|
344
|
-
afterEffect(
|
|
349
|
+
afterEffect(data) {
|
|
350
|
+
const {
|
|
351
|
+
context,
|
|
352
|
+
particle,
|
|
353
|
+
radius
|
|
354
|
+
} = data;
|
|
345
355
|
if (particle.cogHoleRadius === undefined || particle.cogInnerRadius === undefined || particle.cogInnerTaper === undefined || particle.cogNotches === undefined || particle.cogOuterTaper === undefined) {
|
|
346
356
|
return;
|
|
347
357
|
}
|
|
348
358
|
const pi2 = 2 * Math.PI,
|
|
349
359
|
holeRadius = radius * particle.cogHoleRadius / 100;
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
360
|
+
context.globalCompositeOperation = "destination-out";
|
|
361
|
+
context.beginPath();
|
|
362
|
+
context.moveTo(holeRadius, 0);
|
|
363
|
+
context.arc(0, 0, holeRadius, 0, pi2);
|
|
364
|
+
context.closePath();
|
|
365
|
+
context.fill();
|
|
366
|
+
context.globalCompositeOperation = "source-over";
|
|
357
367
|
}
|
|
358
|
-
draw(
|
|
368
|
+
draw(data) {
|
|
369
|
+
const {
|
|
370
|
+
context,
|
|
371
|
+
particle,
|
|
372
|
+
radius
|
|
373
|
+
} = data;
|
|
359
374
|
if (particle.cogHoleRadius === undefined || particle.cogInnerRadius === undefined || particle.cogInnerTaper === undefined || particle.cogNotches === undefined || particle.cogOuterTaper === undefined) {
|
|
360
375
|
return;
|
|
361
376
|
}
|
|
@@ -366,14 +381,14 @@ class CogDrawer {
|
|
|
366
381
|
innerRadius = radius * particle.cogInnerRadius / 100;
|
|
367
382
|
let a = angle,
|
|
368
383
|
toggle = false;
|
|
369
|
-
|
|
384
|
+
context.moveTo(radius * Math.cos(taperAO), radius * Math.sin(taperAO));
|
|
370
385
|
for (; a <= pi2; a += angle) {
|
|
371
386
|
if (toggle) {
|
|
372
|
-
|
|
373
|
-
|
|
387
|
+
context.lineTo(innerRadius * Math.cos(a - taperAI), innerRadius * Math.sin(a - taperAI));
|
|
388
|
+
context.lineTo(radius * Math.cos(a + taperAO), radius * Math.sin(a + taperAO));
|
|
374
389
|
} else {
|
|
375
|
-
|
|
376
|
-
|
|
390
|
+
context.lineTo(radius * Math.cos(a - taperAO), radius * Math.sin(a - taperAO));
|
|
391
|
+
context.lineTo(innerRadius * Math.cos(a + taperAI), innerRadius * Math.sin(a + taperAI));
|
|
377
392
|
}
|
|
378
393
|
toggle = !toggle;
|
|
379
394
|
}
|
|
@@ -644,7 +659,12 @@ function roundedPath(context, path, radius) {
|
|
|
644
659
|
}
|
|
645
660
|
}
|
|
646
661
|
class RoundedPolygonDrawer {
|
|
647
|
-
draw(
|
|
662
|
+
draw(data) {
|
|
663
|
+
const {
|
|
664
|
+
context,
|
|
665
|
+
particle,
|
|
666
|
+
radius
|
|
667
|
+
} = data;
|
|
648
668
|
roundedPath(context, polygon(particle.sides, radius), particle.borderRadius ?? 5);
|
|
649
669
|
}
|
|
650
670
|
getSidesCount(particle) {
|
package/tsparticles.all.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.all.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/shape-bubble"),require("@tsparticles/plugin-canvas-mask"),require("@tsparticles/shape-cards"),require("@tsparticles/path-curves"),require("@tsparticles/plugin-easing-back"),require("@tsparticles/plugin-easing-circ"),require("@tsparticles/plugin-easing-cubic"),require("@tsparticles/plugin-easing-expo"),require("@tsparticles/plugin-easing-quart"),require("@tsparticles/plugin-easing-quint"),require("@tsparticles/plugin-easing-sine"),require("tsparticles"),require("@tsparticles/updater-gradient"),require("@tsparticles/shape-heart"),require("@tsparticles/plugin-hsv-color"),require("@tsparticles/plugin-infection"),require("@tsparticles/interaction-light"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-multiline-text"),require("@tsparticles/updater-orbit"),require("@tsparticles/interaction-particles-repulse"),require("@tsparticles/shape-path"),require("@tsparticles/path-perlin-noise"),require("@tsparticles/plugin-polygon-mask"),require("@tsparticles/path-polygon"),require("@tsparticles/shape-rounded-rect"),require("@tsparticles/path-simplex-noise"),require("@tsparticles/plugin-sounds"),require("@tsparticles/shape-spiral"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/shape-bubble","@tsparticles/plugin-canvas-mask","@tsparticles/shape-cards","@tsparticles/path-curves","@tsparticles/plugin-easing-back","@tsparticles/plugin-easing-circ","@tsparticles/plugin-easing-cubic","@tsparticles/plugin-easing-expo","@tsparticles/plugin-easing-quart","@tsparticles/plugin-easing-quint","@tsparticles/plugin-easing-sine","tsparticles","@tsparticles/updater-gradient","@tsparticles/shape-heart","@tsparticles/plugin-hsv-color","@tsparticles/plugin-infection","@tsparticles/interaction-light","@tsparticles/plugin-motion","@tsparticles/shape-multiline-text","@tsparticles/updater-orbit","@tsparticles/interaction-particles-repulse","@tsparticles/shape-path","@tsparticles/path-perlin-noise","@tsparticles/plugin-polygon-mask","@tsparticles/path-polygon","@tsparticles/shape-rounded-rect","@tsparticles/path-simplex-noise","@tsparticles/plugin-sounds","@tsparticles/shape-spiral"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/shape-bubble"),require("@tsparticles/plugin-canvas-mask"),require("@tsparticles/shape-cards"),require("@tsparticles/path-curves"),require("@tsparticles/plugin-easing-back"),require("@tsparticles/plugin-easing-circ"),require("@tsparticles/plugin-easing-cubic"),require("@tsparticles/plugin-easing-expo"),require("@tsparticles/plugin-easing-quart"),require("@tsparticles/plugin-easing-quint"),require("@tsparticles/plugin-easing-sine"),require("tsparticles"),require("@tsparticles/updater-gradient"),require("@tsparticles/shape-heart"),require("@tsparticles/plugin-hsv-color"),require("@tsparticles/plugin-infection"),require("@tsparticles/interaction-light"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-multiline-text"),require("@tsparticles/updater-orbit"),require("@tsparticles/interaction-particles-repulse"),require("@tsparticles/shape-path"),require("@tsparticles/path-perlin-noise"),require("@tsparticles/plugin-polygon-mask"),require("@tsparticles/path-polygon"),require("@tsparticles/shape-rounded-rect"),require("@tsparticles/path-simplex-noise"),require("@tsparticles/plugin-sounds"),require("@tsparticles/shape-spiral")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(this,((e,t,i,s,a,r,n,o,p,l,c,u,h,g,d,w,v,x,f,m,y,P,_,q,b,I,T,S,R,M)=>(()=>{"use strict";var O={533:t=>{t.exports=e},55:e=>{e.exports=x},297:e=>{e.exports=P},997:e=>{e.exports=a},228:e=>{e.exports=q},231:e=>{e.exports=I},520:e=>{e.exports=S},72:e=>{e.exports=i},792:e=>{e.exports=r},176:e=>{e.exports=n},922:e=>{e.exports=o},594:e=>{e.exports=p},205:e=>{e.exports=l},144:e=>{e.exports=c},691:e=>{e.exports=u},673:e=>{e.exports=w},521:e=>{e.exports=v},82:e=>{e.exports=f},124:e=>{e.exports=b},490:e=>{e.exports=R},164:e=>{e.exports=t},686:e=>{e.exports=s},12:e=>{e.exports=d},940:e=>{e.exports=m},901:e=>{e.exports=_},550:e=>{e.exports=T},561:e=>{e.exports=M},887:e=>{e.exports=g},193:e=>{e.exports=y},802:e=>{e.exports=h}},E={};function k(e){var t=E[e];if(void 0!==t)return t.exports;var i=E[e]={exports:{}};return O[e](i,i.exports,k),i.exports}k.d=(e,t)=>{for(var i in t)k.o(t,i)&&!k.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},k.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),k.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var F={};return(()=>{k.r(F),k.d(F,{loadAll:()=>W});var e=k(533);class t{draw(e,t,i){const s=2*i,a=s*(t.heightFactor??.5),r=s*(t.headWidthFactor??.2),n=a*(t.bodyHeightFactor??.5);e.moveTo(-s/2,0),e.lineTo(-s/2,-n/2),e.lineTo(s/2-r,-n/2),e.lineTo(s/2-r,-a/2),e.lineTo(s/2+r,0),e.lineTo(s/2-r,a/2),e.lineTo(s/2-r,n/2),e.lineTo(-s/2,n/2),e.lineTo(-s/2,0)}particleInit(t,i){const s=i.shapeData;i.heightFactor=(0,e.getRangeValue)(s?.heightFactor??.5),i.headWidthFactor=(0,e.getRangeValue)(s?.headWidthFactor??.2),i.bodyHeightFactor=(0,e.getRangeValue)(s?.bodyHeightFactor??.5)}}var i=k(164),s=k(72),a=k(686);class r{afterEffect(e,t,i){if(void 0===t.cogHoleRadius||void 0===t.cogInnerRadius||void 0===t.cogInnerTaper||void 0===t.cogNotches||void 0===t.cogOuterTaper)return;const s=2*Math.PI,a=i*t.cogHoleRadius/100;e.globalCompositeOperation="destination-out",e.beginPath(),e.moveTo(a,0),e.arc(0,0,a,0,s),e.closePath(),e.fill(),e.globalCompositeOperation="source-over"}draw(e,t,i){if(void 0===t.cogHoleRadius||void 0===t.cogInnerRadius||void 0===t.cogInnerTaper||void 0===t.cogNotches||void 0===t.cogOuterTaper)return;const s=2*Math.PI,a=s/(2*t.cogNotches),r=a*t.cogInnerTaper*.005,n=a*t.cogOuterTaper*.005,o=i*t.cogInnerRadius/100;let p=a,l=!1;for(e.moveTo(i*Math.cos(n),i*Math.sin(n));p<=s;p+=a)l?(e.lineTo(o*Math.cos(p-r),o*Math.sin(p-r)),e.lineTo(i*Math.cos(p+n),i*Math.sin(p+n))):(e.lineTo(i*Math.cos(p-n),i*Math.sin(p-n)),e.lineTo(o*Math.cos(p+r),o*Math.sin(p+r))),l=!l}particleInit(t,i){const s=i.shapeData;i.cogHoleRadius=(0,e.getRangeValue)(s?.holeRadius??44),i.cogInnerRadius=(0,e.getRangeValue)(s?.innerRadius??72),i.cogInnerTaper=(0,e.getRangeValue)(s?.innerTaper??35),i.cogNotches=(0,e.getRangeValue)(s?.notches??7),i.cogOuterTaper=(0,e.getRangeValue)(s?.outerTaper??50)}}var n=k(997),o=k(792),p=k(176),l=k(922),c=k(594),u=k(205),h=k(144),g=k(691);class d{constructor(e,t){this._exportImage=async e=>{const t=this._container.canvas.element;if(t)return new Promise((i=>{t.toBlob((e=>{i(e||void 0)}),e.type??"image/png",e.quality)}))},this._container=e,this._engine=t}async export(e,t){const i={supported:!1};if("image"===e)i.supported=!0,i.blob=await this._exportImage(t);return i}}class w{constructor(e){this.id="export-image",this._engine=e}getPlugin(e){return new d(e,this._engine)}loadOptions(){}needsPlugin(){return!0}}class v{constructor(e,t){this._exportJSON=async()=>{const e=JSON.stringify(this._container.actualOptions,((e,t)=>{if(!e.startsWith("_"))return t}),2);return new Blob([e],{type:"application/json"})},this._container=e,this._engine=t}async export(e){const t={supported:!1};if("json"===e)t.supported=!0,t.blob=await this._exportJSON();return t}}class x{constructor(e){this.id="export-json",this._engine=e}getPlugin(e){return new v(e,this._engine)}loadOptions(){}needsPlugin(){return!0}}const f=["webm","ogg","mp4","x-matroska"],m=["vp9","vp9.0","vp8","vp8.0","avc1","av1","h265","h.265","h264","h.264","opus","pcm","aac","mpeg","mp4a"];class y{constructor(e,t){this._supportedTypes=[],this._exportVideo=async e=>{const t=this._container.canvas.element;if(t)return new Promise((i=>{const s=t.captureStream(e.fps??this._container.actualOptions.fpsLimit),a=e.mimeType??this._supportedTypes[0],r=new MediaRecorder(s,{mimeType:a}),n=[];r.addEventListener("dataavailable",(e=>{n.push(e.data)})),r.addEventListener("stop",(()=>{i(new Blob(n,{type:a}))})),r.start(),setTimeout((()=>{r.stop()}),e.duration??5e3)}))},this._container=e,this._engine=t,this._supportedTypes=function(){const e=MediaRecorder.isTypeSupported,t=[];return f.forEach((i=>{const s=`video/${i}`;m.forEach((i=>[`${s};codecs=${i}`,`${s};codecs=${i.toUpperCase()}`].forEach((i=>{e(i)&&t.push(i)})))),e(s)&&t.push(s)})),t}()}async export(e,t){const i={supported:!1};if("video"===e)i.supported=!0,i.blob=await this._exportVideo(t);return i}}class P{constructor(e){this.id="export-video",this._engine=e}getPlugin(e){return new y(e,this._engine)}loadOptions(){}needsPlugin(){return!0}}var _=k(802),q=k(887),b=k(12),I=k(673),T=k(521),S=k(55),R=k(82),M=k(940),O=k(193),E=k(297),N=k(901),V=k(228),j=k(124),C=k(231);class z{draw(e,t,i){!function(e,t,i){let s=t[0],a=t[1];const r=t.length;e.moveTo((s.x+a.x)/2,(s.y+a.y)/2);for(let n=1;n<=r;n++)s=a,a=t[(n+1)%r],e.arcTo(s.x,s.y,(s.x+a.x)/2,(s.y+a.y)/2,i)}(e,function(e,t,i=0){const s=2*Math.PI/e,a=[];for(let r=0;r<e;r++)a.push({x:Math.cos(r*s+i)*t,y:Math.sin(r*s+i)*t});return a}(t.sides,i),t.borderRadius??5)}getSidesCount(t){const i=t.shapeData;return Math.round((0,e.getRangeValue)(i?.sides??5))}particleInit(t,i){const s=i.shapeData;i.borderRadius=Math.round((0,e.getRangeValue)(s?.radius??5))*t.retina.pixelRatio}}var D=k(550);class H{constructor(){this._paths=[],this._reverse=!1,this._size={width:0,height:0},this._scale=1,this._offset={x:0,y:0,mode:"percent"},this._width=0}generate(t,i){const s=t.container.retina.pixelRatio;void 0===t.svgDirection&&(t.svgDirection=(0,e.getRandom)()>.5?0:1),void 0===t.svgPathIndex&&(t.svgPathIndex=Math.floor(Math.random()*this._paths.length)),void 0===t.svgSpeed&&(t.svgSpeed=t.velocity.mult((t.retina.moveSpeed??1)/2).length),void 0===t.svgStep&&(t.svgStep=(0,e.randomInRange)({min:0,max:this._paths[t.svgPathIndex].length})*s),void 0===t.svgOffset&&(t.svgOffset={width:(0,e.randomInRange)({min:-this._width/2,max:this._width/2})*s,height:(0,e.randomInRange)({min:-this._width/2,max:this._width/2})*s}),void 0===t.svgInitialPosition&&(t.svgInitialPosition={...t.position}),t.velocity.x=0,t.velocity.y=0,0===t.svgDirection?t.svgStep+=t.svgSpeed*i.factor:t.svgStep-=t.svgSpeed*i.factor;let a=this._paths[t.svgPathIndex];if(a){const e=a.length;t.svgStep>=e?(t.svgPathIndex=t.svgPathIndex+1,t.svgPathIndex>=this._paths.length&&(this._reverse?(t.svgPathIndex=this._paths.length-1,t.svgDirection=1):(t.svgPathIndex=0,t.svgStep=0))):t.svgStep<=0&&(t.svgPathIndex=t.svgPathIndex-1,t.svgPathIndex<0&&(this._reverse?(t.svgPathIndex=0,t.svgDirection=0):(t.svgPathIndex=this._paths.length-1,a=this._paths[t.svgPathIndex],t.svgStep=a.length))),a=this._paths[t.svgPathIndex]}if(a){const i=a.element.getPointAtLength(t.svgStep),r=t.container.canvas.size,n=(0,e.getPosition)(this._offset,r),o=this._scale*s;t.position.x=(i.x-this._size.width/2)*o+t.svgInitialPosition.x+n.x+t.svgOffset.width,t.position.y=(i.y-this._size.height/2)*o+t.svgInitialPosition.y+n.y+t.svgOffset.height}return e.Vector.origin}init(e){const t=e.actualOptions.particles.move.path.options,i=t.position??this._offset;if(this._reverse=t.reverse??this._reverse,this._scale=t.scale??1,this._offset.x=i.x,this._offset.y=i.y,this._offset.mode=i.mode,this._width=t.width??0,t.url&&!t.path){const e=t.url;(async()=>{const t=await fetch(e),i=await t.text(),s=(new DOMParser).parseFromString(i,"image/svg+xml"),a=s.getElementsByTagName("svg")[0];let r=a.getElementsByTagName("path");r.length||(r=s.getElementsByTagName("path")),this._paths=[];for(let e=0;e<r.length;e++){const t=r.item(e);t&&this._paths.push({element:t,length:t.getTotalLength()})}this._size.height=parseFloat(a.getAttribute("height")??"0"),this._size.width=parseFloat(a.getAttribute("width")??"0")})()}else if(t.path){const e=t.path;this._paths=[];for(const t of e.data){const e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",t),this._paths.push({element:e,length:e.getTotalLength()})}this._size.height=e.size.height,this._size.width=e.size.width}}reset(){}update(){}}const B="svgPathGenerator";var L=k(520),A=k(490),$=k(561);async function W(e,d=!0){await(0,_.loadFull)(e,!1),await(0,I.loadHsvColorPlugin)(),await(0,o.loadEasingBackPlugin)(),await(0,p.loadEasingCircPlugin)(),await(0,l.loadEasingCubicPlugin)(),await(0,c.loadEasingExpoPlugin)(),await(0,u.loadEasingQuartPlugin)(),await(0,h.loadEasingQuintPlugin)(),await(0,g.loadEasingSinePlugin)(),await(0,I.loadHsvColorPlugin)(),await(0,s.loadCanvasMaskPlugin)(e,!1),await(0,T.loadInfectionPlugin)(e,!1),await(0,R.loadMotionPlugin)(e,!1),await(0,j.loadPolygonMaskPlugin)(e,!1),await(0,A.loadSoundsPlugin)(e,!1),await async function(e,t=!0){await e.addPlugin(new w(e),t)}(e,!1),await async function(e,t=!0){await e.addPlugin(new x(e),t)}(e,!1),await async function(e,t=!0){await e.addPlugin(new P(e),t)}(e,!1),await(0,S.loadLightInteraction)(e,!1),await(0,E.loadParticlesRepulseInteraction)(e,!1),await(0,q.loadGradientUpdater)(e,!1),await(0,O.loadOrbitUpdater)(e,!1),await(0,n.loadCurvesPath)(e,!1),await(0,V.loadPerlinNoisePath)(e,!1),await(0,C.loadPolygonPath)(e,!1),await async function(e,t=!0){await e.addPathGenerator(B,new H,t)}(e,!1),await(0,L.loadSimplexNoisePath)(e,!1),await async function(e,i=!0){await e.addShape("arrow",new t,i)}(e,!1),await(0,i.loadBubbleShape)(e,!1),await(0,a.loadCardsShape)(e,!1),await async function(e,t=!0){await e.addShape("cog",new r,t)}(e,!1),await(0,b.loadHeartShape)(e,!1),await(0,M.loadMultilineTextShape)(e,!1),await(0,N.loadPathShape)(e,!1),await async function(e,t=!0){await e.addShape("rounded-polygon",new z,t)}(e,!1),await(0,D.loadRoundedRectShape)(e,!1),await(0,$.loadSpiralShape)(e,!1),await e.refresh(d)}})(),F})()));
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/shape-bubble"),require("@tsparticles/plugin-canvas-mask"),require("@tsparticles/shape-cards"),require("@tsparticles/path-curves"),require("@tsparticles/plugin-easing-back"),require("@tsparticles/plugin-easing-circ"),require("@tsparticles/plugin-easing-cubic"),require("@tsparticles/plugin-easing-expo"),require("@tsparticles/plugin-easing-quart"),require("@tsparticles/plugin-easing-quint"),require("@tsparticles/plugin-easing-sine"),require("tsparticles"),require("@tsparticles/updater-gradient"),require("@tsparticles/shape-heart"),require("@tsparticles/plugin-hsv-color"),require("@tsparticles/plugin-infection"),require("@tsparticles/interaction-light"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-multiline-text"),require("@tsparticles/updater-orbit"),require("@tsparticles/interaction-particles-repulse"),require("@tsparticles/shape-path"),require("@tsparticles/path-perlin-noise"),require("@tsparticles/plugin-polygon-mask"),require("@tsparticles/path-polygon"),require("@tsparticles/shape-rounded-rect"),require("@tsparticles/path-simplex-noise"),require("@tsparticles/plugin-sounds"),require("@tsparticles/shape-spiral"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/shape-bubble","@tsparticles/plugin-canvas-mask","@tsparticles/shape-cards","@tsparticles/path-curves","@tsparticles/plugin-easing-back","@tsparticles/plugin-easing-circ","@tsparticles/plugin-easing-cubic","@tsparticles/plugin-easing-expo","@tsparticles/plugin-easing-quart","@tsparticles/plugin-easing-quint","@tsparticles/plugin-easing-sine","tsparticles","@tsparticles/updater-gradient","@tsparticles/shape-heart","@tsparticles/plugin-hsv-color","@tsparticles/plugin-infection","@tsparticles/interaction-light","@tsparticles/plugin-motion","@tsparticles/shape-multiline-text","@tsparticles/updater-orbit","@tsparticles/interaction-particles-repulse","@tsparticles/shape-path","@tsparticles/path-perlin-noise","@tsparticles/plugin-polygon-mask","@tsparticles/path-polygon","@tsparticles/shape-rounded-rect","@tsparticles/path-simplex-noise","@tsparticles/plugin-sounds","@tsparticles/shape-spiral"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/shape-bubble"),require("@tsparticles/plugin-canvas-mask"),require("@tsparticles/shape-cards"),require("@tsparticles/path-curves"),require("@tsparticles/plugin-easing-back"),require("@tsparticles/plugin-easing-circ"),require("@tsparticles/plugin-easing-cubic"),require("@tsparticles/plugin-easing-expo"),require("@tsparticles/plugin-easing-quart"),require("@tsparticles/plugin-easing-quint"),require("@tsparticles/plugin-easing-sine"),require("tsparticles"),require("@tsparticles/updater-gradient"),require("@tsparticles/shape-heart"),require("@tsparticles/plugin-hsv-color"),require("@tsparticles/plugin-infection"),require("@tsparticles/interaction-light"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-multiline-text"),require("@tsparticles/updater-orbit"),require("@tsparticles/interaction-particles-repulse"),require("@tsparticles/shape-path"),require("@tsparticles/path-perlin-noise"),require("@tsparticles/plugin-polygon-mask"),require("@tsparticles/path-polygon"),require("@tsparticles/shape-rounded-rect"),require("@tsparticles/path-simplex-noise"),require("@tsparticles/plugin-sounds"),require("@tsparticles/shape-spiral")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(this,((e,t,i,s,a,r,n,o,p,l,c,u,h,g,d,w,v,x,f,m,y,P,_,q,b,I,T,S,R,M)=>(()=>{"use strict";var O={533:t=>{t.exports=e},55:e=>{e.exports=x},297:e=>{e.exports=P},997:e=>{e.exports=a},228:e=>{e.exports=q},231:e=>{e.exports=I},520:e=>{e.exports=S},72:e=>{e.exports=i},792:e=>{e.exports=r},176:e=>{e.exports=n},922:e=>{e.exports=o},594:e=>{e.exports=p},205:e=>{e.exports=l},144:e=>{e.exports=c},691:e=>{e.exports=u},673:e=>{e.exports=w},521:e=>{e.exports=v},82:e=>{e.exports=f},124:e=>{e.exports=b},490:e=>{e.exports=R},164:e=>{e.exports=t},686:e=>{e.exports=s},12:e=>{e.exports=d},940:e=>{e.exports=m},901:e=>{e.exports=_},550:e=>{e.exports=T},561:e=>{e.exports=M},887:e=>{e.exports=g},193:e=>{e.exports=y},802:e=>{e.exports=h}},E={};function k(e){var t=E[e];if(void 0!==t)return t.exports;var i=E[e]={exports:{}};return O[e](i,i.exports,k),i.exports}k.d=(e,t)=>{for(var i in t)k.o(t,i)&&!k.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},k.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),k.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var F={};return(()=>{k.r(F),k.d(F,{loadAll:()=>W});var e=k(533);class t{draw(e){const{context:t,particle:i,radius:s}=e,a=2*s,r=a*(i.heightFactor??.5),n=a*(i.headWidthFactor??.2),o=r*(i.bodyHeightFactor??.5);t.moveTo(-a/2,0),t.lineTo(-a/2,-o/2),t.lineTo(a/2-n,-o/2),t.lineTo(a/2-n,-r/2),t.lineTo(a/2+n,0),t.lineTo(a/2-n,r/2),t.lineTo(a/2-n,o/2),t.lineTo(-a/2,o/2),t.lineTo(-a/2,0)}particleInit(t,i){const s=i.shapeData;i.heightFactor=(0,e.getRangeValue)(s?.heightFactor??.5),i.headWidthFactor=(0,e.getRangeValue)(s?.headWidthFactor??.2),i.bodyHeightFactor=(0,e.getRangeValue)(s?.bodyHeightFactor??.5)}}var i=k(164),s=k(72),a=k(686);class r{afterEffect(e){const{context:t,particle:i,radius:s}=e;if(void 0===i.cogHoleRadius||void 0===i.cogInnerRadius||void 0===i.cogInnerTaper||void 0===i.cogNotches||void 0===i.cogOuterTaper)return;const a=2*Math.PI,r=s*i.cogHoleRadius/100;t.globalCompositeOperation="destination-out",t.beginPath(),t.moveTo(r,0),t.arc(0,0,r,0,a),t.closePath(),t.fill(),t.globalCompositeOperation="source-over"}draw(e){const{context:t,particle:i,radius:s}=e;if(void 0===i.cogHoleRadius||void 0===i.cogInnerRadius||void 0===i.cogInnerTaper||void 0===i.cogNotches||void 0===i.cogOuterTaper)return;const a=2*Math.PI,r=a/(2*i.cogNotches),n=r*i.cogInnerTaper*.005,o=r*i.cogOuterTaper*.005,p=s*i.cogInnerRadius/100;let l=r,c=!1;for(t.moveTo(s*Math.cos(o),s*Math.sin(o));l<=a;l+=r)c?(t.lineTo(p*Math.cos(l-n),p*Math.sin(l-n)),t.lineTo(s*Math.cos(l+o),s*Math.sin(l+o))):(t.lineTo(s*Math.cos(l-o),s*Math.sin(l-o)),t.lineTo(p*Math.cos(l+n),p*Math.sin(l+n))),c=!c}particleInit(t,i){const s=i.shapeData;i.cogHoleRadius=(0,e.getRangeValue)(s?.holeRadius??44),i.cogInnerRadius=(0,e.getRangeValue)(s?.innerRadius??72),i.cogInnerTaper=(0,e.getRangeValue)(s?.innerTaper??35),i.cogNotches=(0,e.getRangeValue)(s?.notches??7),i.cogOuterTaper=(0,e.getRangeValue)(s?.outerTaper??50)}}var n=k(997),o=k(792),p=k(176),l=k(922),c=k(594),u=k(205),h=k(144),g=k(691);class d{constructor(e,t){this._exportImage=async e=>{const t=this._container.canvas.element;if(t)return new Promise((i=>{t.toBlob((e=>{i(e||void 0)}),e.type??"image/png",e.quality)}))},this._container=e,this._engine=t}async export(e,t){const i={supported:!1};if("image"===e)i.supported=!0,i.blob=await this._exportImage(t);return i}}class w{constructor(e){this.id="export-image",this._engine=e}getPlugin(e){return new d(e,this._engine)}loadOptions(){}needsPlugin(){return!0}}class v{constructor(e,t){this._exportJSON=async()=>{const e=JSON.stringify(this._container.actualOptions,((e,t)=>{if(!e.startsWith("_"))return t}),2);return new Blob([e],{type:"application/json"})},this._container=e,this._engine=t}async export(e){const t={supported:!1};if("json"===e)t.supported=!0,t.blob=await this._exportJSON();return t}}class x{constructor(e){this.id="export-json",this._engine=e}getPlugin(e){return new v(e,this._engine)}loadOptions(){}needsPlugin(){return!0}}const f=["webm","ogg","mp4","x-matroska"],m=["vp9","vp9.0","vp8","vp8.0","avc1","av1","h265","h.265","h264","h.264","opus","pcm","aac","mpeg","mp4a"];class y{constructor(e,t){this._supportedTypes=[],this._exportVideo=async e=>{const t=this._container.canvas.element;if(t)return new Promise((i=>{const s=t.captureStream(e.fps??this._container.actualOptions.fpsLimit),a=e.mimeType??this._supportedTypes[0],r=new MediaRecorder(s,{mimeType:a}),n=[];r.addEventListener("dataavailable",(e=>{n.push(e.data)})),r.addEventListener("stop",(()=>{i(new Blob(n,{type:a}))})),r.start(),setTimeout((()=>{r.stop()}),e.duration??5e3)}))},this._container=e,this._engine=t,this._supportedTypes=function(){const e=MediaRecorder.isTypeSupported,t=[];return f.forEach((i=>{const s=`video/${i}`;m.forEach((i=>[`${s};codecs=${i}`,`${s};codecs=${i.toUpperCase()}`].forEach((i=>{e(i)&&t.push(i)})))),e(s)&&t.push(s)})),t}()}async export(e,t){const i={supported:!1};if("video"===e)i.supported=!0,i.blob=await this._exportVideo(t);return i}}class P{constructor(e){this.id="export-video",this._engine=e}getPlugin(e){return new y(e,this._engine)}loadOptions(){}needsPlugin(){return!0}}var _=k(802),q=k(887),b=k(12),I=k(673),T=k(521),S=k(55),R=k(82),M=k(940),O=k(193),E=k(297),N=k(901),V=k(228),j=k(124),C=k(231);class z{draw(e){const{context:t,particle:i,radius:s}=e;!function(e,t,i){let s=t[0],a=t[1];const r=t.length;e.moveTo((s.x+a.x)/2,(s.y+a.y)/2);for(let n=1;n<=r;n++)s=a,a=t[(n+1)%r],e.arcTo(s.x,s.y,(s.x+a.x)/2,(s.y+a.y)/2,i)}(t,function(e,t,i=0){const s=2*Math.PI/e,a=[];for(let r=0;r<e;r++)a.push({x:Math.cos(r*s+i)*t,y:Math.sin(r*s+i)*t});return a}(i.sides,s),i.borderRadius??5)}getSidesCount(t){const i=t.shapeData;return Math.round((0,e.getRangeValue)(i?.sides??5))}particleInit(t,i){const s=i.shapeData;i.borderRadius=Math.round((0,e.getRangeValue)(s?.radius??5))*t.retina.pixelRatio}}var D=k(550);class H{constructor(){this._paths=[],this._reverse=!1,this._size={width:0,height:0},this._scale=1,this._offset={x:0,y:0,mode:"percent"},this._width=0}generate(t,i){const s=t.container.retina.pixelRatio;void 0===t.svgDirection&&(t.svgDirection=(0,e.getRandom)()>.5?0:1),void 0===t.svgPathIndex&&(t.svgPathIndex=Math.floor(Math.random()*this._paths.length)),void 0===t.svgSpeed&&(t.svgSpeed=t.velocity.mult((t.retina.moveSpeed??1)/2).length),void 0===t.svgStep&&(t.svgStep=(0,e.randomInRange)({min:0,max:this._paths[t.svgPathIndex].length})*s),void 0===t.svgOffset&&(t.svgOffset={width:(0,e.randomInRange)({min:-this._width/2,max:this._width/2})*s,height:(0,e.randomInRange)({min:-this._width/2,max:this._width/2})*s}),void 0===t.svgInitialPosition&&(t.svgInitialPosition={...t.position}),t.velocity.x=0,t.velocity.y=0,0===t.svgDirection?t.svgStep+=t.svgSpeed*i.factor:t.svgStep-=t.svgSpeed*i.factor;let a=this._paths[t.svgPathIndex];if(a){const e=a.length;t.svgStep>=e?(t.svgPathIndex=t.svgPathIndex+1,t.svgPathIndex>=this._paths.length&&(this._reverse?(t.svgPathIndex=this._paths.length-1,t.svgDirection=1):(t.svgPathIndex=0,t.svgStep=0))):t.svgStep<=0&&(t.svgPathIndex=t.svgPathIndex-1,t.svgPathIndex<0&&(this._reverse?(t.svgPathIndex=0,t.svgDirection=0):(t.svgPathIndex=this._paths.length-1,a=this._paths[t.svgPathIndex],t.svgStep=a.length))),a=this._paths[t.svgPathIndex]}if(a){const i=a.element.getPointAtLength(t.svgStep),r=t.container.canvas.size,n=(0,e.getPosition)(this._offset,r),o=this._scale*s;t.position.x=(i.x-this._size.width/2)*o+t.svgInitialPosition.x+n.x+t.svgOffset.width,t.position.y=(i.y-this._size.height/2)*o+t.svgInitialPosition.y+n.y+t.svgOffset.height}return e.Vector.origin}init(e){const t=e.actualOptions.particles.move.path.options,i=t.position??this._offset;if(this._reverse=t.reverse??this._reverse,this._scale=t.scale??1,this._offset.x=i.x,this._offset.y=i.y,this._offset.mode=i.mode,this._width=t.width??0,t.url&&!t.path){const e=t.url;(async()=>{const t=await fetch(e),i=await t.text(),s=(new DOMParser).parseFromString(i,"image/svg+xml"),a=s.getElementsByTagName("svg")[0];let r=a.getElementsByTagName("path");r.length||(r=s.getElementsByTagName("path")),this._paths=[];for(let e=0;e<r.length;e++){const t=r.item(e);t&&this._paths.push({element:t,length:t.getTotalLength()})}this._size.height=parseFloat(a.getAttribute("height")??"0"),this._size.width=parseFloat(a.getAttribute("width")??"0")})()}else if(t.path){const e=t.path;this._paths=[];for(const t of e.data){const e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",t),this._paths.push({element:e,length:e.getTotalLength()})}this._size.height=e.size.height,this._size.width=e.size.width}}reset(){}update(){}}const B="svgPathGenerator";var L=k(520),A=k(490),$=k(561);async function W(e,d=!0){await(0,_.loadFull)(e,!1),await(0,I.loadHsvColorPlugin)(),await(0,o.loadEasingBackPlugin)(),await(0,p.loadEasingCircPlugin)(),await(0,l.loadEasingCubicPlugin)(),await(0,c.loadEasingExpoPlugin)(),await(0,u.loadEasingQuartPlugin)(),await(0,h.loadEasingQuintPlugin)(),await(0,g.loadEasingSinePlugin)(),await(0,I.loadHsvColorPlugin)(),await(0,s.loadCanvasMaskPlugin)(e,!1),await(0,T.loadInfectionPlugin)(e,!1),await(0,R.loadMotionPlugin)(e,!1),await(0,j.loadPolygonMaskPlugin)(e,!1),await(0,A.loadSoundsPlugin)(e,!1),await async function(e,t=!0){await e.addPlugin(new w(e),t)}(e,!1),await async function(e,t=!0){await e.addPlugin(new x(e),t)}(e,!1),await async function(e,t=!0){await e.addPlugin(new P(e),t)}(e,!1),await(0,S.loadLightInteraction)(e,!1),await(0,E.loadParticlesRepulseInteraction)(e,!1),await(0,q.loadGradientUpdater)(e,!1),await(0,O.loadOrbitUpdater)(e,!1),await(0,n.loadCurvesPath)(e,!1),await(0,V.loadPerlinNoisePath)(e,!1),await(0,C.loadPolygonPath)(e,!1),await async function(e,t=!0){await e.addPathGenerator(B,new H,t)}(e,!1),await(0,L.loadSimplexNoisePath)(e,!1),await async function(e,i=!0){await e.addShape("arrow",new t,i)}(e,!1),await(0,i.loadBubbleShape)(e,!1),await(0,a.loadCardsShape)(e,!1),await async function(e,t=!0){await e.addShape("cog",new r,t)}(e,!1),await(0,b.loadHeartShape)(e,!1),await(0,M.loadMultilineTextShape)(e,!1),await(0,N.loadPathShape)(e,!1),await async function(e,t=!0){await e.addShape("rounded-polygon",new z,t)}(e,!1),await(0,D.loadRoundedRectShape)(e,!1),await(0,$.loadSpiralShape)(e,!1),await e.refresh(d)}})(),F})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles All v3.0.0-beta.
|
|
1
|
+
/*! tsParticles All v3.0.0-beta.3 by Matteo Bruni */
|