jekyll-theme-zer0 0.1.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.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +499 -0
  4. data/_includes/branding.html +43 -0
  5. data/_includes/breadcrumbs.html +31 -0
  6. data/_includes/dev-shortcuts.html +57 -0
  7. data/_includes/footer.html +57 -0
  8. data/_includes/giscus.html +16 -0
  9. data/_includes/google-analytics.html +9 -0
  10. data/_includes/google-tag-manager-body.html +8 -0
  11. data/_includes/google-tag-manager-head.html +10 -0
  12. data/_includes/halfmoon.html +35 -0
  13. data/_includes/head.html +95 -0
  14. data/_includes/header.html +79 -0
  15. data/_includes/info-section.html +33 -0
  16. data/_includes/intro.html +27 -0
  17. data/_includes/js-cdn.html +24 -0
  18. data/_includes/nav_list.html +63 -0
  19. data/_includes/navbar.html +34 -0
  20. data/_includes/powered-by.html +22 -0
  21. data/_includes/quick-index.html +17 -0
  22. data/_includes/searchbar.html +10 -0
  23. data/_includes/seo.html +131 -0
  24. data/_includes/sidebar-categories.html +21 -0
  25. data/_includes/sidebar-folders.html +107 -0
  26. data/_includes/sidebar-left.html +41 -0
  27. data/_includes/sidebar-right.html +47 -0
  28. data/_includes/sitemap.html +123 -0
  29. data/_includes/style.html +1574 -0
  30. data/_includes/svg.html +81 -0
  31. data/_includes/toc +7 -0
  32. data/_includes/toc.html +182 -0
  33. data/_includes/zer0-env-var.html +88 -0
  34. data/_layouts/collection.html +42 -0
  35. data/_layouts/default.html +37 -0
  36. data/_layouts/home.html +16 -0
  37. data/_layouts/index.html +8 -0
  38. data/_layouts/javascript.html +8 -0
  39. data/_layouts/journals.html +41 -0
  40. data/_layouts/root.html +54 -0
  41. data/_sass/custom.scss +331 -0
  42. data/_sass/it-journey/_docs.scss +3219 -0
  43. data/_sass/it-journey/_syntax.scss +342 -0
  44. data/_sass/it-journey/_theme.scss +247 -0
  45. data/_sass/it-journey/_variables.scss +521 -0
  46. data/_sass/it-journey/code-copy.scss +105 -0
  47. data/assets/.DS_Store +0 -0
  48. data/assets/css/custom.css +120 -0
  49. data/assets/css/main.scss +22 -0
  50. data/assets/images/favicon_gpt_computer_retro.png +0 -0
  51. data/assets/images/gravatar-small.png +0 -0
  52. data/assets/images/gravatar.png +0 -0
  53. data/assets/images/info-banner-mountain-wizard.png +0 -0
  54. data/assets/images/wizard-on-journey.png +0 -0
  55. data/assets/images/zer0-checkpoint-1.png +0 -0
  56. data/assets/images/zer0-checkpoint-2.png +0 -0
  57. data/assets/js/auto-hide-nav.js +18 -0
  58. data/assets/js/back-to-top.js +24 -0
  59. data/assets/js/cheetsheet.js +73 -0
  60. data/assets/js/code-copy.js +27 -0
  61. data/assets/js/color-modes.js +80 -0
  62. data/assets/js/docs.min.js +1 -0
  63. data/assets/js/halfmoon.js +80 -0
  64. data/assets/js/myScript.js +12 -0
  65. data/assets/js/nanobar.min.js +1 -0
  66. data/assets/js/particles-source.js +888 -0
  67. data/assets/js/particles.js +133 -0
  68. data/assets/js/side-bar-folders.js +12 -0
  69. data/assets/particles.json +110 -0
  70. metadata +153 -0
