···1-/*!
2- * Personal website of Sefa Eyeoglu
3- * Copyright (C) 2018-2022 Sefa Eyeoglu <contact@scrumplex.net>
4- *
5- * This program is free software: you can redistribute it and/or modify
6- * it under the terms of the GNU Affero General Public License as published by
7- * the Free Software Foundation, either version 3 of the License, or
8- * (at your option) any later version.
9- *
10- * This program is distributed in the hope that it will be useful,
11- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13- * GNU Affero General Public License for more details.
14- *
15- * You should have received a copy of the GNU Affero General Public License
16- * along with this program. If not, see <https://www.gnu.org/licenses/>.
17- */
18-19-import { tsParticles } from "@tsparticles/engine";
20-import { loadAngleUpdater } from "@tsparticles/updater-angle";
21-import { loadBaseMover } from "@tsparticles/move-base";
22-import { loadCircleShape } from "@tsparticles/shape-circle";
23-import { loadColorUpdater } from "@tsparticles/updater-color";
24-import { loadOpacityUpdater } from "@tsparticles/updater-opacity";
25-import { loadSizeUpdater } from "@tsparticles/updater-size";
26-27-import options from "./tsParticles-config.json";
28-import ready from "./_utils";
29-30-const { matches } = matchMedia("(min-width: 768px)");
31-32-async function loadParticles() {
33- await loadAngleUpdater(tsParticles);
34- await loadBaseMover(tsParticles);
35- await loadCircleShape(tsParticles);
36- await loadColorUpdater(tsParticles);
37- await loadOpacityUpdater(tsParticles);
38- await loadSizeUpdater(tsParticles);
39- tsParticles
40- .load({ id: "particles-js", options })
41- .then()
42- .catch((e) => {
43- console.error("tsparticles failed to load :(");
44- console.error(e);
45- });
46-}
47-48-if (matches) {
49- ready().then(() => {
50- // tsParticles causes heavy lag while loading, lets delay it, so that all animations are smooth at least
51- setTimeout(loadParticles, 500);
52- });
53-}