@tsparticles/preset-hyperspace 3.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,186 @@
1
+ [![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)
2
+
3
+ # tsParticles Hyperspace Preset
4
+
5
+ [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-hyperspace/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-hyperspace) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-hyperspace.svg)](https://www.npmjs.com/package/@tsparticles/preset-hyperspace) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-hyperspace)](https://www.npmjs.com/package/@tsparticles/preset-hyperspace) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
6
+
7
+ [tsParticles](https://github.com/matteobruni/tsparticles) preset for creating a starry night effect with blinking hyperspace.
8
+
9
+ [![Slack](https://particles.js.org/images/slack.png)](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI) [![Discord](https://particles.js.org/images/discord.png)](https://discord.gg/hACwv45Hme) [![Telegram](https://particles.js.org/images/telegram.png)](https://t.me/tsparticles)
10
+
11
+ [![tsParticles Product Hunt](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=186113&theme=light)](https://www.producthunt.com/posts/tsparticles?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-tsparticles") <a href="https://www.buymeacoffee.com/matteobruni"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a beer&emoji=🍺&slug=matteobruni&button_colour=5F7FFF&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00"></a>
12
+
13
+ ## Sample
14
+
15
+ [![demo](https://raw.githubusercontent.com/matteobruni/tsparticles/main/presets/hyperspace/images/sample.png)](https://particles.js.org/samples/presets/hyperspace)
16
+
17
+ ## How to use it
18
+
19
+ ### CDN / Vanilla JS / jQuery
20
+
21
+ The first step is installing [tsParticles](https://github.com/matteobruni/tsparticles) following the instructions for
22
+ vanilla javascript in the main project [here](https://github.com/matteobruni/tsparticles)
23
+
24
+ Once installed you need one more script to be included in your page (or you can download that
25
+ from [jsDelivr](https://www.jsdelivr.com/package/npm/@tsparticles/preset-hyperspace):
26
+
27
+ ```html
28
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/engine@2/tsparticles.engine.min.js"></script>
29
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/basic@2/tsparticles.basic.min.js"></script>
30
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/move-base@2/tsparticles.move.base.min.js"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/shape-circle@2/tsparticles.shape.circle.min.js"></script>
32
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/updater-color@2/tsparticles.updater.color.min.js"></script>
33
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/updater-opacity@2/tsparticles.updater.opacity.min.js"></script>
34
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/updater-out-modes@2/tsparticles.updater.out-modes.min.js"></script>
35
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/updater-size@2/tsparticles.updater.size.min.js"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-hyperspace@2/tsparticles.preset.hyperspace.min.js"></script>
37
+ ```
38
+
39
+ This script **MUST** be placed after the `tsParticles` one.
40
+
41
+ #### Bundle
42
+
43
+ A bundled script can also be used, this will include every needed plugin needed by the preset.
44
+
45
+ ```html
46
+ <script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-hyperspace@2/tsparticles.preset.hyperspace.bundle.min.js"></script>
47
+ ```
48
+
49
+ ### Usage
50
+
51
+ Once the scripts are loaded you can set up `tsParticles` like this:
52
+
53
+ ```javascript
54
+ (async () => {
55
+ await loadHyperspacePreset(tsParticles); // this is required only if you are not using the bundle script
56
+
57
+ await tsParticles.load("tsparticles", {
58
+ preset: "hyperspace",
59
+ });
60
+ })();
61
+ ```
62
+
63
+ #### Customization
64
+
65
+ **Important ⚠️**
66
+ You can override all the options defining the properties like in any standard `tsParticles` installation.
67
+
68
+ ```javascript
69
+ tsParticles.load("tsparticles", {
70
+ particles: {
71
+ shape: {
72
+ type: "square", // starting from v2, this require the square shape script
73
+ },
74
+ },
75
+ preset: "hyperspace",
76
+ });
77
+ ```
78
+
79
+ Like in the sample above, the circles will be replaced by squares.
80
+
81
+ ### React.js / Preact / Inferno
82
+
83
+ _The syntax for `React.js`, `Preact` and `Inferno` is the same_.
84
+
85
+ This sample uses the class component syntax, but you can use hooks as well (if the library supports it).
86
+
87
+ ```typescript jsx
88
+ import Particles from "react-particles";
89
+ import type { Engine } from "@tsparticles/engine";
90
+ import { loadHyperspacePreset } from "@tsparticles/preset-hyperspace";
91
+
92
+ export class ParticlesContainer extends React.PureComponent<IProps> {
93
+ // this customizes the component tsParticles installation
94
+ async customInit(engine: Engine): Promise<void> {
95
+ // this adds the preset to tsParticles, you can safely use the
96
+ await loadHyperspacePreset(engine);
97
+ }
98
+
99
+ render() {
100
+ const options = {
101
+ preset: "hyperspace",
102
+ };
103
+
104
+ return <Particles options={options} init={this.customInit} />;
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### Vue (2.x and 3.x)
110
+
111
+ _The syntax for `Vue.js 2.x` and `3.x` is the same_
112
+
113
+ ```vue
114
+ <Particles id="tsparticles" :particlesInit="particlesInit" :options="particlesOptions" />
115
+ ```
116
+
117
+ ```ts
118
+ const particlesOptions = {
119
+ preset: "hyperspace",
120
+ };
121
+
122
+ async function particlesInit(engine: Engine): Promise<void> {
123
+ await loadHyperspacePreset(engine);
124
+ }
125
+ ```
126
+
127
+ ### Angular
128
+
129
+ ```html
130
+ <ng-particles [id]="id" [options]="particlesOptions" [particlesInit]="particlesInit"></ng-particles>
131
+ ```
132
+
133
+ ```typescript
134
+ const particlesOptions = {
135
+ preset: "hyperspace",
136
+ };
137
+
138
+ async function particlesInit(engine: Engine): Promise<void> {
139
+ await loadHyperspacePreset(engine);
140
+ }
141
+ ```
142
+
143
+ ### Svelte
144
+
145
+ ```sveltehtml
146
+
147
+ <Particles
148
+ id="tsparticles"
149
+ options={particlesOptions}
150
+ particlesInit={particlesInit}
151
+ />
152
+ ```
153
+
154
+ ```js
155
+ let particlesOptions = {
156
+ preset: "bubbles",
157
+ };
158
+
159
+ let particlesInit = async (engine) => {
160
+ await loadHyperspacePreset(engine);
161
+ };
162
+ ```
163
+
164
+ ---
165
+
166
+ ```mermaid
167
+ flowchart TD
168
+
169
+ subgraph pl [Plugins]
170
+ ple[Emitters]
171
+ end
172
+
173
+ bb[tsParticles Basic] --> pl
174
+
175
+ subgraph u [Updaters]
176
+ ul[Life]
177
+ end
178
+
179
+ bb --> u
180
+
181
+ subgraph pr [Presets]
182
+ prhs[Hyperspace]
183
+ end
184
+
185
+ bb & ple & ul --> prhs
186
+ ```
@@ -0,0 +1,4 @@
1
+ import { loadHyperspacePreset } from ".";
2
+ import { tsParticles } from "@tsparticles/engine";
3
+ loadHyperspacePreset(tsParticles);
4
+ export { loadHyperspacePreset, tsParticles };
@@ -0,0 +1,12 @@
1
+ import { loadBasic } from "@tsparticles/basic";
2
+ import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
3
+ import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
4
+ import { loadLifeUpdater } from "@tsparticles/updater-life";
5
+ import { options } from "./options";
6
+ export async function loadHyperspacePreset(engine, refresh = true) {
7
+ await loadBasic(engine, false);
8
+ await loadEmittersShapeSquare(engine, false);
9
+ await loadEmittersPlugin(engine, false);
10
+ await loadLifeUpdater(engine, false);
11
+ await engine.addPreset("hyperspace", options, refresh);
12
+ }
@@ -0,0 +1,57 @@
1
+ export const options = {
2
+ background: {
3
+ color: "#000000",
4
+ },
5
+ particles: {
6
+ number: {
7
+ value: 100,
8
+ },
9
+ color: {
10
+ value: "#ffffff",
11
+ },
12
+ life: {
13
+ count: 1,
14
+ duration: {
15
+ value: 5,
16
+ },
17
+ },
18
+ shape: {
19
+ type: "circle",
20
+ },
21
+ opacity: {
22
+ value: 1,
23
+ },
24
+ size: {
25
+ value: 3,
26
+ },
27
+ move: {
28
+ enable: true,
29
+ speed: 10,
30
+ decay: 0.005,
31
+ direction: "outside",
32
+ straight: true,
33
+ outModes: "destroy",
34
+ trail: {
35
+ enable: true,
36
+ length: 15,
37
+ fill: {
38
+ color: "#000000",
39
+ },
40
+ },
41
+ },
42
+ },
43
+ emitters: {
44
+ position: {
45
+ x: 50,
46
+ y: 50,
47
+ },
48
+ size: {
49
+ width: 100,
50
+ height: 100,
51
+ },
52
+ rate: {
53
+ quantity: 10,
54
+ delay: 0.1,
55
+ },
56
+ },
57
+ };
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/cjs/bundle.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tsParticles = exports.loadHyperspacePreset = void 0;
4
+ const _1 = require(".");
5
+ Object.defineProperty(exports, "loadHyperspacePreset", { enumerable: true, get: function () { return _1.loadHyperspacePreset; } });
6
+ const engine_1 = require("@tsparticles/engine");
7
+ Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
8
+ (0, _1.loadHyperspacePreset)(engine_1.tsParticles);
package/cjs/index.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadHyperspacePreset = void 0;
4
+ const basic_1 = require("@tsparticles/basic");
5
+ const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
6
+ const plugin_emitters_shape_square_1 = require("@tsparticles/plugin-emitters-shape-square");
7
+ const updater_life_1 = require("@tsparticles/updater-life");
8
+ const options_1 = require("./options");
9
+ async function loadHyperspacePreset(engine, refresh = true) {
10
+ await (0, basic_1.loadBasic)(engine, false);
11
+ await (0, plugin_emitters_shape_square_1.loadEmittersShapeSquare)(engine, false);
12
+ await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
13
+ await (0, updater_life_1.loadLifeUpdater)(engine, false);
14
+ await engine.addPreset("hyperspace", options_1.options, refresh);
15
+ }
16
+ exports.loadHyperspacePreset = loadHyperspacePreset;
package/cjs/options.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.options = void 0;
4
+ exports.options = {
5
+ background: {
6
+ color: "#000000",
7
+ },
8
+ particles: {
9
+ number: {
10
+ value: 100,
11
+ },
12
+ color: {
13
+ value: "#ffffff",
14
+ },
15
+ life: {
16
+ count: 1,
17
+ duration: {
18
+ value: 5,
19
+ },
20
+ },
21
+ shape: {
22
+ type: "circle",
23
+ },
24
+ opacity: {
25
+ value: 1,
26
+ },
27
+ size: {
28
+ value: 3,
29
+ },
30
+ move: {
31
+ enable: true,
32
+ speed: 10,
33
+ decay: 0.005,
34
+ direction: "outside",
35
+ straight: true,
36
+ outModes: "destroy",
37
+ trail: {
38
+ enable: true,
39
+ length: 15,
40
+ fill: {
41
+ color: "#000000",
42
+ },
43
+ },
44
+ },
45
+ },
46
+ emitters: {
47
+ position: {
48
+ x: 50,
49
+ y: 50,
50
+ },
51
+ size: {
52
+ width: 100,
53
+ height: 100,
54
+ },
55
+ rate: {
56
+ quantity: 10,
57
+ delay: 0.1,
58
+ },
59
+ },
60
+ };
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
package/esm/bundle.js ADDED
@@ -0,0 +1,4 @@
1
+ import { loadHyperspacePreset } from ".";
2
+ import { tsParticles } from "@tsparticles/engine";
3
+ loadHyperspacePreset(tsParticles);
4
+ export { loadHyperspacePreset, tsParticles };
package/esm/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import { loadBasic } from "@tsparticles/basic";
2
+ import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
3
+ import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
4
+ import { loadLifeUpdater } from "@tsparticles/updater-life";
5
+ import { options } from "./options";
6
+ export async function loadHyperspacePreset(engine, refresh = true) {
7
+ await loadBasic(engine, false);
8
+ await loadEmittersShapeSquare(engine, false);
9
+ await loadEmittersPlugin(engine, false);
10
+ await loadLifeUpdater(engine, false);
11
+ await engine.addPreset("hyperspace", options, refresh);
12
+ }
package/esm/options.js ADDED
@@ -0,0 +1,57 @@
1
+ export const options = {
2
+ background: {
3
+ color: "#000000",
4
+ },
5
+ particles: {
6
+ number: {
7
+ value: 100,
8
+ },
9
+ color: {
10
+ value: "#ffffff",
11
+ },
12
+ life: {
13
+ count: 1,
14
+ duration: {
15
+ value: 5,
16
+ },
17
+ },
18
+ shape: {
19
+ type: "circle",
20
+ },
21
+ opacity: {
22
+ value: 1,
23
+ },
24
+ size: {
25
+ value: 3,
26
+ },
27
+ move: {
28
+ enable: true,
29
+ speed: 10,
30
+ decay: 0.005,
31
+ direction: "outside",
32
+ straight: true,
33
+ outModes: "destroy",
34
+ trail: {
35
+ enable: true,
36
+ length: 15,
37
+ fill: {
38
+ color: "#000000",
39
+ },
40
+ },
41
+ },
42
+ },
43
+ emitters: {
44
+ position: {
45
+ x: 50,
46
+ y: 50,
47
+ },
48
+ size: {
49
+ width: 100,
50
+ height: 100,
51
+ },
52
+ rate: {
53
+ quantity: 10,
54
+ delay: 0.1,
55
+ },
56
+ },
57
+ };
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@tsparticles/preset-hyperspace",
3
+ "version": "3.0.0-beta.4",
4
+ "description": "tsParticles hyperspace preset",
5
+ "homepage": "https://particles.js.org",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/tsparticles/presets.git",
9
+ "directory": "presets/hyperspace"
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
+ "tsparticles-preset"
64
+ ],
65
+ "author": "Matteo Bruni <matteo.bruni@me.com>",
66
+ "license": "MIT",
67
+ "bugs": {
68
+ "url": "https://github.com/tsparticles/presets/issues"
69
+ },
70
+ "funding": [
71
+ {
72
+ "type": "github",
73
+ "url": "https://github.com/sponsors/matteobruni"
74
+ },
75
+ {
76
+ "type": "github",
77
+ "url": "https://github.com/sponsors/tsparticles"
78
+ },
79
+ {
80
+ "type": "buymeacoffee",
81
+ "url": "https://www.buymeacoffee.com/matteobruni"
82
+ }
83
+ ],
84
+ "main": "cjs/index.js",
85
+ "jsdelivr": "tsparticles.preset.hyperspace.min.js",
86
+ "unpkg": "tsparticles.preset.hyperspace.min.js",
87
+ "module": "esm/index.js",
88
+ "types": "types/index.d.ts",
89
+ "dependencies": {
90
+ "@tsparticles/basic": "^3.0.0-beta.4",
91
+ "@tsparticles/engine": "^3.0.0-beta.4",
92
+ "@tsparticles/plugin-emitters": "^3.0.0-beta.4",
93
+ "@tsparticles/plugin-emitters-shape-square": "^3.0.0-beta.4",
94
+ "@tsparticles/updater-life": "^3.0.0-beta.4"
95
+ },
96
+ "publishConfig": {
97
+ "access": "public"
98
+ }
99
+ }