@tsparticles/preset-snow 3.0.0-alpha.1 → 3.0.0-beta.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
@@ -25,14 +25,15 @@ Once installed you need one more script to be included in your page (or you can
25
25
  from [jsDelivr](https://www.jsdelivr.com/package/npm/@tsparticles/preset-snow):
26
26
 
27
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-move-base@2/tsparticles.move.base.min.js"></script>
30
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-shape-circle@2/tsparticles.shape.circle.min.js"></script>
31
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-color@2/tsparticles.updater.color.min.js"></script>
32
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-opacity@2/tsparticles.updater.opacity.min.js"></script>
33
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-out-modes@2/tsparticles.updater.out-modes.min.js"></script>
34
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-size@2/tsparticles.updater.size.min.js"></script>
35
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-wobble@2/tsparticles.updater.size.min.js"></script>
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/updater-wobble@2/tsparticles.updater.size.min.js"></script>
36
37
  <script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-snow@2/tsparticles.preset.snow.min.js"></script>
37
38
  ```
38
39
 
@@ -86,7 +87,7 @@ This sample uses the class component syntax, but you can use hooks as well (if t
86
87
 
87
88
  ```typescript jsx
88
89
  import Particles from "react-particles";
89
- import type { Engine } from "tsparticles-engine";
90
+ import type { Engine } from "@tsparticles/engine";
90
91
  import { loadSnowPreset } from "@tsparticles/preset-snow";
91
92
 
92
93
  export class ParticlesContainer extends React.PureComponent<IProps> {
@@ -127,7 +128,7 @@ async function particlesInit(engine: Engine): Promise<void> {
127
128
  ### Angular
128
129
 
129
130
  ```html
130
- <angular-particles [id]="id" [options]="particlesOptions" [particlesInit]="particlesInit"></angular-particles>
131
+ <ng-particles [id]="id" [options]="particlesOptions" [particlesInit]="particlesInit"></ng-particles>
131
132
  ```
132
133
 
133
134
  ```ts
@@ -166,35 +167,15 @@ let particlesInit = async (engine) => {
166
167
  ```mermaid
167
168
  flowchart TD
168
169
 
169
- e[tsParticles Engine]
170
-
171
- subgraph m [Movers]
172
- mb[Base]
173
- end
174
-
175
- e --> m
176
-
177
- subgraph s [Shapes]
178
- sc[Circle]
179
- end
180
-
181
- e --> s
182
-
183
170
  subgraph u [Updaters]
184
- uc[Color]
185
- uop[Opacity]
186
- uou[Out Modes]
187
- usi[Size]
188
171
  uwo[Wobble]
189
172
  end
190
173
 
191
- e --> u
174
+ bb[tsParticles Engine] --> u
192
175
 
193
176
  subgraph pr [Presets]
194
177
  prsn[Snow]
195
178
  end
196
179
 
197
- e --> pr
198
-
199
- mb & sc & uc & uop & uou & usi --> prsn
180
+ bb & uwo --> prsn
200
181
  ```
package/browser/bundle.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import { loadSnowPreset } from ".";
2
2
  import { tsParticles } from "@tsparticles/engine";
3
- (async () => {
4
- await loadSnowPreset(tsParticles);
5
- })();
3
+ loadSnowPreset(tsParticles);
6
4
  export { loadSnowPreset, tsParticles };
package/browser/index.js CHANGED
@@ -1,18 +1,8 @@
1
- import { loadBaseMover } from "@tsparticles/move-base";
2
- import { loadCircleShape } from "@tsparticles/shape-circle";
3
- import { loadColorUpdater } from "@tsparticles/updater-color";
4
- import { loadOpacityUpdater } from "@tsparticles/updater-opacity";
5
- import { loadOutModesUpdater } from "@tsparticles/updater-out-modes";
6
- import { loadSizeUpdater } from "@tsparticles/updater-size";
1
+ import { loadBasic } from "@tsparticles/basic";
7
2
  import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
8
3
  import { options } from "./options";
9
- export async function loadSnowPreset(engine) {
10
- await loadBaseMover(engine);
11
- await loadCircleShape(engine);
12
- await loadColorUpdater(engine);
13
- await loadOpacityUpdater(engine);
14
- await loadOutModesUpdater(engine);
15
- await loadSizeUpdater(engine);
16
- await loadWobbleUpdater(engine);
17
- await engine.addPreset("snow", options);
4
+ export async function loadSnowPreset(engine, refresh = true) {
5
+ await loadBasic(engine, false);
6
+ await loadWobbleUpdater(engine, false);
7
+ await engine.addPreset("snow", options, refresh);
18
8
  }
@@ -3,6 +3,9 @@ export const options = {
3
3
  color: "#333",
4
4
  },
5
5
  particles: {
6
+ number: {
7
+ value: 100,
8
+ },
6
9
  move: {
7
10
  direction: "bottom",
8
11
  enable: true,
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/cjs/bundle.js CHANGED
@@ -1,19 +1,8 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.tsParticles = exports.loadSnowPreset = void 0;
13
4
  const _1 = require(".");
14
5
  Object.defineProperty(exports, "loadSnowPreset", { enumerable: true, get: function () { return _1.loadSnowPreset; } });
15
6
  const engine_1 = require("@tsparticles/engine");
16
7
  Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
17
- (() => __awaiter(void 0, void 0, void 0, function* () {
18
- yield (0, _1.loadSnowPreset)(engine_1.tsParticles);
19
- }))();
8
+ (0, _1.loadSnowPreset)(engine_1.tsParticles);
package/cjs/index.js CHANGED
@@ -1,33 +1,12 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.loadSnowPreset = void 0;
13
- const move_base_1 = require("@tsparticles/move-base");
14
- const shape_circle_1 = require("@tsparticles/shape-circle");
15
- const updater_color_1 = require("@tsparticles/updater-color");
16
- const updater_opacity_1 = require("@tsparticles/updater-opacity");
17
- const updater_out_modes_1 = require("@tsparticles/updater-out-modes");
18
- const updater_size_1 = require("@tsparticles/updater-size");
4
+ const basic_1 = require("@tsparticles/basic");
19
5
  const updater_wobble_1 = require("@tsparticles/updater-wobble");
20
6
  const options_1 = require("./options");
21
- function loadSnowPreset(engine) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- yield (0, move_base_1.loadBaseMover)(engine);
24
- yield (0, shape_circle_1.loadCircleShape)(engine);
25
- yield (0, updater_color_1.loadColorUpdater)(engine);
26
- yield (0, updater_opacity_1.loadOpacityUpdater)(engine);
27
- yield (0, updater_out_modes_1.loadOutModesUpdater)(engine);
28
- yield (0, updater_size_1.loadSizeUpdater)(engine);
29
- yield (0, updater_wobble_1.loadWobbleUpdater)(engine);
30
- yield engine.addPreset("snow", options_1.options);
31
- });
7
+ async function loadSnowPreset(engine, refresh = true) {
8
+ await (0, basic_1.loadBasic)(engine, false);
9
+ await (0, updater_wobble_1.loadWobbleUpdater)(engine, false);
10
+ await engine.addPreset("snow", options_1.options, refresh);
32
11
  }
33
12
  exports.loadSnowPreset = loadSnowPreset;
package/cjs/options.js CHANGED
@@ -6,6 +6,9 @@ exports.options = {
6
6
  color: "#333",
7
7
  },
8
8
  particles: {
9
+ number: {
10
+ value: 100,
11
+ },
9
12
  move: {
10
13
  direction: "bottom",
11
14
  enable: true,
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
package/esm/bundle.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import { loadSnowPreset } from ".";
2
2
  import { tsParticles } from "@tsparticles/engine";
3
- (async () => {
4
- await loadSnowPreset(tsParticles);
5
- })();
3
+ loadSnowPreset(tsParticles);
6
4
  export { loadSnowPreset, tsParticles };
package/esm/index.js CHANGED
@@ -1,18 +1,8 @@
1
- import { loadBaseMover } from "@tsparticles/move-base";
2
- import { loadCircleShape } from "@tsparticles/shape-circle";
3
- import { loadColorUpdater } from "@tsparticles/updater-color";
4
- import { loadOpacityUpdater } from "@tsparticles/updater-opacity";
5
- import { loadOutModesUpdater } from "@tsparticles/updater-out-modes";
6
- import { loadSizeUpdater } from "@tsparticles/updater-size";
1
+ import { loadBasic } from "@tsparticles/basic";
7
2
  import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
8
3
  import { options } from "./options";
9
- export async function loadSnowPreset(engine) {
10
- await loadBaseMover(engine);
11
- await loadCircleShape(engine);
12
- await loadColorUpdater(engine);
13
- await loadOpacityUpdater(engine);
14
- await loadOutModesUpdater(engine);
15
- await loadSizeUpdater(engine);
16
- await loadWobbleUpdater(engine);
17
- await engine.addPreset("snow", options);
4
+ export async function loadSnowPreset(engine, refresh = true) {
5
+ await loadBasic(engine, false);
6
+ await loadWobbleUpdater(engine, false);
7
+ await engine.addPreset("snow", options, refresh);
18
8
  }
package/esm/options.js CHANGED
@@ -3,6 +3,9 @@ export const options = {
3
3
  color: "#333",
4
4
  },
5
5
  particles: {
6
+ number: {
7
+ value: 100,
8
+ },
6
9
  move: {
7
10
  direction: "bottom",
8
11
  enable: true,
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@tsparticles/preset-snow",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "tsParticles snow preset",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/matteobruni/tsparticles.git",
8
+ "url": "git+https://github.com/tsparticles/presets.git",
9
9
  "directory": "presets/snow"
10
10
  },
11
11
  "keywords": [
@@ -65,13 +65,17 @@
65
65
  "author": "Matteo Bruni <matteo.bruni@me.com>",
66
66
  "license": "MIT",
67
67
  "bugs": {
68
- "url": "https://github.com/matteobruni/tsparticles/issues"
68
+ "url": "https://github.com/tsparticles/presets/issues"
69
69
  },
70
70
  "funding": [
71
71
  {
72
72
  "type": "github",
73
73
  "url": "https://github.com/sponsors/matteobruni"
74
74
  },
75
+ {
76
+ "type": "github",
77
+ "url": "https://github.com/sponsors/tsparticles"
78
+ },
75
79
  {
76
80
  "type": "buymeacoffee",
77
81
  "url": "https://www.buymeacoffee.com/matteobruni"
@@ -82,17 +86,9 @@
82
86
  "unpkg": "tsparticles.preset.snow.min.js",
83
87
  "module": "esm/index.js",
84
88
  "types": "types/index.d.ts",
85
- "publishConfig": {
86
- "access": "public"
87
- },
88
89
  "dependencies": {
89
- "@tsparticles/engine": "^3.0.0-alpha.1",
90
- "@tsparticles/move-base": "^3.0.0-alpha.1",
91
- "@tsparticles/shape-circle": "^3.0.0-alpha.1",
92
- "@tsparticles/updater-color": "^3.0.0-alpha.1",
93
- "@tsparticles/updater-opacity": "^3.0.0-alpha.1",
94
- "@tsparticles/updater-out-modes": "^3.0.0-alpha.1",
95
- "@tsparticles/updater-size": "^3.0.0-alpha.1",
96
- "@tsparticles/updater-wobble": "^3.0.0-alpha.1"
90
+ "@tsparticles/basic": "^3.0.0-beta.4",
91
+ "@tsparticles/engine": "^3.0.0-beta.4",
92
+ "@tsparticles/updater-wobble": "^3.0.0-beta.4"
97
93
  }
98
- }
94
+ }