Sebastiankay commited on
Commit
d53cf7c
·
verified ·
1 Parent(s): e24942c

Upload 2 files

Browse files
static/we_wallpaper_1/assets/js/particles.min.js ADDED
@@ -0,0 +1,541 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* -----------------------------------------------
2
+ /* Author : Vincent Garreau - vincentgarreau.com
3
+ /* MIT license: http://opensource.org/licenses/MIT
4
+ /* Demo / Generator : vincentgarreau.com/particles.js
5
+ /* GitHub : github.com/VincentGarreau/particles.js
6
+ /* How to use? : Check the GitHub README
7
+ /* v2.0.0
8
+ /* ----------------------------------------------- */
9
+ function hexToRgb(e) {
10
+ var a = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
11
+ e = e.replace(a, function (e, a, t, i) {
12
+ return a + a + t + t + i + i;
13
+ });
14
+ var t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
15
+ return t ? { r: parseInt(t[1], 16), g: parseInt(t[2], 16), b: parseInt(t[3], 16) } : null;
16
+ }
17
+ function clamp(e, a, t) {
18
+ return Math.min(Math.max(e, a), t);
19
+ }
20
+ function isInArray(e, a) {
21
+ return a.indexOf(e) > -1;
22
+ }
23
+ var pJS = function (e, a) {
24
+ var t = document.querySelector("#" + e + " > .particles-js-canvas-el");
25
+ this.pJS = {
26
+ canvas: { el: t, w: t.offsetWidth, h: t.offsetHeight },
27
+ particles: {
28
+ number: { value: 400, density: { enable: !0, value_area: 800 } },
29
+ color: { value: "#fff" },
30
+ shape: { type: "circle", stroke: { width: 0, color: "#ff0000" }, polygon: { nb_sides: 5 }, image: { src: "", width: 100, height: 100 } },
31
+ opacity: { value: 1, random: !1, anim: { enable: !1, speed: 2, opacity_min: 0, sync: !1 } },
32
+ size: { value: 20, random: !1, anim: { enable: !1, speed: 20, size_min: 0, sync: !1 } },
33
+ line_linked: { enable: !0, distance: 100, color: "#fff", opacity: 1, width: 1 },
34
+ move: { enable: !0, speed: 2, direction: "none", random: !1, straight: !1, out_mode: "out", bounce: !1, attract: { enable: !1, rotateX: 3e3, rotateY: 3e3 } },
35
+ array: [],
36
+ },
37
+ 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: 0.4 }, repulse: { distance: 200, duration: 0.4 }, push: { particles_nb: 4 }, remove: { particles_nb: 2 } }, mouse: {} },
38
+ retina_detect: !1,
39
+ fn: { interact: {}, modes: {}, vendors: {} },
40
+ tmp: {},
41
+ };
42
+ var i = this.pJS;
43
+ a && Object.deepExtend(i, a),
44
+ (i.tmp.obj = {
45
+ size_value: i.particles.size.value,
46
+ size_anim_speed: i.particles.size.anim.speed,
47
+ move_speed: i.particles.move.speed,
48
+ line_linked_distance: i.particles.line_linked.distance,
49
+ line_linked_width: i.particles.line_linked.width,
50
+ mode_grab_distance: i.interactivity.modes.grab.distance,
51
+ mode_bubble_distance: i.interactivity.modes.bubble.distance,
52
+ mode_bubble_size: i.interactivity.modes.bubble.size,
53
+ mode_repulse_distance: i.interactivity.modes.repulse.distance,
54
+ }),
55
+ (i.fn.retinaInit = function () {
56
+ i.retina_detect && window.devicePixelRatio > 1 ? ((i.canvas.pxratio = window.devicePixelRatio), (i.tmp.retina = !0)) : ((i.canvas.pxratio = 1), (i.tmp.retina = !1)),
57
+ (i.canvas.w = i.canvas.el.offsetWidth * i.canvas.pxratio),
58
+ (i.canvas.h = i.canvas.el.offsetHeight * i.canvas.pxratio),
59
+ (i.particles.size.value = i.tmp.obj.size_value * i.canvas.pxratio),
60
+ (i.particles.size.anim.speed = i.tmp.obj.size_anim_speed * i.canvas.pxratio),
61
+ (i.particles.move.speed = i.tmp.obj.move_speed * i.canvas.pxratio),
62
+ (i.particles.line_linked.distance = i.tmp.obj.line_linked_distance * i.canvas.pxratio),
63
+ (i.interactivity.modes.grab.distance = i.tmp.obj.mode_grab_distance * i.canvas.pxratio),
64
+ (i.interactivity.modes.bubble.distance = i.tmp.obj.mode_bubble_distance * i.canvas.pxratio),
65
+ (i.particles.line_linked.width = i.tmp.obj.line_linked_width * i.canvas.pxratio),
66
+ (i.interactivity.modes.bubble.size = i.tmp.obj.mode_bubble_size * i.canvas.pxratio),
67
+ (i.interactivity.modes.repulse.distance = i.tmp.obj.mode_repulse_distance * i.canvas.pxratio);
68
+ }),
69
+ (i.fn.canvasInit = function () {
70
+ i.canvas.ctx = i.canvas.el.getContext("2d");
71
+ }),
72
+ (i.fn.canvasSize = function () {
73
+ (i.canvas.el.width = i.canvas.w),
74
+ (i.canvas.el.height = i.canvas.h),
75
+ i &&
76
+ i.interactivity.events.resize &&
77
+ window.addEventListener("resize", function () {
78
+ (i.canvas.w = i.canvas.el.offsetWidth),
79
+ (i.canvas.h = i.canvas.el.offsetHeight),
80
+ i.tmp.retina && ((i.canvas.w *= i.canvas.pxratio), (i.canvas.h *= i.canvas.pxratio)),
81
+ (i.canvas.el.width = i.canvas.w),
82
+ (i.canvas.el.height = i.canvas.h),
83
+ i.particles.move.enable || (i.fn.particlesEmpty(), i.fn.particlesCreate(), i.fn.particlesDraw(), i.fn.vendors.densityAutoParticles()),
84
+ i.fn.vendors.densityAutoParticles();
85
+ });
86
+ }),
87
+ (i.fn.canvasPaint = function () {
88
+ i.canvas.ctx.fillRect(0, 0, i.canvas.w, i.canvas.h);
89
+ }),
90
+ (i.fn.canvasClear = function () {
91
+ i.canvas.ctx.clearRect(0, 0, i.canvas.w, i.canvas.h);
92
+ }),
93
+ (i.fn.particle = function (e, a, t) {
94
+ if (
95
+ ((this.radius = (i.particles.size.random ? Math.random() : 1) * i.particles.size.value),
96
+ i.particles.size.anim.enable && ((this.size_status = !1), (this.vs = i.particles.size.anim.speed / 100), i.particles.size.anim.sync || (this.vs = this.vs * Math.random())),
97
+ (this.x = t ? t.x : Math.random() * i.canvas.w),
98
+ (this.y = t ? t.y : Math.random() * i.canvas.h),
99
+ 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),
100
+ 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),
101
+ i.particles.move.bounce && i.fn.vendors.checkOverlap(this, t),
102
+ (this.color = {}),
103
+ "object" == typeof e.value)
104
+ )
105
+ if (e.value instanceof Array) {
106
+ var s = e.value[Math.floor(Math.random() * i.particles.color.value.length)];
107
+ this.color.rgb = hexToRgb(s);
108
+ } else void 0 != e.value.r && void 0 != e.value.g && void 0 != e.value.b && (this.color.rgb = { r: e.value.r, g: e.value.g, b: e.value.b }), void 0 != e.value.h && void 0 != e.value.s && void 0 != e.value.l && (this.color.hsl = { h: e.value.h, s: e.value.s, l: e.value.l });
109
+ else "random" == e.value ? (this.color.rgb = { r: Math.floor(256 * Math.random()) + 0, g: Math.floor(256 * Math.random()) + 0, b: Math.floor(256 * Math.random()) + 0 }) : "string" == typeof e.value && ((this.color = e), (this.color.rgb = hexToRgb(this.color.value)));
110
+ (this.opacity = (i.particles.opacity.random ? Math.random() : 1) * i.particles.opacity.value), i.particles.opacity.anim.enable && ((this.opacity_status = !1), (this.vo = i.particles.opacity.anim.speed / 100), i.particles.opacity.anim.sync || (this.vo = this.vo * Math.random()));
111
+ var n = {};
112
+ switch (i.particles.move.direction) {
113
+ case "top":
114
+ n = { x: 0, y: -1 };
115
+ break;
116
+ case "top-right":
117
+ n = { x: 0.5, y: -0.5 };
118
+ break;
119
+ case "right":
120
+ n = { x: 1, y: -0 };
121
+ break;
122
+ case "bottom-right":
123
+ n = { x: 0.5, y: 0.5 };
124
+ break;
125
+ case "bottom":
126
+ n = { x: 0, y: 1 };
127
+ break;
128
+ case "bottom-left":
129
+ n = { x: -0.5, y: 1 };
130
+ break;
131
+ case "left":
132
+ n = { x: -1, y: 0 };
133
+ break;
134
+ case "top-left":
135
+ n = { x: -0.5, y: -0.5 };
136
+ break;
137
+ default:
138
+ n = { x: 0, y: 0 };
139
+ }
140
+ i.particles.move.straight ? ((this.vx = n.x), (this.vy = n.y), i.particles.move.random && ((this.vx = this.vx * Math.random()), (this.vy = this.vy * Math.random()))) : ((this.vx = n.x + Math.random() - 0.5), (this.vy = n.y + Math.random() - 0.5)), (this.vx_i = this.vx), (this.vy_i = this.vy);
141
+ var r = i.particles.shape.type;
142
+ if ("object" == typeof r) {
143
+ if (r instanceof Array) {
144
+ var c = r[Math.floor(Math.random() * r.length)];
145
+ this.shape = c;
146
+ }
147
+ } else this.shape = r;
148
+ if ("image" == this.shape) {
149
+ var o = i.particles.shape;
150
+ (this.img = { src: o.image.src, ratio: o.image.width / o.image.height }), this.img.ratio || (this.img.ratio = 1), "svg" == i.tmp.img_type && void 0 != i.tmp.source_svg && (i.fn.vendors.createSvgImg(this), i.tmp.pushing && (this.img.loaded = !1));
151
+ }
152
+ }),
153
+ (i.fn.particle.prototype.draw = function () {
154
+ function e() {
155
+ i.canvas.ctx.drawImage(r, a.x - t, a.y - t, 2 * t, (2 * t) / a.img.ratio);
156
+ }
157
+ var a = this;
158
+ if (void 0 != a.radius_bubble) var t = a.radius_bubble;
159
+ else var t = a.radius;
160
+ if (void 0 != a.opacity_bubble) var s = a.opacity_bubble;
161
+ else var s = a.opacity;
162
+ if (a.color.rgb) var n = "rgba(" + a.color.rgb.r + "," + a.color.rgb.g + "," + a.color.rgb.b + "," + s + ")";
163
+ else var n = "hsla(" + a.color.hsl.h + "," + a.color.hsl.s + "%," + a.color.hsl.l + "%," + s + ")";
164
+ switch (((i.canvas.ctx.fillStyle = n), i.canvas.ctx.beginPath(), a.shape)) {
165
+ case "circle":
166
+ i.canvas.ctx.arc(a.x, a.y, t, 0, 2 * Math.PI, !1);
167
+ break;
168
+ case "edge":
169
+ i.canvas.ctx.rect(a.x - t, a.y - t, 2 * t, 2 * t);
170
+ break;
171
+ case "triangle":
172
+ i.fn.vendors.drawShape(i.canvas.ctx, a.x - t, a.y + t / 1.66, 2 * t, 3, 2);
173
+ break;
174
+ case "polygon":
175
+ i.fn.vendors.drawShape(i.canvas.ctx, a.x - t / (i.particles.shape.polygon.nb_sides / 3.5), a.y - t / 0.76, (2.66 * t) / (i.particles.shape.polygon.nb_sides / 3), i.particles.shape.polygon.nb_sides, 1);
176
+ break;
177
+ case "star":
178
+ 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);
179
+ break;
180
+ case "image":
181
+ if ("svg" == i.tmp.img_type) var r = a.img.obj;
182
+ else var r = i.tmp.img_obj;
183
+ r && e();
184
+ }
185
+ i.canvas.ctx.closePath(), i.particles.shape.stroke.width > 0 && ((i.canvas.ctx.strokeStyle = i.particles.shape.stroke.color), (i.canvas.ctx.lineWidth = i.particles.shape.stroke.width), i.canvas.ctx.stroke()), i.canvas.ctx.fill();
186
+ }),
187
+ (i.fn.particlesCreate = function () {
188
+ for (var e = 0; e < i.particles.number.value; e++) i.particles.array.push(new i.fn.particle(i.particles.color, i.particles.opacity.value));
189
+ }),
190
+ (i.fn.particlesUpdate = function () {
191
+ for (var e = 0; e < i.particles.array.length; e++) {
192
+ var a = i.particles.array[e];
193
+ if (i.particles.move.enable) {
194
+ var t = i.particles.move.speed / 2;
195
+ (a.x += a.vx * t), (a.y += a.vy * t);
196
+ }
197
+ if (
198
+ (i.particles.opacity.anim.enable && (1 == a.opacity_status ? (a.opacity >= i.particles.opacity.value && (a.opacity_status = !1), (a.opacity += a.vo)) : (a.opacity <= i.particles.opacity.anim.opacity_min && (a.opacity_status = !0), (a.opacity -= a.vo)), a.opacity < 0 && (a.opacity = 0)),
199
+ i.particles.size.anim.enable && (1 == a.size_status ? (a.radius >= i.particles.size.value && (a.size_status = !1), (a.radius += a.vs)) : (a.radius <= i.particles.size.anim.size_min && (a.size_status = !0), (a.radius -= a.vs)), a.radius < 0 && (a.radius = 0)),
200
+ "bounce" == i.particles.move.out_mode)
201
+ )
202
+ var s = { x_left: a.radius, x_right: i.canvas.w, y_top: a.radius, y_bottom: i.canvas.h };
203
+ else var s = { x_left: -a.radius, x_right: i.canvas.w + a.radius, y_top: -a.radius, y_bottom: i.canvas.h + a.radius };
204
+ switch ((a.x - a.radius > i.canvas.w ? ((a.x = s.x_left), (a.y = Math.random() * i.canvas.h)) : a.x + a.radius < 0 && ((a.x = s.x_right), (a.y = Math.random() * i.canvas.h)), a.y - a.radius > i.canvas.h ? ((a.y = s.y_top), (a.x = Math.random() * i.canvas.w)) : a.y + a.radius < 0 && ((a.y = s.y_bottom), (a.x = Math.random() * i.canvas.w)), i.particles.move.out_mode)) {
205
+ case "bounce":
206
+ a.x + a.radius > i.canvas.w ? (a.vx = -a.vx) : a.x - a.radius < 0 && (a.vx = -a.vx), a.y + a.radius > i.canvas.h ? (a.vy = -a.vy) : a.y - a.radius < 0 && (a.vy = -a.vy);
207
+ }
208
+ if (
209
+ (isInArray("grab", i.interactivity.events.onhover.mode) && i.fn.modes.grabParticle(a),
210
+ (isInArray("bubble", i.interactivity.events.onhover.mode) || isInArray("bubble", i.interactivity.events.onclick.mode)) && i.fn.modes.bubbleParticle(a),
211
+ (isInArray("repulse", i.interactivity.events.onhover.mode) || isInArray("repulse", i.interactivity.events.onclick.mode)) && i.fn.modes.repulseParticle(a),
212
+ i.particles.line_linked.enable || i.particles.move.attract.enable)
213
+ )
214
+ for (var n = e + 1; n < i.particles.array.length; n++) {
215
+ var r = i.particles.array[n];
216
+ i.particles.line_linked.enable && i.fn.interact.linkParticles(a, r), i.particles.move.attract.enable && i.fn.interact.attractParticles(a, r), i.particles.move.bounce && i.fn.interact.bounceParticles(a, r);
217
+ }
218
+ }
219
+ }),
220
+ (i.fn.particlesDraw = function () {
221
+ i.canvas.ctx.clearRect(0, 0, i.canvas.w, i.canvas.h), i.fn.particlesUpdate();
222
+ for (var e = 0; e < i.particles.array.length; e++) {
223
+ var a = i.particles.array[e];
224
+ a.draw();
225
+ }
226
+ }),
227
+ (i.fn.particlesEmpty = function () {
228
+ i.particles.array = [];
229
+ }),
230
+ (i.fn.particlesRefresh = function () {
231
+ cancelRequestAnimFrame(i.fn.checkAnimFrame), cancelRequestAnimFrame(i.fn.drawAnimFrame), (i.tmp.source_svg = void 0), (i.tmp.img_obj = void 0), (i.tmp.count_svg = 0), i.fn.particlesEmpty(), i.fn.canvasClear(), i.fn.vendors.start();
232
+ }),
233
+ (i.fn.interact.linkParticles = function (e, a) {
234
+ var t = e.x - a.x,
235
+ s = e.y - a.y,
236
+ n = Math.sqrt(t * t + s * s);
237
+ if (n <= i.particles.line_linked.distance) {
238
+ var r = i.particles.line_linked.opacity - n / (1 / i.particles.line_linked.opacity) / i.particles.line_linked.distance;
239
+ if (r > 0) {
240
+ var c = i.particles.line_linked.color_rgb_line;
241
+ (i.canvas.ctx.strokeStyle = "rgba(" + c.r + "," + c.g + "," + c.b + "," + r + ")"), (i.canvas.ctx.lineWidth = i.particles.line_linked.width), i.canvas.ctx.beginPath(), i.canvas.ctx.moveTo(e.x, e.y), i.canvas.ctx.lineTo(a.x, a.y), i.canvas.ctx.stroke(), i.canvas.ctx.closePath();
242
+ }
243
+ }
244
+ }),
245
+ (i.fn.interact.attractParticles = function (e, a) {
246
+ var t = e.x - a.x,
247
+ s = e.y - a.y,
248
+ n = Math.sqrt(t * t + s * s);
249
+ if (n <= i.particles.line_linked.distance) {
250
+ var r = t / (1e3 * i.particles.move.attract.rotateX),
251
+ c = s / (1e3 * i.particles.move.attract.rotateY);
252
+ (e.vx -= r), (e.vy -= c), (a.vx += r), (a.vy += c);
253
+ }
254
+ }),
255
+ (i.fn.interact.bounceParticles = function (e, a) {
256
+ var t = e.x - a.x,
257
+ i = e.y - a.y,
258
+ s = Math.sqrt(t * t + i * i),
259
+ n = e.radius + a.radius;
260
+ n >= s && ((e.vx = -e.vx), (e.vy = -e.vy), (a.vx = -a.vx), (a.vy = -a.vy));
261
+ }),
262
+ (i.fn.modes.pushParticles = function (e, a) {
263
+ i.tmp.pushing = !0;
264
+ for (var t = 0; e > t; t++) i.particles.array.push(new i.fn.particle(i.particles.color, i.particles.opacity.value, { x: a ? a.pos_x : Math.random() * i.canvas.w, y: a ? a.pos_y : Math.random() * i.canvas.h })), t == e - 1 && (i.particles.move.enable || i.fn.particlesDraw(), (i.tmp.pushing = !1));
265
+ }),
266
+ (i.fn.modes.removeParticles = function (e) {
267
+ i.particles.array.splice(0, e), i.particles.move.enable || i.fn.particlesDraw();
268
+ }),
269
+ (i.fn.modes.bubbleParticle = function (e) {
270
+ function a() {
271
+ (e.opacity_bubble = e.opacity), (e.radius_bubble = e.radius);
272
+ }
273
+ function t(a, t, s, n, c) {
274
+ if (a != t)
275
+ if (i.tmp.bubble_duration_end) {
276
+ if (void 0 != s) {
277
+ var o = n - (p * (n - a)) / i.interactivity.modes.bubble.duration,
278
+ l = a - o;
279
+ (d = a + l), "size" == c && (e.radius_bubble = d), "opacity" == c && (e.opacity_bubble = d);
280
+ }
281
+ } else if (r <= i.interactivity.modes.bubble.distance) {
282
+ if (void 0 != s) var v = s;
283
+ else var v = n;
284
+ if (v != a) {
285
+ var d = n - (p * (n - a)) / i.interactivity.modes.bubble.duration;
286
+ "size" == c && (e.radius_bubble = d), "opacity" == c && (e.opacity_bubble = d);
287
+ }
288
+ } else "size" == c && (e.radius_bubble = void 0), "opacity" == c && (e.opacity_bubble = void 0);
289
+ }
290
+ if (i.interactivity.events.onhover.enable && isInArray("bubble", i.interactivity.events.onhover.mode)) {
291
+ var s = e.x - i.interactivity.mouse.pos_x,
292
+ n = e.y - i.interactivity.mouse.pos_y,
293
+ r = Math.sqrt(s * s + n * n),
294
+ c = 1 - r / i.interactivity.modes.bubble.distance;
295
+ if (r <= i.interactivity.modes.bubble.distance) {
296
+ if (c >= 0 && "mousemove" == i.interactivity.status) {
297
+ if (i.interactivity.modes.bubble.size != i.particles.size.value)
298
+ if (i.interactivity.modes.bubble.size > i.particles.size.value) {
299
+ var o = e.radius + i.interactivity.modes.bubble.size * c;
300
+ o >= 0 && (e.radius_bubble = o);
301
+ } else {
302
+ var l = e.radius - i.interactivity.modes.bubble.size,
303
+ o = e.radius - l * c;
304
+ o > 0 ? (e.radius_bubble = o) : (e.radius_bubble = 0);
305
+ }
306
+ if (i.interactivity.modes.bubble.opacity != i.particles.opacity.value)
307
+ if (i.interactivity.modes.bubble.opacity > i.particles.opacity.value) {
308
+ var v = i.interactivity.modes.bubble.opacity * c;
309
+ v > e.opacity && v <= i.interactivity.modes.bubble.opacity && (e.opacity_bubble = v);
310
+ } else {
311
+ var v = e.opacity - (i.particles.opacity.value - i.interactivity.modes.bubble.opacity) * c;
312
+ v < e.opacity && v >= i.interactivity.modes.bubble.opacity && (e.opacity_bubble = v);
313
+ }
314
+ }
315
+ } else a();
316
+ "mouseleave" == i.interactivity.status && a();
317
+ } else if (i.interactivity.events.onclick.enable && isInArray("bubble", i.interactivity.events.onclick.mode)) {
318
+ if (i.tmp.bubble_clicking) {
319
+ var s = e.x - i.interactivity.mouse.click_pos_x,
320
+ n = e.y - i.interactivity.mouse.click_pos_y,
321
+ r = Math.sqrt(s * s + n * n),
322
+ p = (new Date().getTime() - i.interactivity.mouse.click_time) / 1e3;
323
+ p > i.interactivity.modes.bubble.duration && (i.tmp.bubble_duration_end = !0), p > 2 * i.interactivity.modes.bubble.duration && ((i.tmp.bubble_clicking = !1), (i.tmp.bubble_duration_end = !1));
324
+ }
325
+ i.tmp.bubble_clicking && (t(i.interactivity.modes.bubble.size, i.particles.size.value, e.radius_bubble, e.radius, "size"), t(i.interactivity.modes.bubble.opacity, i.particles.opacity.value, e.opacity_bubble, e.opacity, "opacity"));
326
+ }
327
+ }),
328
+ (i.fn.modes.repulseParticle = function (e) {
329
+ function a() {
330
+ var a = Math.atan2(d, p);
331
+ if (((e.vx = u * Math.cos(a)), (e.vy = u * Math.sin(a)), "bounce" == i.particles.move.out_mode)) {
332
+ var t = { x: e.x + e.vx, y: e.y + e.vy };
333
+ t.x + e.radius > i.canvas.w ? (e.vx = -e.vx) : t.x - e.radius < 0 && (e.vx = -e.vx), t.y + e.radius > i.canvas.h ? (e.vy = -e.vy) : t.y - e.radius < 0 && (e.vy = -e.vy);
334
+ }
335
+ }
336
+ if (i.interactivity.events.onhover.enable && isInArray("repulse", i.interactivity.events.onhover.mode) && "mousemove" == i.interactivity.status) {
337
+ var t = e.x - i.interactivity.mouse.pos_x,
338
+ s = e.y - i.interactivity.mouse.pos_y,
339
+ n = Math.sqrt(t * t + s * s),
340
+ r = { x: t / n, y: s / n },
341
+ c = i.interactivity.modes.repulse.distance,
342
+ o = 100,
343
+ l = clamp((1 / c) * (-1 * Math.pow(n / c, 2) + 1) * c * o, 0, 50),
344
+ v = { x: e.x + r.x * l, y: e.y + r.y * l };
345
+ "bounce" == i.particles.move.out_mode ? (v.x - e.radius > 0 && v.x + e.radius < i.canvas.w && (e.x = v.x), v.y - e.radius > 0 && v.y + e.radius < i.canvas.h && (e.y = v.y)) : ((e.x = v.x), (e.y = v.y));
346
+ } else if (i.interactivity.events.onclick.enable && isInArray("repulse", i.interactivity.events.onclick.mode))
347
+ if ((i.tmp.repulse_finish || (i.tmp.repulse_count++, i.tmp.repulse_count == i.particles.array.length && (i.tmp.repulse_finish = !0)), i.tmp.repulse_clicking)) {
348
+ var c = Math.pow(i.interactivity.modes.repulse.distance / 6, 3),
349
+ p = i.interactivity.mouse.click_pos_x - e.x,
350
+ d = i.interactivity.mouse.click_pos_y - e.y,
351
+ m = p * p + d * d,
352
+ u = (-c / m) * 1;
353
+ c >= m && a();
354
+ } else 0 == i.tmp.repulse_clicking && ((e.vx = e.vx_i), (e.vy = e.vy_i));
355
+ }),
356
+ (i.fn.modes.grabParticle = function (e) {
357
+ if (i.interactivity.events.onhover.enable && "mousemove" == i.interactivity.status) {
358
+ var a = e.x - i.interactivity.mouse.pos_x,
359
+ t = e.y - i.interactivity.mouse.pos_y,
360
+ s = Math.sqrt(a * a + t * t);
361
+ if (s <= i.interactivity.modes.grab.distance) {
362
+ var n = i.interactivity.modes.grab.line_linked.opacity - s / (1 / i.interactivity.modes.grab.line_linked.opacity) / i.interactivity.modes.grab.distance;
363
+ if (n > 0) {
364
+ var r = i.particles.line_linked.color_rgb_line;
365
+ (i.canvas.ctx.strokeStyle = "rgba(" + r.r + "," + r.g + "," + r.b + "," + n + ")"), (i.canvas.ctx.lineWidth = i.particles.line_linked.width), i.canvas.ctx.beginPath(), i.canvas.ctx.moveTo(e.x, e.y), i.canvas.ctx.lineTo(i.interactivity.mouse.pos_x, i.interactivity.mouse.pos_y), i.canvas.ctx.stroke(), i.canvas.ctx.closePath();
366
+ }
367
+ }
368
+ }
369
+ }),
370
+ (i.fn.vendors.eventsListeners = function () {
371
+ "window" == i.interactivity.detect_on ? (i.interactivity.el = window) : (i.interactivity.el = i.canvas.el),
372
+ (i.interactivity.events.onhover.enable || i.interactivity.events.onclick.enable) &&
373
+ (i.interactivity.el.addEventListener("mousemove", function (e) {
374
+ if (i.interactivity.el == window)
375
+ var a = e.clientX,
376
+ t = e.clientY;
377
+ else
378
+ var a = e.offsetX || e.clientX,
379
+ t = e.offsetY || e.clientY;
380
+ (i.interactivity.mouse.pos_x = a), (i.interactivity.mouse.pos_y = t), i.tmp.retina && ((i.interactivity.mouse.pos_x *= i.canvas.pxratio), (i.interactivity.mouse.pos_y *= i.canvas.pxratio)), (i.interactivity.status = "mousemove");
381
+ }),
382
+ i.interactivity.el.addEventListener("mouseleave", function (e) {
383
+ (i.interactivity.mouse.pos_x = null), (i.interactivity.mouse.pos_y = null), (i.interactivity.status = "mouseleave");
384
+ })),
385
+ i.interactivity.events.onclick.enable &&
386
+ i.interactivity.el.addEventListener("click", function () {
387
+ if (((i.interactivity.mouse.click_pos_x = i.interactivity.mouse.pos_x), (i.interactivity.mouse.click_pos_y = i.interactivity.mouse.pos_y), (i.interactivity.mouse.click_time = new Date().getTime()), i.interactivity.events.onclick.enable))
388
+ switch (i.interactivity.events.onclick.mode) {
389
+ case "push":
390
+ 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);
391
+ break;
392
+ case "remove":
393
+ i.fn.modes.removeParticles(i.interactivity.modes.remove.particles_nb);
394
+ break;
395
+ case "bubble":
396
+ i.tmp.bubble_clicking = !0;
397
+ break;
398
+ case "repulse":
399
+ (i.tmp.repulse_clicking = !0),
400
+ (i.tmp.repulse_count = 0),
401
+ (i.tmp.repulse_finish = !1),
402
+ setTimeout(function () {
403
+ i.tmp.repulse_clicking = !1;
404
+ }, 1e3 * i.interactivity.modes.repulse.duration);
405
+ }
406
+ });
407
+ }),
408
+ (i.fn.vendors.densityAutoParticles = function () {
409
+ if (i.particles.number.density.enable) {
410
+ var e = (i.canvas.el.width * i.canvas.el.height) / 1e3;
411
+ i.tmp.retina && (e /= 2 * i.canvas.pxratio);
412
+ var a = (e * i.particles.number.value) / i.particles.number.density.value_area,
413
+ t = i.particles.array.length - a;
414
+ 0 > t ? i.fn.modes.pushParticles(Math.abs(t)) : i.fn.modes.removeParticles(t);
415
+ }
416
+ }),
417
+ (i.fn.vendors.checkOverlap = function (e, a) {
418
+ for (var t = 0; t < i.particles.array.length; t++) {
419
+ var s = i.particles.array[t],
420
+ n = e.x - s.x,
421
+ r = e.y - s.y,
422
+ c = Math.sqrt(n * n + r * r);
423
+ c <= e.radius + s.radius && ((e.x = a ? a.x : Math.random() * i.canvas.w), (e.y = a ? a.y : Math.random() * i.canvas.h), i.fn.vendors.checkOverlap(e));
424
+ }
425
+ }),
426
+ (i.fn.vendors.createSvgImg = function (e) {
427
+ var a = i.tmp.source_svg,
428
+ t = /#([0-9A-F]{3,6})/gi,
429
+ s = a.replace(t, function (a, t, i, s) {
430
+ if (e.color.rgb) var n = "rgba(" + e.color.rgb.r + "," + e.color.rgb.g + "," + e.color.rgb.b + "," + e.opacity + ")";
431
+ else var n = "hsla(" + e.color.hsl.h + "," + e.color.hsl.s + "%," + e.color.hsl.l + "%," + e.opacity + ")";
432
+ return n;
433
+ }),
434
+ n = new Blob([s], { type: "image/svg+xml;charset=utf-8" }),
435
+ r = window.URL || window.webkitURL || window,
436
+ c = r.createObjectURL(n),
437
+ o = new Image();
438
+ o.addEventListener("load", function () {
439
+ (e.img.obj = o), (e.img.loaded = !0), r.revokeObjectURL(c), i.tmp.count_svg++;
440
+ }),
441
+ (o.src = c);
442
+ }),
443
+ (i.fn.vendors.destroypJS = function () {
444
+ cancelAnimationFrame(i.fn.drawAnimFrame), t.remove(), (pJSDom = null);
445
+ }),
446
+ (i.fn.vendors.drawShape = function (e, a, t, i, s, n) {
447
+ var r = s * n,
448
+ c = s / n,
449
+ o = (180 * (c - 2)) / c,
450
+ l = Math.PI - (Math.PI * o) / 180;
451
+ e.save(), e.beginPath(), e.translate(a, t), e.moveTo(0, 0);
452
+ for (var v = 0; r > v; v++) e.lineTo(i, 0), e.translate(i, 0), e.rotate(l);
453
+ e.fill(), e.restore();
454
+ }),
455
+ (i.fn.vendors.exportImg = function () {
456
+ window.open(i.canvas.el.toDataURL("image/png"), "_blank");
457
+ }),
458
+ (i.fn.vendors.loadImg = function (e) {
459
+ if (((i.tmp.img_error = void 0), "" != i.particles.shape.image.src))
460
+ if ("svg" == e) {
461
+ var a = new XMLHttpRequest();
462
+ a.open("GET", i.particles.shape.image.src),
463
+ (a.onreadystatechange = function (e) {
464
+ 4 == a.readyState && (200 == a.status ? ((i.tmp.source_svg = e.currentTarget.response), i.fn.vendors.checkBeforeDraw()) : (console.log("Error pJS - Image not found"), (i.tmp.img_error = !0)));
465
+ }),
466
+ a.send();
467
+ } else {
468
+ var t = new Image();
469
+ t.addEventListener("load", function () {
470
+ (i.tmp.img_obj = t), i.fn.vendors.checkBeforeDraw();
471
+ }),
472
+ (t.src = i.particles.shape.image.src);
473
+ }
474
+ else console.log("Error pJS - No image.src"), (i.tmp.img_error = !0);
475
+ }),
476
+ (i.fn.vendors.draw = function () {
477
+ "image" == i.particles.shape.type
478
+ ? "svg" == i.tmp.img_type
479
+ ? i.tmp.count_svg >= i.particles.number.value
480
+ ? (i.fn.particlesDraw(), i.particles.move.enable ? (i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw)) : cancelRequestAnimFrame(i.fn.drawAnimFrame))
481
+ : i.tmp.img_error || (i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw))
482
+ : void 0 != i.tmp.img_obj
483
+ ? (i.fn.particlesDraw(), i.particles.move.enable ? (i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw)) : cancelRequestAnimFrame(i.fn.drawAnimFrame))
484
+ : i.tmp.img_error || (i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw))
485
+ : (i.fn.particlesDraw(), i.particles.move.enable ? (i.fn.drawAnimFrame = requestAnimFrame(i.fn.vendors.draw)) : cancelRequestAnimFrame(i.fn.drawAnimFrame));
486
+ }),
487
+ (i.fn.vendors.checkBeforeDraw = function () {
488
+ "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), i.tmp.img_error || (i.fn.vendors.init(), i.fn.vendors.draw()))) : (i.fn.vendors.init(), i.fn.vendors.draw());
489
+ }),
490
+ (i.fn.vendors.init = function () {
491
+ i.fn.retinaInit(), i.fn.canvasInit(), i.fn.canvasSize(), i.fn.canvasPaint(), i.fn.particlesCreate(), i.fn.vendors.densityAutoParticles(), (i.particles.line_linked.color_rgb_line = hexToRgb(i.particles.line_linked.color));
492
+ }),
493
+ (i.fn.vendors.start = function () {
494
+ isInArray("image", i.particles.shape.type) ? ((i.tmp.img_type = i.particles.shape.image.src.substr(i.particles.shape.image.src.length - 3)), i.fn.vendors.loadImg(i.tmp.img_type)) : i.fn.vendors.checkBeforeDraw();
495
+ }),
496
+ i.fn.vendors.eventsListeners(),
497
+ i.fn.vendors.start();
498
+ };
499
+ (Object.deepExtend = function (e, a) {
500
+ for (var t in a) a[t] && a[t].constructor && a[t].constructor === Object ? ((e[t] = e[t] || {}), arguments.callee(e[t], a[t])) : (e[t] = a[t]);
501
+ return e;
502
+ }),
503
+ (window.requestAnimFrame = (function () {
504
+ return (
505
+ window.requestAnimationFrame ||
506
+ window.webkitRequestAnimationFrame ||
507
+ window.mozRequestAnimationFrame ||
508
+ window.oRequestAnimationFrame ||
509
+ window.msRequestAnimationFrame ||
510
+ function (e) {
511
+ window.setTimeout(e, 1e3 / 60);
512
+ }
513
+ );
514
+ })()),
515
+ (window.cancelRequestAnimFrame = (function () {
516
+ return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout;
517
+ })()),
518
+ (window.pJSDom = []),
519
+ (window.particlesJS = function (e, a) {
520
+ "string" != typeof e && ((a = e), (e = "particles-js")), e || (e = "particles-js");
521
+ var t = document.getElementById(e),
522
+ i = "particles-js-canvas-el",
523
+ s = t.getElementsByClassName(i);
524
+ if (s.length) for (; s.length > 0; ) t.removeChild(s[0]);
525
+ var n = document.createElement("canvas");
526
+ (n.className = i), (n.style.width = "100%"), (n.style.height = "100%");
527
+ var r = document.getElementById(e).appendChild(n);
528
+ null != r && pJSDom.push(new pJS(e, a));
529
+ }),
530
+ (window.particlesJS.load = function (e, a, t) {
531
+ var i = new XMLHttpRequest();
532
+ i.open("GET", a),
533
+ (i.onreadystatechange = function (a) {
534
+ if (4 == i.readyState)
535
+ if (200 == i.status) {
536
+ var s = JSON.parse(a.currentTarget.response);
537
+ window.particlesJS(e, s), t && t();
538
+ } else console.log("Error pJS - XMLHttpRequest status: " + i.status), console.log("Error pJS - File config not found");
539
+ }),
540
+ i.send();
541
+ });
static/we_wallpaper_1/assets/particles.json ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "particles": {
3
+ "number": {
4
+ "value": 67,
5
+ "density": {
6
+ "enable": true,
7
+ "value_area": 2244.776885211732
8
+ }
9
+ },
10
+ "color": {
11
+ "value": "#ffffff"
12
+ },
13
+ "shape": {
14
+ "type": "circle",
15
+ "stroke": {
16
+ "width": 0,
17
+ "color": "#ffffff"
18
+ },
19
+ "polygon": {
20
+ "nb_sides": 4
21
+ },
22
+ "image": {
23
+ "src": "img/github.svg",
24
+ "width": 100,
25
+ "height": 100
26
+ }
27
+ },
28
+ "opacity": {
29
+ "value": 0.5,
30
+ "random": true,
31
+ "anim": {
32
+ "enable": false,
33
+ "speed": 1,
34
+ "opacity_min": 0.1,
35
+ "sync": false
36
+ }
37
+ },
38
+ "size": {
39
+ "value": 2,
40
+ "random": false,
41
+ "anim": {
42
+ "enable": false,
43
+ "speed": 43.852169464272635,
44
+ "size_min": 0.1,
45
+ "sync": true
46
+ }
47
+ },
48
+ "line_linked": {
49
+ "enable": true,
50
+ "distance": 220,
51
+ "color": "#d4b3ff",
52
+ "opacity": 0.6,
53
+ "width": 1.2
54
+ },
55
+ "move": {
56
+ "enable": true,
57
+ "speed": 1,
58
+ "direction": "none",
59
+ "random": true,
60
+ "straight": false,
61
+ "out_mode": "bounce",
62
+ "bounce": false,
63
+ "attract": {
64
+ "enable": false,
65
+ "rotateX": 600,
66
+ "rotateY": 1200
67
+ }
68
+ }
69
+ },
70
+ "interactivity": {
71
+ "detect_on": "window",
72
+ "events": {
73
+ "onhover": {
74
+ "enable": true,
75
+ "mode": "grab"
76
+ },
77
+ "onclick": {
78
+ "enable": true,
79
+ "mode": "repulse"
80
+ },
81
+ "resize": true
82
+ },
83
+ "modes": {
84
+ "grab": {
85
+ "distance": 400,
86
+ "line_linked": {
87
+ "opacity": 1
88
+ }
89
+ },
90
+ "bubble": {
91
+ "distance": 400,
92
+ "size": 40,
93
+ "duration": 2,
94
+ "opacity": 8,
95
+ "speed": 3
96
+ },
97
+ "repulse": {
98
+ "distance": 200,
99
+ "duration": 0.4
100
+ },
101
+ "push": {
102
+ "particles_nb": 4
103
+ },
104
+ "remove": {
105
+ "particles_nb": 2
106
+ }
107
+ }
108
+ },
109
+ "retina_detect": true
110
+ }