@tsparticles/pjs 3.0.3 → 3.2.0

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.
@@ -4,7 +4,15 @@
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.3
7
+ * v3.2.0
8
+ */
9
+ /*
10
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
11
+ * This devtool is neither made for production nor for readable output files.
12
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
13
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
14
+ * or disable the default devtool with "devtool: false".
15
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8
16
  */
9
17
  (function webpackUniversalModuleDefinition(root, factory) {
10
18
  if(typeof exports === 'object' && typeof module === 'object')
@@ -15,15 +23,48 @@
15
23
  var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
16
24
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
25
  }
18
- })(this, (__WEBPACK_EXTERNAL_MODULE__533__) => {
26
+ })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
19
27
  return /******/ (() => { // webpackBootstrap
20
28
  /******/ "use strict";
21
29
  /******/ var __webpack_modules__ = ({
22
30
 
23
- /***/ 533:
31
+ /***/ "./dist/browser/VincentGarreau/particles.js":
32
+ /*!**************************************************!*\
33
+ !*** ./dist/browser/VincentGarreau/particles.js ***!
34
+ \**************************************************/
35
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
+
37
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initParticlesJS: () => (/* binding */ initParticlesJS)\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 defaultMinOpacity = 0,\n defaultMinSize = 0,\n speedFactor = 3,\n defaultPjsOptions = {\n particles: {\n number: {\n value: 400,\n density: {\n enable: true,\n value_area: 800\n }\n },\n color: {\n value: \"#fff\"\n },\n shape: {\n type: \"circle\",\n stroke: {\n width: 0,\n color: \"#ff0000\"\n },\n polygon: {\n nb_sides: 5\n },\n image: {\n src: \"\",\n width: 100,\n height: 100\n }\n },\n opacity: {\n value: 1,\n random: false,\n anim: {\n enable: false,\n speed: 2,\n opacity_min: 0,\n sync: false\n }\n },\n size: {\n value: 20,\n random: false,\n anim: {\n enable: false,\n speed: 20,\n size_min: 0,\n sync: false\n }\n },\n line_linked: {\n enable: true,\n distance: 100,\n color: \"#fff\",\n opacity: 1,\n width: 1\n },\n move: {\n enable: true,\n speed: 2,\n direction: \"none\",\n random: false,\n straight: false,\n out_mode: \"out\",\n bounce: false,\n attract: {\n enable: false,\n rotateX: 3000,\n rotateY: 3000\n }\n }\n },\n interactivity: {\n detect_on: \"canvas\",\n events: {\n onhover: {\n enable: true,\n mode: \"grab\"\n },\n onclick: {\n enable: true,\n mode: \"push\"\n },\n resize: true\n },\n modes: {\n grab: {\n distance: 100,\n line_linked: {\n opacity: 1\n }\n },\n bubble: {\n distance: 200,\n size: 80,\n duration: 0.4,\n opacity: 1,\n speed: 3\n },\n repulse: {\n distance: 200,\n duration: 0.4\n },\n push: {\n particles_nb: 4\n },\n remove: {\n particles_nb: 2\n }\n }\n },\n retina_detect: false\n };\nconst initParticlesJS = engine => {\n const particlesJS = (tagId, options) => {\n const fixedOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)(defaultPjsOptions, options);\n return engine.load({\n id: tagId,\n options: {\n fullScreen: {\n enable: false\n },\n detectRetina: fixedOptions.retina_detect,\n smooth: true,\n interactivity: {\n detectsOn: fixedOptions.interactivity.detect_on,\n events: {\n onHover: {\n enable: fixedOptions.interactivity.events.onhover.enable,\n mode: fixedOptions.interactivity.events.onhover.mode\n },\n onClick: {\n enable: fixedOptions.interactivity.events.onclick.enable,\n mode: fixedOptions.interactivity.events.onclick.mode\n },\n resize: {\n enable: fixedOptions.interactivity.events.resize\n }\n },\n modes: {\n grab: {\n distance: fixedOptions.interactivity.modes.grab.distance,\n links: {\n opacity: fixedOptions.interactivity.modes.grab.line_linked.opacity\n }\n },\n bubble: {\n distance: fixedOptions.interactivity.modes.bubble.distance,\n size: fixedOptions.interactivity.modes.bubble.size,\n duration: fixedOptions.interactivity.modes.bubble.duration,\n opacity: fixedOptions.interactivity.modes.bubble.opacity,\n speed: fixedOptions.interactivity.modes.bubble.speed\n },\n repulse: {\n distance: fixedOptions.interactivity.modes.repulse.distance,\n duration: fixedOptions.interactivity.modes.repulse.duration\n },\n push: {\n quantity: fixedOptions.interactivity.modes.push.particles_nb\n },\n remove: {\n quantity: fixedOptions.interactivity.modes.remove.particles_nb\n }\n }\n },\n particles: {\n collisions: {\n enable: fixedOptions.particles.move.bounce\n },\n number: {\n value: fixedOptions.particles.number.value,\n density: {\n enable: fixedOptions.particles.number.density.enable,\n width: fixedOptions.particles.number.density.value_area\n }\n },\n color: {\n value: fixedOptions.particles.color.value\n },\n stroke: {\n width: fixedOptions.particles.shape.stroke.width,\n color: {\n value: fixedOptions.particles.shape.stroke.color\n }\n },\n shape: {\n type: fixedOptions.particles.shape.type,\n options: {\n polygon: {\n sides: fixedOptions.particles.shape.polygon.nb_sides\n },\n image: {\n src: fixedOptions.particles.shape.image.src,\n width: fixedOptions.particles.shape.image.width,\n height: fixedOptions.particles.shape.image.height\n }\n }\n },\n opacity: {\n value: fixedOptions.particles.opacity.random ? {\n min: fixedOptions.particles.opacity.anim.enable ? fixedOptions.particles.opacity.anim.opacity_min : defaultMinOpacity,\n max: fixedOptions.particles.opacity.value\n } : fixedOptions.particles.opacity.value,\n animation: {\n enable: fixedOptions.particles.opacity.anim.enable,\n speed: fixedOptions.particles.opacity.anim.speed,\n sync: fixedOptions.particles.opacity.anim.sync\n }\n },\n size: {\n value: fixedOptions.particles.size.random ? {\n min: fixedOptions.particles.size.anim.enable ? fixedOptions.particles.size.anim.size_min : defaultMinSize,\n max: fixedOptions.particles.size.value\n } : fixedOptions.particles.size.value,\n animation: {\n enable: fixedOptions.particles.size.anim.enable,\n speed: fixedOptions.particles.size.anim.speed,\n sync: fixedOptions.particles.size.anim.sync\n }\n },\n links: {\n enable: fixedOptions.particles.line_linked.enable,\n distance: fixedOptions.particles.line_linked.distance,\n color: fixedOptions.particles.line_linked.color,\n opacity: fixedOptions.particles.line_linked.opacity,\n width: fixedOptions.particles.line_linked.width\n },\n move: {\n enable: fixedOptions.particles.move.enable,\n speed: fixedOptions.particles.move.speed / speedFactor,\n direction: fixedOptions.particles.move.direction,\n random: fixedOptions.particles.move.random,\n straight: fixedOptions.particles.move.straight,\n outModes: fixedOptions.particles.move.out_mode,\n attract: {\n enable: fixedOptions.particles.move.attract.enable,\n rotate: {\n x: fixedOptions.particles.move.attract.rotateX,\n y: fixedOptions.particles.move.attract.rotateY\n }\n }\n }\n }\n }\n });\n };\n particlesJS.load = (tagId, pathConfigJson, callback) => {\n engine.load({\n id: tagId,\n url: pathConfigJson\n }).then(container => {\n if (container) {\n callback(container);\n }\n }).catch(() => {\n callback(undefined);\n });\n };\n particlesJS.setOnClickHandler = callback => {\n engine.setOnClickHandler(callback);\n };\n const pJSDom = engine.dom();\n return {\n particlesJS,\n pJSDom\n };\n};\n\n\n//# sourceURL=webpack://@tsparticles/pjs/./dist/browser/VincentGarreau/particles.js?");
38
+
39
+ /***/ }),
40
+
41
+ /***/ "./dist/browser/index.js":
42
+ /*!*******************************!*\
43
+ !*** ./dist/browser/index.js ***!
44
+ \*******************************/
45
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
46
+
47
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initPjs: () => (/* binding */ initPjs)\n/* harmony export */ });\n/* harmony import */ var _marcbruederlin_Particles_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./marcbruederlin/Particles.js */ \"./dist/browser/marcbruederlin/Particles.js\");\n/* harmony import */ var _VincentGarreau_particles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VincentGarreau/particles.js */ \"./dist/browser/VincentGarreau/particles.js\");\n\n\nconst initPjs = engine => {\n const {\n particlesJS,\n pJSDom\n } = (0,_VincentGarreau_particles_js__WEBPACK_IMPORTED_MODULE_0__.initParticlesJS)(engine);\n window.particlesJS = particlesJS;\n window.pJSDom = pJSDom;\n window.Particles = _marcbruederlin_Particles_js__WEBPACK_IMPORTED_MODULE_1__.Particles;\n return {\n particlesJS,\n pJSDom,\n Particles: _marcbruederlin_Particles_js__WEBPACK_IMPORTED_MODULE_1__.Particles\n };\n};\n\n\n//# sourceURL=webpack://@tsparticles/pjs/./dist/browser/index.js?");
48
+
49
+ /***/ }),
50
+
51
+ /***/ "./dist/browser/marcbruederlin/Particles.js":
52
+ /*!**************************************************!*\
53
+ !*** ./dist/browser/marcbruederlin/Particles.js ***!
54
+ \**************************************************/
55
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
56
+
57
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Particles: () => (/* binding */ Particles)\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 linksMinDistance = 120,\n moveMinSpeed = 0.5,\n particlesMinCount = 100,\n sizeMinValue = 3;\nclass Particles {\n static init(options) {\n const particles = new Particles(),\n selector = options.selector;\n if (!selector) {\n throw new Error(\"No selector provided\");\n }\n const el = document.querySelector(selector);\n if (!el) {\n throw new Error(\"No element found for selector\");\n }\n void _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles.load({\n element: el,\n id: selector.replace(\".\", \"\").replace(\"!\", \"\"),\n options: {\n fullScreen: {\n enable: false\n },\n particles: {\n color: {\n value: options.color ?? \"!000000\"\n },\n links: {\n color: \"random\",\n distance: options.minDistance ?? linksMinDistance,\n enable: options.connectParticles ?? false\n },\n move: {\n enable: true,\n speed: options.speed ?? moveMinSpeed\n },\n number: {\n value: options.maxParticles ?? particlesMinCount\n },\n size: {\n value: {\n min: 1,\n max: options.sizeVariations ?? sizeMinValue\n }\n }\n },\n responsive: options.responsive?.map(responsive => ({\n maxWidth: responsive.breakpoint,\n options: {\n particles: {\n color: {\n value: responsive.options?.color\n },\n links: {\n distance: responsive.options?.minDistance,\n enable: responsive.options?.connectParticles\n },\n number: {\n value: options.maxParticles\n },\n move: {\n enable: true,\n speed: responsive.options?.speed\n },\n size: {\n value: responsive.options?.sizeVariations\n }\n }\n }\n }))\n }\n }).then(container => {\n particles._container = container;\n });\n return particles;\n }\n destroy() {\n const container = this._container;\n container?.destroy();\n }\n pauseAnimation() {\n const container = this._container;\n container?.pause();\n }\n resumeAnimation() {\n const container = this._container;\n container?.play();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/pjs/./dist/browser/marcbruederlin/Particles.js?");
58
+
59
+ /***/ }),
60
+
61
+ /***/ "@tsparticles/engine":
62
+ /*!*********************************************************************************************************************************!*\
63
+ !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
64
+ \*********************************************************************************************************************************/
24
65
  /***/ ((module) => {
25
66
 
26
- module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
67
+ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
27
68
 
28
69
  /***/ })
29
70
 
@@ -54,6 +95,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
54
95
  /******/ }
