canvasparticles-js 3.6.6 → 3.6.7

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
@@ -339,7 +339,7 @@ const options = {
339
339
 
340
340
  ### Update options on the fly
341
341
 
342
- **Note:** The new option values are not validated, except for the options with a setter. Assigning invalid values will lead to unexpected behavior and system errors.
342
+ **Note:** The new option values are not validated, except for the options with a setter. Assigning invalid values will lead to unexpected behavior.
343
343
 
344
344
  #### Using the setter
345
345
 
@@ -350,12 +350,12 @@ These options require dedicated setters to ensure proper integration.
350
350
  - options.particles.color
351
351
 
352
352
  ```js
353
- const particles = new CanvasParticles(selector, options)
353
+ const instance = new CanvasParticles(selector, options)
354
354
 
355
355
  // Use the setters to update these specific options
356
- particles.setBackground('red')
357
- particles.setMouseConnectDistMult(0.8)
358
- particles.setParticleColor('hsl(149, 100%, 50%)')
356
+ instance.setBackground('red')
357
+ instance.setMouseConnectDistMult(0.8)
358
+ instance.setParticleColor('hsl(149, 100%, 50%)')
359
359
  ```
360
360
 
361
361
  #### Changing the particle count
@@ -366,12 +366,12 @@ After updating the following options, the number of particles is not automatical
366
366
  - options.particles.max
367
367
 
368
368
  ```js
369
- particles.options.particles.ppm = 100
370
- particles.options.particles.max = 300
369
+ instance.options.particles.ppm = 100
370
+ instance.options.particles.max = 300
371
371
 
372
372
  // Apply the changes using one of these methods:
373
- particles.newParticles() // Remove all particles and create the correct amount of new ones
374
- particles.matchParticleCount() // Add or remove some particles to match the count
373
+ instance.newParticles() // Remove all particles and create the correct amount of new ones
374
+ instance.matchParticleCount() // Add or remove some particles to match the count
375
375
  ```
376
376
 
377
377
  #### Modifying object properties
@@ -379,9 +379,9 @@ particles.matchParticleCount() // Add or remove some particles to match the coun
379
379
  **All** other options can be updated by modifying the `options` object properties, with changes taking immediate effect.
380
380
 
381
381
  ```js
382
- particles.options.mouse.interactionType = 0
383
- particles.options.particles.connectDist = 200
384
- particles.options.gravity.repulsive = 1
382
+ instance.options.mouse.interactionType = 0
383
+ instance.options.particles.connectDist = 200
384
+ instance.options.gravity.repulsive = 1
385
385
  ```
386
386
 
387
387
  #### Updating options object
@@ -390,7 +390,7 @@ To update all options for the same class, pass a new options object.
390
390
 
391
391
  ```js
392
392
  const options = { ... }
393
- particles.setOptions(options)
393
+ instance.setOptions(options)
394
394
  ```
395
395
 
396
396
  ## One pager example
@@ -9,7 +9,7 @@
9
9
  typeof self !== 'undefined' ? self : this,
10
10
  () =>
11
11
  class CanvasParticles {
12
- static version = '3.6.6'
12
+ static version = '3.6.7'
13
13
 
14
14
  // Mouse interaction with the particles.
15
15
  static interactionType = Object.freeze({
@@ -2,7 +2,7 @@
2
2
  // https://github.com/Khoeckman/canvasparticles-js/blob/main/LICENSE
3
3
 
4
4
  export default class CanvasParticles {
5
- static version = '3.6.6'
5
+ static version = '3.6.7'
6
6
 
7
7
  // Mouse interaction with the particles.
8
8
  static interactionType = Object.freeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvasparticles-js",
3
- "version": "3.6.6",
3
+ "version": "3.6.7",
4
4
  "description": "In an HTML canvas, a bunch of interactive particles connected with lines when they approach each other.",
5
5
  "main": "canvasParticles.js",
6
6
  "module": "canvasParticles.mjs",