This commit is contained in:
2019-09-07 16:28:12 +02:00
parent 1ba5e27263
commit 414d0ec9b7
12 changed files with 48 additions and 24 deletions
+13 -3
View File
@@ -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";
}