@@ -0,0 +1,888 @@
1
+ /* -----------------------------------------------
2
+ /* Author :
3
+ /* MIT license: http://opensource.org/licenses/MIT
4
+ /* v1.0.0
5
+ /* ----------------------------------------------- */
6
+
7
+ function hexToRgb(e) {
8
+ var a = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
9
+ e = e.replace(a, function(e, a, t, i) {
10
+ return a + a + t + t + i + i
11
+ });
12
+ var t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
13
+ return t ? {
14
+ r: parseInt(t[1], 16),
15
+ g: parseInt(t[2], 16),
16
+ b: parseInt(t[3], 16)
17
+ } : null
18
+ }
19
+ function clamp(e, a, t) {
20
+ return Math.min(Math.max(e, a), t)
21
+ }
22
+ function isInArray(e, a) {
23
+ return a.indexOf(e) > -1
24
+ }
25
+ var pJS = function(e, a) {
26
+ var t = document.querySelector("#" + e + " > .particles-js-canvas-el");
27
+ this.pJS = {
28
+ canvas: {
29
+ el: t,
30
+ w: t.offsetWidth,
31
+ h: t.offsetHeight
32
+ },
33
+ particles: {
34
+ number: {
35
+ value: 400,
36
+ density: {
37
+ enable: !0,
38
+ value_area: 800
39
+ }
40
+ },
41
+ color: {
42
+ value: "#fff"
43
+ },
44
+ shape: {
45
+ type: "circle",
46
+ stroke: {
47
+ width: 0,
48
+ color: "#ff0000"
49
+ },
50
+ polygon: {
51
+ nb_sides: 5
52
+ },
53
+ image: {
54
+ src: null,
55
+ width: 100,
56
+ height: 100
57
+ }
58
+ },
59
+ opacity: {
60
+ value: 1,
61
+ random: !1,
62
+ anim: {
63
+ enable: !1,
64
+ speed: 2,
65
+ opacity_min: 0,
66
+ sync: !1
67
+ }
68
+ },
69
+ size: {
70
+ value: 20,
71
+ random: !1,
72
+ anim: {
73
+ enable: !1,
74
+ speed: 20,
75
+ size_min: 0,
76
+ sync: !1
77
+ }
78
+ },
79
+ line_linked: {
80
+ enable: !0,
81
+ distance: 100,
82
+ color: "#fff",
83
+ opacity: 1,
84
+ width: 1
85
+ },
86
+ move: {
87
+ enable: !0,
88
+ speed: 2,
89
+ direction: "none",
90
+ random: !1,
91
+ straight: !1,
92
+ out_mode: "out",
93
+ bounce: !1,
94
+ attract: {
95
+ enable: !1,
96
+ rotateX: 3e3,
97
+ rotateY: 3e3
98
+ }
99
+ },
100
+ array: []
101
+ },
102
+ interactivity: {
103
+ detect_on: "canvas",
104
+ events: {
105
+ onhover: {
106
+ enable: !0,
107
+ mode: "grab"
108
+ },
109
+ onclick: {
110
+ enable: !0,
111
+ mode: "push"
112
+ },
113
+ resize: !0
114
+ },
115
+ modes: {
116
+ grab: {
117
+ distance: 100,
118
+ line_linked: {
119
+ opacity: 1
120
+ }
121
+ },
122
+ bubble: {
123
+ distance: 200,
124
+ size: 80,
125
+ duration: .4
126
+ },
127
+ repulse: {
128
+ distance: 200,
129
+ duration: .4
130
+ },
131
+ push: {
132
+ particles_nb: 4
133
+ },
134
+ remove: {
135
+ particles_nb: 2
136
+ }
137
+ },
138
+ mouse: {}
139
+ },
140
+ retina_detect: !1,
141
+ fn: {
142
+ interact: {},
143
+ modes: {},
144
+ vendors: {}
145
+ },
146
+ tmp: {}
147
+ };
148
+ var i = this.pJS;
149
+ a && Object.deepExtend(i, a),
150
+ i.tmp.obj = {
151
+ size_value: i.particles.size.value,
152
+ size_anim_speed: i.particles.size.anim.speed,
153
+ move_speed: i.particles.move.speed,
154
+ line_linked_distance: i.particles.line_linked.distance,
155
+ line_linked_width: i.particles.line_linked.width,
156
+ mode_grab_distance: i.interactivity.modes.grab.distance,
157
+ mode_bubble_distance: i.interactivity.modes.bubble.distance,
158
+ mode_bubble_size: i.interactivity.modes.bubble.size,
159
+ mode_repulse_distance: i.interactivity.modes.repulse.distance
160
+ },
161
+ i.fn.retinaInit = function() {
162
+ i.retina_detect && window.devicePixelRatio > 1 ? (i.canvas.pxratio = window.devicePixelRatio,
163
+ i.tmp.retina = !0) : (i.canvas.pxratio = 1,
164
+ i.tmp.retina = !1),
165
+ i.canvas.w = i.canvas.el.offsetWidth * i.canvas.pxratio,
166
+ i.canvas.h = i.canvas.el.offsetHeight * i.canvas.pxratio,
167
+ i.particles.size.value = i.tmp.obj.size_value * i.canvas.pxratio,
168
+ i.particles.size.anim.speed = i.tmp.obj.size_anim_speed * i.canvas.pxratio,
169
+ i.particles.move.speed = i.tmp.obj.move_speed * i.canvas.pxratio,
170
+ i.particles.line_linked.distance = i.tmp.obj.line_linked_distance * i.canvas.pxratio,
171
+ i.interactivity.modes.grab.distance = i.tmp.obj.mode_grab_distance * i.canvas.pxratio,
172
+ i.interactivity.modes.bubble.distance = i.tmp.obj.mode_bubble_distance * i.canvas.pxratio,
173
+ i.particles.line_linked.width = i.tmp.obj.line_linked_width * i.canvas.pxratio,
174
+ i.interactivity.modes.bubble.size = i.tmp.obj.mode_bubble_size * i.canvas.pxratio,
175
+ i.interactivity.modes.repulse.distance = i.tmp.obj.mode_repulse_distance * i.canvas.pxratio
176
+ }
177
+ ,
178
+ i.fn.canvasInit = function() {
179
+ i.canvas.ctx = i.canvas.el.getContext("2d")
180
+ }
181
+ ,
182
+ i.fn.canvasSize = function() {
183
+ i.canvas.el.width = i.canvas.w,
184
+ i.canvas.el.height = i.canvas.h,
185
+ i && i.interactivity.events.resize && window.addEventListener("resize", function() {
186
+ i.canvas.w = i.canvas.el.offsetWidth,
187
+ i.canvas.h = i.canvas.el.offsetHeight,
188
+ i.tmp.retina && (i.canvas.w *= i.canvas.pxratio,
189
+ i.canvas.h *= i.canvas.pxratio),
190
+ i.canvas.el.width = i.canvas.w,
191
+ i.canvas.el.height = i.canvas.h,
192
+ i.particles.move.enable || (i.fn.particlesEmpty(),
193
+ i.fn.particlesCreate(),
194
+ i.fn.particlesDraw(),
195
+ i.fn.vendors.densityAutoParticles()),
196
+ i.fn.vendors.densityAutoParticles()
197
+ })
198
+ }
199
+ ,
200
+ i.fn.canvasPaint = function() {
201
+ i.canvas.ctx.fillRect(0, 0, i.canvas.w, i.canvas.h)
202
+ }
203
+ ,
204
+ i.fn.canvasClear = function() {
205
+ i.canvas.ctx.clearRect(0, 0, i.canvas.w, i.canvas.h)
206
+ }
207
+ ,
208
+ i.fn.particle = function(e, a, t) {
209
+ if (this.radius = (i.particles.size.random ? Math.random() : 1) * i.particles.size.value,
210
+ i.particles.size.anim.enable && (this.size_status = !1,
211
+ this.vs = i.particles.size.anim.speed / 100,
212
+ i.particles.size.anim.sync || (this.vs = this.vs * Math.random())),
213
+ this.x = t ? t.x : Math.random() * i.canvas.w,
214
+ this.y = t ? t.y : Math.random() * i.canvas.h,
215
+ this.x > i.canvas.w - 2 * this.radius ? this.x = this.x - this.radius : this.x < 2 * this.radius && (this.x = this.x + this.radius),
216
+ this.y > i.canvas.h - 2 * this.radius ? this.y = this.y - this.radius : this.y < 2 * this.radius && (this.y = this.y + this.radius),
217
+ i.particles.move.bounce && i.fn.vendors.checkOverlap(this, t),
218
+ this.color = {},
219
+ "object" == typeof e.value)
220
+ if (e.value instanceof Array) {
221
+ var s = e.value[Math.floor(Math.random() * i.particles.color.value.length)];
222
+ this.color.rgb = hexToRgb(s)
223
+ } else
224
+ void 0 != e.value.r && void 0 != e.value.g && void 0 != e.value.b && (this.color.rgb = {
225
+ r: e.value.r,
226
+ g: e.value.g,
227
+ b: e.value.b
228
+ }),
229
+ void 0 != e.value.h && void 0 != e.value.s && void 0 != e.value.l && (this.color.hsl = {
230
+ h: e.value.h,
231
+ s: e.value.s,
232
+ l: e.value.l
233
+ });
234
+ else
235
+ "random" == e.value ? this.color.rgb = {
236
+ r: Math.floor(256 * Math.random()) + 0,
237
+ g: Math.floor(256 * Math.random()) + 0,
238
+ b: Math.floor(256 * Math.random()) + 0
239
+ } : "string" == typeof e.value && (this.color = e,
240
+ this.color.rgb = hexToRgb(this.color.value));
241
+ this.opacity = (i.particles.opacity.random ? Math.random() : 1) * i.particles.opacity.value,
242
+ i.particles.opacity.anim.enable && (this.opacity_status = !1,
243
+ this.vo = i.particles.opacity.anim.speed / 100,
244
+ i.particles.opacity.anim.sync || (this.vo = this.vo * Math.random()));
245
+ var n = {};
246
+ switch (i.particles.move.direction) {
247
+ case "top":
248
+ n = {
249
+ x: 0,
250
+ y: -1
251
+ };
252
+ break;
253
+ case "top-right":
254
+ n = {
255
+ x: .5,
256
+ y: -.5
257
+ };
258
+ break;
259
+ case "right":
260
+ n = {
261
+ x: 1,
262
+ y: -0
263
+ };
264
+ break;
265
+ case "bottom-right":
266
+ n = {
267
+ x: .5,
268
+ y: .5
269
+ };
270
+ break;
271
+ case "bottom":
272
+ n = {
273
+ x: 0,
274
+ y: 1
275
+ };
276
+ break;
277
+ case "bottom-left":
278
+ n = {
279
+ x: -.5,
280
+ y: 1
281
+ };
282
+ break;
283
+ case "left":
284
+ n = {
285
+ x: -1,
286
+ y: 0
287
+ };
288
+ break;
289
+ case "top-left":
290
+ n = {
291
+ x: -.5,
292
+ y: -.5
293
+ };
294
+ break;
295
+ default:
296
+ n = {
297
+ x: 0,
298
+ y: 0
299
+ }
300
+ }
301
+ i.particles.move.straight ? (this.vx = n.x,
302
+ this.vy = n.y,
303
+ i.particles.move.random && (this.vx = this.vx * Math.random(),
304
+ this.vy = this.vy * Math.random())) : (this.vx = n.x + Math.random() - .5,
305
+ this.vy = n.y + Math.random() - .5),
306
+ this.vx_i = this.vx,
307
+ this.vy_i = this.vy;
308
+ var r = i.particles.shape.type;
309
+ if ("object" == typeof r) {
310
+ if (r instanceof Array) {
311
+ var c = r[Math.floor(Math.random() * r.length)];
312
+ this.shape = c
313
+ }
314
+ } else
315
+ this.shape = r;
316
+ if ("image" == this.shape) {
317
+ var o = i.particles.shape;
318
+ this.img = {
319
+ src: o.image.src,
320
+ ratio: o.image.width / o.image.height
321
+ },
322
+ this.img.ratio || (this.img.ratio = 1),
323
+ "svg" == i.tmp.img_type && void 0 != i.tmp.source_svg && (i.fn.vendors.createSvgImg(this),
324
+ i.tmp.pushing && (this.img.loaded = !1))
325
+ }
326
+ }
327
+ ,
328
+ i.fn.particle.prototype.draw = function() {
329
+ function e() {
330
+ i.canvas.ctx.drawImage(r, a.x - t, a.y - t, 2 * t, 2 * t / a.img.ratio)
331
+ }
332
+ var a = this;
333
+ if (void 0 != a.radius_bubble)
334
+ var t = a.radius_bubble;
335
+ else
336
+ var t = a.radius;
337
+ if (void 0 != a.opacity_bubble)
338
+ var s = a.opacity_bubble;
339
+ else
340
+ var s = a.opacity;
341
+ if (a.color.rgb)
342
+ var n = "rgba(" + a.color.rgb.r + "," + a.color.rgb.g + "," + a.color.rgb.b + "," + s + ")";
343
+ else
344
+ var n = "hsla(" + a.color.hsl.h + "," + a.color.hsl.s + "%," + a.color.hsl.l + "%," + s + ")";
345
+ switch (i.canvas.ctx.fillStyle = n,
346
+ i.canvas.ctx.beginPath(),
347
+ a.shape) {
348
+ case "circle":
349
+ i.canvas.ctx.arc(a.x, a.y, t, 0, 2 * Math.PI, !1);
350
+ break;
351
+ case "edge":
352
+ i.canvas.ctx.rect(a.x - t, a.y - t, 2 * t, 2 * t);
353
+ break;
354
+ case "triangle":
355
+ i.fn.vendors.drawShape(i.canvas.ctx, a.x - t, a.y + t / 1.66, 2 * t, 3, 2);
356
+ break;
357
+ case "polygon":
358
+ i.fn.vendors.drawShape(i.canvas.ctx, a.x - t / (i.particles.shape.polygon.nb_sides / 3.5), a.y - t / .76, 2.66 * t / (i.particles.shape.polygon.nb_sides / 3), i.particles.shape.polygon.nb_sides, 1);
359
+ break;
360
+ case "star":
361
+ i.fn.vendors.drawShape(i.canvas.ctx, a.x - 2 * t / (i.particles.shape.polygon.nb_sides / 4), a.y - t / 1.52, 2 * t * 2.66 / (i.particles.shape.polygon.nb_sides / 3), i.particles.shape.polygon.nb_sides, 2);
362
+ break;
363
+ case "image":
364
+ if ("svg" == i.tmp.img_type)
365
+ var r = a.img.obj;
366
+ else
367
+ var r = i.tmp.img_obj;
368
+ r && e()
369
+ }
370
+ i.canvas.ctx.closePath(),
371
+ i.particles.shape.stroke.width > 0 && (i.canvas.ctx.strokeStyle = i.particles.shape.stroke.color,
372
+ i.canvas.ctx.lineWidth = i.particles.shape.stroke.width,
373
+ i.canvas.ctx.stroke()),
374
+ i.canvas.ctx.fill()
375
+ }
376
+ ,
377
+ i.fn.particlesCreate = function() {
378
+ for (var e = 0; e < i.particles.number.value; e++)
379
+ i.particles.array.push(new i.fn.particle(i.particles.color,i.particles.opacity.value))
380
+ }
381
+ ,
382
+ i.fn.particlesUpdate = function() {
383
+ for (var e = 0; e < i.particles.array.length; e++) {
384
+ var a = i.particles.array[e];
385
+ if (i.particles.move.enable) {
386
+ var t = i.particles.move.speed / 2;
387
+ a.x += a.vx * t,
388
+ a.y += a.vy * t
389
+ }
390
+ if (i.particles.opacity.anim.enable && (1 == a.opacity_status ? (a.opacity >= i.particles.opacity.value && (a.opacity_status = !1),
391
+ a.opacity += a.vo) : (a.opacity <= i.particles.opacity.anim.opacity_min && (a.opacity_status = !0),
392
+ a.opacity -= a.vo),
393
+ a.opacity < 0 && (a.opacity = 0)),
394
+ i.particles.size.anim.enable && (1 == a.size_status ? (a.radius >= i.particles.size.value && (a.size_status = !1),
395
+ a.radius += a.vs) : (a.radius <= i.particles.size.anim.size_min && (a.size_status = !0),
396
+ a.radius -= a.vs),
397
+ a.radius < 0 && (a.radius = 0)),
398
+ "bounce" == i.particles.move.out_mode)
399
+ var s = {
400
+ x_left: a.radius,
401
+ x_right: i.canvas.w,
402
+ y_top: a.radius,
403
+ y_bottom: i.canvas.h
404
+ };
405
+ else
406
+ var s = {
407
+ x_left: -a.radius,
408
+ x_right: i.canvas.w + a.radius,
409
+ y_top: -a.radius,
410
+ y_bottom: i.canvas.h + a.radius
411
+ };
412
+ switch (a.x - a.radius > i.canvas.w ? (a.x = s.x_left,
413
+ a.y = Math.random() * i.canvas.h) : a.x + a.radius < 0 && (a.x = s.x_right,
414
+ a.y = Math.random() * i.canvas.h),
415
+ a.y - a.radius > i.canvas.h ? (a.y = s.y_top,
416
+ a.x = Math.random() * i.canvas.w) : a.y + a.radius < 0 && (a.y = s.y_bottom,
417
+ a.x = Math.random() * i.canvas.w),
418
+ i.particles.move.out_mode) {
419
+ case "bounce":
420
+ a.x + a.radius > i.canvas.w ? a.vx = -a.vx : a.x - a.radius < 0 && (a.vx = -a.vx),
421
+ a.y + a.radius > i.canvas.h ? a.vy = -a.vy : a.y - a.radius < 0 && (a.vy = -a.vy)
422
+ }
423
+ if (isInArray("grab", i.interactivity.events.onhover.mode) && i.fn.modes.grabParticle(a),
424
+ (isInArray("bubble", i.interactivity.events.onhover.mode) || isInArray("bubble", i.interactivity.events.onclick.mode)) && i.fn.modes.bubbleParticle(a),
425
+ (isInArray("repulse", i.interactivity.events.onhover.mode) || isInArray("repulse", i.interactivity.events.onclick.mode)) && i.fn.modes.repulseParticle(a),
426
+ i.particles.line_linked.enable || i.particles.move.attract.enable)
427
+ for (var n = e + 1; n < i.particles.array.length; n++) {
428
+ var r = i.particles.array[n];
429
+ i.particles.line_linked.enable && i.fn.interact.linkParticles(a, r),
430
+ i.particles.move.attract.enable && i.fn.interact.attractParticles(a, r),
431
+ i.particles.move.bounce && i.fn.interact.bounceParticles(a, r)
432
+ }
433
+ }
434
+ }
435
+ ,
436
+ i.fn.particlesDraw = function() {
437
+ i.canvas.ctx.clearRect(0, 0, i.canvas.w, i.canvas.h),
438
+ i.fn.particlesUpdate();
439
+ for (var e = 0; e < i.particles.array.length; e++) {
440
+ var a = i.particles.array[e];
441
+ a.draw()
442
+ }
443
+ }
444
+ ,
445
+ i.fn.particlesEmpty = function() {
446
+ i.particles.array = []
447
+ }
448
+ ,
449
+ i.fn.particlesRefresh = function() {
450
+ cancelRequestAnimFrame(i.fn.checkAnimFrame),
451
+ cancelRequestAnimFrame(i.fn.drawAnimFrame),
452
+ i.tmp.source_svg = void 0,
453
+ i.tmp.img_obj = void 0,
454
+ i.tmp.count_svg = 0,
455
+ i.fn.particlesEmpty(),
456
+ i.fn.canvasClear(),
457
+ i.fn.vendors.start()
458
+ }
459
+ ,
460
+ i.fn.interact.linkParticles = function(e, a) {
461
+ var t = e.x - a.x
462
+ , s = e.y - a.y
463
+ , n = Math.sqrt(t * t + s * s);
464
+ if (n <= i.particles.line_linked.distance) {
465
+ var r = i.particles.line_linked.opacity - n / (1 / i.particles.line_linked.opacity) / i.particles.line_linked.distance;
466
+ if (r > 0) {
467
+ var c = i.particles.line_linked.color_rgb_line;
468
+ i.canvas.ctx.strokeStyle = "rgba(" + c.r + "," + c.g + "," + c.b + "," + r + ")",
469
+ i.canvas.ctx.lineWidth = i.particles.line_linked.width,
470
+ i.canvas.ctx.beginPath(),
471
+ i.canvas.ctx.moveTo(e.x, e.y),
472
+ i.canvas.ctx.lineTo(a.x, a.y),
473
+ i.canvas.ctx.stroke(),
474
+ i.canvas.ctx.closePath()
475
+ }
476
+ }
477
+ }
478
+ ,
479
+ i.fn.interact.attractParticles = function(e, a) {
480
+ var t = e.x - a.x
481
+ , s = e.y - a.y
482
+ , n = Math.sqrt(t * t + s * s);
483
+ if (n <= i.particles.line_linked.distance) {
484
+ var r = t / (1e3 * i.particles.move.attract.rotateX)
485
+ , c = s / (1e3 * i.particles.move.attract.rotateY);
486
+ e.vx -= r,
487
+ e.vy -= c,
488
+ a.vx += r,
489
+ a.vy += c
490
+ }
491
+ }
492
+ ,
493
+ i.fn.interact.bounceParticles = function(e, a) {
494
+ var t = e.x - a.x
495
+ , i = e.y - a.y
496
+ , s = Math.sqrt(t * t + i * i)
497
+ , n = e.radius + a.radius;
498
+ n >= s && (e.vx = -e.vx,
499
+ e.vy = -e.vy,
500
+ a.vx = -a.vx,
501
+ a.vy = -a.vy)
502
+ }
503
+ ,
504
+ i.fn.modes.pushParticles = function(e, a) {
505
+ i.tmp.pushing = !0;
506
+ for (var t = 0; e > t; t++)
507
+ i.particles.array.push(new i.fn.particle(i.particles.color,i.particles.opacity.value,{
508
+ x: a ? a.pos_x : Math.random() * i.canvas.w,
509
+ y: a ? a.pos_y : Math.random() * i.canvas.h
510
+ })),
511
+ t == e - 1 && (i.particles.move.enable || i.fn.particlesDraw(),
512
+ i.tmp.pushing = !1)
513
+ }
514
+ ,
515
+ i.fn.modes.removeParticles = function(e) {
516
+ i.particles.array.splice(0, e),
517
+ i.particles.move.enable || i.fn.particlesDraw()
518
+ }
519
+ ,
520
+ i.fn.modes.bubbleParticle = function(e) {
521
+ function a() {
522
+ e.opacity_bubble = e.opacity,
523
+ e.radius_bubble = e.radius
524
+ }
525
+ function t(a, t, s, n, c) {
526
+ if (a != t)
527
+ if (i.tmp.bubble_duration_end) {
528
+ if (void 0 != s) {
529
+ var o = n - p * (n - a) / i.interactivity.modes.bubble.duration
530
+ , l = a - o;
531
+ d = a + l,
532
+ "size" == c && (e.radius_bubble = d),
533
+ "opacity" == c && (e.opacity_bubble = d)
534
+ }
535
+ } else if (r <= i.interactivity.modes.bubble.distance) {
536
+ if (void 0 != s)
537
+ var v = s;
538
+ else
539
+ var v = n;
540
+ if (v != a) {
541
+ var d = n - p * (n - a) / i.interactivity.modes.bubble.duration;
542
+ "size" == c && (e.radius_bubble = d),
543
+ "opacity" == c && (e.opacity_bubble = d)
544
+ }
545
+ } else
546
+ "size" == c && (e.radius_bubble = void 0),
547
+ "opacity" == c && (e.opacity_bubble = void 0)
548
+ }
549
+ if (i.interactivity.events.onhover.enable && isInArray("bubble", i.interactivity.events.onhover.mode)) {
550
+ var s = e.x - i.interactivity.mouse.pos_x
551
+ , n = e.y - i.interactivity.mouse.pos_y
552
+ , r = Math.sqrt(s * s + n * n)
553
+ , c = 1 - r / i.interactivity.modes.bubble.distance;
554
+ if (r <= i.interactivity.modes.bubble.distance) {
555
+ if (c >= 0 && "mousemove" == i.interactivity.status) {
556
+ if (i.interactivity.modes.bubble.size != i.particles.size.value)
557
+ if (i.interactivity.modes.bubble.size > i.particles.size.value) {
558
+ var o = e.radius + i.interactivity.modes.bubble.size * c;
559
+ o >= 0 && (e.radius_bubble = o)
560
+ } else {
561
+ var l = e.radius - i.interactivity.modes.bubble.size
562
+ , o = e.radius - l * c;
563
+ o > 0 ? e.radius_bubble = o : e.radius_bubble = 0
564
+ }
565
+ if (i.interactivity.modes.bubble.opacity != i.particles.opacity.value)
566
+ if (i.interactivity.modes.bubble.opacity > i.particles.opacity.value) {
567
+ var v = i.interactivity.modes.bubble.opacity * c;
568
+ v > e.opacity && v <= i.interactivity.modes.bubble.opacity && (e.opacity_bubble = v)
569
+ } else {
570
+ var v = e.opacity - (i.particles.opacity.value - i.interactivity.modes.bubble.opacity) * c;
571
+ v < e.opacity && v >= i.interactivity.modes.bubble.opacity && (e.opacity_bubble = v)
572
+ }
573
+ }
574
+ } else
575
+ a();
576
+ "mouseleave" == i.interactivity.status && a()
577
+ } else if (i.interactivity.events.onclick.enable && isInArray("bubble", i.interactivity.events.onclick.mode)) {
578
+ if (i.tmp.bubble_clicking) {
579
+ var s = e.x - i.interactivity.mouse.click_pos_x
580
+ , n = e.y - i.interactivity.mouse.click_pos_y
581
+ , r = Math.sqrt(s * s + n * n)
582
+ , p = ((new Date).getTime() - i.interactivity.mouse.click_time) / 1e3;
583
+ p > i.interactivity.modes.bubble.duration && (i.tmp.bubble_duration_end = !0),
584
+ p > 2 * i.interactivity.modes.bubble.duration && (i.tmp.bubble_clicking = !1,
585
+ i.tmp.bubble_duration_end = !1)
586
+ }
587
+ i.tmp.bubble_clicking && (t(i.interactivity.modes.bubble.size, i.particles.size.value, e.radius_bubble, e.radius, "size"),
588
+ t(i.interactivity.modes.bubble.opacity, i.particles.opacity.value, e.opacity_bubble, e.opacity, "opacity"))
589
+ }
590
+ }
591
+ ,
592
+ i.fn.modes.repulseParticle = function(e) {
593
+ function a() {
594
+ var a = Math.atan2(d, p);
595
+ if (e.vx = u * Math.cos(a),
596
+ e.vy = u * Math.sin(a),
597
+ "bounce" == i.particles.move.out_mode) {
598
+ var t = {
599
+ x: e.x + e.vx,
600
+ y: e.y + e.vy
601
+ };
602
+ t.x + e.radius > i.canvas.w ? e.vx = -e.vx : t.x - e.radius < 0 && (e.vx = -e.vx),
603
+ t.y + e.radius > i.canvas.h ? e.vy = -e.vy : t.y - e.radius < 0 && (e.vy = -e.vy)
604
+ }
605
+ }
606
+ if (i.interactivity.events.onhover.enable && isInArray("repulse", i.interactivity.events.onhover.mode) && "mousemove" == i.interactivity.status) {
607
+ var t = e.x - i.interactivity.mouse.pos_x
608
+ , s = e.y - i.interactivity.mouse.pos_y
609
+ , n = Math.sqrt(t * t + s * s)
610
+ , r = {
611
+ x: t / n,
612
+ y: s / n
613
+ }
614
+ , c = i.interactivity.modes.repulse.distance
615
+ , o = 100
616
+ , l = clamp(1 / c * (-1 * Math.pow(n / c, 2) + 1) * c * o, 0, 50)
617
+ , v = {
618
+ x: e.x + r.x * l,
619
+ y: e.y + r.y * l
620
+ };
621
+ "bounce" == i.particles.move.out_mode ? (v.x - e.radius > 0 && v.x + e.radius < i.canvas.w && (e.x = v.x),
622
+ v.y - e.radius > 0 && v.y + e.radius < i.canvas.h && (e.y = v.y)) : (e.x = v.x,
623
+ e.y = v.y)
624
+ } else if (i.interactivity.events.onclick.enable && isInArray("repulse", i.interactivity.events.onclick.mode))
625
+ if (i.tmp.repulse_finish || (i.tmp.repulse_count++,
626
+ i.tmp.repulse_count == i.particles.array.length && (i.tmp.repulse_finish = !0)),
627
+ i.tmp.repulse_clicking) {
628
+ var c = Math.pow(i.interactivity.modes.repulse.distance / 6, 3)
629
+ , p = i.interactivity.mouse.click_pos_x - e.x
630
+ , d = i.interactivity.mouse.click_pos_y - e.y
631
+ , m = p * p + d * d
632
+ , u = -c / m * 1;
633
+ c >= m && a()
634
+ } else
635
+ 0 == i.tmp.repulse_clicking && (e.vx = e.vx_i,
636
+ e.vy = e.vy_i)
637
+ }
638
+ ,
639
+ i.fn.modes.grabParticle = function(e) {
640
+ if (i.interactivity.events.onhover.enable && "mousemove" == i.interactivity.status) {
641
+ var a = e.x - i.interactivity.mouse.pos_x
642
+ , t = e.y - i.interactivity.mouse.pos_y
643
+ , s = Math.sqrt(a * a + t * t);
644
+ if (s <= i.interactivity.modes.grab.distance) {
645
+ var n = i.interactivity.modes.grab.line_linked.opacity - s / (1 / i.interactivity.modes.grab.line_linked.opacity) / i.interactivity.modes.grab.distance;
646
+ if (n > 0) {
647
+ var r = i.particles.line_linked.color_rgb_line;
648
+ i.canvas.ctx.strokeStyle = "rgba(" + r.r + "," + r.g + "," + r.b + "," + n + ")",
649
+ i.canvas.ctx.lineWidth = i.particles.line_linked.width,
650
+ i.canvas.ctx.beginPath(),
651
+ i.canvas.ctx.moveTo(e.x, e.y),
652
+ i.canvas.ctx.lineTo(i.interactivity.mouse.pos_x, i.interactivity.mouse.pos_y),
653
+ i.canvas.ctx.stroke(),
654
+ i.canvas.ctx.closePath()
655
+ }
656
+ }
657
+ }
658
+ }
659
+ ,
660
+ i.fn.vendors.eventsListeners = function() {
661
+ "window" == i.interactivity.detect_on ? i.interactivity.el = window : i.interactivity.el = i.canvas.el,
662
+ (i.interactivity.events.onhover.enable || i.interactivity.events.onclick.enable) && (i.interactivity.el.addEventListener("mousemove", function(e) {
663
+ if (i.interactivity.el == window)
664
+ var a = e.clientX
665
+ , t = e.clientY;
666
+ else
667
+ var a = e.offsetX || e.clientX
668
+ , t = e.offsetY || e.clientY;
669
+ i.interactivity.mouse.pos_x = a,
670
+ i.interactivity.mouse.pos_y = t,
671
+ i.tmp.retina && (i.interactivity.mouse.pos_x *= i.canvas.pxratio,
672
+ i.interactivity.mouse.pos_y *= i.canvas.pxratio),
673
+ i.interactivity.status = "mousemove"
674
+ }),
675
+ i.interactivity.el.addEventListener("mouseleave", function(e) {
676
+ i.interactivity.mouse.pos_x = null,
677
+ i.interactivity.mouse.pos_y = null,
678
+ i.interactivity.status = "mouseleave"
679
+ })),
680
+ i.interactivity.events.onclick.enable && i.interactivity.el.addEventListener("click", function() {
681
+ if (i.interactivity.mouse.click_pos_x = i.interactivity.mouse.pos_x,
682
+ i.interactivity.mouse.click_pos_y = i.interactivity.mouse.pos_y,
683
+ i.interactivity.mouse.click_time = (new Date).getTime(),
684
+ i.interactivity.events.onclick.enable)
685
+ switch (i.interactivity.events.onclick.mode) {
686
+ case "push":
687
+ i.particles.move.enable ? i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb, i.interactivity.mouse) : 1 == i.interactivity.modes.push.particles_nb ? i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb, i.interactivity.mouse) : i.interactivity.modes.push.particles_nb > 1 && i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb);
688
+ break;
689
+ case "remove":
690
+ i.fn.modes.removeParticles(i.interactivity.modes.remove.particles_nb);
691
+ break;
692
+ case "bubble":
693
+ i.tmp.bubble_clicking = !0;
694
+ break;
695
+ case "repulse":
696
+ i.tmp.repulse_clicking = !0,
697
+ i.tmp.repulse_count = 0,
698
+ i.tmp.repulse_finish = !1,
699
+ setTimeout(function() {
700
+ i.tmp.repulse_clicking = !1
701
+ }, 1e3 * i.interactivity.modes.repulse.duration)
702
+ }
703
+ })
704
+ }
705
+ ,
706
+ i.fn.vendors.densityAutoParticles = function() {
707
+ if (i.particles.number.density.enable) {
708
+ var e = i.canvas.el.width * i.canvas.el.height / 1e3;
709
+ i.tmp.retina && (e /= 2 * i.canvas.pxratio);
710
+ var a = e * i.particles.number.value / i.particles.number.density.value_area
711
+ , t = i.particles.array.length - a;
712
+ 0 > t ? i.fn.modes.pushParticles(Math.abs(t)) : i.fn.modes.removeParticles(t)
713
+ }
714
+ }
715
+ ,
716
+ i.fn.vendors.checkOverlap = function(e, a) {
717
+ for (var t = 0; t < i.particles.array.length; t++) {
718
+ var s = i.particles.array[t]
719
+ , n = e.x - s.x
720
+ , r = e.y - s.y
721
+ , c = Math.sqrt(n * n + r * r);
722
+ c <= e.radius + s.radius && (e.x = a ? a.x : Math.random() * i.canvas.w,
723
+ e.y = a ? a.y : Math.random() * i.canvas.h,
724
+ i.fn.vendors.checkOverlap(e))
725
+ }
726
+ }
727
+ ,
728
+ i.fn.vendors.createSvgImg = function(e) {
729
+ var a = i.tmp.source_svg
730
+ , t = /#([0-9A-F]{3,6})/gi
731
+ , s = a.replace(t, function(a, t, i, s) {
732
+ if (e.color.rgb)
733
+ var n = "rgba(" + e.color.rgb.r + "," + e.color.rgb.g + "," + e.color.rgb.b + "," + e.opacity + ")";
734
+ else
735
+ var n = "hsla(" + e.color.hsl.h + "," + e.color.hsl.s + "%," + e.color.hsl.l + "%," + e.opacity + ")";
736
+ return n
737
+ })
738
+ , n = new Blob([s],{
739
+ type: "image/svg+xml;charset=utf-8"
740
+ })
741
+ , r = window.URL || window.webkitURL || window
742
+ , c = r.createObjectURL(n)
743
+ , o = new Image;
744
+ o.addEventListener("load", function() {
745
+ e.img.obj = o,
746
+ e.img.loaded = !0,
747
+ r.revokeObjectURL(c),
748
+ i.tmp.count_svg++
749
+ }),
750
+ o.src = c
751
+ }
752
+ ,
753
+ i.fn.vendors.destroypJS = function() {
754
+ cancelAnimationFrame(i.fn.drawAnimFrame),
755
+ t.remove(),
756
+ pJSDom = null
757
+ }
758
+ ,
759
+ i.fn.vendors.drawShape = function(e, a, t, i, s, n) {
760
+ var r = s * n
761
+ , c = s / n
762
+ , o = 180 * (c - 2) / c
763
+ , l = Math.PI - Math.PI * o / 180;
764
+ e.save(),
765
+ e.beginPath(),
766
+ e.translate(a, t),
767
+ e.moveTo(0, 0);
768
+ for (var v = 0; r > v; v++)
769
+ e.lineTo(i, 0),
770
+ e.translate(i, 0),
771
+ e.rotate(l);
772
+ e.fill(),
773
+ e.restore()
774
+ }
775
+ ,
776
+ i.fn.vendors.exportImg = function() {
777
+ window.open(i.canvas.el.toDataURL("image/png"), "_blank")
778
+ }
779
+ ,
780
+ i.fn.vendors.loadImg = function(e) {
781
+ if (i.tmp.img_error = void 0,
782
+ "" != i.particles.shape.image.src)
783
+ if ("svg" == e) {
784
+ var a = new XMLHttpRequest;
785
+ a.open("GET", i.particles.shape.image.src),
786
+ a.onreadystatechange = function(e) {
787
+ 4 == a.readyState && (200 == a.status ? (i.tmp.source_svg = e.currentTarget.response,
788
+ i.fn.vendors.checkBeforeDraw()) : (console.log("Error pJS - Image not found"),
789
+ i.tmp.img_error = !0))
790
+ }
791
+ ,
792
+ a.send()
793
+ } else {
794
+ var t = new Image;
795
+ t.addEventListener("load", function() {
796
+ i.tmp.img_obj = t,
797
+ i.fn.vendors.checkBeforeDraw()
798
+ }),
799
+ t.src = i.particles.shape.image.src
800
+ }
801
+ else
802
+ console.log("Error pJS - No image.src"),
803
+ i.tmp.img_error = !0
804
+ }
805
+ ,
806
+ i.fn.vendors.draw = function() {
807
+ "image" == i.particles.shape.type ? "svg" == i.tmp.img_type ? i.tmp.count_svg >= i.particles.number.value ? (i.fn.particlesDraw(),
808
+ i.particles.move.enable ? i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw) : cancelRequestAnimFrame(i.fn.drawAnimFrame)) : i.tmp.img_error || (i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw)) : void 0 != i.tmp.img_obj ? (i.fn.particlesDraw(),
809
+ i.particles.move.enable ? i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw) : cancelRequestAnimFrame(i.fn.drawAnimFrame)) : i.tmp.img_error || (i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw)) : (i.fn.particlesDraw(),
810
+ i.particles.move.enable ? i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw) : cancelRequestAnimFrame(i.fn.drawAnimFrame))
811
+ }
812
+ ,
813
+ i.fn.vendors.checkBeforeDraw = function() {
814
+ "image" == i.particles.shape.type ? "svg" == i.tmp.img_type && void 0 == i.tmp.source_svg ? i.tmp.checkAnimFrame = requestAnimFrame(check) : (cancelRequestAnimFrame(i.tmp.checkAnimFrame),
815
+ i.tmp.img_error || (i.fn.vendors.init(),
816
+ i.fn.vendors.draw())) : (i.fn.vendors.init(),
817
+ i.fn.vendors.draw())
818
+ }
819
+ ,
820
+ i.fn.vendors.init = function() {
821
+ i.fn.retinaInit(),
822
+ i.fn.canvasInit(),
823
+ i.fn.canvasSize(),
824
+ i.fn.canvasPaint(),
825
+ i.fn.particlesCreate(),
826
+ i.fn.vendors.densityAutoParticles(),
827
+ i.particles.line_linked.color_rgb_line = hexToRgb(i.particles.line_linked.color)
828
+ }
829
+ ,
830
+ i.fn.vendors.start = function() {
831
+ isInArray("image", i.particles.shape.type) ? (i.tmp.img_type = i.particles.shape.image.src.substr(i.particles.shape.image.src.length - 3),
832
+ i.fn.vendors.loadImg(i.tmp.img_type)) : i.fn.vendors.checkBeforeDraw()
833
+ }
834
+ ,
835
+ i.fn.vendors.eventsListeners(),
836
+ i.fn.vendors.start()
837
+ };
838
+ Object.deepExtend = function(e, a) {
839
+ for (var t in a)
840
+ a[t] && a[t].constructor && a[t].constructor === Object ? (e[t] = e[t] || {},
841
+ arguments.callee(e[t], a[t])) : e[t] = a[t];
842
+ return e
843
+ }
844
+ ,
845
+ window.requestAnimFrame = function() {
846
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e) {
847
+ window.setTimeout(e, 1e3 / 60)
848
+ }
849
+ }(),
850
+ window.cancelRequestAnimFrame = function() {
851
+ return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout
852
+ }(),
853
+ window.pJSDom = [],
854
+ window.particlesJS = function(e, a) {
855
+ "string" != typeof e && (a = e,
856
+ e = "particles-js"),
857
+ e || (e = "particles-js");
858
+ var t = document.getElementById(e)
859
+ , i = "particles-js-canvas-el"
860
+ , s = t.getElementsByClassName(i);
861
+ if (s.length)
862
+ for (; s.length > 0; )
863
+ t.removeChild(s[0]);
864
+ var n = document.createElement("canvas");
865
+ n.className = i,
866
+ n.style.width = "100%",
867
+ n.style.height = "100%";
868
+ var r = document.getElementById(e).appendChild(n);
869
+ null != r && pJSDom.push(new pJS(e,a))
870
+ }
871
+ ,
872
+ window.particlesJS.load = function(e, a, t) {
873
+ var i = new XMLHttpRequest;
874
+ i.open("GET", a),
875
+ i.onreadystatechange = function(a) {
876
+ if (4 == i.readyState)
877
+ if (200 == i.status) {
878
+ var s = JSON.parse(a.currentTarget.response);
879
+ window.particlesJS(e, s),
880
+ t && t()
881
+ } else
882
+ console.log("Error pJS - XMLHttpRequest status: " + i.status),
883
+ console.log("Error pJS - File config not found")
884
+ }
885
+ ,
886
+ i.send()
887
+ }
888
+ ;