@tsparticles/pjs 3.0.0-alpha.1 → 3.0.0-beta.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/README.md +46 -8
  2. package/browser/VincentGarreau/particles.js +271 -0
  3. package/browser/bundle.js +2 -2
  4. package/browser/index.js +7 -20
  5. package/browser/marcbruederlin/Particles.js +83 -0
  6. package/browser/package.json +1 -0
  7. package/cjs/VincentGarreau/particles.js +274 -0
  8. package/cjs/bundle.js +3 -2
  9. package/cjs/index.js +7 -20
  10. package/cjs/marcbruederlin/Particles.js +87 -0
  11. package/cjs/package.json +1 -0
  12. package/esm/VincentGarreau/particles.js +271 -0
  13. package/esm/bundle.js +2 -2
  14. package/esm/index.js +7 -20
  15. package/esm/marcbruederlin/Particles.js +83 -0
  16. package/esm/package.json +1 -0
  17. package/package.json +36 -13
  18. package/report.html +5 -5
  19. package/tsparticles.pjs.bundle.js +2596 -2312
  20. package/tsparticles.pjs.bundle.min.js +1 -1
  21. package/tsparticles.pjs.bundle.min.js.LICENSE.txt +1 -8
  22. package/tsparticles.pjs.js +396 -12
  23. package/tsparticles.pjs.min.js +1 -1
  24. package/tsparticles.pjs.min.js.LICENSE.txt +1 -8
  25. package/types/VincentGarreau/IParticlesJS.d.ts +117 -0
  26. package/types/VincentGarreau/particles.d.ts +7 -0
  27. package/types/bundle.d.ts +2 -2
  28. package/types/index.d.ts +11 -2
  29. package/types/marcbruederlin/Particles.d.ts +23 -0
  30. package/umd/VincentGarreau/particles.js +284 -0
  31. package/umd/bundle.js +3 -2
  32. package/umd/index.js +8 -21
  33. package/umd/marcbruederlin/Particles.js +97 -0
  34. package/types/IParticlesJS.d.ts +0 -6
  35. /package/browser/{IParticlesJS.js → VincentGarreau/IParticlesJS.js} +0 -0
  36. /package/cjs/{IParticlesJS.js → VincentGarreau/IParticlesJS.js} +0 -0
  37. /package/esm/{IParticlesJS.js → VincentGarreau/IParticlesJS.js} +0 -0
  38. /package/umd/{IParticlesJS.js → VincentGarreau/IParticlesJS.js} +0 -0
@@ -4,22 +4,54 @@
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-alpha.1
7
+ * v3.0.0-beta.5
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
11
- module.exports = factory();
11
+ module.exports = factory(require("@tsparticles/engine"));
12
12
  else if(typeof define === 'function' && define.amd)
13
- define([], factory);
13
+ define(["@tsparticles/engine"], factory);
14
14
  else {
15
- var a = factory();
15
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
16
16
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
17
  }
