@tsparticles/preset-firefly 3.0.0-alpha.1
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 +21 -0
- package/README.md +211 -0
- package/browser/bundle.js +6 -0
- package/browser/index.js +18 -0
- package/browser/options.js +60 -0
- package/cjs/bundle.js +19 -0
- package/cjs/index.js +33 -0
- package/cjs/options.js +63 -0
- package/esm/bundle.js +6 -0
- package/esm/index.js +18 -0
- package/esm/options.js +60 -0
- package/package.json +98 -0
- package/report.html +39 -0
- package/tsparticles.preset.firefly.bundle.js +6223 -0
- package/tsparticles.preset.firefly.bundle.min.js +2 -0
- package/tsparticles.preset.firefly.bundle.min.js.LICENSE.txt +8 -0
- package/tsparticles.preset.firefly.js +241 -0
- package/tsparticles.preset.firefly.min.js +2 -0
- package/tsparticles.preset.firefly.min.js.LICENSE.txt +8 -0
- package/types/bundle.d.ts +3 -0
- package/types/index.d.ts +2 -0
- package/types/options.d.ts +2 -0
- package/umd/bundle.js +20 -0
- package/umd/index.js +32 -0
- package/umd/options.js +73 -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,211 @@
|
|
|
1
|
+
[](https://particles.js.org)
|
|
2
|
+
|
|
3
|
+
# tsParticles Firefly Preset
|
|
4
|
+
|
|
5
|
+
[](https://www.jsdelivr.com/package/npm/@tsparticles/preset-firefly) [](https://www.npmjs.com/package/@tsparticles/preset-firefly) [](https://www.npmjs.com/package/@tsparticles/preset-firefly) [](https://github.com/sponsors/matteobruni)
|
|
6
|
+
|
|
7
|
+
[tsParticles](https://github.com/matteobruni/tsparticles) preset for a mouse trail made with small fading particles like
|
|
8
|
+
little fireflies.
|
|
9
|
+
|
|
10
|
+
[](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI) [](https://discord.gg/hACwv45Hme) [](https://t.me/tsparticles)
|
|
11
|
+
|
|
12
|
+
[](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>
|
|
13
|
+
|
|
14
|
+
## Sample
|
|
15
|
+
|
|
16
|
+
[](https://particles.js.org/samples/presets/firefly)
|
|
17
|
+
|
|
18
|
+
## How to use it
|
|
19
|
+
|
|
20
|
+
### CDN / Vanilla JS / jQuery
|
|
21
|
+
|
|
22
|
+
The first step is installing [tsParticles](https://github.com/matteobruni/tsparticles) following the instructions for
|
|
23
|
+
vanilla javascript in the main project [here](https://github.com/matteobruni/tsparticles)
|
|
24
|
+
|
|
25
|
+
Once installed you need one more script to be included in your page (or you can download that
|
|
26
|
+
from [jsDelivr](https://www.jsdelivr.com/package/npm/@tsparticles/preset-firefly):
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-engine@2/tsparticles.engine.min.js"></script>
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-interaction-external-trail@2/tsparticles.interaction.external.trail.min.js"></script>
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-move-base@2/tsparticles.move.base.min.js"></script>
|
|
32
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-plugin-emitters@2/tsparticles.plugin.emitters.min.js"></script>
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-shape-circle@2/tsparticles.shape.circle.min.js"></script>
|
|
34
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-color@2/tsparticles.updater.color.min.js"></script>
|
|
35
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-life@2/tsparticles.updater.life.min.js"></script>
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-opacity@2/tsparticles.updater.opacity.min.js"></script>
|
|
37
|
+
<script src="https://cdn.jsdelivr.net/npm/tsparticles-updater-size@2/tsparticles.updater.size.min.js"></script>
|
|
38
|
+
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-firefly@2/tsparticles.preset.firefly.min.js"></script>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This script **MUST** be placed after the `tsParticles` one.
|
|
42
|
+
|
|
43
|
+
#### Bundle
|
|
44
|
+
|
|
45
|
+
A bundled script can also be used, this will include every needed plugin needed by the preset.
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-firefly@2/tsparticles.preset.firefly.bundle.min.js"></script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Usage
|
|
52
|
+
|
|
53
|
+
Once the scripts are loaded you can set up `tsParticles` like this:
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
(async () => {
|
|
57
|
+
await loadFireflyPreset(tsParticles); // this is required only if you are not using the bundle script
|
|
58
|
+
|
|
59
|
+
await tsParticles.load("tsparticles", {
|
|
60
|
+
preset: "firefly",
|
|
61
|
+
});
|
|
62
|
+
})();
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Customization
|
|
66
|
+
|
|
67
|
+
**Important ⚠️**
|
|
68
|
+
You can override all the options defining the properties like in any standard `tsParticles` installation.
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
tsParticles.load("tsparticles", {
|
|
72
|
+
particles: {
|
|
73
|
+
shape: {
|
|
74
|
+
type: "square", // starting from v2, this require the square shape script
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
preset: "firefly",
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Like in the sample above, the circles will be replaced by squares.
|
|
82
|
+
|
|
83
|
+
### React.js / Preact / react-particles
|
|
84
|
+
|
|
85
|
+
_The syntax for `React.js`, `Preact` and `@tsparticles/react` is the same_.
|
|
86
|
+
|
|
87
|
+
This sample uses the class component syntax, but you can use hooks as well (if the library supports it).
|
|
88
|
+
|
|
89
|
+
```typescript jsx
|
|
90
|
+
import Particles from "react-particles";
|
|
91
|
+
import type { Engine } from "tsparticles-engine";
|
|
92
|
+
import { loadFireflyPreset } from "@tsparticles/preset-firefly";
|
|
93
|
+
|
|
94
|
+
export class ParticlesContainer extends React.PureComponent<IProps> {
|
|
95
|
+
// this customizes the component tsParticles installation
|
|
96
|
+
async customInit(engine: Engine): Promise<void> {
|
|
97
|
+
// this adds the preset to tsParticles, you can safely use the
|
|
98
|
+
await loadFireflyPreset(engine);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
render() {
|
|
102
|
+
const options = {
|
|
103
|
+
preset: "firefly",
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return <Particles options={options} init={this.customInit} />;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Vue (2.x and 3.x)
|
|
112
|
+
|
|
113
|
+
_The syntax for `Vue.js 2.x` and `3.x` is the same_
|
|
114
|
+
|
|
115
|
+
```vue
|
|
116
|
+
<Particles id="tsparticles" :particlesInit="particlesInit" :options="particlesOptions" />
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
let particlesOptions = {
|
|
121
|
+
preset: "firefly",
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
async function particlesInit(engine: Engine): Promise<void> {
|
|
125
|
+
await loadFireflyPreset(engine);
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Angular
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<angular-particles [id]="id" [options]="particlesOptions" [particlesInit]="particlesInit"></angular-particles>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
const particlesOptions = {
|
|
137
|
+
preset: "firefly",
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
async function particlesInit(engine: Engine): Promise<void> {
|
|
141
|
+
await loadFireflyPreset(engine);
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Svelte
|
|
146
|
+
|
|
147
|
+
```sveltehtml
|
|
148
|
+
|
|
149
|
+
<Particles
|
|
150
|
+
id="tsparticles"
|
|
151
|
+
options={particlesOptions}
|
|
152
|
+
particlesInit="{particlesInit}"
|
|
153
|
+
/>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
let particlesOptions = {
|
|
158
|
+
preset: "firefly",
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
let particlesInit = async (engine) => {
|
|
162
|
+
await loadFireflyPreset(main);
|
|
163
|
+
};
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
```mermaid
|
|
169
|
+
flowchart TD
|
|
170
|
+
|
|
171
|
+
subgraph i [Interactions]
|
|
172
|
+
|
|
173
|
+
subgraph ie [Externals]
|
|
174
|
+
iet[Trail]
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
i --> ie
|
|
180
|
+
|
|
181
|
+
e[tsParticles Engine] --> i
|
|
182
|
+
|
|
183
|
+
subgraph m [Movers]
|
|
184
|
+
mb[Base]
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
e --> m
|
|
188
|
+
|
|
189
|
+
subgraph s [Shapes]
|
|
190
|
+
sc[Circle]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
e --> s
|
|
194
|
+
|
|
195
|
+
subgraph u [Updaters]
|
|
196
|
+
uc[Color]
|
|
197
|
+
uop[Opacity]
|
|
198
|
+
uou[Out Modes]
|
|
199
|
+
usi[Size]
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
e --> u
|
|
203
|
+
|
|
204
|
+
subgraph pr [Presets]
|
|
205
|
+
prff[Firefly]
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
e --> pr
|
|
209
|
+
|
|
210
|
+
iet & mb & sc & uc & uop & uou & usi --> prff
|
|
211
|
+
```
|
package/browser/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { loadBaseMover } from "@tsparticles/move-base";
|
|
2
|
+
import { loadCircleShape } from "@tsparticles/shape-circle";
|
|
3
|
+
import { loadColorUpdater } from "@tsparticles/updater-color";
|
|
4
|
+
import { loadExternalTrailInteraction } from "@tsparticles/interaction-external-trail";
|
|
5
|
+
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
6
|
+
import { loadOpacityUpdater } from "@tsparticles/updater-opacity";
|
|
7
|
+
import { loadSizeUpdater } from "@tsparticles/updater-size";
|
|
8
|
+
import { options } from "./options";
|
|
9
|
+
export async function loadFireflyPreset(engine) {
|
|
10
|
+
await loadBaseMover(engine);
|
|
11
|
+
await loadExternalTrailInteraction(engine);
|
|
12
|
+
await loadCircleShape(engine);
|
|
13
|
+
await loadColorUpdater(engine);
|
|
14
|
+
await loadLifeUpdater(engine);
|
|
15
|
+
await loadOpacityUpdater(engine);
|
|
16
|
+
await loadSizeUpdater(engine);
|
|
17
|
+
await engine.addPreset("firefly", options);
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const options = {
|
|
2
|
+
fullScreen: {
|
|
3
|
+
enable: true,
|
|
4
|
+
zIndex: -1,
|
|
5
|
+
},
|
|
6
|
+
fpsLimit: 120,
|
|
7
|
+
particles: {
|
|
8
|
+
number: {
|
|
9
|
+
value: 0,
|
|
10
|
+
},
|
|
11
|
+
color: {
|
|
12
|
+
value: "#fff",
|
|
13
|
+
},
|
|
14
|
+
life: {
|
|
15
|
+
duration: {
|
|
16
|
+
value: 5,
|
|
17
|
+
sync: false,
|
|
18
|
+
},
|
|
19
|
+
count: 1,
|
|
20
|
+
},
|
|
21
|
+
opacity: {
|
|
22
|
+
value: { min: 0.1, max: 1 },
|
|
23
|
+
animation: {
|
|
24
|
+
enable: true,
|
|
25
|
+
speed: 3,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
value: {
|
|
30
|
+
min: 3,
|
|
31
|
+
max: 6,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
move: {
|
|
35
|
+
enable: true,
|
|
36
|
+
speed: 3,
|
|
37
|
+
random: false,
|
|
38
|
+
size: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
interactivity: {
|
|
42
|
+
events: {
|
|
43
|
+
onHover: {
|
|
44
|
+
enable: true,
|
|
45
|
+
mode: "trail",
|
|
46
|
+
},
|
|
47
|
+
resize: true,
|
|
48
|
+
},
|
|
49
|
+
modes: {
|
|
50
|
+
trail: {
|
|
51
|
+
delay: 0.5,
|
|
52
|
+
pauseOnStop: true,
|
|
53
|
+
quantity: 4,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
background: {
|
|
58
|
+
color: "#000",
|
|
59
|
+
},
|
|
60
|
+
};
|
package/cjs/bundle.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.tsParticles = exports.loadFireflyPreset = void 0;
|
|
13
|
+
const _1 = require(".");
|
|
14
|
+
Object.defineProperty(exports, "loadFireflyPreset", { enumerable: true, get: function () { return _1.loadFireflyPreset; } });
|
|
15
|
+
const engine_1 = require("@tsparticles/engine");
|
|
16
|
+
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.loadFireflyPreset)(engine_1.tsParticles);
|
|
19
|
+
}))();
|
package/cjs/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.loadFireflyPreset = 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 interaction_external_trail_1 = require("@tsparticles/interaction-external-trail");
|
|
17
|
+
const updater_life_1 = require("@tsparticles/updater-life");
|
|
18
|
+
const updater_opacity_1 = require("@tsparticles/updater-opacity");
|
|
19
|
+
const updater_size_1 = require("@tsparticles/updater-size");
|
|
20
|
+
const options_1 = require("./options");
|
|
21
|
+
function loadFireflyPreset(engine) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
yield (0, move_base_1.loadBaseMover)(engine);
|
|
24
|
+
yield (0, interaction_external_trail_1.loadExternalTrailInteraction)(engine);
|
|
25
|
+
yield (0, shape_circle_1.loadCircleShape)(engine);
|
|
26
|
+
yield (0, updater_color_1.loadColorUpdater)(engine);
|
|
27
|
+
yield (0, updater_life_1.loadLifeUpdater)(engine);
|
|
28
|
+
yield (0, updater_opacity_1.loadOpacityUpdater)(engine);
|
|
29
|
+
yield (0, updater_size_1.loadSizeUpdater)(engine);
|
|
30
|
+
yield engine.addPreset("firefly", options_1.options);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.loadFireflyPreset = loadFireflyPreset;
|
package/cjs/options.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.options = void 0;
|
|
4
|
+
exports.options = {
|
|
5
|
+
fullScreen: {
|
|
6
|
+
enable: true,
|
|
7
|
+
zIndex: -1,
|
|
8
|
+
},
|
|
9
|
+
fpsLimit: 120,
|
|
10
|
+
particles: {
|
|
11
|
+
number: {
|
|
12
|
+
value: 0,
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
value: "#fff",
|
|
16
|
+
},
|
|
17
|
+
life: {
|
|
18
|
+
duration: {
|
|
19
|
+
value: 5,
|
|
20
|
+
sync: false,
|
|
21
|
+
},
|
|
22
|
+
count: 1,
|
|
23
|
+
},
|
|
24
|
+
opacity: {
|
|
25
|
+
value: { min: 0.1, max: 1 },
|
|
26
|
+
animation: {
|
|
27
|
+
enable: true,
|
|
28
|
+
speed: 3,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
value: {
|
|
33
|
+
min: 3,
|
|
34
|
+
max: 6,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
move: {
|
|
38
|
+
enable: true,
|
|
39
|
+
speed: 3,
|
|
40
|
+
random: false,
|
|
41
|
+
size: true,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
interactivity: {
|
|
45
|
+
events: {
|
|
46
|
+
onHover: {
|
|
47
|
+
enable: true,
|
|
48
|
+
mode: "trail",
|
|
49
|
+
},
|
|
50
|
+
resize: true,
|
|
51
|
+
},
|
|
52
|
+
modes: {
|
|
53
|
+
trail: {
|
|
54
|
+
delay: 0.5,
|
|
55
|
+
pauseOnStop: true,
|
|
56
|
+
quantity: 4,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
background: {
|
|
61
|
+
color: "#000",
|
|
62
|
+
},
|
|
63
|
+
};
|
package/esm/bundle.js
ADDED
package/esm/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { loadBaseMover } from "@tsparticles/move-base";
|
|
2
|
+
import { loadCircleShape } from "@tsparticles/shape-circle";
|
|
3
|
+
import { loadColorUpdater } from "@tsparticles/updater-color";
|
|
4
|
+
import { loadExternalTrailInteraction } from "@tsparticles/interaction-external-trail";
|
|
5
|
+
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
6
|
+
import { loadOpacityUpdater } from "@tsparticles/updater-opacity";
|
|
7
|
+
import { loadSizeUpdater } from "@tsparticles/updater-size";
|
|
8
|
+
import { options } from "./options";
|
|
9
|
+
export async function loadFireflyPreset(engine) {
|
|
10
|
+
await loadBaseMover(engine);
|
|
11
|
+
await loadExternalTrailInteraction(engine);
|
|
12
|
+
await loadCircleShape(engine);
|
|
13
|
+
await loadColorUpdater(engine);
|
|
14
|
+
await loadLifeUpdater(engine);
|
|
15
|
+
await loadOpacityUpdater(engine);
|
|
16
|
+
await loadSizeUpdater(engine);
|
|
17
|
+
await engine.addPreset("firefly", options);
|
|
18
|
+
}
|
package/esm/options.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const options = {
|
|
2
|
+
fullScreen: {
|
|
3
|
+
enable: true,
|
|
4
|
+
zIndex: -1,
|
|
5
|
+
},
|
|
6
|
+
fpsLimit: 120,
|
|
7
|
+
particles: {
|
|
8
|
+
number: {
|
|
9
|
+
value: 0,
|
|
10
|
+
},
|
|
11
|
+
color: {
|
|
12
|
+
value: "#fff",
|
|
13
|
+
},
|
|
14
|
+
life: {
|
|
15
|
+
duration: {
|
|
16
|
+
value: 5,
|
|
17
|
+
sync: false,
|
|
18
|
+
},
|
|
19
|
+
count: 1,
|
|
20
|
+
},
|
|
21
|
+
opacity: {
|
|
22
|
+
value: { min: 0.1, max: 1 },
|
|
23
|
+
animation: {
|
|
24
|
+
enable: true,
|
|
25
|
+
speed: 3,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
value: {
|
|
30
|
+
min: 3,
|
|
31
|
+
max: 6,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
move: {
|
|
35
|
+
enable: true,
|
|
36
|
+
speed: 3,
|
|
37
|
+
random: false,
|
|
38
|
+
size: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
interactivity: {
|
|
42
|
+
events: {
|
|
43
|
+
onHover: {
|
|
44
|
+
enable: true,
|
|
45
|
+
mode: "trail",
|
|
46
|
+
},
|
|
47
|
+
resize: true,
|
|
48
|
+
},
|
|
49
|
+
modes: {
|
|
50
|
+
trail: {
|
|
51
|
+
delay: 0.5,
|
|
52
|
+
pauseOnStop: true,
|
|
53
|
+
quantity: 4,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
background: {
|
|
58
|
+
color: "#000",
|
|
59
|
+
},
|
|
60
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tsparticles/preset-firefly",
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
|
+
"description": "tsParticles firefly preset",
|
|
5
|
+
"homepage": "https://particles.js.org",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/matteobruni/tsparticles.git",
|
|
9
|
+
"directory": "presets/firefly"
|
|
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/matteobruni/tsparticles/issues"
|
|
69
|
+
},
|
|
70
|
+
"funding": [
|
|
71
|
+
{
|
|
72
|
+
"type": "github",
|
|
73
|
+
"url": "https://github.com/sponsors/matteobruni"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"type": "buymeacoffee",
|
|
77
|
+
"url": "https://www.buymeacoffee.com/matteobruni"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"main": "cjs/index.js",
|
|
81
|
+
"jsdelivr": "tsparticles.preset.firefly.min.js",
|
|
82
|
+
"unpkg": "tsparticles.preset.firefly.min.js",
|
|
83
|
+
"module": "esm/index.js",
|
|
84
|
+
"types": "types/index.d.ts",
|
|
85
|
+
"publishConfig": {
|
|
86
|
+
"access": "public"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"@tsparticles/engine": "^3.0.0-alpha.1",
|
|
90
|
+
"@tsparticles/interaction-external-trail": "^3.0.0-alpha.1",
|
|
91
|
+
"@tsparticles/move-base": "^3.0.0-alpha.1",
|
|
92
|
+
"@tsparticles/shape-circle": "^3.0.0-alpha.1",
|
|
93
|
+
"@tsparticles/updater-color": "^3.0.0-alpha.1",
|
|
94
|
+
"@tsparticles/updater-life": "^3.0.0-alpha.1",
|
|
95
|
+
"@tsparticles/updater-opacity": "^3.0.0-alpha.1",
|
|
96
|
+
"@tsparticles/updater-size": "^3.0.0-alpha.1"
|
|
97
|
+
}
|
|
98
|
+
}
|