55
96
  /******/
56
97
  /************************************************************************/
98
+ /******/ /* webpack/runtime/compat get default export */
99
+ /******/ (() => {
100
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
101
+ /******/ __webpack_require__.n = (module) => {
102
+ /******/ var getter = module && module.__esModule ?
103
+ /******/ () => (module['default']) :
104
+ /******/ () => (module);
105
+ /******/ __webpack_require__.d(getter, { a: getter });
106
+ /******/ return getter;
107
+ /******/ };
108
+ /******/ })();
109
+ /******/
57
110
  /******/ /* webpack/runtime/define property getters */
58
111
  /******/ (() => {
59
112
  /******/ // define getter functions for harmony exports
@@ -83,392 +136,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
83
136
  /******/ })();
84
137
  /******/
85
138
  /************************************************************************/
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
90
- __webpack_require__.r(__webpack_exports__);
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 => {
298
- const particlesJS = (tagId, options) => {
299
- const fixedOptions = (0,engine_root_window_.deepExtend)(defaultPjsOptions, options);
300
- return engine.load({
301
- id: tagId,
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
- }
428
- });
429
- };
430
- particlesJS.load = (tagId, pathConfigJson, callback) => {
431
- engine.load({
432
- id: tagId,
433
- url: pathConfigJson
434
- }).then(container => {
435
- if (container) {
436
- callback(container);
437
- }
438
- }).catch(() => {
439
- callback(undefined);
440
- });
441
- };
442
- particlesJS.setOnClickHandler = callback => {
443
- engine.setOnClickHandler(callback);
444
- };
445
- const pJSDom = engine.dom();
446
- return {
447
- particlesJS,
448
- pJSDom
449
- };
450
- };
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
-
139
+ /******/
140
+ /******/ // startup
141
+ /******/ // Load entry module and return exports
142
+ /******/ // This entry module can't be inlined because the eval devtool is used.
143
+ /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
144
+ /******/
472
145
  /******/ return __webpack_exports__;
