tsparticles 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.
@@ -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-beta.4
7
+ * v3.0.0
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -1228,7 +1228,8 @@ function drawParticle(data) {
1228
1228
  particle,
1229
1229
  radius,
1230
1230
  opacity,
1231
- delta
1231
+ delta,
1232
+ transformData
1232
1233
  };
1233
1234
  context.beginPath();
1234
1235
  drawShape(drawData);
@@ -1253,7 +1254,8 @@ function drawEffect(data) {
1253
1254
  particle,
1254
1255
  radius,
1255
1256
  opacity,
1256
- delta
1257
+ delta,
1258
+ transformData
1257
1259
  } = data;
1258
1260
  if (!particle.effect) {
1259
1261
  return;
@@ -1268,7 +1270,10 @@ function drawEffect(data) {
1268
1270
  radius,
1269
1271
  opacity,
1270
1272
  delta,
1271
- pixelRatio: container.retina.pixelRatio
1273
+ pixelRatio: container.retina.pixelRatio,
1274
+ transformData: {
1275
+ ...transformData
1276
+ }
1272
1277
  });
1273
1278
  }
1274
1279
  function drawShape(data) {
@@ -1278,7 +1283,8 @@ function drawShape(data) {
1278
1283
  particle,
1279
1284
  radius,
1280
1285
  opacity,
1281
- delta
1286
+ delta,
1287
+ transformData
1282
1288
  } = data;
1283
1289
  if (!particle.shape) {
1284
1290
  return;
@@ -1293,7 +1299,10 @@ function drawShape(data) {
1293
1299
  radius,
1294
1300
  opacity,
1295
1301
  delta,
1296
- pixelRatio: container.retina.pixelRatio
1302
+ pixelRatio: container.retina.pixelRatio,
1303
+ transformData: {
1304
+ ...transformData
1305
+ }
1297
1306
  });
1298
1307
  }
1299
1308
  function drawShapeAfterDraw(data) {
@@ -1303,7 +1312,8 @@ function drawShapeAfterDraw(data) {
1303
1312
  particle,
1304
1313
  radius,
1305
1314
  opacity,
1306
- delta
1315
+ delta,
1316
+ transformData
1307
1317
  } = data;
1308
1318
  if (!particle.shape) {
1309
1319
  return;
@@ -1318,7 +1328,10 @@ function drawShapeAfterDraw(data) {
1318
1328
  radius,
1319
1329
  opacity,
1320
1330
  delta,
1321
- pixelRatio: container.retina.pixelRatio
1331
+ pixelRatio: container.retina.pixelRatio,
1332
+ transformData: {
1333
+ ...transformData
1334
+ }
1322
1335
  });
1323
1336
  }
1324
1337
  function drawPlugin(context, plugin, delta) {
@@ -1555,7 +1568,7 @@ class Canvas {
1555
1568
  } else if (trailFill.image) {
1556
1569
  this._paintImage(trailFill.image, trailFill.opacity);
1557
1570
  }
1558
- } else {
1571
+ } else if (options.clear) {
1559
1572
  this.draw(ctx => {
1560
1573
  clear(ctx, this.size);
1561
1574
  });
@@ -2402,11 +2415,7 @@ class Events {
2402
2415
  });
2403
2416
  }
2404
2417
  this.onHover.load(data.onHover);
2405
- if (isBoolean(data.resize)) {
2406
- this.resize.enable = data.resize;
2407
- } else {
2408
- this.resize.load(data.resize);
2409
- }
2418
+ this.resize.load(data.resize);
2410
2419
  }
2411
2420
  }
2412
2421
  ;// CONCATENATED MODULE: ../../engine/dist/browser/Options/Classes/Interactivity/Modes/Modes.js