18
- })(this, () => {
18
+ })(this, (__WEBPACK_EXTERNAL_MODULE__533__) => {
19
19
  return /******/ (() => { // webpackBootstrap
20
20
  /******/ "use strict";
21
- /******/ // The require scope
22
- /******/ var __webpack_require__ = {};
21
+ /******/ var __webpack_modules__ = ({
22
+
23
+ /***/ 533:
24
+ /***/ ((module) => {
25
+
26
+ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
27
+
28
+ /***/ })
29
+
30
+ /******/ });
31
+ /************************************************************************/
32
+ /******/ // The module cache
33
+ /******/ var __webpack_module_cache__ = {};
34
+ /******/
35
+ /******/ // The require function
36
+ /******/ function __webpack_require__(moduleId) {
37
+ /******/ // Check if module is in cache
38
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
39
+ /******/ if (cachedModule !== undefined) {
40
+ /******/ return cachedModule.exports;
41
+ /******/ }
42
+ /******/ // Create a new module (and put it into the cache)
43
+ /******/ var module = __webpack_module_cache__[moduleId] = {
44
+ /******/ // no module.id needed
45
+ /******/ // no module.loaded needed
46
+ /******/ exports: {}
47
+ /******/ };
48
+ /******/
49
+ /******/ // Execute the module function
50
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
51
+ /******/
52
+ /******/ // Return the exports of the module
53
+ /******/ return module.exports;
54
+ /******/ }
23
55
  /******/
24
56
  /************************************************************************/
25
57
  /******/ /* webpack/runtime/define property getters */
@@ -52,15 +84,347 @@ return /******/ (() => { // webpackBootstrap
52
84
  /******/
53
85
  /************************************************************************/
54
86
  var __webpack_exports__ = {};
87
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
88
+ (() => {
89
+ // ESM COMPAT FLAG
55
90
  __webpack_require__.r(__webpack_exports__);
56
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
57
- /* harmony export */ "initPjs": () => (/* binding */ initPjs)
58
- /* harmony export */ });
59
- const initPjs = engine => {
91
+
92
+ // EXPORTS
93
+ __webpack_require__.d(__webpack_exports__, {
94
+ initPjs: () => (/* binding */ initPjs)
95
+ });
96
+
97
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
98
+ var engine_root_window_ = __webpack_require__(533);
99
+ ;// CONCATENATED MODULE: ./dist/browser/marcbruederlin/Particles.js
100
+
101
+ class Particles {
102
+ static init(options) {
103
+ const particles = new Particles(),
104
+ selector = options.selector;
105
+ if (!selector) {
106
+ throw new Error("No selector provided");
107
+ }
108
+ const el = document.querySelector(selector);
109
+ if (!el) {
110
+ throw new Error("No element found for selector");
111
+ }
112
+ engine_root_window_.tsParticles.load({
113
+ id: selector.replace(".", "").replace("!", ""),
114
+ element: el,
115
+ options: {
116
+ fullScreen: {
117
+ enable: false
118
+ },
119
+ particles: {
120
+ color: {
121
+ value: options.color ?? "!000000"
122
+ },
123
+ links: {
124
+ color: "random",
125
+ distance: options.minDistance ?? 120,
126
+ enable: options.connectParticles ?? false
127
+ },
128
+ move: {
129
+ enable: true,
130
+ speed: options.speed ?? 0.5
131
+ },
132
+ number: {
133
+ value: options.maxParticles ?? 100
134
+ },
135
+ size: {
136
+ value: {
137
+ min: 1,
138
+ max: options.sizeVariations ?? 3
139
+ }
140
+ }
141
+ },
142
+ responsive: options.responsive?.map(responsive => ({
143
+ maxWidth: responsive.breakpoint,
144
+ options: {
145
+ particles: {
146
+ color: {
147
+ value: responsive.options?.color
148
+ },
149
+ links: {
150
+ distance: responsive.options?.minDistance,
151
+ enable: responsive.options?.connectParticles
152
+ },
153
+ number: {
154
+ value: options.maxParticles
155
+ },
156
+ move: {
157
+ enable: true,
158
+ speed: responsive.options?.speed
159
+ },
160
+ size: {
161
+ value: responsive.options?.sizeVariations
162
+ }
163
+ }
164
+ }
165
+ }))
166
+ }
167
+ }).then(container => {
168
+ particles._container = container;
169
+ });
170
+ return particles;
171
+ }
172
+ destroy() {
173
+ const container = this._container;
174
+ container && container.destroy();
175
+ }
176
+ pauseAnimation() {
177
+ const container = this._container;
178
+ container && container.pause();
179
+ }
180
+ resumeAnimation() {
181
+ const container = this._container;
182
+ container && container.play();
183
+ }
184
+ }
185
+ ;// CONCATENATED MODULE: ./dist/browser/VincentGarreau/particles.js
186
+
187
+ const defaultPjsOptions = {
188
+ particles: {
189
+ number: {
190
+ value: 400,
191
+ density: {
192
+ enable: true,
193
+ value_area: 800
194
+ }
195
+ },
196
+ color: {
197
+ value: "#fff"
198
+ },
199
+ shape: {
200
+ type: "circle",
201
+ stroke: {
202
+ width: 0,
203
+ color: "#ff0000"
204
+ },
205
+ polygon: {
206
+ nb_sides: 5
207
+ },
208
+ image: {
209
+ src: "",
210
+ width: 100,
211
+ height: 100
212
+ }
213
+ },
214
+ opacity: {
215
+ value: 1,
216
+ random: false,
217
+ anim: {
218
+ enable: false,
219
+ speed: 2,
220
+ opacity_min: 0,
221
+ sync: false
222
+ }
223
+ },
224
+ size: {
225
+ value: 20,
226
+ random: false,
227
+ anim: {
228
+ enable: false,
229
+ speed: 20,
230
+ size_min: 0,
231
+ sync: false
232
+ }
233
+ },
234
+ line_linked: {
235
+ enable: true,
236
+ distance: 100,
237
+ color: "#fff",
238
+ opacity: 1,
239
+ width: 1
240
+ },
241
+ move: {
242
+ enable: true,
243
+ speed: 2,
244
+ direction: "none",
245
+ random: false,
246
+ straight: false,
247
+ out_mode: "out",
248
+ bounce: false,
249
+ attract: {
250
+ enable: false,
251
+ rotateX: 3000,
252
+ rotateY: 3000
253
+ }
254
+ }
255
+ },
256
+ interactivity: {
257
+ detect_on: "canvas",
258
+ events: {
259
+ onhover: {
260
+ enable: true,
261
+ mode: "grab"
262
+ },
263
+ onclick: {
264
+ enable: true,
265
+ mode: "push"
266
+ },
267
+ resize: true
268
+ },
269
+ modes: {
270
+ grab: {
271
+ distance: 100,
272
+ line_linked: {
273
+ opacity: 1
274
+ }
275
+ },
276
+ bubble: {
277
+ distance: 200,
278
+ size: 80,
279
+ duration: 0.4,
280
+ opacity: 1,
281
+ speed: 3
282
+ },
283
+ repulse: {
284
+ distance: 200,
285
+ duration: 0.4
286
+ },
287
+ push: {
288
+ particles_nb: 4
289
+ },
290
+ remove: {
291
+ particles_nb: 2
292
+ }
293
+ }
294
+ },
295
+ retina_detect: false
296
+ };
297
+ const initParticlesJS = engine => {
60
298
  const particlesJS = (tagId, options) => {
299
+ const fixedOptions = (0,engine_root_window_.deepExtend)(defaultPjsOptions, options);
61
300
  return engine.load({
62
301
  id: tagId,
63
- options: options
302
+ options: {
303
+ fullScreen: {
304
+ enable: false
305
+ },
306
+ detectRetina: fixedOptions.retina_detect,
307
+ smooth: true,
308
+ interactivity: {
309
+ detectsOn: fixedOptions.interactivity.detect_on,
310
+ events: {
311
+ onHover: {
312
+ enable: fixedOptions.interactivity.events.onhover.enable,
313
+ mode: fixedOptions.interactivity.events.onhover.mode
314
+ },
315
+ onClick: {
316
+ enable: fixedOptions.interactivity.events.onclick.enable,
317
+ mode: fixedOptions.interactivity.events.onclick.mode
318
+ },
319
+ resize: {
320
+ enable: fixedOptions.interactivity.events.resize
321
+ }
322
+ },
323
+ modes: {
324
+ grab: {
325
+ distance: fixedOptions.interactivity.modes.grab.distance,
326
+ links: {
327
+ opacity: fixedOptions.interactivity.modes.grab.line_linked.opacity
328
+ }
329
+ },
330
+ bubble: {
331
+ distance: fixedOptions.interactivity.modes.bubble.distance,
332
+ size: fixedOptions.interactivity.modes.bubble.size,
333
+ duration: fixedOptions.interactivity.modes.bubble.duration,
334
+ opacity: fixedOptions.interactivity.modes.bubble.opacity,
335
+ speed: fixedOptions.interactivity.modes.bubble.speed
336
+ },
337
+ repulse: {
338
+ distance: fixedOptions.interactivity.modes.repulse.distance,
339
+ duration: fixedOptions.interactivity.modes.repulse.duration
340
+ },
341
+ push: {
342
+ quantity: fixedOptions.interactivity.modes.push.particles_nb
343
+ },
344
+ remove: {
345
+ quantity: fixedOptions.interactivity.modes.remove.particles_nb
346
+ }
347
+ }
348
+ },
349
+ particles: {
350
+ collisions: {
351
+ enable: fixedOptions.particles.move.bounce
352
+ },
353
+ number: {
354
+ value: fixedOptions.particles.number.value,
355
+ density: {
356
+ enable: fixedOptions.particles.number.density.enable,
357
+ width: fixedOptions.particles.number.density.value_area
358
+ }
359
+ },
360
+ color: {
361
+ value: fixedOptions.particles.color.value
362
+ },
363
+ stroke: {
364
+ width: fixedOptions.particles.shape.stroke.width,
365
+ color: {
366
+ value: fixedOptions.particles.shape.stroke.color
367
+ }
368
+ },
369
+ shape: {
370
+ type: fixedOptions.particles.shape.type,
371
+ options: {
372
+ polygon: {
373
+ sides: fixedOptions.particles.shape.polygon.nb_sides
374
+ },
375
+ image: {
376
+ src: fixedOptions.particles.shape.image.src,
377
+ width: fixedOptions.particles.shape.image.width,
378
+ height: fixedOptions.particles.shape.image.height
379
+ }
380
+ }
381
+ },
382
+ opacity: {
383
+ value: fixedOptions.particles.opacity.random ? {
384
+ min: fixedOptions.particles.opacity.anim.enable ? fixedOptions.particles.opacity.anim.opacity_min : 0,
385
+ max: fixedOptions.particles.opacity.value
386
+ } : fixedOptions.particles.opacity.value,
387
+ animation: {
388
+ enable: fixedOptions.particles.opacity.anim.enable,
389
+ speed: fixedOptions.particles.opacity.anim.speed,
390
+ sync: fixedOptions.particles.opacity.anim.sync
391
+ }
392
+ },
393
+ size: {
394
+ value: fixedOptions.particles.size.random ? {
395
+ min: fixedOptions.particles.size.anim.enable ? fixedOptions.particles.size.anim.size_min : 0,
396
+ max: fixedOptions.particles.size.value
397
+ } : fixedOptions.particles.size.value,
398
+ animation: {
399
+ enable: fixedOptions.particles.size.anim.enable,
400
+ speed: fixedOptions.particles.size.anim.speed,
401
+ sync: fixedOptions.particles.size.anim.sync
402
+ }
403
+ },
404
+ links: {
405
+ enable: fixedOptions.particles.line_linked.enable,
406
+ distance: fixedOptions.particles.line_linked.distance,
407
+ color: fixedOptions.particles.line_linked.color,
408
+ opacity: fixedOptions.particles.line_linked.opacity,
409
+ width: fixedOptions.particles.line_linked.width
410
+ },
411
+ move: {
412
+ enable: fixedOptions.particles.move.enable,
413
+ speed: fixedOptions.particles.move.speed / 3,
414
+ direction: fixedOptions.particles.move.direction,
415
+ random: fixedOptions.particles.move.random,
416
+ straight: fixedOptions.particles.move.straight,
417
+ outModes: fixedOptions.particles.move.out_mode,
418
+ attract: {
419
+ enable: fixedOptions.particles.move.attract.enable,
420
+ rotate: {
421
+ x: fixedOptions.particles.move.attract.rotateX,
422
+ y: fixedOptions.particles.move.attract.rotateY
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
64
428
  });
65
429
  };
66
430
  particlesJS.load = (tagId, pathConfigJson, callback) => {
@@ -85,6 +449,26 @@ const initPjs = engine => {
85
449
  };
86
450
  };
87
451
 
452
+ ;// CONCATENATED MODULE: ./dist/browser/index.js
453
+
454
+
455
+ const initPjs = engine => {
456
+ const {
457
+ particlesJS,
458
+ pJSDom
459
+ } = initParticlesJS(engine);
460
+ window.particlesJS = particlesJS;
461
+ window.pJSDom = pJSDom;
462
+ window.Particles = Particles;
463
+ return {
464
+ particlesJS,
465
+ pJSDom,
466
+ Particles: Particles
467
+ };
468
+ };
469
+
470
+ })();
471
+
88
472
  /******/ return __webpack_exports__;
89
473
  /******/ })()
90
474
  ;
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.pjs.min.js.LICENSE.txt */
2
- !function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var t=o();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{initPjs:()=>t});const t=e=>{const o=(o,t)=>e.load({id:o,options:t});o.load=(o,t,r)=>{e.load({id:o,url:t}).then((e=>{e&&r(e)})).catch((()=>{r(void 0)}))},o.setOnClickHandler=o=>{e.setOnClickHandler(o)};return{particlesJS:o,pJSDom:e.dom()}};return o})()));
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 a in i)("object"==typeof exports?exports:e)[a]=i[a]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},i={};function a(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{a.r(n),a.d(n,{initPjs:()=>o});var e=a(533);class t{static init(i){const a=new t,n=i.selector;if(!n)throw new Error("No selector provided");const o=document.querySelector(n);if(!o)throw new Error("No element found for selector");return e.tsParticles.load({id:n.replace(".","").replace("!",""),element:o,options:{fullScreen:{enable:!1},particles:{color:{value:i.color??"!000000"},links:{color:"random",distance:i.minDistance??120,enable:i.connectParticles??!1},move:{enable:!0,speed:i.speed??.5},number:{value:i.maxParticles??100},size:{value:{min:1,max:i.sizeVariations??3}}},responsive:i.responsive?.map((e=>({maxWidth:e.breakpoint,options:{particles:{color:{value:e.options?.color},links:{distance:e.options?.minDistance,enable:e.options?.connectParticles},number:{value:i.maxParticles},move:{enable:!0,speed:e.options?.speed},size:{value:e.options?.sizeVariations}}}})))}}).then((e=>{a._container=e})),a}destroy(){const e=this._container;e&&e.destroy()}pauseAnimation(){const e=this._container;e&&e.pause()}resumeAnimation(){const e=this._container;e&&e.play()}}const i={particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}}},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4,opacity:1,speed:3},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}}},retina_detect:!1},o=a=>{const{particlesJS:n,pJSDom:o}=(t=>{const a=(a,n)=>{const o=(0,e.deepExtend)(i,n);return t.load({id:a,options:{fullScreen:{enable:!1},detectRetina:o.retina_detect,smooth:!0,interactivity:{detectsOn:o.interactivity.detect_on,events:{onHover:{enable:o.interactivity.events.onhover.enable,mode:o.interactivity.events.onhover.mode},onClick:{enable:o.interactivity.events.onclick.enable,mode:o.interactivity.events.onclick.mode},resize:{enable:o.interactivity.events.resize}},modes:{grab:{distance:o.interactivity.modes.grab.distance,links:{opacity:o.interactivity.modes.grab.line_linked.opacity}},bubble:{distance:o.interactivity.modes.bubble.distance,size:o.interactivity.modes.bubble.size,duration:o.interactivity.modes.bubble.duration,opacity:o.interactivity.modes.bubble.opacity,speed:o.interactivity.modes.bubble.speed},repulse:{distance:o.interactivity.modes.repulse.distance,duration:o.interactivity.modes.repulse.duration},push:{quantity:o.interactivity.modes.push.particles_nb},remove:{quantity:o.interactivity.modes.remove.particles_nb}}},particles:{collisions:{enable:o.particles.move.bounce},number:{value:o.particles.number.value,density:{enable:o.particles.number.density.enable,width:o.particles.number.density.value_area}},color:{value:o.particles.color.value},stroke:{width:o.particles.shape.stroke.width,color:{value:o.particles.shape.stroke.color}},shape:{type:o.particles.shape.type,options:{polygon:{sides:o.particles.shape.polygon.nb_sides},image:{src:o.particles.shape.image.src,width:o.particles.shape.image.width,height:o.particles.shape.image.height}}},opacity:{value:o.particles.opacity.random?{min:o.particles.opacity.anim.enable?o.particles.opacity.anim.opacity_min:0,max:o.particles.opacity.value}:o.particles.opacity.value,animation:{enable:o.particles.opacity.anim.enable,speed:o.particles.opacity.anim.speed,sync:o.particles.opacity.anim.sync}},size:{value:o.particles.size.random?{min:o.particles.size.anim.enable?o.particles.size.anim.size_min:0,max:o.particles.size.value}:o.particles.size.value,animation:{enable:o.particles.size.anim.enable,speed:o.particles.size.anim.speed,sync:o.particles.size.anim.sync}},links:{enable:o.particles.line_linked.enable,distance:o.particles.line_linked.distance,color:o.particles.line_linked.color,opacity:o.particles.line_linked.opacity,width:o.particles.line_linked.width},move:{enable:o.particles.move.enable,speed:o.particles.move.speed/3,direction:o.particles.move.direction,random:o.particles.move.random,straight:o.particles.move.straight,outModes:o.particles.move.out_mode,attract:{enable:o.particles.move.attract.enable,rotate:{x:o.particles.move.attract.rotateX,y:o.particles.move.attract.rotateY}}}}}})};return a.load=(e,i,a)=>{t.load({id:e,url:i}).then((e=>{e&&a(e)})).catch((()=>{a(void 0)}))},a.setOnClickHandler=e=>{t.setOnClickHandler(e)},{particlesJS:a,pJSDom:t.dom()}})(a);return window.particlesJS=n,window.pJSDom=o,window.Particles=t,{particlesJS:n,pJSDom:o,Particles:t}}})(),n})()));
@@ -1,8 +1 @@
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.0.0-alpha.1
8
- */
1
+ /*! tsParticles Particles.js v3.0.0-beta.5 by Matteo Bruni */
@@ -0,0 +1,117 @@
1
+ import type { Container, IHsl, IRgb, IValueColor, InteractivityDetect, MoveDirection, OutMode } from "@tsparticles/engine";
2
+ export interface IParticlesJSOptions {
3
+ interactivity: {
4
+ detect_on: InteractivityDetect | keyof typeof InteractivityDetect;
5
+ events: {
6
+ onclick: {
7
+ enable: boolean;
8
+ mode: string;
9
+ };
10
+ onhover: {
11
+ enable: boolean;
12
+ mode: string;
13
+ };
14
+ resize: boolean;
15
+ };
16
+ modes: {
17
+ bubble: {
18
+ distance: number;
19
+ duration: number;
20
+ opacity: number;
21
+ size: number;
22
+ speed: number;
23
+ };
24
+ grab: {
25
+ distance: number;
26
+ line_linked: {
27
+ opacity: number;
28
+ };
29
+ };
30
+ push: {
31
+ particles_nb: number;
32
+ };
33
+ remove: {
34
+ particles_nb: number;
35
+ };
36
+ repulse: {
37
+ distance: number;
38
+ duration: number;
39
+ };
40
+ };
41
+ };
42
+ particles: {
43
+ color: {
44
+ value: string | IRgb | IHsl | IValueColor;
45
+ };
46
+ line_linked: {
47
+ color: string;
48
+ distance: number;
49
+ enable: boolean;
50
+ opacity: number;
51
+ width: number;
52
+ };
53
+ move: {
54
+ attract: {
55
+ enable: boolean;
56
+ rotateX: number;
57
+ rotateY: number;
58
+ };
59
+ bounce: boolean;
60
+ direction: MoveDirection | keyof typeof MoveDirection;
61
+ enable: boolean;
62
+ out_mode: OutMode | keyof typeof OutMode;
63
+ random: boolean;
64
+ speed: number;
65
+ straight: boolean;
66
+ };
67
+ number: {
68
+ density: {
69
+ enable: boolean;
70
+ value_area: number;
71
+ };
72
+ value: number;
73
+ };
74
+ opacity: {
75
+ anim: {
76
+ enable: boolean;
77
+ opacity_min: number;
78
+ speed: number;
79
+ sync: boolean;
80
+ };
81
+ random: boolean;
82
+ value: number;
83
+ };
84
+ shape: {
85
+ image: {
86
+ height: number;
87
+ replace_color?: boolean;
88
+ src: string;
89
+ width: number;
90
+ };
91
+ polygon: {
92
+ nb_sides: number;
93
+ };
94
+ stroke: {
95
+ color: string | IRgb | IHsl | IValueColor;
96
+ width: number;
97
+ };
98
+ type: string;
99
+ };
100
+ size: {
101
+ anim: {
102
+ enable: boolean;
103
+ size_min: number;
104
+ speed: number;
105
+ sync: boolean;
106
+ };
107
+ random: boolean;
108
+ value: number;
109
+ };
110
+ };
111
+ retina_detect: boolean;
112
+ }
113
+ export interface IParticlesJS {
114
+ (tagId: string, options: IParticlesJSOptions): Promise<Container | undefined>;
115
+ load(tagId: string, pathConfigJson: string, callback: (container?: Container) => void): void;
116
+ setOnClickHandler(callback: EventListenerOrEventListenerObject): void;
117
+ }
@@ -0,0 +1,7 @@
1
+ import { type Container, type Engine } from "@tsparticles/engine";
2
+ import type { IParticlesJS } from "./IParticlesJS.js";
3
+ declare const initParticlesJS: (engine: Engine) => {
4
+ pJSDom: Container[];
5
+ particlesJS: IParticlesJS;
6
+ };
7
+ export { initParticlesJS };
package/types/bundle.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const particlesJS: import("./IParticlesJS").IParticlesJS, pJSDom: import("@tsparticles/engine").Container[];
1
+ declare const particlesJS: import("./VincentGarreau/IParticlesJS").IParticlesJS, pJSDom: import("@tsparticles/engine").Container[], Particles: typeof import("./marcbruederlin/Particles").Particles;
2
2
  export * from "@tsparticles/engine";
