@tsparticles/slim 3.0.0-beta.4 → 3.0.0
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 +1 -1
- package/browser/index.js +2 -4
- package/cjs/index.js +2 -4
- package/esm/index.js +2 -4
- package/package.json +33 -34
- package/report.html +3 -3
- package/tsparticles.slim.bundle.js +155 -279
- package/tsparticles.slim.bundle.min.js +1 -1
- package/tsparticles.slim.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.slim.js +18 -29
- package/tsparticles.slim.min.js +1 -1
- package/tsparticles.slim.min.js.LICENSE.txt +1 -1
- package/umd/index.js +3 -5
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0
|
|
7
|
+
* v3.0.0
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -1227,7 +1227,8 @@ function drawParticle(data) {
|
|
|
1227
1227
|
particle,
|
|
1228
1228
|
radius,
|
|
1229
1229
|
opacity,
|
|
1230
|
-
delta
|
|
1230
|
+
delta,
|
|
1231
|
+
transformData
|
|
1231
1232
|
};
|
|
1232
1233
|
context.beginPath();
|
|
1233
1234
|
drawShape(drawData);
|
|
@@ -1252,7 +1253,8 @@ function drawEffect(data) {
|
|
|
1252
1253
|
particle,
|
|
1253
1254
|
radius,
|
|
1254
1255
|
opacity,
|
|
1255
|
-
delta
|
|
1256
|
+
delta,
|
|
1257
|
+
transformData
|
|
1256
1258
|
} = data;
|
|
1257
1259
|
if (!particle.effect) {
|
|
1258
1260
|
return;
|
|
@@ -1267,7 +1269,10 @@ function drawEffect(data) {
|
|
|
1267
1269
|
radius,
|
|
1268
1270
|
opacity,
|
|
1269
1271
|
delta,
|
|
1270
|
-
pixelRatio: container.retina.pixelRatio
|
|
1272
|
+
pixelRatio: container.retina.pixelRatio,
|
|
1273
|
+
transformData: {
|
|
1274
|
+
...transformData
|
|
1275
|
+
}
|
|
1271
1276
|
});
|
|
1272
1277
|
}
|
|
1273
1278
|
function drawShape(data) {
|
|
@@ -1277,7 +1282,8 @@ function drawShape(data) {
|
|
|
1277
1282
|
particle,
|
|
1278
1283
|
radius,
|
|
1279
1284
|
opacity,
|
|
1280
|
-
delta
|
|
1285
|
+
delta,
|
|
1286
|
+
transformData
|
|
1281
1287
|
} = data;
|
|
1282
1288
|
if (!particle.shape) {
|
|
1283
1289
|
return;
|
|
@@ -1292,7 +1298,10 @@ function drawShape(data) {
|
|
|
1292
1298
|
radius,
|
|
1293
1299
|
opacity,
|
|
1294
1300
|
delta,
|
|
1295
|
-
pixelRatio: container.retina.pixelRatio
|
|
1301
|
+
pixelRatio: container.retina.pixelRatio,
|
|
1302
|
+
transformData: {
|
|
1303
|
+
...transformData
|
|
1304
|
+
}
|
|
1296
1305
|
});
|
|
1297
1306
|
}
|
|
1298
1307
|
function drawShapeAfterDraw(data) {
|
|
@@ -1302,7 +1311,8 @@ function drawShapeAfterDraw(data) {
|
|
|
1302
1311
|
particle,
|
|
1303
1312
|
radius,
|
|
1304
1313
|
opacity,
|
|
1305
|
-
delta
|
|
1314
|
+
delta,
|
|
1315
|
+
transformData
|
|
1306
1316
|
} = data;
|
|
1307
1317
|
if (!particle.shape) {
|
|
1308
1318
|
return;
|
|
@@ -1317,7 +1327,10 @@ function drawShapeAfterDraw(data) {
|
|
|
1317
1327
|
radius,
|
|
1318
1328
|
opacity,
|
|
1319
1329
|
delta,
|
|
1320
|
-
pixelRatio: container.retina.pixelRatio
|
|
1330
|
+
pixelRatio: container.retina.pixelRatio,
|
|
1331
|
+
transformData: {
|
|
1332
|
+
...transformData
|
|
1333
|
+
}
|
|
1321
1334
|
});
|
|
1322
1335
|
}
|
|
1323
1336
|
function drawPlugin(context, plugin, delta) {
|
|
@@ -1554,7 +1567,7 @@ class Canvas {
|
|
|
1554
1567
|
} else if (trailFill.image) {
|
|
1555
1568
|
this._paintImage(trailFill.image, trailFill.opacity);
|
|
1556
1569
|
}
|
|
1557
|
-
} else {
|
|
1570
|
+
} else if (options.clear) {
|
|
1558
1571
|
this.draw(ctx => {
|
|
1559
1572
|
clear(ctx, this.size);
|
|
1560
1573
|
});
|
|
@@ -2401,11 +2414,7 @@ class Events {
|
|
|
2401
2414
|
});
|
|
2402
2415
|
}
|
|
2403
2416
|
this.onHover.load(data.onHover);
|
|
2404
|
-
|
|
2405
|
-
this.resize.enable = data.resize;
|
|
2406
|
-
} else {
|
|
2407
|
-
this.resize.load(data.resize);
|
|
2408
|
-
}
|
|
2417
|
+
this.resize.load(data.resize);
|
|
2409
2418
|
}
|
|
2410
2419
|
}
|
|
2411
2420
|
;// CONCATENATED MODULE: ../../engine/dist/browser/Options/Classes/Interactivity/Modes/Modes.js
|
|
@@ -3430,23 +3439,26 @@ class ParticlesOptions {
|
|
|
3430
3439
|
if (!data) {
|
|
3431
3440
|
return;
|
|
3432
3441
|
}
|
|
3433
|
-
this.bounce.load(data.bounce);
|
|
3434
|
-
this.color.load(AnimatableColor.create(this.color, data.color));
|
|
3435
|
-
this.effect.load(data.effect);
|
|
3436
3442
|
if (data.groups !== undefined) {
|
|
3437
|
-
for (const group
|
|
3443
|
+
for (const group of Object.keys(data.groups)) {
|
|
3444
|
+
if (!Object.hasOwn(data.groups, group)) {
|
|
3445
|
+
continue;
|
|
3446
|
+
}
|
|
3438
3447
|
const item = data.groups[group];
|
|
3439
3448
|
if (item !== undefined) {
|
|
3440
3449
|
this.groups[group] = deepExtend(this.groups[group] ?? {}, item);
|
|
3441
3450
|
}
|
|
3442
3451
|
}
|
|
3443
3452
|
}
|
|
3444
|
-
this.move.load(data.move);
|
|
3445
|
-
this.number.load(data.number);
|
|
3446
|
-
this.opacity.load(data.opacity);
|
|
3447
3453
|
if (data.reduceDuplicates !== undefined) {
|
|
3448
3454
|
this.reduceDuplicates = data.reduceDuplicates;
|
|
3449
3455
|
}
|
|
3456
|
+
this.bounce.load(data.bounce);
|
|
3457
|
+
this.color.load(AnimatableColor.create(this.color, data.color));
|
|
3458
|
+
this.effect.load(data.effect);
|
|
3459
|
+
this.move.load(data.move);
|
|
3460
|
+
this.number.load(data.number);
|
|
3461
|
+
this.opacity.load(data.opacity);
|
|
3450
3462
|
this.shape.load(data.shape);
|
|
3451
3463
|
this.size.load(data.size);
|
|
3452
3464
|
this.shadow.load(data.shadow);
|
|
@@ -3519,6 +3531,7 @@ class Options {
|
|
|
3519
3531
|
this.autoPlay = true;
|
|
3520
3532
|
this.background = new Background();
|
|
3521
3533
|
this.backgroundMask = new BackgroundMask();
|
|
3534
|
+
this.clear = true;
|
|
3522
3535
|
this.defaultThemes = {};
|
|
3523
3536
|
this.delay = 0;
|
|
3524
3537
|
this.fullScreen = new FullScreen();
|
|
@@ -3546,6 +3559,12 @@ class Options {
|
|
|
3546
3559
|
if (data.autoPlay !== undefined) {
|
|
3547
3560
|
this.autoPlay = data.autoPlay;
|
|
3548
3561
|
}
|
|
3562
|
+
if (data.clear !== undefined) {
|
|
3563
|
+
this.clear = data.clear;
|
|
3564
|
+
}
|
|
3565
|
+
if (data.name !== undefined) {
|
|
3566
|
+
this.name = data.name;
|
|
3567
|
+
}
|
|
3549
3568
|
if (data.delay !== undefined) {
|
|
3550
3569
|
this.delay = setRangeValue(data.delay);
|
|
3551
3570
|
}
|
|
@@ -3871,7 +3890,9 @@ class Particle {
|
|
|
3871
3890
|
this.bubble.inRange = false;
|
|
3872
3891
|
this.slow.inRange = false;
|
|
3873
3892
|
const container = this.container,
|
|
3874
|
-
pathGenerator = this.pathGenerator
|
|
3893
|
+
pathGenerator = this.pathGenerator,
|
|
3894
|
+
shapeDrawer = container.shapeDrawers.get(this.shape);
|
|
3895
|
+
shapeDrawer && shapeDrawer.particleDestroy && shapeDrawer.particleDestroy(this);
|
|
3875
3896
|
for (const [, plugin] of container.plugins) {
|
|
3876
3897
|
plugin.particleDestroyed && plugin.particleDestroyed(this, override);
|
|
3877
3898
|
}
|
|
@@ -5125,7 +5146,7 @@ class Engine {
|
|
|
5125
5146
|
return res;
|
|
5126
5147
|
}
|
|
5127
5148
|
get version() {
|
|
5128
|
-
return "3.0.0
|
|
5149
|
+
return "3.0.0";
|
|
5129
5150
|
}
|
|
5130
5151
|
addConfig(config) {
|
|
5131
5152
|
const name = config.name ?? "default";
|
|
@@ -5536,140 +5557,6 @@ if (!isSsr()) {
|
|
|
5536
5557
|
|
|
5537
5558
|
|
|
5538
5559
|
|
|
5539
|
-
;// CONCATENATED MODULE: ../pjs/dist/browser/marcbruederlin/Particles.js
|
|
5540
|
-
|
|
5541
|
-
class Particles_Particles {
|
|
5542
|
-
static init(options) {
|
|
5543
|
-
const particles = new Particles_Particles(),
|
|
5544
|
-
selector = options.selector;
|
|
5545
|
-
if (!selector) {
|
|
5546
|
-
throw new Error("No selector provided");
|
|
5547
|
-
}
|
|
5548
|
-
const el = document.querySelector(selector);
|
|
5549
|
-
if (!el) {
|
|
5550
|
-
throw new Error("No element found for selector");
|
|
5551
|
-
}
|
|
5552
|
-
tsParticles.load({
|
|
5553
|
-
id: selector.replace(".", "").replace("!", ""),
|
|
5554
|
-
element: el,
|
|
5555
|
-
options: {
|
|
5556
|
-
fullScreen: {
|
|
5557
|
-
enable: false
|
|
5558
|
-
},
|
|
5559
|
-
particles: {
|
|
5560
|
-
color: {
|
|
5561
|
-
value: options.color ?? "!000000"
|
|
5562
|
-
},
|
|
5563
|
-
links: {
|
|
5564
|
-
color: "random",
|
|
5565
|
-
distance: options.minDistance ?? 120,
|
|
5566
|
-
enable: options.connectParticles ?? false
|
|
5567
|
-
},
|
|
5568
|
-
move: {
|
|
5569
|
-
enable: true,
|
|
5570
|
-
speed: options.speed ?? 0.5
|
|
5571
|
-
},
|
|
5572
|
-
number: {
|
|
5573
|
-
value: options.maxParticles ?? 100
|
|
5574
|
-
},
|
|
5575
|
-
size: {
|
|
5576
|
-
value: {
|
|
5577
|
-
min: 1,
|
|
5578
|
-
max: options.sizeVariations ?? 3
|
|
5579
|
-
}
|
|
5580
|
-
}
|
|
5581
|
-
},
|
|
5582
|
-
responsive: options.responsive?.map(responsive => ({
|
|
5583
|
-
maxWidth: responsive.breakpoint,
|
|
5584
|
-
options: {
|
|
5585
|
-
particles: {
|
|
5586
|
-
color: {
|
|
5587
|
-
value: responsive.options?.color
|
|
5588
|
-
},
|
|
5589
|
-
links: {
|
|
5590
|
-
distance: responsive.options?.minDistance,
|
|
5591
|
-
enable: responsive.options?.connectParticles
|
|
5592
|
-
},
|
|
5593
|
-
number: {
|
|
5594
|
-
value: options.maxParticles
|
|
5595
|
-
},
|
|
5596
|
-
move: {
|
|
5597
|
-
enable: true,
|
|
5598
|
-
speed: responsive.options?.speed
|
|
5599
|
-
},
|
|
5600
|
-
size: {
|
|
5601
|
-
value: responsive.options?.sizeVariations
|
|
5602
|
-
}
|
|
5603
|
-
}
|
|
5604
|
-
}
|
|
5605
|
-
}))
|
|
5606
|
-
}
|
|
5607
|
-
}).then(container => {
|
|
5608
|
-
particles._container = container;
|
|
5609
|
-
});
|
|
5610
|
-
return particles;
|
|
5611
|
-
}
|
|
5612
|
-
destroy() {
|
|
5613
|
-
const container = this._container;
|
|
5614
|
-
container && container.destroy();
|
|
5615
|
-
}
|
|
5616
|
-
pauseAnimation() {
|
|
5617
|
-
const container = this._container;
|
|
5618
|
-
container && container.pause();
|
|
5619
|
-
}
|
|
5620
|
-
resumeAnimation() {
|
|
5621
|
-
const container = this._container;
|
|
5622
|
-
container && container.play();
|
|
5623
|
-
}
|
|
5624
|
-
}
|
|
5625
|
-
;// CONCATENATED MODULE: ../pjs/dist/browser/VincentGarreau/particles.js
|
|
5626
|
-
const initParticlesJS = engine => {
|
|
5627
|
-
const particlesJS = (tagId, options) => {
|
|
5628
|
-
return engine.load({
|
|
5629
|
-
id: tagId,
|
|
5630
|
-
options
|
|
5631
|
-
});
|
|
5632
|
-
};
|
|
5633
|
-
particlesJS.load = (tagId, pathConfigJson, callback) => {
|
|
5634
|
-
engine.load({
|
|
5635
|
-
id: tagId,
|
|
5636
|
-
url: pathConfigJson
|
|
5637
|
-
}).then(container => {
|
|
5638
|
-
if (container) {
|
|
5639
|
-
callback(container);
|
|
5640
|
-
}
|
|
5641
|
-
}).catch(() => {
|
|
5642
|
-
callback(undefined);
|
|
5643
|
-
});
|
|
5644
|
-
};
|
|
5645
|
-
particlesJS.setOnClickHandler = callback => {
|
|
5646
|
-
engine.setOnClickHandler(callback);
|
|
5647
|
-
};
|
|
5648
|
-
const pJSDom = engine.dom();
|
|
5649
|
-
return {
|
|
5650
|
-
particlesJS,
|
|
5651
|
-
pJSDom
|
|
5652
|
-
};
|
|
5653
|
-
};
|
|
5654
|
-
|
|
5655
|
-
;// CONCATENATED MODULE: ../pjs/dist/browser/index.js
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
const initPjs = engine => {
|
|
5659
|
-
const {
|
|
5660
|
-
particlesJS,
|
|
5661
|
-
pJSDom
|
|
5662
|
-
} = initParticlesJS(engine);
|
|
5663
|
-
window.particlesJS = particlesJS;
|
|
5664
|
-
window.pJSDom = pJSDom;
|
|
5665
|
-
window.Particles = Particles_Particles;
|
|
5666
|
-
return {
|
|
5667
|
-
particlesJS,
|
|
5668
|
-
pJSDom,
|
|
5669
|
-
Particles: Particles_Particles
|
|
5670
|
-
};
|
|
5671
|
-
};
|
|
5672
|
-
|
|
5673
5560
|
;// CONCATENATED MODULE: ../../move/base/dist/browser/Utils.js
|
|
5674
5561
|
|
|
5675
5562
|
function applyDistance(particle) {
|
|
@@ -6370,7 +6257,7 @@ class OutOutMode {
|
|
|
6370
6257
|
}
|
|
6371
6258
|
case "normal":
|
|
6372
6259
|
{
|
|
6373
|
-
const
|
|
6260
|
+
const warp = particle.options.move.warp,
|
|
6374
6261
|
canvasSize = container.canvas.size,
|
|
6375
6262
|
newPos = {
|
|
6376
6263
|
bottom: canvasSize.height + particle.getRadius() + particle.offset.y,
|
|
@@ -6383,27 +6270,27 @@ class OutOutMode {
|
|
|
6383
6270
|
if (direction === "right" && nextBounds.left > canvasSize.width + particle.offset.x) {
|
|
6384
6271
|
particle.position.x = newPos.left;
|
|
6385
6272
|
particle.initialPosition.x = particle.position.x;
|
|
6386
|
-
if (!
|
|
6273
|
+
if (!warp) {
|
|
6387
6274
|
particle.position.y = getRandom() * canvasSize.height;
|
|
6388
6275
|
particle.initialPosition.y = particle.position.y;
|
|
6389
6276
|
}
|
|
6390
6277
|
} else if (direction === "left" && nextBounds.right < -particle.offset.x) {
|
|
6391
6278
|
particle.position.x = newPos.right;
|
|
6392
6279
|
particle.initialPosition.x = particle.position.x;
|
|
6393
|
-
if (!
|
|
6280
|
+
if (!warp) {
|
|
6394
6281
|
particle.position.y = getRandom() * canvasSize.height;
|
|
6395
6282
|
particle.initialPosition.y = particle.position.y;
|
|
6396
6283
|
}
|
|
6397
6284
|
}
|
|
6398
6285
|
if (direction === "bottom" && nextBounds.top > canvasSize.height + particle.offset.y) {
|
|
6399
|
-
if (!
|
|
6286
|
+
if (!warp) {
|
|
6400
6287
|
particle.position.x = getRandom() * canvasSize.width;
|
|
6401
6288
|
particle.initialPosition.x = particle.position.x;
|
|
6402
6289
|
}
|
|
6403
6290
|
particle.position.y = newPos.top;
|
|
6404
6291
|
particle.initialPosition.y = particle.position.y;
|
|
6405
6292
|
} else if (direction === "top" && nextBounds.bottom < -particle.offset.y) {
|
|
6406
|
-
if (!
|
|
6293
|
+
if (!warp) {
|
|
6407
6294
|
particle.position.x = getRandom() * canvasSize.width;
|
|
6408
6295
|
particle.initialPosition.x = particle.position.x;
|
|
6409
6296
|
}
|
|
@@ -6571,6 +6458,104 @@ async function loadEasingQuadPlugin() {
|
|
|
6571
6458
|
addEasing("ease-out-quad", value => 1 - (1 - value) ** 2);
|
|
6572
6459
|
addEasing("ease-in-out-quad", value => value < 0.5 ? 2 * value ** 2 : 1 - (-2 * value + 2) ** 2 / 2);
|
|
6573
6460
|
}
|
|
6461
|
+
;// CONCATENATED MODULE: ../../shapes/emoji/dist/browser/EmojiDrawer.js
|
|
6462
|
+
|
|
6463
|
+
const validTypes = ["emoji"];
|
|
6464
|
+
const defaultFont = '"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"';
|
|
6465
|
+
class EmojiDrawer {
|
|
6466
|
+
constructor() {
|
|
6467
|
+
this._emojiShapeDict = new Map();
|
|
6468
|
+
}
|
|
6469
|
+
destroy() {
|
|
6470
|
+
for (const [, emojiData] of this._emojiShapeDict) {
|
|
6471
|
+
emojiData instanceof ImageBitmap && emojiData?.close();
|
|
6472
|
+
}
|
|
6473
|
+
}
|
|
6474
|
+
draw(data) {
|
|
6475
|
+
const {
|
|
6476
|
+
context,
|
|
6477
|
+
particle,
|
|
6478
|
+
radius,
|
|
6479
|
+
opacity
|
|
6480
|
+
} = data,
|
|
6481
|
+
emojiData = particle.emojiData;
|
|
6482
|
+
if (!emojiData) {
|
|
6483
|
+
return;
|
|
6484
|
+
}
|
|
6485
|
+
context.globalAlpha = opacity;
|
|
6486
|
+
context.drawImage(emojiData, -radius, -radius, radius * 2, radius * 2);
|
|
6487
|
+
context.globalAlpha = 1;
|
|
6488
|
+
}
|
|
6489
|
+
async init(container) {
|
|
6490
|
+
const options = container.actualOptions;
|
|
6491
|
+
if (validTypes.find(t => isInArray(t, options.particles.shape.type))) {
|
|
6492
|
+
const promises = [loadFont(defaultFont)],
|
|
6493
|
+
shapeOptions = validTypes.map(t => options.particles.shape.options[t]).find(t => !!t);
|
|
6494
|
+
if (shapeOptions) {
|
|
6495
|
+
executeOnSingleOrMultiple(shapeOptions, shape => {
|
|
6496
|
+
shape.font && promises.push(loadFont(shape.font));
|
|
6497
|
+
});
|
|
6498
|
+
}
|
|
6499
|
+
await Promise.all(promises);
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
particleDestroy(particle) {
|
|
6503
|
+
delete particle.emojiData;
|
|
6504
|
+
}
|
|
6505
|
+
particleInit(container, particle) {
|
|
6506
|
+
if (!particle.emojiData) {
|
|
6507
|
+
const shapeData = particle.shapeData;
|
|
6508
|
+
if (!shapeData?.value) {
|
|
6509
|
+
return;
|
|
6510
|
+
}
|
|
6511
|
+
const emoji = itemFromSingleOrMultiple(shapeData.value, particle.randomIndexData),
|
|
6512
|
+
font = shapeData.font ?? defaultFont;
|
|
6513
|
+
if (!emoji) {
|
|
6514
|
+
return;
|
|
6515
|
+
}
|
|
6516
|
+
const key = `${emoji}_${font}`,
|
|
6517
|
+
existingData = this._emojiShapeDict.get(key);
|
|
6518
|
+
if (existingData) {
|
|
6519
|
+
particle.emojiData = existingData;
|
|
6520
|
+
return;
|
|
6521
|
+
}
|
|
6522
|
+
const canvasSize = getRangeMax(particle.size.value) * 2;
|
|
6523
|
+
let emojiData;
|
|
6524
|
+
if (typeof OffscreenCanvas !== "undefined") {
|
|
6525
|
+
const canvas = new OffscreenCanvas(canvasSize, canvasSize),
|
|
6526
|
+
context = canvas.getContext("2d");
|
|
6527
|
+
if (!context) {
|
|
6528
|
+
return;
|
|
6529
|
+
}
|
|
6530
|
+
context.font = `400 ${getRangeMax(particle.size.value) * 2}px ${font}`;
|
|
6531
|
+
context.textBaseline = "middle";
|
|
6532
|
+
context.textAlign = "center";
|
|
6533
|
+
context.fillText(emoji, getRangeMax(particle.size.value), getRangeMax(particle.size.value));
|
|
6534
|
+
emojiData = canvas.transferToImageBitmap();
|
|
6535
|
+
} else {
|
|
6536
|
+
const canvas = document.createElement("canvas");
|
|
6537
|
+
canvas.width = canvasSize;
|
|
6538
|
+
canvas.height = canvasSize;
|
|
6539
|
+
const context = canvas.getContext("2d");
|
|
6540
|
+
if (!context) {
|
|
6541
|
+
return;
|
|
6542
|
+
}
|
|
6543
|
+
context.font = `400 ${getRangeMax(particle.size.value) * 2}px ${font}`;
|
|
6544
|
+
context.textBaseline = "middle";
|
|
6545
|
+
context.textAlign = "center";
|
|
6546
|
+
context.fillText(emoji, getRangeMax(particle.size.value), getRangeMax(particle.size.value));
|
|
6547
|
+
emojiData = canvas;
|
|
6548
|
+
}
|
|
6549
|
+
this._emojiShapeDict.set(key, emojiData);
|
|
6550
|
+
particle.emojiData = emojiData;
|
|
6551
|
+
}
|
|
6552
|
+
}
|
|
6553
|
+
}
|
|
6554
|
+
;// CONCATENATED MODULE: ../../shapes/emoji/dist/browser/index.js
|
|
6555
|
+
|
|
6556
|
+
async function loadEmojiShape(engine, refresh = true) {
|
|
6557
|
+
await engine.addShape(validTypes, new EmojiDrawer(), refresh);
|
|
6558
|
+
}
|
|
6574
6559
|
;// CONCATENATED MODULE: ../../interactions/external/attract/dist/browser/Options/Classes/Attract.js
|
|
6575
6560
|
class Attract {
|
|
6576
6561
|
constructor() {
|
|
@@ -7471,18 +7456,6 @@ class Grab {
|
|
|
7471
7456
|
this.distance = 100;
|
|
7472
7457
|
this.links = new GrabLinks();
|
|
7473
7458
|
}
|
|
7474
|
-
get lineLinked() {
|
|
7475
|
-
return this.links;
|
|
7476
|
-
}
|
|
7477
|
-
set lineLinked(value) {
|
|
7478
|
-
this.links = value;
|
|
7479
|
-
}
|
|
7480
|
-
get line_linked() {
|
|
7481
|
-
return this.links;
|
|
7482
|
-
}
|
|
7483
|
-
set line_linked(value) {
|
|
7484
|
-
this.links = value;
|
|
7485
|
-
}
|
|
7486
7459
|
load(data) {
|
|
7487
7460
|
if (!data) {
|
|
7488
7461
|
return;
|
|
@@ -7490,7 +7463,7 @@ class Grab {
|
|
|
7490
7463
|
if (data.distance !== undefined) {
|
|
7491
7464
|
this.distance = data.distance;
|
|
7492
7465
|
}
|
|
7493
|
-
this.links.load(data.links
|
|
7466
|
+
this.links.load(data.links);
|
|
7494
7467
|
}
|
|
7495
7468
|
}
|
|
7496
7469
|
;// CONCATENATED MODULE: ../../interactions/external/grab/dist/browser/Utils.js
|
|
@@ -7629,12 +7602,6 @@ class Push {
|
|
|
7629
7602
|
this.groups = [];
|
|
7630
7603
|
this.quantity = 4;
|
|
7631
7604
|
}
|
|
7632
|
-
get particles_nb() {
|
|
7633
|
-
return this.quantity;
|
|
7634
|
-
}
|
|
7635
|
-
set particles_nb(value) {
|
|
7636
|
-
this.quantity = setRangeValue(value);
|
|
7637
|
-
}
|
|
7638
7605
|
load(data) {
|
|
7639
7606
|
if (!data) {
|
|
7640
7607
|
return;
|
|
@@ -7648,7 +7615,7 @@ class Push {
|
|
|
7648
7615
|
if (!this.groups.length) {
|
|
7649
7616
|
this.default = true;
|
|
7650
7617
|
}
|
|
7651
|
-
const quantity = data.quantity
|
|
7618
|
+
const quantity = data.quantity;
|
|
7652
7619
|
if (quantity !== undefined) {
|
|
7653
7620
|
this.quantity = setRangeValue(quantity);
|
|
7654
7621
|
}
|
|
@@ -7709,17 +7676,11 @@ class Remove {
|
|
|
7709
7676
|
constructor() {
|
|
7710
7677
|
this.quantity = 2;
|
|
7711
7678
|
}
|
|
7712
|
-
get particles_nb() {
|
|
7713
|
-
return this.quantity;
|
|
7714
|
-
}
|
|
7715
|
-
set particles_nb(value) {
|
|
7716
|
-
this.quantity = setRangeValue(value);
|
|
7717
|
-
}
|
|
7718
7679
|
load(data) {
|
|
7719
7680
|
if (!data) {
|
|
7720
7681
|
return;
|
|
7721
7682
|
}
|
|
7722
|
-
const quantity = data.quantity
|
|
7683
|
+
const quantity = data.quantity;
|
|
7723
7684
|
if (quantity !== undefined) {
|
|
7724
7685
|
this.quantity = setRangeValue(quantity);
|
|
7725
7686
|
}
|
|
@@ -8782,8 +8743,9 @@ class ImageDrawer {
|
|
|
8782
8743
|
pos = {
|
|
8783
8744
|
x: -radius,
|
|
8784
8745
|
y: -radius
|
|
8785
|
-
}
|
|
8786
|
-
|
|
8746
|
+
},
|
|
8747
|
+
diameter = radius * 2;
|
|
8748
|
+
context.drawImage(element, pos.x, pos.y, diameter, diameter / ratio);
|
|
8787
8749
|
}
|
|
8788
8750
|
context.globalAlpha = 1;
|
|
8789
8751
|
}
|
|
@@ -9620,7 +9582,7 @@ class Linker extends ParticlesInteractorBase {
|
|
|
9620
9582
|
options.links = new Links();
|
|
9621
9583
|
}
|
|
9622
9584
|
for (const source of sources) {
|
|
9623
|
-
options.links.load(source?.links
|
|
9585
|
+
options.links.load(source?.links);
|
|
9624
9586
|
}
|
|
9625
9587
|
}
|
|
9626
9588
|
reset() {}
|
|
@@ -10373,90 +10335,6 @@ class StrokeColorUpdater {
|
|
|
10373
10335
|
async function loadStrokeColorUpdater(engine, refresh = true) {
|
|
10374
10336
|
await engine.addParticleUpdater("strokeColor", container => new StrokeColorUpdater(container), refresh);
|
|
10375
10337
|
}
|
|
10376
|
-
;// CONCATENATED MODULE: ../../shapes/text/dist/browser/TextDrawer.js
|
|
10377
|
-
|
|
10378
|
-
const validTypes = ["text", "character", "char", "multiline-text"];
|
|
10379
|
-
class TextDrawer {
|
|
10380
|
-
constructor() {
|
|
10381
|
-
this._drawLine = (context, line, radius, opacity, index, fill) => {
|
|
10382
|
-
const offsetX = line.length * radius / 2,
|
|
10383
|
-
pos = {
|
|
10384
|
-
x: -offsetX,
|
|
10385
|
-
y: radius / 2
|
|
10386
|
-
};
|
|
10387
|
-
if (fill) {
|
|
10388
|
-
context.fillText(line, pos.x, pos.y + radius * 2 * index);
|
|
10389
|
-
} else {
|
|
10390
|
-
context.strokeText(line, pos.x, pos.y + radius * 2 * index);
|
|
10391
|
-
}
|
|
10392
|
-
};
|
|
10393
|
-
}
|
|
10394
|
-
draw(data) {
|
|
10395
|
-
const {
|
|
10396
|
-
context,
|
|
10397
|
-
particle,
|
|
10398
|
-
radius,
|
|
10399
|
-
opacity
|
|
10400
|
-
} = data,
|
|
10401
|
-
character = particle.shapeData;
|
|
10402
|
-
if (!character) {
|
|
10403
|
-
return;
|
|
10404
|
-
}
|
|
10405
|
-
const textData = character.value;
|
|
10406
|
-
if (textData === undefined) {
|
|
10407
|
-
return;
|
|
10408
|
-
}
|
|
10409
|
-
if (particle.text === undefined) {
|
|
10410
|
-
particle.text = itemFromSingleOrMultiple(textData, particle.randomIndexData);
|
|
10411
|
-
}
|
|
10412
|
-
const text = particle.text,
|
|
10413
|
-
style = character.style ?? "",
|
|
10414
|
-
weight = character.weight ?? "400",
|
|
10415
|
-
size = Math.round(radius) * 2,
|
|
10416
|
-
font = character.font ?? "Verdana",
|
|
10417
|
-
fill = particle.shapeFill;
|
|
10418
|
-
const lines = text?.split("\n");
|
|
10419
|
-
if (!lines) {
|
|
10420
|
-
return;
|
|
10421
|
-
}
|
|
10422
|
-
context.font = `${style} ${weight} ${size}px "${font}"`;
|
|
10423
|
-
context.globalAlpha = opacity;
|
|
10424
|
-
for (let i = 0; i < lines.length; i++) {
|
|
10425
|
-
this._drawLine(context, lines[i], radius, opacity, i, fill);
|
|
10426
|
-
}
|
|
10427
|
-
context.globalAlpha = 1;
|
|
10428
|
-
}
|
|
10429
|
-
async init(container) {
|
|
10430
|
-
const options = container.actualOptions;
|
|
10431
|
-
if (validTypes.find(t => isInArray(t, options.particles.shape.type))) {
|
|
10432
|
-
const shapeOptions = validTypes.map(t => options.particles.shape.options[t]).find(t => !!t),
|
|
10433
|
-
promises = [];
|
|
10434
|
-
executeOnSingleOrMultiple(shapeOptions, shape => {
|
|
10435
|
-
promises.push(loadFont(shape.font, shape.weight));
|
|
10436
|
-
});
|
|
10437
|
-
await Promise.all(promises);
|
|
10438
|
-
}
|
|
10439
|
-
}
|
|
10440
|
-
particleInit(container, particle) {
|
|
10441
|
-
if (!particle.shape || !validTypes.includes(particle.shape)) {
|
|
10442
|
-
return;
|
|
10443
|
-
}
|
|
10444
|
-
const character = particle.shapeData;
|
|
10445
|
-
if (character === undefined) {
|
|
10446
|
-
return;
|
|
10447
|
-
}
|
|
10448
|
-
const textData = character.value;
|
|
10449
|
-
if (textData === undefined) {
|
|
10450
|
-
return;
|
|
10451
|
-
}
|
|
10452
|
-
particle.text = itemFromSingleOrMultiple(textData, particle.randomIndexData);
|
|
10453
|
-
}
|
|
10454
|
-
}
|
|
10455
|
-
;// CONCATENATED MODULE: ../../shapes/text/dist/browser/index.js
|
|
10456
|
-
|
|
10457
|
-
async function loadTextShape(engine, refresh = true) {
|
|
10458
|
-
await engine.addShape(validTypes, new TextDrawer(), refresh);
|
|
10459
|
-
}
|
|
10460
10338
|
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
10461
10339
|
|
|
10462
10340
|
|
|
@@ -10481,11 +10359,9 @@ async function loadTextShape(engine, refresh = true) {
|
|
|
10481
10359
|
|
|
10482
10360
|
|
|
10483
10361
|
|
|
10484
|
-
|
|
10485
10362
|
|
|
10486
10363
|
|
|
10487
10364
|
async function loadSlim(engine, refresh = true) {
|
|
10488
|
-
initPjs(engine);
|
|
10489
10365
|
await loadParallaxMover(engine, false);
|
|
10490
10366
|
await loadExternalAttractInteraction(engine, false);
|
|
10491
10367
|
await loadExternalBounceInteraction(engine, false);
|
|
@@ -10501,12 +10377,12 @@ async function loadSlim(engine, refresh = true) {
|
|
|
10501
10377
|
await loadParticlesCollisionsInteraction(engine, false);
|
|
10502
10378
|
await loadParticlesLinksInteraction(engine, false);
|
|
10503
10379
|
await loadEasingQuadPlugin();
|
|
10380
|
+
await loadEmojiShape(engine, false);
|
|
10504
10381
|
await loadImageShape(engine, false);
|
|
10505
10382
|
await loadLineShape(engine, false);
|
|
10506
10383
|
await loadPolygonShape(engine, false);
|
|
10507
10384
|
await loadSquareShape(engine, false);
|
|
10508
10385
|
await loadStarShape(engine, false);
|
|
10509
|
-
await loadTextShape(engine, false);
|
|
10510
10386
|
await loadLifeUpdater(engine, false);
|
|
10511
10387
|
await loadRotateUpdater(engine, false);
|
|
10512
10388
|
await loadStrokeColorUpdater(engine, false);
|