@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 CHANGED
@@ -4,7 +4,8 @@
4
4
 
5
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
6
 
7
- [tsParticles](https://github.com/matteobruni/tsparticles) preset for creating a starry night effect with blinking hyperspace.
7
+ [tsParticles](https://github.com/tsparticles/tsparticles) preset for creating a starry night effect with blinking
8
+ hyperspace.
8
9
 
9
10
  [![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
 
@@ -12,38 +13,14 @@
12
13
 
13
14
  ## Sample
14
15
 
15
- [![demo](https://raw.githubusercontent.com/matteobruni/tsparticles/main/presets/hyperspace/images/sample.png)](https://particles.js.org/samples/presets/hyperspace)
16
+ [![demo](https://raw.githubusercontent.com/tsparticles/tsparticles/main/presets/hyperspace/images/sample.png)](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@2/tsparticles.preset.hyperspace.bundle.min.js"></script>
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
- (async () => {
55
- await loadHyperspacePreset(tsParticles); // this is required only if you are not using the bundle script
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("tsparticles", {
70
- particles: {
71
- shape: {
72
- type: "square", // starting from v2, this require the square shape script
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
- ### 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
- };
60
+ ### Frameworks with a tsParticles component library
121
61
 
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
- ```
62
+ Checkout the documentation in the component library repository and call the `loadHyperspacePreset` function instead of `loadFull`, `loadSlim` or similar functions.
132
63
 
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
- ```
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 _1 = require(".");
5
- Object.defineProperty(exports, "loadHyperspacePreset", { enumerable: true, get: function () { return _1.loadHyperspacePreset; } });
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, _1.loadHyperspacePreset)(engine_1.tsParticles);
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 options_1 = require("./options");
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", options_1.options, refresh);
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.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.0",
91
- "@tsparticles/engine": "^3.0.0",
92
- "@tsparticles/plugin-emitters": "^3.0.0",
93
- "@tsparticles/plugin-emitters-shape-square": "^3.0.0",
94
- "@tsparticles/updater-life": "^3.0.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"