@@ -3431,23 +3440,26 @@ class ParticlesOptions {
3431
3440
  if (!data) {
3432
3441
  return;
3433
3442
  }
3434
- this.bounce.load(data.bounce);
3435
- this.color.load(AnimatableColor.create(this.color, data.color));
3436
- this.effect.load(data.effect);
3437
3443
  if (data.groups !== undefined) {
3438
- for (const group in data.groups) {
3444
+ for (const group of Object.keys(data.groups)) {
3445
+ if (!Object.hasOwn(data.groups, group)) {
3446
+ continue;
3447
+ }
3439
3448
  const item = data.groups[group];
3440
3449
  if (item !== undefined) {
3441
3450
  this.groups[group] = deepExtend(this.groups[group] ?? {}, item);
3442
3451
  }
3443
3452
  }
3444
3453
  }
3445
- this.move.load(data.move);
3446
- this.number.load(data.number);
3447
- this.opacity.load(data.opacity);
3448
3454
  if (data.reduceDuplicates !== undefined) {
3449
3455
  this.reduceDuplicates = data.reduceDuplicates;
3450
3456
  }
3457
+ this.bounce.load(data.bounce);
3458
+ this.color.load(AnimatableColor.create(this.color, data.color));
3459
+ this.effect.load(data.effect);
3460
+ this.move.load(data.move);
3461
+ this.number.load(data.number);
3462
+ this.opacity.load(data.opacity);
3451
3463
  this.shape.load(data.shape);
3452
3464
  this.size.load(data.size);
3453
3465
  this.shadow.load(data.shadow);
@@ -3520,6 +3532,7 @@ class Options {
3520
3532
  this.autoPlay = true;
3521
3533
  this.background = new Background();
3522
3534
  this.backgroundMask = new BackgroundMask();
3535
+ this.clear = true;
3523
3536
  this.defaultThemes = {};
3524
3537
  this.delay = 0;
3525
3538
  this.fullScreen = new FullScreen();
@@ -3547,6 +3560,12 @@ class Options {
3547
3560
  if (data.autoPlay !== undefined) {
3548
3561
  this.autoPlay = data.autoPlay;
3549
3562
  }
3563
+ if (data.clear !== undefined) {
3564
+ this.clear = data.clear;
3565
+ }
3566
+ if (data.name !== undefined) {
3567
+ this.name = data.name;
3568
+ }
3550
3569
  if (data.delay !== undefined) {
3551
3570
  this.delay = setRangeValue(data.delay);
3552
3571
  }
@@ -3872,7 +3891,9 @@ class Particle {
3872
3891
  this.bubble.inRange = false;
3873
3892
  this.slow.inRange = false;
3874
3893
  const container = this.container,
3875
- pathGenerator = this.pathGenerator;
3894
+ pathGenerator = this.pathGenerator,
3895
+ shapeDrawer = container.shapeDrawers.get(this.shape);
3896
+ shapeDrawer && shapeDrawer.particleDestroy && shapeDrawer.particleDestroy(this);
3876
3897
  for (const [, plugin] of container.plugins) {
3877
3898
  plugin.particleDestroyed && plugin.particleDestroyed(this, override);
3878
3899
  }
@@ -5126,7 +5147,7 @@ class Engine {
5126
5147
  return res;
5127
5148
  }
5128
5149
  get version() {
5129
- return "3.0.0-beta.4";
5150
+ return "3.0.0";
5130
5151
  }
5131
5152
  addConfig(config) {
5132
5153
  const name = config.name ?? "default";
@@ -7231,140 +7252,6 @@ class RollUpdater {
7231
7252
  async function loadRollUpdater(engine, refresh = true) {
7232
7253
  await engine.addParticleUpdater("roll", () => new RollUpdater(), refresh);
7233
7254
  }
7234
- ;// CONCATENATED MODULE: ../pjs/dist/browser/marcbruederlin/Particles.js
7235
-
7236
- class Particles_Particles {
7237
- static init(options) {
7238
- const particles = new Particles_Particles(),
7239
- selector = options.selector;
7240
- if (!selector) {
7241
- throw new Error("No selector provided");
7242
- }
7243
- const el = document.querySelector(selector);
7244
- if (!el) {
7245
- throw new Error("No element found for selector");
7246
- }
7247
- tsParticles.load({
7248
- id: selector.replace(".", "").replace("!", ""),
7249
- element: el,
7250
- options: {
7251
- fullScreen: {
7252
- enable: false
7253
- },
7254
- particles: {
7255
- color: {
7256
- value: options.color ?? "!000000"
7257
- },
7258
- links: {
7259
- color: "random",
7260
- distance: options.minDistance ?? 120,
7261
- enable: options.connectParticles ?? false
7262
- },
7263
- move: {
7264
- enable: true,
7265
- speed: options.speed ?? 0.5
7266
- },
7267
- number: {
7268
- value: options.maxParticles ?? 100
7269
- },
7270
- size: {
7271
- value: {
7272
- min: 1,
7273
- max: options.sizeVariations ?? 3
7274
- }
7275
- }
7276
- },
7277
- responsive: options.responsive?.map(responsive => ({
7278
- maxWidth: responsive.breakpoint,
7279
- options: {
7280
- particles: {
7281
- color: {
7282
- value: responsive.options?.color
7283
- },
7284
- links: {
7285
- distance: responsive.options?.minDistance,
7286
- enable: responsive.options?.connectParticles
7287
- },
7288
- number: {
7289
- value: options.maxParticles
7290
- },
7291
- move: {
7292
- enable: true,
7293
- speed: responsive.options?.speed
7294
- },
7295
- size: {
7296
- value: responsive.options?.sizeVariations
7297
- }
7298
- }
7299
- }
7300
- }))
7301
- }
7302
- }).then(container => {
7303
- particles._container = container;
7304
- });
7305
- return particles;
7306
- }
7307
- destroy() {
7308
- const container = this._container;
7309
- container && container.destroy();
7310
- }
7311
- pauseAnimation() {
7312
- const container = this._container;
7313
- container && container.pause();
7314
- }
7315
- resumeAnimation() {
7316
- const container = this._container;
7317
- container && container.play();
7318
- }
7319
- }
7320
- ;// CONCATENATED MODULE: ../pjs/dist/browser/VincentGarreau/particles.js
7321
- const initParticlesJS = engine => {
7322
- const particlesJS = (tagId, options) => {
7323
- return engine.load({
7324
- id: tagId,
7325
- options
7326
- });
7327
- };
7328
- particlesJS.load = (tagId, pathConfigJson, callback) => {
7329
- engine.load({
7330
- id: tagId,
7331
- url: pathConfigJson
7332
- }).then(container => {
7333
- if (container) {
7334
- callback(container);
7335
- }
7336
- }).catch(() => {
7337
- callback(undefined);
7338
- });
7339
- };
7340
- particlesJS.setOnClickHandler = callback => {
7341
- engine.setOnClickHandler(callback);
7342
- };
7343
- const pJSDom = engine.dom();
7344
- return {
7345
- particlesJS,
7346
- pJSDom
7347
- };
7348
- };
7349
-
7350
- ;// CONCATENATED MODULE: ../pjs/dist/browser/index.js
7351
-
7352
-
7353
- const initPjs = engine => {
7354
- const {
7355
- particlesJS,
7356
- pJSDom
7357
- } = initParticlesJS(engine);
7358
- window.particlesJS = particlesJS;
7359
- window.pJSDom = pJSDom;
7360
- window.Particles = Particles_Particles;
7361
- return {
7362
- particlesJS,
7363
- pJSDom,
7364
- Particles: Particles_Particles
7365
- };
7366
- };
7367
-
7368
7255
  ;// CONCATENATED MODULE: ../../move/base/dist/browser/Utils.js
7369
7256
 
7370
7257
  function applyDistance(particle) {
@@ -8065,7 +7952,7 @@ class OutOutMode {
8065
7952
  }
8066
7953
  case "normal":
8067
7954
  {
8068
- const wrap = particle.options.move.warp,
7955
+ const warp = particle.options.move.warp,
8069
7956
  canvasSize = container.canvas.size,
8070
7957
  newPos = {
8071
7958
  bottom: canvasSize.height + particle.getRadius() + particle.offset.y,
@@ -8078,27 +7965,27 @@ class OutOutMode {
8078
7965
  if (direction === "right" && nextBounds.left > canvasSize.width + particle.offset.x) {
8079
7966
  particle.position.x = newPos.left;
8080
7967
  particle.initialPosition.x = particle.position.x;
8081
- if (!wrap) {
7968
+ if (!warp) {
8082
7969
  particle.position.y = getRandom() * canvasSize.height;
8083
7970
  particle.initialPosition.y = particle.position.y;
8084
7971
  }
8085
7972
  } else if (direction === "left" && nextBounds.right < -particle.offset.x) {
8086
7973
  particle.position.x = newPos.right;
8087
7974
  particle.initialPosition.x = particle.position.x;
8088
- if (!wrap) {
7975
+ if (!warp) {
8089
7976
  particle.position.y = getRandom() * canvasSize.height;
8090
7977
  particle.initialPosition.y = particle.position.y;
8091
7978
  }
8092
7979
  }
8093
7980
  if (direction === "bottom" && nextBounds.top > canvasSize.height + particle.offset.y) {
8094
- if (!wrap) {
7981
+ if (!warp) {
8095
7982
  particle.position.x = getRandom() * canvasSize.width;
8096
7983
  particle.initialPosition.x = particle.position.x;
8097
7984
  }
8098
7985
  particle.position.y = newPos.top;
8099
7986
  particle.initialPosition.y = particle.position.y;
8100
7987
  } else if (direction === "top" && nextBounds.bottom < -particle.offset.y) {
8101
- if (!wrap) {
7988
+ if (!warp) {
8102
7989
  particle.position.x = getRandom() * canvasSize.width;
8103
7990
  particle.initialPosition.x = particle.position.x;
8104
7991
  }
@@ -8266,6 +8153,104 @@ async function loadEasingQuadPlugin() {
8266
8153
  addEasing("ease-out-quad", value => 1 - (1 - value) ** 2);
8267
8154
  addEasing("ease-in-out-quad", value => value < 0.5 ? 2 * value ** 2 : 1 - (-2 * value + 2) ** 2 / 2);
8268
8155
  }
8156
+ ;// CONCATENATED MODULE: ../../shapes/emoji/dist/browser/EmojiDrawer.js
8157
+
8158
+ const validTypes = ["emoji"];
8159
+ const defaultFont = '"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"';
8160
+ class EmojiDrawer {
8161
+ constructor() {
8162
+ this._emojiShapeDict = new Map();
8163
+ }
8164
+ destroy() {
8165
+ for (const [, emojiData] of this._emojiShapeDict) {
8166
+ emojiData instanceof ImageBitmap && emojiData?.close();
8167
+ }
8168
+ }
8169
+ draw(data) {
8170
+ const {
8171
+ context,
8172
+ particle,
8173
+ radius,
8174
+ opacity
8175
+ } = data,
8176
+ emojiData = particle.emojiData;
8177
+ if (!emojiData) {
8178
+ return;
8179
+ }
8180
+ context.globalAlpha = opacity;
8181
+ context.drawImage(emojiData, -radius, -radius, radius * 2, radius * 2);
8182
+ context.globalAlpha = 1;
8183
+ }
8184
+ async init(container) {
8185
+ const options = container.actualOptions;
8186
+ if (validTypes.find(t => isInArray(t, options.particles.shape.type))) {
8187
+ const promises = [loadFont(defaultFont)],
8188
+ shapeOptions = validTypes.map(t => options.particles.shape.options[t]).find(t => !!t);
8189
+ if (shapeOptions) {
8190
+ executeOnSingleOrMultiple(shapeOptions, shape => {
8191
+ shape.font && promises.push(loadFont(shape.font));
8192
+ });
8193
+ }
8194
+ await Promise.all(promises);
8195
+ }
8196
+ }
8197
+ particleDestroy(particle) {
8198
+ delete particle.emojiData;
8199
+ }
8200
+ particleInit(container, particle) {
8201
+ if (!particle.emojiData) {
8202
+ const shapeData = particle.shapeData;
8203
+ if (!shapeData?.value) {
8204
+ return;
8205
+ }
8206
+ const emoji = itemFromSingleOrMultiple(shapeData.value, particle.randomIndexData),
8207
+ font = shapeData.font ?? defaultFont;
8208
+ if (!emoji) {
8209
+ return;
8210
+ }
8211
+ const key = `${emoji}_${font}`,
8212
+ existingData = this._emojiShapeDict.get(key);
8213
+ if (existingData) {
8214
+ particle.emojiData = existingData;
8215
+ return;
8216
+ }
8217
+ const canvasSize = getRangeMax(particle.size.value) * 2;
8218
+ let emojiData;
8219
+ if (typeof OffscreenCanvas !== "undefined") {
8220
+ const canvas = new OffscreenCanvas(canvasSize, canvasSize),
8221
+ context = canvas.getContext("2d");
8222
+ if (!context) {
8223
+ return;
8224
+ }
8225
+ context.font = `400 ${getRangeMax(particle.size.value) * 2}px ${font}`;
8226
+ context.textBaseline = "middle";
8227
+ context.textAlign = "center";
8228
+ context.fillText(emoji, getRangeMax(particle.size.value), getRangeMax(particle.size.value));
8229
+ emojiData = canvas.transferToImageBitmap();
8230
+ } else {
8231
+ const canvas = document.createElement("canvas");
8232
+ canvas.width = canvasSize;
8233
+ canvas.height = canvasSize;
8234
+ const context = canvas.getContext("2d");
8235
+ if (!context) {
8236
+ return;
8237
+ }
8238
+ context.font = `400 ${getRangeMax(particle.size.value) * 2}px ${font}`;
8239
+ context.textBaseline = "middle";
8240
+ context.textAlign = "center";
8241
+ context.fillText(emoji, getRangeMax(particle.size.value), getRangeMax(particle.size.value));
8242
+ emojiData = canvas;
8243
+ }
8244
+ this._emojiShapeDict.set(key, emojiData);
8245
+ particle.emojiData = emojiData;
8246
+ }
8247
+ }
8248
+ }
8249
+ ;// CONCATENATED MODULE: ../../shapes/emoji/dist/browser/index.js
8250
+
8251
+ async function loadEmojiShape(engine, refresh = true) {
8252
+ await engine.addShape(validTypes, new EmojiDrawer(), refresh);
8253
+ }
8269
8254
  ;// CONCATENATED MODULE: ../../interactions/external/attract/dist/browser/Options/Classes/Attract.js
8270
8255
  class Attract {
8271
8256
  constructor() {
@@ -9166,18 +9151,6 @@ class Grab {
9166
9151
  this.distance = 100;
9167
9152
  this.links = new GrabLinks();
9168
9153
  }
9169
- get lineLinked() {
9170
- return this.links;
9171
- }
9172
- set lineLinked(value) {
9173
- this.links = value;
9174
- }
9175
- get line_linked() {
9176
- return this.links;
9177
- }
9178
- set line_linked(value) {
9179
- this.links = value;
9180
- }
9181
9154
  load(data) {
9182
9155
  if (!data) {
9183
9156
  return;
@@ -9185,7 +9158,7 @@ class Grab {
9185
9158
  if (data.distance !== undefined) {
9186
9159
  this.distance = data.distance;
9187
9160
  }
9188
- this.links.load(data.links ?? data.lineLinked ?? data.line_linked);
9161
+ this.links.load(data.links);
9189
9162
  }
9190
9163
  }
9191
9164
  ;// CONCATENATED MODULE: ../../interactions/external/grab/dist/browser/Utils.js
@@ -9324,12 +9297,6 @@ class Push {
9324
9297
  this.groups = [];
9325
9298
  this.quantity = 4;
9326
9299
  }
9327
- get particles_nb() {
9328
- return this.quantity;
9329
- }
9330
- set particles_nb(value) {
9331
- this.quantity = setRangeValue(value);
9332
- }
9333
9300
  load(data) {
9334
9301
  if (!data) {
9335
9302
  return;
@@ -9343,7 +9310,7 @@ class Push {
9343
9310
  if (!this.groups.length) {
9344
9311
  this.default = true;
9345
9312
  }
9346
- const quantity = data.quantity ?? data.particles_nb;
9313
+ const quantity = data.quantity;
9347
9314
  if (quantity !== undefined) {
9348
9315
  this.quantity = setRangeValue(quantity);
9349
9316
  }
@@ -9404,17 +9371,11 @@ class Remove {
9404
9371
  constructor() {
9405
9372
  this.quantity = 2;
9406
9373
  }
9407
- get particles_nb() {
9408
- return this.quantity;
9409
- }
9410
- set particles_nb(value) {
9411
- this.quantity = setRangeValue(value);
9412
- }
9413
9374
  load(data) {
9414
9375
  if (!data) {
9415
9376
  return;
9416
9377
  }
9417
- const quantity = data.quantity ?? data.particles_nb;
9378
+ const quantity = data.quantity;
9418
9379
  if (quantity !== undefined) {
9419
9380
  this.quantity = setRangeValue(quantity);
9420
9381
  }
@@ -10477,8 +10438,9 @@ class ImageDrawer {
10477
10438
  pos = {
10478
10439
  x: -radius,
10479
10440
  y: -radius
10480
- };
10481
- context.drawImage(element, pos.x, pos.y, radius * 2, radius * 2 / ratio);
10441
+ },
10442
+ diameter = radius * 2;
10443
+ context.drawImage(element, pos.x, pos.y, diameter, diameter / ratio);
10482
10444
  }
10483
10445
  context.globalAlpha = 1;
10484
10446
  }
@@ -11315,7 +11277,7 @@ class Linker extends ParticlesInteractorBase {
11315
11277
  options.links = new Links();
11316
11278
  }
11317
11279
  for (const source of sources) {
11318
- options.links.load(source?.links ?? source?.lineLinked ?? source?.line_linked);
11280
+ options.links.load(source?.links);
11319
11281
  }
11320
11282
  }
11321
11283
  reset() {}
@@ -12068,9 +12030,62 @@ class StrokeColorUpdater {
12068
12030
  async function loadStrokeColorUpdater(engine, refresh = true) {
12069
12031
  await engine.addParticleUpdater("strokeColor", container => new StrokeColorUpdater(container), refresh);
12070
12032
  }
12033
+ ;// CONCATENATED MODULE: ../slim/dist/browser/index.js
12034
+
12035
+
12036
+
12037
+
12038
+
12039
+
12040
+
12041
+
12042
+
12043
+
12044
+
12045
+
12046
+
12047
+
12048
+
12049
+
12050
+
12051
+
12052
+
12053
+
12054
+
12055
+
12056
+
12057
+
12058
+
12059
+ async function loadSlim(engine, refresh = true) {
12060
+ await loadParallaxMover(engine, false);
12061
+ await loadExternalAttractInteraction(engine, false);
12062
+ await loadExternalBounceInteraction(engine, false);
12063
+ await loadExternalBubbleInteraction(engine, false);
12064
+ await loadExternalConnectInteraction(engine, false);
12065
+ await loadExternalGrabInteraction(engine, false);
12066
+ await loadExternalPauseInteraction(engine, false);
12067
+ await loadExternalPushInteraction(engine, false);
12068
+ await loadExternalRemoveInteraction(engine, false);
12069
+ await loadExternalRepulseInteraction(engine, false);
12070
+ await loadExternalSlowInteraction(engine, false);
12071
+ await loadParticlesAttractInteraction(engine, false);
12072
+ await loadParticlesCollisionsInteraction(engine, false);
12073
+ await loadParticlesLinksInteraction(engine, false);
12074
+ await loadEasingQuadPlugin();
12075
+ await loadEmojiShape(engine, false);
12076
+ await loadImageShape(engine, false);
12077
+ await loadLineShape(engine, false);
12078
+ await loadPolygonShape(engine, false);
12079
+ await loadSquareShape(engine, false);
12080
+ await loadStarShape(engine, false);
12081
+ await loadLifeUpdater(engine, false);
12082
+ await loadRotateUpdater(engine, false);
12083
+ await loadStrokeColorUpdater(engine, false);
12084
+ await loadBasic(engine, refresh);
12085
+ }
12071
12086
  ;// CONCATENATED MODULE: ../../shapes/text/dist/browser/TextDrawer.js
12072
12087
 
12073
- const validTypes = ["text", "character", "char", "multiline-text"];
12088
+ const TextDrawer_validTypes = ["text", "character", "char", "multiline-text"];
12074
12089
  class TextDrawer {
12075
12090
  constructor() {
12076
12091
  this._drawLine = (context, line, radius, opacity, index, fill) => {
@@ -12078,11 +12093,12 @@ class TextDrawer {
12078
12093
  pos = {
12079
12094
  x: -offsetX,
12080
12095
  y: radius / 2
12081
- };
12096
+ },
12097
+ diameter = radius * 2;
12082
12098
  if (fill) {
12083
- context.fillText(line, pos.x, pos.y + radius * 2 * index);
12099
+ context.fillText(line, pos.x, pos.y + diameter * index);
12084
12100
  } else {
12085
- context.strokeText(line, pos.x, pos.y + radius * 2 * index);
12101
+ context.strokeText(line, pos.x, pos.y + diameter * index);
12086
12102
  }
12087
12103
  };
12088
12104
  }
@@ -12123,8 +12139,8 @@ class TextDrawer {
12123
12139
  }
12124
12140
  async init(container) {
12125
12141
  const options = container.actualOptions;
12126
- if (validTypes.find(t => isInArray(t, options.particles.shape.type))) {
12127
- const shapeOptions = validTypes.map(t => options.particles.shape.options[t]).find(t => !!t),
12142
+ if (TextDrawer_validTypes.find(t => isInArray(t, options.particles.shape.type))) {
12143
+ const shapeOptions = TextDrawer_validTypes.map(t => options.particles.shape.options[t]).find(t => !!t),
12128
12144
  promises = [];
12129
12145
  executeOnSingleOrMultiple(shapeOptions, shape => {
12130
12146
  promises.push(loadFont(shape.font, shape.weight));
@@ -12133,7 +12149,7 @@ class TextDrawer {
12133
12149
  }
12134
12150
  }
12135
12151
  particleInit(container, particle) {
12136
- if (!particle.shape || !validTypes.includes(particle.shape)) {
12152
+ if (!particle.shape || !TextDrawer_validTypes.includes(particle.shape)) {
12137
12153
  return;
12138
12154
  }
12139
12155
  const character = particle.shapeData;
@@ -12150,62 +12166,7 @@ class TextDrawer {
12150
12166
  ;// CONCATENATED MODULE: ../../shapes/text/dist/browser/index.js
12151
12167
 
12152
12168
  async function loadTextShape(engine, refresh = true) {
12153
- await engine.addShape(validTypes, new TextDrawer(), refresh);
12154
- }
12155
- ;// CONCATENATED MODULE: ../slim/dist/browser/index.js
12156
-
12157
-
12158
-
12159
-
12160
-
12161
-
12162
-
12163
-
12164
-
12165
-
12166
-
12167
-
12168
-
12169
-
12170
-
12171
-
12172
-
12173
-
12174
-
12175
-
12176
-
12177
-
12178
-
12179
-
12180
-
12181
-
12182
- async function loadSlim(engine, refresh = true) {
12183
- initPjs(engine);
12184
- await loadParallaxMover(engine, false);
12185
- await loadExternalAttractInteraction(engine, false);
12186
- await loadExternalBounceInteraction(engine, false);
12187
- await loadExternalBubbleInteraction(engine, false);
12188
- await loadExternalConnectInteraction(engine, false);
12189
- await loadExternalGrabInteraction(engine, false);
12190
- await loadExternalPauseInteraction(engine, false);
12191
- await loadExternalPushInteraction(engine, false);
12192
- await loadExternalRemoveInteraction(engine, false);
12193
- await loadExternalRepulseInteraction(engine, false);
12194
- await loadExternalSlowInteraction(engine, false);
12195
- await loadParticlesAttractInteraction(engine, false);
12196
- await loadParticlesCollisionsInteraction(engine, false);
12197
- await loadParticlesLinksInteraction(engine, false);
12198
- await loadEasingQuadPlugin();
12199
- await loadImageShape(engine, false);
12200
- await loadLineShape(engine, false);
12201
- await loadPolygonShape(engine, false);
12202
- await loadSquareShape(engine, false);
12203
- await loadStarShape(engine, false);
12204
- await loadTextShape(engine, false);
12205
- await loadLifeUpdater(engine, false);
12206
- await loadRotateUpdater(engine, false);
12207
- await loadStrokeColorUpdater(engine, false);
12208
- await loadBasic(engine, refresh);
12169
+ await engine.addShape(TextDrawer_validTypes, new TextDrawer(), refresh);
12209
12170
  }
12210
12171
  ;// CONCATENATED MODULE: ../../updaters/tilt/dist/browser/Options/Classes/TiltAnimation.js
12211
12172
 
@@ -12593,12 +12554,14 @@ async function loadWobbleUpdater(engine, refresh = true) {
12593
12554
 
12594
12555
 
12595
12556
 
12557
+
12596
12558
  async function loadFull(engine, refresh = true) {
12597
12559
  await loadDestroyUpdater(engine, false);
12598
12560
  await loadRollUpdater(engine, false);
12599
12561
  await loadTiltUpdater(engine, false);
12600
12562
  await loadTwinkleUpdater(engine, false);
12601
12563
  await loadWobbleUpdater(engine, false);
12564
+ await loadTextShape(engine, false);
12602
12565
  await loadExternalTrailInteraction(engine, false);
12603
12566
  await loadAbsorbersPlugin(engine, false);
12604
12567
  await loadEmittersPlugin(engine, false);