3
- export { particlesJS, pJSDom };
3
+ export { particlesJS, pJSDom, Particles };
package/types/index.d.ts CHANGED
@@ -1,6 +1,15 @@
1
- import type { Container, Engine } from "@tsparticles/engine";
2
- import type { IParticlesJS } from "./IParticlesJS";
1
+ import { type Container, type Engine } from "@tsparticles/engine";
2
+ import type { IParticlesJS } from "./VincentGarreau/IParticlesJS.js";
3
+ import { Particles } from "./marcbruederlin/Particles.js";
4
+ declare global {
5
+ interface Window {
6
+ Particles: typeof Particles;
7
+ pJSDom: Container[];
8
+ particlesJS: IParticlesJS;
9
+ }
10
+ }
3
11
  declare const initPjs: (engine: Engine) => {
12
+ Particles: typeof Particles;
4
13
  pJSDom: Container[];
5
14
  particlesJS: IParticlesJS;
6
15
  };
@@ -0,0 +1,23 @@
1
+ import { type RecursivePartial, type SingleOrMultiple } from "@tsparticles/engine";
2
+ interface ResponsiveOptions {
3
+ breakpoint: number;
4
+ options: ParticlesOptions;
5
+ }
6
+ interface ParticlesOptions {
7
+ color: SingleOrMultiple<string>;
8
+ connectParticles: boolean;
9
+ maxParticles: number;
10
+ minDistance: number;
11
+ responsive: ResponsiveOptions[];
12
+ selector: string;
13
+ sizeVariations: number;
14
+ speed: number;
15
+ }
16
+ export declare class Particles {
17
+ private _container?;
18
+ static init(options: RecursivePartial<ParticlesOptions>): Particles;
19
+ destroy(): void;
20
+ pauseAnimation(): void;
21
+ resumeAnimation(): void;
22
+ }
23
+ export {};