Skip to content

Commit ddb1fed

Browse files
committed
build: improving docs
1 parent 147894b commit ddb1fed

8 files changed

Lines changed: 187 additions & 77 deletions

File tree

bundles/pjs/src/VincentGarreau/particles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ const defaultMinOpacity = 0,
119119
engine: InteractivityEngine,
120120
): {
121121
/**
122-
* @deprecated this method is obsolete, please use the new {@link Engine.dom | tsParticles.dom}
122+
* @deprecated this method is obsolete, please use the new `tsParticles.dom`
123123
* The particles.js compatibility dom array
124124
*/
125125
pJSDom: Container[];
126126

127127
/**
128-
* @deprecated this method is obsolete, please use the new {@link Engine.load | tsParticles.load}
128+
* @deprecated this method is obsolete, please use the new `tsParticles.load`
129129
* The particles.js compatibility instance
130130
*/
131131
particlesJS: IParticlesJS;
@@ -314,7 +314,7 @@ const defaultMinOpacity = 0,
314314

315315
/**
316316
* All the {@link Container} objects loaded
317-
* @deprecated this method is obsolete, please use the new {@link Engine.dom | tsParticles.dom}
317+
* @deprecated this method is obsolete, please use the new `tsParticles.dom`
318318
*/
319319
const pJSDom = engine.items;
320320

bundles/pjs/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ declare const __VERSION__: string;
1010

1111
declare global {
1212
/**
13-
* @deprecated this method is obsolete, please use the new {@link Engine.load | tsParticles.load}
13+
* @deprecated this method is obsolete, please use the new `tsParticles.load`
1414
* The particles.js compatibility object
1515
*/
1616
var Particles: typeof MBParticles,
1717
/**
18-
* @deprecated this method is obsolete, please use the new {@link Engine.dom | tsParticles.dom}
18+
* @deprecated this method is obsolete, please use the new `tsParticles.dom`
1919
* The particles.js compatibility dom array
2020
*/
2121
pJSDom: Container[],
2222
/**
23-
* @deprecated this method is obsolete, please use the new {@link Engine.load | tsParticles.load}
23+
* @deprecated this method is obsolete, please use the new `tsParticles.load`
2424
* The particles.js compatibility instance
2525
*/
2626
particlesJS: IParticlesJS;

interactions/external/pop/typedoc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"hideGenerator": true,
88
"out": "./docs",
99
"clarityId": "8q4bxin4tm",
10-
"carbonServe": "CEAI6KJL",
11-
"carbonPlacement": "particlesjsorg",
10+
"googleAdsId": "ca-pub-6401284988946422",
1211
"keywords": [
1312
"html",
1413
"css",
Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
{
2-
"projectDocuments": ["../markdown/**/*.md"],
3-
"entryPoints": ["./src/"],
4-
"entryPointStrategy": "expand",
5-
"name": "tsParticles Remove External Interaction",
6-
"includeVersion": true,
7-
"hideGenerator": true,
8-
"out": "./docs",
9-
"clarityId": "8q4bxin4tm",
10-
"carbonServe": "CEAI6KJL",
11-
"carbonPlacement": "particlesjsorg",
12-
"keywords": [
13-
"html",
14-
"css",
15-
"javascript",
16-
"typescript",
17-
"particles",
18-
"js",
19-
"ts",
20-
"jsx",
21-
"tsx",
22-
"canvas",
23-
"confetti",
24-
"fireworks",
25-
"animations",
26-
"react",
27-
"vue",
28-
"angular",
29-
"svelte",
30-
"libraries",
31-
"how",
32-
"to",
33-
"create",
34-
"add"
35-
],
36-
"validation": {
37-
"invalidLink": true,
38-
"notDocumented": true
39-
}
2+
"projectDocuments": ["../markdown/**/*.md"],
3+
"entryPoints": ["./src/"],
4+
"entryPointStrategy": "expand",
5+
"name": "tsParticles Remove External Interaction",
6+
"includeVersion": true,
7+
"hideGenerator": true,
8+
"out": "./docs",
9+
"clarityId": "8q4bxin4tm",
10+
"googleAdsId": "ca-pub-6401284988946422",
11+
"keywords": [
12+
"html",
13+
"css",
14+
"javascript",
15+
"typescript",
16+
"particles",
17+
"js",
18+
"ts",
19+
"jsx",
20+
"tsx",
21+
"canvas",
22+
"confetti",
23+
"fireworks",
24+
"animations",
25+
"react",
26+
"vue",
27+
"angular",
28+
"svelte",
29+
"libraries",
30+
"how",
31+
"to",
32+
"create",
33+
"add"
34+
],
35+
"validation": {
36+
"invalidLink": true,
37+
"notDocumented": true
38+
}
4039
}

markdown/Options.md

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# Options
22

3-
This page is a quick map of root options. For full type details, use the API reference too:
3+
This page is the main map for root options.
4+
5+
Use it to choose where to start, then jump to the detailed guides for each option group. For full type details, use the API reference too:
46

57
- <https://particles.js.org/docs/interfaces/tsParticles_Engine.Options_Interfaces_IOptions.IOptions.html>
68

9+
## Choose your configuration path
10+
11+
- **I want full manual control**: define `particles`, `interactivity`, and `background` yourself
12+
- **I want a quick object to inspect and edit**: start from `@tsparticles/configs`
13+
- **I want a ready effect first**: use a `preset` and then override only the fields you care about
14+
- **I need responsive behavior**: add `responsive` rules after your base config is stable
15+
716
## Minimal complete example
817

918
```json
@@ -35,12 +44,6 @@ This page is a quick map of root options. For full type details, use the API ref
3544
}
3645
```
3746

38-
## Choose your configuration path
39-
40-
- **I want a fast visual result**: start with `preset` and then override only key fields
41-
- **I want full control**: define `particles`, `interactivity`, and `background` manually
42-
- **I need responsive behavior**: add `responsive` rules after your base config is stable
43-
4447
## Most-used root options
4548

4649
| Property | Type | Example | Notes |
@@ -80,6 +83,46 @@ This page is a quick map of root options. For full type details, use the API ref
8083
- Particles: [Options/Particles](./Options/Particles.md)
8184
- Themes: [Options/Themes](./Options/Themes.md)
8285

86+
## Detailed guides for the most updated sections
87+
88+
### Interactivity
89+
90+
- [Click](./Options/Interactivity/Click.md)
91+
- [Hover](./Options/Interactivity/Hover.md)
92+
- [Div](./Options/Interactivity/Div.md)
93+
94+
### Particle visuals and behavior
95+
96+
- [Color](./Options/Particles/Color.md)
97+
- [Bounce](./Options/Particles/Bounce.md)
98+
- [Collisions](./Options/Particles/Collisions.md)
99+
- [Destroy](./Options/Particles/Destroy.md)
100+
- [Group](./Options/Particles/Group.md)
101+
- [Life](./Options/Particles/Life.md)
102+
- [Orbit](./Options/Particles/Orbit.md)
103+
- [Repulse](./Options/Particles/Repulse.md)
104+
- [Roll](./Options/Particles/Roll.md)
105+
- [Rotate](./Options/Particles/Rotate.md)
106+
- [Shadow](./Options/Particles/Shadow.md)
107+
- [Stroke](./Options/Particles/Stroke.md)
108+
- [Tilt](./Options/Particles/Tilt.md)
109+
- [Twinkle](./Options/Particles/Twinkle.md)
110+
- [Wobble](./Options/Particles/Wobble.md)
111+
- [ZIndex](./Options/Particles/ZIndex.md)
112+
113+
### Plugin-powered options
114+
115+
- [Absorbers](./Options/Plugins/Absorbers.md)
116+
- [Emitters](./Options/Plugins/Emitters.md)
117+
- [Infection](./Options/Plugins/Infection.md)
118+
- [Polygon Mask](./Options/Plugins/PolygonMask.md)
119+
120+
## Recommended starting sources
121+
122+
- Config objects: <https://github.com/tsparticles/tsparticles/blob/main/utils/configs/README.md>
123+
- Official presets and palettes: <https://github.com/tsparticles/presets>
124+
- Main getting-started guide: [Pages/index](./Pages/index.md)
125+
83126
## Common pitfalls
84127

85128
- Enabling plugin options (`emitters`, `absorbers`, `polygonMask`) without loading their packages
@@ -92,3 +135,4 @@ This page is a quick map of root options. For full type details, use the API ref
92135
- Color values and formats: [Color](./Color.md)
93136
- Runtime container management: [Container](./Container.md)
94137
- Official presets: <https://github.com/tsparticles/presets>
138+
- Config package: <https://github.com/tsparticles/tsparticles/blob/main/utils/configs/README.md>

markdown/Pages/index.md

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
# tsParticles
22

3-
Quick guide to understand what to use, where to find options, and how to start in a few minutes.
3+
Quick guide to choose the right package, find the right option reference, and start from presets, palettes, or ready-made configs in a few minutes.
44

5-
## Start here
5+
## Quick checklist
66

77
If this is your first time with tsParticles:
88

9-
1. Install a ready bundle (`@tsparticles/slim` in most cases)
10-
2. Load the bundle once
11-
3. Start an instance with `tsParticles.load(...)`
9+
1. Install `@tsparticles/engine`
10+
2. Pick one runtime path:
11+
- `@tsparticles/slim` for most production websites and apps
12+
- `@tsparticles/all` for prototypes, playgrounds, and full feature coverage
13+
- only the packages you need if you want a minimal custom build
14+
3. Load your chosen bundle once
15+
4. Start with one of these inputs:
16+
- manual options
17+
- a ready-made config from `@tsparticles/configs`
18+
- an official preset from the `tsparticles/presets` repository
19+
20+
## Minimal start example
1221

1322
```ts
1423
import { tsParticles } from "@tsparticles/engine";
@@ -41,14 +50,9 @@ await tsParticles.load({
4150
## Choose your quick-start path
4251

4352
- **I need a production-ready default**: `@tsparticles/slim`
44-
- **I need only core and custom plugins**: `@tsparticles/engine`
53+
- **I need only core plus custom plugins**: `@tsparticles/engine`
4554
- **I need every feature for quick prototyping**: `@tsparticles/all`
46-
47-
## Common pitfalls
48-
49-
- Calling `tsParticles.load(...)` before loading bundle features
50-
- Using an `id` that does not exist in the DOM
51-
- Mixing too many presets/options in the first iteration
55+
- **I want a ready visual starting point**: use `@tsparticles/configs` or an official preset first
5256

5357
## Quick documentation map
5458

@@ -58,18 +62,68 @@ await tsParticles.load({
5862
- Plugins, custom shapes, custom presets: [Plugins](../Plugins.md)
5963
- Migration from particles.js: [pjsMigration](../pjsMigration.md)
6064

65+
## Detailed option guides
66+
67+
- Canvas and global behavior: [Background](../Options/Background.md), [Background Mask](../Options/BackgroundMask.md), [Full Screen](../Options/FullScreen.md), [Motion](../Options/Motion.md)
68+
- Interactivity: [Interactivity](../Options/Interactivity.md), [Click](../Options/Interactivity/Click.md), [Hover](../Options/Interactivity/Hover.md), [Div](../Options/Interactivity/Div.md)
69+
- Particle behavior: [Particles](../Options/Particles.md), [Color](../Options/Particles/Color.md), [Collisions](../Options/Particles/Collisions.md), [Life](../Options/Particles/Life.md), [Orbit](../Options/Particles/Orbit.md)
70+
- Plugin-driven options: [Absorbers](../Options/Plugins/Absorbers.md), [Emitters](../Options/Plugins/Emitters.md), [Infection](../Options/Plugins/Infection.md), [Polygon Mask](../Options/Plugins/PolygonMask.md)
71+
72+
## Ready-made starting sources
73+
74+
### Configs (`@tsparticles/configs`)
75+
76+
Use configs when you want a concrete example object you can inspect and modify directly.
77+
78+
- Package README: <https://github.com/tsparticles/tsparticles/blob/main/utils/configs/README.md>
79+
- Typical use case: copy a working config, then tune particles, interactivity, and visuals step by step
80+
81+
### Presets
82+
83+
Use presets when you want a reusable effect name such as `stars`, `fireworks`, or `confetti`.
84+
85+
- Repository: <https://github.com/tsparticles/presets>
86+
- Demo catalog: <https://particles.js.org/samples/presets/>
87+
88+
Main preset catalog:
89+
90+
- Ambient
91+
- Big Circles
92+
- Bubbles
93+
- Confetti
94+
- Confetti Cannon
95+
- Confetti Explosions
96+
- Confetti Falling
97+
- Confetti Parade
98+
- Fire
99+
- Firefly
100+
- Fireworks
101+
- Fountain
102+
- Hyperspace
103+
- Links
104+
- Sea Anemone
105+
- Snow
106+
- Squares
107+
- Stars
108+
- Triangles
109+
110+
### Palettes
111+
112+
Use palettes when you already have the behavior you want and only need a reusable color direction.
113+
114+
- Repository directory: <https://github.com/tsparticles/presets/tree/main/palettes>
115+
- Palette-based demos: <https://particles.js.org/samples/presets/>
116+
61117
## Bundle choice
62118

63119
- `@tsparticles/basic`: simple use cases and reduced payload
64120
- `@tsparticles/slim`: recommended choice for most websites and apps
65121
- `tsparticles`: complete bundle with many extensions
66122
- `@tsparticles/all`: includes everything (useful for prototypes/playgrounds)
67123

68-
## Ready-to-use presets
69-
70-
If you want to start without configuring everything manually, use official presets:
71-
72-
- Repository: <https://github.com/tsparticles/presets>
73-
- Demo catalog: <https://particles.js.org/samples/presets/>
124+
## Common pitfalls
74125

75-
Presets are great to start fast and then customize only the options you need.
126+
- Calling `tsParticles.load(...)` before loading bundle or preset features
127+
- Using an `id` that does not exist in the DOM
128+
- Assuming configs or presets also load the runtime plugins they depend on
129+
- Mixing too many presets/options in the first iteration instead of starting from one stable base

markdown/Plugins.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ tsParticles can be extended with plugins, custom shapes, and custom presets.
44

55
This page provides a practical flow to build extensions that users can reuse easily.
66

7+
## Choose your extension path
8+
9+
- **Custom shape**: when you need a new particle drawing primitive
10+
- **Custom preset**: when you want to reuse the same effect across many projects
11+
- **Plugin**: when you need new runtime behavior, interactions, or rendering logic
12+
713
## Before you start
814

915
- Register shape/preset before calling `tsParticles.load(...)`
1016
- Use a unique name (for example, with a project prefix)
1117
- Always document a minimal configuration example
18+
- If you are starting from an existing demo object, keep that config as a fixture while developing your extension
1219

1320
## Create a custom shape
1421

@@ -111,8 +118,16 @@ Preset usage:
111118
- For presets: use the `tsparticles-preset` tag
112119
- Include in README: installation, registration snippet, config snippet
113120

121+
## Reuse strategy
122+
123+
- Start from `@tsparticles/configs` if you need a concrete object to evolve into a preset
124+
- Start from the official presets repository if you need a ready effect close to your target result
125+
- Use palettes when behavior is already correct and only the color identity should change
126+
114127
## Related resources
115128

116129
- Official presets: <https://github.com/tsparticles/presets>
130+
- Official palettes: <https://github.com/tsparticles/presets/tree/main/palettes>
131+
- Demo configs: <https://github.com/tsparticles/tsparticles/blob/main/utils/configs/README.md>
117132
- Root options: [Options](./Options.md)
118133
- Docs introduction: [Pages/index](./Pages/index.md)

0 commit comments

Comments
 (0)