Commit
This commit is contained in:
Vendored
+13
-3
@@ -15,7 +15,13 @@ function clamp(e, a, t) { return Math.min(Math.max(e, a), t) }
|
||||
function isInArray(e, a) { return a.indexOf(e) > -1 } var pJS = function (e, a) {
|
||||
var t = document.querySelector("#" + e + " > .particles-js-canvas-el");
|
||||
this.pJS = {
|
||||
canvas: { el: t, w: t.offsetWidth, h: t.offsetHeight },
|
||||
_canvas: { el: t, w: t.offsetWidth, h: t.offsetHeight },
|
||||
get canvas() {
|
||||
return this._canvas;
|
||||
},
|
||||
set canvas(value) {
|
||||
this._canvas = value;
|
||||
},
|
||||
particles: {
|
||||
number: { value: 400, density: { enable: !0, value_area: 800 } }, color: { value: "#fff" }, shape: {
|
||||
type: "circle",
|
||||
@@ -246,7 +252,7 @@ Object.deepExtend = function (e, a) {
|
||||
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];
|
||||
return e
|
||||
}, window.requestAnimFrame = function () { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (e) { window.setTimeout(e, 1e3 / 60) } }(), window.cancelRequestAnimFrame = function () { return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout }(), window.pJSDom = [], window.particlesJS = function (e, a) {
|
||||
"string" != typeof e && (a = e, e = "particles-js"), e || (e = "particles-js");
|
||||
"string" != typeof e && (a = e, e = newFunction()), e || (e = "particles-js");
|
||||
var t = document.getElementById(e), i = "particles-js-canvas-el", s = t.getElementsByClassName(i);
|
||||
if (s.length) for (; s.length > 0;)t.removeChild(s[0]); var n = document.createElement("canvas");
|
||||
n.className = i, n.style.width = "100%", n.style.height = "100%";
|
||||
@@ -260,4 +266,8 @@ Object.deepExtend = function (e, a) {
|
||||
window.particlesJS(e, s), t && t()
|
||||
} else console.log("Error pJS - XMLHttpRequest status: " + i.status), console.log("Error pJS - File config not found")
|
||||
}, i.send()
|
||||
};
|
||||
};
|
||||
|
||||
function newFunction() {
|
||||
return "particles-js";
|
||||
}
|
||||
|
||||
+4
-4
@@ -36,7 +36,7 @@ particlesJS('particles-js',
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#ffffff"
|
||||
"value": "random"
|
||||
},
|
||||
"shape": {
|
||||
"type": "polygon",
|
||||
@@ -59,7 +59,7 @@ particlesJS('particles-js',
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 10,
|
||||
"value": 20,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
@@ -81,7 +81,7 @@ particlesJS('particles-js',
|
||||
"direction": "none",
|
||||
"random": false,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"out_mode": "bounce",
|
||||
"attract": {
|
||||
"enable": false,
|
||||
"rotateX": 600,
|
||||
@@ -117,7 +117,7 @@ particlesJS('particles-js',
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 200
|
||||
"distance": 100
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 4
|
||||
|
||||
Reference in New Issue
Block a user