473
146
  /******/ })()
474
147
  ;
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.pjs.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 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})()));
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=>(()=>{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({element:o,id:n.replace(".","").replace("!",""),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?.destroy()}pauseAnimation(){const e=this._container;e?.pause()}resumeAnimation(){const e=this._container;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 +1 @@
1
- /*! tsParticles Particles.js v3.0.3 by Matteo Bruni */
1
+ /*! tsParticles Particles.js v3.2.0 by Matteo Bruni */
@@ -11,7 +11,7 @@
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.initParticlesJS = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const defaultPjsOptions = {
14
+ const defaultMinOpacity = 0, defaultMinSize = 0, speedFactor = 3, defaultPjsOptions = {
15
15
  particles: {
16
16
  number: {
17
17
  value: 400,
@@ -211,7 +211,7 @@
211
211
  ? {
212
212
  min: fixedOptions.particles.opacity.anim.enable
213
213
  ? fixedOptions.particles.opacity.anim.opacity_min
214
- : 0,
214
+ : defaultMinOpacity,
215
215
  max: fixedOptions.particles.opacity.value,
216
216
  }
217
217
  : fixedOptions.particles.opacity.value,
@@ -226,7 +226,7 @@
226
226
  ? {
227
227
  min: fixedOptions.particles.size.anim.enable
228
228
  ? fixedOptions.particles.size.anim.size_min
229
- : 0,
229
+ : defaultMinSize,
230
230
  max: fixedOptions.particles.size.value,
231
231
  }
232
232
  : fixedOptions.particles.size.value,
@@ -245,7 +245,7 @@
245
245
  },
246
246
  move: {
247
247
  enable: fixedOptions.particles.move.enable,
248
- speed: fixedOptions.particles.move.speed / 3,
248
+ speed: fixedOptions.particles.move.speed / speedFactor,
249
249
  direction: fixedOptions.particles.move.direction,
250
250
  random: fixedOptions.particles.move.random,
251
251
  straight: fixedOptions.particles.move.straight,
@@ -11,6 +11,7 @@
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Particles = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
+ const linksMinDistance = 120, moveMinSpeed = 0.5, particlesMinCount = 100, sizeMinValue = 3;
14
15
  class Particles {
15
16
  static init(options) {
16
17
  const particles = new Particles(), selector = options.selector;
@@ -21,10 +22,10 @@
21
22
  if (!el) {
22
23
  throw new Error("No element found for selector");
23
24
  }
24
- engine_1.tsParticles
25
+ void engine_1.tsParticles
25
26
  .load({
26
- id: selector.replace(".", "").replace("!", ""),
27
27
  element: el,
28
+ id: selector.replace(".", "").replace("!", ""),
28
29
  options: {
29
30
  fullScreen: {
30
31
  enable: false,
@@ -35,18 +36,18 @@
35
36
  },
36
37
  links: {
37
38
  color: "random",
38
- distance: options.minDistance ?? 120,
39
+ distance: options.minDistance ?? linksMinDistance,
39
40
  enable: options.connectParticles ?? false,
40
41
  },
41
42
  move: {
42
43
  enable: true,
43
- speed: options.speed ?? 0.5,
44
+ speed: options.speed ?? moveMinSpeed,
44
45
  },
45
46
  number: {
46
- value: options.maxParticles ?? 100,
47
+ value: options.maxParticles ?? particlesMinCount,
47
48
  },
48
49
  size: {
49
- value: { min: 1, max: options.sizeVariations ?? 3 },
50
+ value: { min: 1, max: options.sizeVariations ?? sizeMinValue },
50
51
  },
51
52
  },
52
53
  responsive: options.responsive?.map((responsive) => ({
@@ -82,15 +83,15 @@
82
83
  }
83
84
  destroy() {
84
85
  const container = this._container;
85
- container && container.destroy();
86
+ container?.destroy();
86
87
  }
87
88
  pauseAnimation() {
88
89
  const container = this._container;
89
- container && container.pause();
90
+ container?.pause();
90
91
  }
91
92
  resumeAnimation() {
92
93
  const container = this._container;
93
- container && container.play();
94
+ container?.play();
94
95
  }
95
96
  }
96
97
  exports.Particles = Particles;