@tsparticles/preset-hyperspace 3.0.0 → 3.0.2
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/README.md +20 -118
- package/browser/bundle.js +2 -2
- package/browser/index.js +1 -1
- package/cjs/bundle.js +3 -3
- package/cjs/index.js +2 -2
- package/esm/bundle.js +2 -2
- package/esm/index.js +1 -1
- package/package.json +6 -6
- package/report.html +2 -2
- package/tsparticles.preset.hyperspace.bundle.js +147 -127
- package/tsparticles.preset.hyperspace.bundle.min.js +1 -1
- package/tsparticles.preset.hyperspace.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.preset.hyperspace.js +1 -1
- package/tsparticles.preset.hyperspace.min.js.LICENSE.txt +1 -1
- package/types/bundle.d.ts +1 -1
- package/umd/bundle.js +4 -4
- package/umd/index.js +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-hyperspace) [](https://www.npmjs.com/package/@tsparticles/preset-hyperspace) [](https://www.npmjs.com/package/@tsparticles/preset-hyperspace) [](https://github.com/sponsors/matteobruni)
|
|
6
6
|
|
|
7
|
-
[tsParticles](https://github.com/
|
|
7
|
+
[tsParticles](https://github.com/tsparticles/tsparticles) preset for creating a starry night effect with blinking
|
|
8
|
+
hyperspace.
|
|
8
9
|
|
|
9
10
|
[](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI) [](https://discord.gg/hACwv45Hme) [](https://t.me/tsparticles)
|
|
10
11
|
|
|
@@ -12,38 +13,14 @@
|
|
|
12
13
|
|
|
13
14
|
## Sample
|
|
14
15
|
|
|
15
|
-
[](https://particles.js.org/samples/presets/hyperspace)
|
|
16
17
|
|
|
17
18
|
## How to use it
|
|
18
19
|
|
|
19
20
|
### CDN / Vanilla JS / jQuery
|
|
20
21
|
|
|
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
22
|
```html
|
|
46
|
-
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-hyperspace@
|
|
23
|
+
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-hyperspace@3/tsparticles.preset.hyperspace.bundle.min.js"></script>
|
|
47
24
|
```
|
|
48
25
|
|
|
49
26
|
### Usage
|
|
@@ -51,13 +28,12 @@ A bundled script can also be used, this will include every needed plugin needed
|
|
|
51
28
|
Once the scripts are loaded you can set up `tsParticles` like this:
|
|
52
29
|
|
|
53
30
|
```javascript
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
await tsParticles.load("tsparticles", {
|
|
31
|
+
tsParticles.load({
|
|
32
|
+
id: "tsparticles",
|
|
33
|
+
options: {
|
|
58
34
|
preset: "hyperspace",
|
|
59
|
-
}
|
|
60
|
-
})
|
|
35
|
+
},
|
|
36
|
+
});
|
|
61
37
|
```
|
|
62
38
|
|
|
63
39
|
#### Customization
|
|
@@ -66,100 +42,26 @@ Once the scripts are loaded you can set up `tsParticles` like this:
|
|
|
66
42
|
You can override all the options defining the properties like in any standard `tsParticles` installation.
|
|
67
43
|
|
|
68
44
|
```javascript
|
|
69
|
-
tsParticles.load(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
45
|
+
tsParticles.load({
|
|
46
|
+
id: "tsparticles",
|
|
47
|
+
options: {
|
|
48
|
+
particles: {
|
|
49
|
+
shape: {
|
|
50
|
+
type: "square", // starting from v2, this require the square shape script
|
|
51
|
+
},
|
|
73
52
|
},
|
|
53
|
+
preset: "hyperspace",
|
|
74
54
|
},
|
|
75
|
-
preset: "hyperspace",
|
|
76
55
|
});
|
|
77
56
|
```
|
|
78
57
|
|
|
79
58
|
Like in the sample above, the circles will be replaced by squares.
|
|
80
59
|
|
|
81
|
-
###
|
|
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
|
-
};
|
|
60
|
+
### Frameworks with a tsParticles component library
|
|
121
61
|
|
|
122
|
-
|
|
123
|
-
await loadHyperspacePreset(engine);
|
|
124
|
-
}
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Angular
|
|
128
|
-
|
|
129
|
-
```html
|
|
130
|
-
<ng-particles [id]="id" [options]="particlesOptions" [particlesInit]="particlesInit"></ng-particles>
|
|
131
|
-
```
|
|
62
|
+
Checkout the documentation in the component library repository and call the `loadHyperspacePreset` function instead of `loadFull`, `loadSlim` or similar functions.
|
|
132
63
|
|
|
133
|
-
|
|
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
|
-
```
|
|
64
|
+
The options shown above are valid for all the component libraries.
|
|
163
65
|
|
|
164
66
|
---
|
|
165
67
|
|
package/browser/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadHyperspacePreset } from ".";
|
|
1
|
+
import { loadHyperspacePreset } from "./index.js";
|
|
2
2
|
import { tsParticles } from "@tsparticles/engine";
|
|
3
|
-
loadHyperspacePreset(tsParticles);
|
|
3
|
+
void loadHyperspacePreset(tsParticles);
|
|
4
4
|
export { loadHyperspacePreset, tsParticles };
|
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { loadBasic } from "@tsparticles/basic";
|
|
|
2
2
|
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
|
|
3
3
|
import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
|
|
4
4
|
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
5
|
-
import { options } from "./options";
|
|
5
|
+
import { options } from "./options.js";
|
|
6
6
|
export async function loadHyperspacePreset(engine, refresh = true) {
|
|
7
7
|
await loadBasic(engine, false);
|
|
8
8
|
await loadEmittersShapeSquare(engine, false);
|
package/cjs/bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tsParticles = exports.loadHyperspacePreset = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "loadHyperspacePreset", { enumerable: true, get: function () { return
|
|
4
|
+
const index_js_1 = require("./index.js");
|
|
5
|
+
Object.defineProperty(exports, "loadHyperspacePreset", { enumerable: true, get: function () { return index_js_1.loadHyperspacePreset; } });
|
|
6
6
|
const engine_1 = require("@tsparticles/engine");
|
|
7
7
|
Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
|
|
8
|
-
(0,
|
|
8
|
+
void (0, index_js_1.loadHyperspacePreset)(engine_1.tsParticles);
|
package/cjs/index.js
CHANGED
|
@@ -5,12 +5,12 @@ const basic_1 = require("@tsparticles/basic");
|
|
|
5
5
|
const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
|
|
6
6
|
const plugin_emitters_shape_square_1 = require("@tsparticles/plugin-emitters-shape-square");
|
|
7
7
|
const updater_life_1 = require("@tsparticles/updater-life");
|
|
8
|
-
const
|
|
8
|
+
const options_js_1 = require("./options.js");
|
|
9
9
|
async function loadHyperspacePreset(engine, refresh = true) {
|
|
10
10
|
await (0, basic_1.loadBasic)(engine, false);
|
|
11
11
|
await (0, plugin_emitters_shape_square_1.loadEmittersShapeSquare)(engine, false);
|
|
12
12
|
await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
|
|
13
13
|
await (0, updater_life_1.loadLifeUpdater)(engine, false);
|
|
14
|
-
await engine.addPreset("hyperspace",
|
|
14
|
+
await engine.addPreset("hyperspace", options_js_1.options, refresh);
|
|
15
15
|
}
|
|
16
16
|
exports.loadHyperspacePreset = loadHyperspacePreset;
|
package/esm/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadHyperspacePreset } from ".";
|
|
1
|
+
import { loadHyperspacePreset } from "./index.js";
|
|
2
2
|
import { tsParticles } from "@tsparticles/engine";
|
|
3
|
-
loadHyperspacePreset(tsParticles);
|
|
3
|
+
void loadHyperspacePreset(tsParticles);
|
|
4
4
|
export { loadHyperspacePreset, tsParticles };
|
package/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { loadBasic } from "@tsparticles/basic";
|
|
|
2
2
|
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
|
|
3
3
|
import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
|
|
4
4
|
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
5
|
-
import { options } from "./options";
|
|
5
|
+
import { options } from "./options.js";
|
|
6
6
|
export async function loadHyperspacePreset(engine, refresh = true) {
|
|
7
7
|
await loadBasic(engine, false);
|
|
8
8
|
await loadEmittersShapeSquare(engine, false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/preset-hyperspace",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "tsParticles hyperspace preset",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
"module": "esm/index.js",
|
|
88
88
|
"types": "types/index.d.ts",
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/basic": "^3.0.
|
|
91
|
-
"@tsparticles/engine": "^3.0.
|
|
92
|
-
"@tsparticles/plugin-emitters": "^3.0.
|
|
93
|
-
"@tsparticles/plugin-emitters-shape-square": "^3.0.
|
|
94
|
-
"@tsparticles/updater-life": "^3.0.
|
|
90
|
+
"@tsparticles/basic": "^3.0.3",
|
|
91
|
+
"@tsparticles/engine": "^3.0.3",
|
|
92
|
+
"@tsparticles/plugin-emitters": "^3.0.3",
|
|
93
|
+
"@tsparticles/plugin-emitters-shape-square": "^3.0.3",
|
|
94
|
+
"@tsparticles/updater-life": "^3.0.3"
|
|
95
95
|
},
|
|
96
96
|
"publishConfig": {
|
|
97
97
|
"access": "public"
|