@tsparticles/pjs 3.0.0-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/browser/IParticlesJS.js +1 -0
- package/browser/bundle.js +5 -0
- package/browser/index.js +23 -0
- package/cjs/IParticlesJS.js +2 -0
- package/cjs/bundle.js +23 -0
- package/cjs/index.js +26 -0
- package/esm/IParticlesJS.js +1 -0
- package/esm/bundle.js +5 -0
- package/esm/index.js +23 -0
- package/package.json +84 -0
- package/report.html +39 -0
- package/tsparticles.pjs.bundle.js +5580 -0
- package/tsparticles.pjs.bundle.min.js +2 -0
- package/tsparticles.pjs.bundle.min.js.LICENSE.txt +8 -0
- package/tsparticles.pjs.js +91 -0
- package/tsparticles.pjs.min.js +2 -0
- package/tsparticles.pjs.min.js.LICENSE.txt +8 -0
- package/types/IParticlesJS.d.ts +6 -0
- package/types/bundle.d.ts +3 -0
- package/types/index.d.ts +7 -0
- package/umd/IParticlesJS.js +12 -0
- package/umd/bundle.js +33 -0
- package/umd/index.js +36 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Matteo Bruni
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
[![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org)
|
2
|
+
|
3
|
+
# tsParticles Particles.js Compatibility Package
|
4
|
+
|
5
|
+
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-particles.js/badge)](https://www.jsdelivr.com/package/npm/tsparticles-particles.js) [![npmjs](https://badge.fury.io/js/tsparticles-particles.js.svg)](https://www.npmjs.com/package/tsparticles-particles.js) [![npmjs](https://img.shields.io/npm/dt/tsparticles-particles.js)](https://www.npmjs.com/package/tsparticles-particles.js) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
|
6
|
+
|
7
|
+
[tsParticles](https://github.com/matteobruni/tsparticles) particles.js compatibility library.
|
8
|
+
|
9
|
+
## How to use it
|
10
|
+
|
11
|
+
### CDN / Vanilla JS / jQuery
|
12
|
+
|
13
|
+
The CDN/Vanilla version JS has two different files:
|
14
|
+
|
15
|
+
- One is a bundle file with all the scripts included in a single file
|
16
|
+
- One is a file including just the `initPjs` function to load the tsParticles/particles.js compatibility
|
17
|
+
|
18
|
+
#### Bundle
|
19
|
+
|
20
|
+
Including the `tsparticles.pjs.bundle.min.js` file will work exactly like `v1`, you can start using the `tsParticles` or
|
21
|
+
the `particlesJS` instance in the same way.
|
22
|
+
|
23
|
+
This is the easiest usage, since it's a single file with the some of the `v1` features.
|
24
|
+
|
25
|
+
All new features will be added as external packages, this bundle is recommended for migrating from `v1` easily.
|
26
|
+
|
27
|
+
#### Not Bundle
|
28
|
+
|
29
|
+
This installation requires more work since all dependencies must be included in the page. Some lines above are all
|
30
|
+
specified in the **Included Packages** section.
|
31
|
+
|
32
|
+
### Usage
|
33
|
+
|
34
|
+
Once the scripts are loaded you can set up `tsParticles` or `particlesJS` like this:
|
35
|
+
|
36
|
+
```javascript
|
37
|
+
const { particlesJS } = initPjs(tsParticles); // not needed if using the bundle script, required for any other installation
|
38
|
+
|
39
|
+
particlesJS("tsparticles", {
|
40
|
+
/* options */
|
41
|
+
});
|
42
|
+
|
43
|
+
// or
|
44
|
+
|
45
|
+
tsParticles.load({
|
46
|
+
id: "tsparticles",
|
47
|
+
options: {
|
48
|
+
/* options */
|
49
|
+
},
|
50
|
+
});
|
51
|
+
```
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/browser/index.js
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
const initPjs = (engine) => {
|
2
|
+
const particlesJS = (tagId, options) => {
|
3
|
+
return engine.load({ id: tagId, options: options });
|
4
|
+
};
|
5
|
+
particlesJS.load = (tagId, pathConfigJson, callback) => {
|
6
|
+
engine
|
7
|
+
.load({ id: tagId, url: pathConfigJson })
|
8
|
+
.then((container) => {
|
9
|
+
if (container) {
|
10
|
+
callback(container);
|
11
|
+
}
|
12
|
+
})
|
13
|
+
.catch(() => {
|
14
|
+
callback(undefined);
|
15
|
+
});
|
16
|
+
};
|
17
|
+
particlesJS.setOnClickHandler = (callback) => {
|
18
|
+
engine.setOnClickHandler(callback);
|
19
|
+
};
|
20
|
+
const pJSDom = engine.dom();
|
21
|
+
return { particlesJS, pJSDom };
|
22
|
+
};
|
23
|
+
export { initPjs };
|
package/cjs/bundle.js
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
exports.pJSDom = exports.particlesJS = void 0;
|
18
|
+
const _1 = require(".");
|
19
|
+
const engine_1 = require("@tsparticles/engine");
|
20
|
+
const { particlesJS, pJSDom } = (0, _1.initPjs)(engine_1.tsParticles);
|
21
|
+
exports.particlesJS = particlesJS;
|
22
|
+
exports.pJSDom = pJSDom;
|
23
|
+
__exportStar(require("@tsparticles/engine"), exports);
|
package/cjs/index.js
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.initPjs = void 0;
|
4
|
+
const initPjs = (engine) => {
|
5
|
+
const particlesJS = (tagId, options) => {
|
6
|
+
return engine.load({ id: tagId, options: options });
|
7
|
+
};
|
8
|
+
particlesJS.load = (tagId, pathConfigJson, callback) => {
|
9
|
+
engine
|
10
|
+
.load({ id: tagId, url: pathConfigJson })
|
11
|
+
.then((container) => {
|
12
|
+
if (container) {
|
13
|
+
callback(container);
|
14
|
+
}
|
15
|
+
})
|
16
|
+
.catch(() => {
|
17
|
+
callback(undefined);
|
18
|
+
});
|
19
|
+
};
|
20
|
+
particlesJS.setOnClickHandler = (callback) => {
|
21
|
+
engine.setOnClickHandler(callback);
|
22
|
+
};
|
23
|
+
const pJSDom = engine.dom();
|
24
|
+
return { particlesJS, pJSDom };
|
25
|
+
};
|
26
|
+
exports.initPjs = initPjs;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/esm/bundle.js
ADDED
package/esm/index.js
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
const initPjs = (engine) => {
|
2
|
+
const particlesJS = (tagId, options) => {
|
3
|
+
return engine.load({ id: tagId, options: options });
|
4
|
+
};
|
5
|
+
particlesJS.load = (tagId, pathConfigJson, callback) => {
|
6
|
+
engine
|
7
|
+
.load({ id: tagId, url: pathConfigJson })
|
8
|
+
.then((container) => {
|
9
|
+
if (container) {
|
10
|
+
callback(container);
|
11
|
+
}
|
12
|
+
})
|
13
|
+
.catch(() => {
|
14
|
+
callback(undefined);
|
15
|
+
});
|
16
|
+
};
|
17
|
+
particlesJS.setOnClickHandler = (callback) => {
|
18
|
+
engine.setOnClickHandler(callback);
|
19
|
+
};
|
20
|
+
const pJSDom = engine.dom();
|
21
|
+
return { particlesJS, pJSDom };
|
22
|
+
};
|
23
|
+
export { initPjs };
|
package/package.json
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
{
|
2
|
+
"name": "@tsparticles/pjs",
|
3
|
+
"version": "3.0.0-alpha.0",
|
4
|
+
"description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
|
5
|
+
"homepage": "https://particles.js.org",
|
6
|
+
"repository": {
|
7
|
+
"type": "git",
|
8
|
+
"url": "git+https://github.com/matteobruni/tsparticles.git",
|
9
|
+
"directory": "bundles/pjs"
|
10
|
+
},
|
11
|
+
"keywords": [
|
12
|
+
"front-end",
|
13
|
+
"frontend",
|
14
|
+
"tsparticles",
|
15
|
+
"particles.js",
|
16
|
+
"particlesjs",
|
17
|
+
"particles",
|
18
|
+
"particle",
|
19
|
+
"canvas",
|
20
|
+
"jsparticles",
|
21
|
+
"xparticles",
|
22
|
+
"particles-js",
|
23
|
+
"particles-bg",
|
24
|
+
"particles-bg-vue",
|
25
|
+
"particles-ts",
|
26
|
+
"particles.ts",
|
27
|
+
"react-particles-js",
|
28
|
+
"react-particles.js",
|
29
|
+
"react-particles",
|
30
|
+
"react",
|
31
|
+
"reactjs",
|
32
|
+
"vue-particles",
|
33
|
+
"ngx-particles",
|
34
|
+
"angular-particles",
|
35
|
+
"particleground",
|
36
|
+
"vue",
|
37
|
+
"vuejs",
|
38
|
+
"preact",
|
39
|
+
"preactjs",
|
40
|
+
"jquery",
|
41
|
+
"angularjs",
|
42
|
+
"angular",
|
43
|
+
"typescript",
|
44
|
+
"javascript",
|
45
|
+
"animation",
|
46
|
+
"web",
|
47
|
+
"html5",
|
48
|
+
"web-design",
|
49
|
+
"webdesign",
|
50
|
+
"css",
|
51
|
+
"html",
|
52
|
+
"css3",
|
53
|
+
"animated",
|
54
|
+
"background",
|
55
|
+
"confetti",
|
56
|
+
"canvas",
|
57
|
+
"fireworks",
|
58
|
+
"fireworks-js",
|
59
|
+
"confetti-js",
|
60
|
+
"confettijs",
|
61
|
+
"fireworksjs",
|
62
|
+
"canvas-confetti"
|
63
|
+
],
|
64
|
+
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
65
|
+
"license": "MIT",
|
66
|
+
"bugs": {
|
67
|
+
"url": "https://github.com/matteobruni/tsparticles/issues"
|
68
|
+
},
|
69
|
+
"funding": {
|
70
|
+
"type": "github",
|
71
|
+
"url": "https://github.com/sponsors/matteobruni"
|
72
|
+
},
|
73
|
+
"main": "cjs/index.js",
|
74
|
+
"module": "esm/index.js",
|
75
|
+
"jsdelivr": "tsparticles.pjs.min.js",
|
76
|
+
"unpkg": "tsparticles.pjs.min.js",
|
77
|
+
"types": "types/index.d.ts",
|
78
|
+
"publishConfig": {
|
79
|
+
"access": "public"
|
80
|
+
},
|
81
|
+
"dependencies": {
|
82
|
+
"@tsparticles/engine": "^3.0.0-alpha.0"
|
83
|
+
}
|
84
|
+
}
|