own-the-canvas 1.0.4 → 1.0.5

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.
Files changed (83) hide show
  1. package/README.md +185 -187
  2. package/dist/components/AntColony/AntColony.d.ts +42 -0
  3. package/dist/components/AntColony/index.d.ts +2 -0
  4. package/dist/components/AntColony/useAntColony.d.ts +22 -0
  5. package/dist/components/AuroraBorealis/AuroraBorealis.d.ts +27 -0
  6. package/dist/components/AuroraBorealis/index.d.ts +2 -0
  7. package/dist/components/AuroraBorealis/useAuroraBorealis.d.ts +14 -0
  8. package/dist/components/CrystalGrowth/CrystalGrowth.d.ts +37 -0
  9. package/dist/components/CrystalGrowth/index.d.ts +3 -0
  10. package/dist/components/CrystalGrowth/useCrystalGrowth.d.ts +20 -0
  11. package/dist/components/DiffusionAggregation/DiffusionAggregation.d.ts +42 -0
  12. package/dist/components/DiffusionAggregation/index.d.ts +3 -0
  13. package/dist/components/DiffusionAggregation/useDiffusionAggregation.d.ts +17 -0
  14. package/dist/components/FireEffect/FireEffect.d.ts +1 -1
  15. package/dist/components/GameOfLife/GameOfLife.d.ts +13 -0
  16. package/dist/components/GameOfLife/index.d.ts +1 -1
  17. package/dist/components/InkBleed/InkBleed.d.ts +36 -0
  18. package/dist/components/InkBleed/index.d.ts +2 -0
  19. package/dist/components/InkBleed/useInkBleed.d.ts +19 -0
  20. package/dist/components/Kaleidoscope/Kaleidoscope.d.ts +29 -0
  21. package/dist/components/Kaleidoscope/index.d.ts +2 -0
  22. package/dist/components/Kaleidoscope/useKaleidoscope.d.ts +15 -0
  23. package/dist/components/LSystem/LSystem.d.ts +33 -0
  24. package/dist/components/LSystem/index.d.ts +2 -0
  25. package/dist/components/LSystem/useLSystem.d.ts +17 -0
  26. package/dist/components/Lissajous/Lissajous.d.ts +40 -0
  27. package/dist/components/Lissajous/index.d.ts +3 -0
  28. package/dist/components/Lissajous/useLissajous.d.ts +21 -0
  29. package/dist/components/MagneticField/MagneticField.d.ts +38 -0
  30. package/dist/components/MagneticField/index.d.ts +2 -0
  31. package/dist/components/MagneticField/useMagneticField.d.ts +20 -0
  32. package/dist/components/MatrixRain/MatrixRain.d.ts +9 -0
  33. package/dist/components/MatrixRain/index.d.ts +1 -1
  34. package/dist/components/Metaballs/Metaballs.d.ts +32 -0
  35. package/dist/components/Metaballs/index.d.ts +2 -0
  36. package/dist/components/Metaballs/useMetaballs.d.ts +17 -0
  37. package/dist/components/NeuralWeb/NeuralWeb.d.ts +42 -0
  38. package/dist/components/NeuralWeb/index.d.ts +2 -0
  39. package/dist/components/NeuralWeb/useNeuralWeb.d.ts +22 -0
  40. package/dist/components/ParticleText/ParticleText.d.ts +38 -0
  41. package/dist/components/ParticleText/index.d.ts +2 -0
  42. package/dist/components/ParticleText/useParticleText.d.ts +20 -0
  43. package/dist/components/PendulaWave/PendulaWave.d.ts +41 -0
  44. package/dist/components/PendulaWave/index.d.ts +3 -0
  45. package/dist/components/PendulaWave/usePendulaWave.d.ts +22 -0
  46. package/dist/components/Rain/Rain.d.ts +3 -3
  47. package/dist/components/ReactionDiffusion/ReactionDiffusion.d.ts +29 -0
  48. package/dist/components/ReactionDiffusion/index.d.ts +2 -0
  49. package/dist/components/ReactionDiffusion/useReactionDiffusion.d.ts +15 -0
  50. package/dist/components/SandSimulation/SandSimulation.d.ts +30 -0
  51. package/dist/components/SandSimulation/index.d.ts +3 -0
  52. package/dist/components/SandSimulation/useSandSimulation.d.ts +16 -0
  53. package/dist/components/Shockwave/Shockwave.d.ts +1 -1
  54. package/dist/components/SlimeMold/SlimeMold.d.ts +37 -0
  55. package/dist/components/SlimeMold/index.d.ts +2 -0
  56. package/dist/components/SlimeMold/useSlimeMold.d.ts +19 -0
  57. package/dist/components/Spirograph/Spirograph.d.ts +42 -0
  58. package/dist/components/Spirograph/index.d.ts +3 -0
  59. package/dist/components/Spirograph/useSpirograph.d.ts +22 -0
  60. package/dist/components/Spotlight/Spotlight.d.ts +15 -1
  61. package/dist/components/Spotlight/index.d.ts +1 -1
  62. package/dist/components/TerrainMesh/TerrainMesh.d.ts +42 -0
  63. package/dist/components/TerrainMesh/index.d.ts +2 -0
  64. package/dist/components/TerrainMesh/useTerrainMesh.d.ts +22 -0
  65. package/dist/components/VoronoiCells/VoronoiCells.d.ts +32 -0
  66. package/dist/components/VoronoiCells/index.d.ts +3 -0
  67. package/dist/components/VoronoiCells/useVoronoiCells.d.ts +17 -0
  68. package/dist/components/WatercolorBloom/WatercolorBloom.d.ts +38 -0
  69. package/dist/components/WatercolorBloom/index.d.ts +2 -0
  70. package/dist/components/WatercolorBloom/useWatercolorBloom.d.ts +20 -0
  71. package/dist/components/WaveInterference/WaveInterference.d.ts +37 -0
  72. package/dist/components/WaveInterference/index.d.ts +2 -0
  73. package/dist/components/WaveInterference/useWaveInterference.d.ts +15 -0
  74. package/dist/index.cjs.js +1 -1
  75. package/dist/index.d.ts +42 -2
  76. package/dist/index.es.js +7402 -2944
  77. package/dist/robots.txt +4 -0
  78. package/dist/sitemap.xml +168 -0
  79. package/package.json +1 -1
  80. package/dist/components/RippleEffect/RippleEffect.d.ts +0 -33
  81. package/dist/components/RippleEffect/RippleEffect.stories.d.ts +0 -7
  82. package/dist/components/RippleEffect/index.d.ts +0 -2
  83. package/dist/components/RippleEffect/useRippleEffect.d.ts +0 -17
package/README.md CHANGED
@@ -1,19 +1,29 @@
1
1
  <p align="left">
2
- <img src="https://raw.githubusercontent.com/jabid-19/own-the-canvas/main/.github/assets/logo.png" alt="own-the-canvas logo" width="120" />
2
+ <img src="https://raw.githubusercontent.com/jabid-19/own-the-canvas/main/.github/assets/logo.png" alt="own-the-canvas logo" width="100" />
3
3
  </p>
4
4
 
5
5
  # own-the-canvas
6
6
 
7
- Beautiful, responsive, fully customizable HTML canvas–based React visual components. Zero dependencies. TypeScript.
7
+ **52 canvas-based React visual components. Zero dependencies. TypeScript.**
8
+
9
+ [![npm version](https://img.shields.io/npm/v/own-the-canvas?style=flat-square&color=555555)](https://www.npmjs.com/package/own-the-canvas)
10
+ [![license](https://img.shields.io/npm/l/own-the-canvas?style=flat-square&color=555555)](LICENSE)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-555555?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org)
12
+ [![zero deps](https://img.shields.io/badge/dependencies-0-555555?style=flat-square)](https://www.npmjs.com/package/own-the-canvas)
13
+ [![React](https://img.shields.io/badge/React-18%2B-555555?style=flat-square&logo=react&logoColor=white)](https://react.dev)
8
14
 
9
15
  ![own-the-canvas cover](https://raw.githubusercontent.com/jabid-19/own-the-canvas/main/.github/assets/cover.png)
10
16
 
17
+ ---
18
+
11
19
  ## Install
12
20
 
13
21
  ```bash
14
22
  npm install own-the-canvas
15
23
  # or
16
24
  pnpm add own-the-canvas
25
+ # or
26
+ yarn add own-the-canvas
17
27
  ```
18
28
 
19
29
  > **Peer deps:** React 18+
@@ -22,300 +32,288 @@ pnpm add own-the-canvas
22
32
 
23
33
  ## Quick Start
24
34
 
35
+ Every component fills its parent container by default. Drop it in and it works.
36
+
25
37
  ```tsx
26
- import { MatrixRain, ParticleField, Starfield } from "own-the-canvas";
38
+ import { DragonCursor, MatrixRain, ParticleText } from "own-the-canvas";
27
39
 
28
40
  export default function App() {
29
41
  return (
30
42
  <div style={{ width: "100vw", height: "100vh" }}>
31
- <MatrixRain color="#00ff41" glowEffect />
43
+ <MatrixRain preset="cyberpunk" />
32
44
  </div>
33
45
  );
34
46
  }
35
47
  ```
36
48
 
37
- All components default to `width: "100%"` and `height: "100%"` so they fill their parent.
49
+ All components accept a `preset` prop for instant themed defaults — override any individual prop on top.
38
50
 
39
51
  ---
40
52
 
41
- ## Components
53
+ ## Featured Components
42
54
 
43
- ### MatrixRain
55
+ ### DragonCursor
44
56
 
45
- Classic falling character rain effect.
57
+ A sinuous dragon body that trails your cursor in real time. Segments, wings, optional fire breath — all configurable.
58
+
59
+ **Presets:** `default · emerald · inferno · void · ice`
46
60
 
47
61
  ```tsx
48
- import { MatrixRain } from "own-the-canvas";
62
+ import { DragonCursor } from "own-the-canvas";
49
63
 
50
- <MatrixRain
51
- color="#00ff41"
52
- fontSize={16}
53
- speed={1}
54
- charset="katakana"
55
- glowEffect
56
- />;
64
+ <DragonCursor preset="inferno" segmentCount={24} showFire wingSpan={70} />
57
65
  ```
58
66
 
59
- | Prop | Type | Default | Description |
60
- | ----------------- | --------------------------------------------- | -------------------- | -------------------------------------- |
61
- | `color` | `string` | `"#00ff41"` | Character color |
62
- | `backgroundColor` | `string` | `"rgba(0,0,0,0.05)"` | Canvas background (use rgba for trail) |
63
- | `fontSize` | `number` | `16` | Character font size in px |
64
- | `speed` | `number` | `1` | Fall speed multiplier |
65
- | `charset` | `"katakana" \| "latin" \| "binary" \| string` | `"katakana"` | Character set |
66
- | `density` | `number` | `0.85` | Column density 0–1 |
67
- | `fadeStrength` | `number` | `0.05` | Trail fade 0–1 |
68
- | `glowEffect` | `boolean` | `true` | Neon glow |
67
+ | Prop | Type | Default | Description |
68
+ | --- | --- | --- | --- |
69
+ | `segmentCount` | `number` | `20` | Body segment count |
70
+ | `bodyColor` | `string` | `"#ffffff"` | Dragon body color |
71
+ | `wingSpan` | `number` | `60` | Wing span in px |
72
+ | `showFire` | `boolean` | `false` | Enable fire breath |
73
+ | `followSpeed` | `number` | `0.15` | Cursor follow lerp speed |
69
74
 
70
75
  ---
71
76
 
72
- ### ParticleField
77
+ ### MatrixRain
78
+
79
+ Falling character rain — katakana, latin, or binary. Per-column trail fade, variable speed, neon green or any color.
73
80
 
74
- Floating particles with optional connections and mouse repulsion.
81
+ **Presets:** `default · cyberpunk · binary · minimal · blood`
75
82
 
76
83
  ```tsx
77
- import { ParticleField } from "own-the-canvas";
78
-
79
- <ParticleField
80
- particleCount={120}
81
- particleColor="#7eb8f7"
82
- connectParticles
83
- interactive
84
- />;
84
+ import { MatrixRain } from "own-the-canvas";
85
+
86
+ <MatrixRain color="#00ff41" charset="katakana" fontSize={16} speed={20} />
85
87
  ```
86
88
 
87
- | Prop | Type | Default | Description |
88
- | ------------------ | --------- | --------------- | ---------------------------------- |
89
- | `particleCount` | `number` | `120` | Number of particles |
90
- | `particleColor` | `string` | `"#7eb8f7"` | Particle fill color |
91
- | `lineColor` | `string` | `"#7eb8f7"` | Connection line color |
92
- | `lineDistance` | `number` | `120` | Max distance for lines |
93
- | `particleSize` | `number` | `2.5` | Max particle radius |
94
- | `speed` | `number` | `0.8` | Movement speed |
95
- | `connectParticles` | `boolean` | `true` | Draw lines between close particles |
96
- | `interactive` | `boolean` | `true` | Repel on mouse move |
97
- | `backgroundColor` | `string` | `"transparent"` | Background color |
89
+ | Prop | Type | Default | Description |
90
+ | --- | --- | --- | --- |
91
+ | `color` | `string` | `"#ffffff"` | Character color |
92
+ | `charset` | `"latin" \| "binary" \| "katakana" \| string` | `"latin"` | Character set |
93
+ | `fontSize` | `number` | `14` | Font size in px |
94
+ | `speed` | `number` | `33` | Ms per frame — lower = faster |
95
+ | `backgroundColor` | `string` | `"rgba(17,17,17,0.1)"` | Per-frame overlay — controls trail length |
98
96
 
99
97
  ---
100
98
 
101
- ### Starfield
99
+ ### KoiPond
102
100
 
103
- 2D twinkle or 3D warp tunnel starfield.
101
+ Living koi pond on canvas — fish navigate with organic steering, ripple on hover, lily pads float, caustic light dances.
102
+
103
+ **Presets:** `default · koi · night · lotus · neon`
104
104
 
105
105
  ```tsx
106
- import { Starfield } from "own-the-canvas";
106
+ import { KoiPond } from "own-the-canvas";
107
107
 
108
- <Starfield starCount={200} perspective="3D" speed={2} shootingStars />;
108
+ <KoiPond preset="koi" fishCount={8} interactive showLilies caustics />
109
109
  ```
110
110
 
111
- | Prop | Type | Default | Description |
112
- | ---------------------- | -------------- | ----------- | ------------------------- |
113
- | `starCount` | `number` | `200` | Number of stars |
114
- | `starColor` | `string` | `"#ffffff"` | Star color |
115
- | `backgroundColor` | `string` | `"#000010"` | Background |
116
- | `speed` | `number` | `0.5` | Movement speed |
117
- | `twinkle` | `boolean` | `true` | Twinkle effect |
118
- | `shootingStars` | `boolean` | `true` | Shooting stars |
119
- | `shootingStarInterval` | `number` | `3000` | Ms between shooting stars |
120
- | `perspective` | `"2D" \| "3D"` | `"2D"` | Flat or warp tunnel |
111
+ | Prop | Type | Default | Description |
112
+ | --- | --- | --- | --- |
113
+ | `fishCount` | `number` | `6` | Number of koi fish |
114
+ | `fishColor` | `string` | `"#ffffff"` | Fish body color |
115
+ | `showLilies` | `boolean` | `true` | Render floating lily pads |
116
+ | `caustics` | `boolean` | `true` | Caustic light shimmer |
117
+ | `interactive` | `boolean` | `true` | React to mouse movement |
121
118
 
122
119
  ---
123
120
 
124
- ### FireEffect
121
+ ### FluidSimulation
125
122
 
126
- Pixel-level fire simulation with multiple palettes.
123
+ Real-time Navier-Stokes fluid solver. Move your mouse to inject velocity and ink — auto-bursts fire at intervals for continuous motion.
124
+
125
+ **Presets:** `default · ink · neon · lava · ocean · smoke`
127
126
 
128
127
  ```tsx
129
- import { FireEffect } from "own-the-canvas";
128
+ import { FluidSimulation } from "own-the-canvas";
130
129
 
131
- <FireEffect palette="inferno" intensity={0.95} />;
130
+ <FluidSimulation
131
+ preset="neon"
132
+ inkColors={["#ff00ff", "#00ffff", "#7700ff"]}
133
+ resolution={80}
134
+ />
132
135
  ```
133
136
 
134
- | Prop | Type | Default | Description |
135
- | --------------- | ------------------------------------------- | ----------- | -------------------- |
136
- | `palette` | `"inferno" \| "toxic" \| "ice" \| "plasma"` | `"inferno"` | Color theme |
137
- | `intensity` | `number` | `0.95` | Flame intensity 0–1 |
138
- | `windStrength` | `number` | `0.3` | Horizontal wind 0–1 |
139
- | `windDirection` | `number` | `1` | 1 = right, -1 = left |
140
- | `spread` | `number` | `0.7` | Flame spread 0–1 |
141
- | `cooling` | `number` | `0.3` | Cooling rate 0–1 |
137
+ | Prop | Type | Default | Description |
138
+ | --- | --- | --- | --- |
139
+ | `resolution` | `number` | `128` | Grid resolution 32–128 |
140
+ | `inkColors` | `string[]` | monochrome | Ink colors |
141
+ | `viscosity` | `number` | `0.0001` | Fluid viscosity |
142
+ | `autoInk` | `boolean` | `true` | Auto-inject ink bursts |
143
+ | `mouseForce` | `number` | `5` | Mouse velocity force multiplier |
142
144
 
143
145
  ---
144
146
 
145
- ### AudioVisualizer
147
+ ### FlowField
146
148
 
147
- Web Audio API visualizer with 4 modes.
149
+ Perlin noise vector field guiding 800 particle streams. Enable `curl` for swirling, organic motion. Builds layered ink-like compositions over time.
148
150
 
149
- ```tsx
150
- import { AudioVisualizer } from "own-the-canvas";
151
-
152
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
151
+ **Presets:** `default · neon · ocean · lava · forest · monochrome`
153
152
 
154
- <AudioVisualizer audioSource={stream} mode="bars" barCount={64} gradient />;
153
+ ```tsx
154
+ import { FlowField } from "own-the-canvas";
155
+
156
+ <FlowField
157
+ preset="ocean"
158
+ particleCount={1200}
159
+ curl
160
+ noiseScale={0.003}
161
+ />
155
162
  ```
156
163
 
157
- | Prop | Type | Default | Description |
158
- | ---------------- | -------------------------------------------- | ----------- | ---------------------------------------- |
159
- | `audioSource` | `MediaStream \| null` | `null` | Audio stream (shows idle anim when null) |
160
- | `barCount` | `number` | `64` | Number of frequency bars |
161
- | `barColor` | `string` | `"#00cfff"` | Bar fill color |
162
- | `waveColor` | `string` | `"#00cfff"` | Wave stroke color |
163
- | `mode` | `"bars" \| "wave" \| "circular" \| "mirror"` | `"bars"` | Visualization mode |
164
- | `sensitivity` | `number` | `1` | Amplitude multiplier |
165
- | `gapBetweenBars` | `number` | `2` | Gap between bars (px) |
166
- | `rounded` | `boolean` | `true` | Rounded bar caps |
167
- | `gradient` | `boolean` | `true` | Color gradient on bars |
164
+ | Prop | Type | Default | Description |
165
+ | --- | --- | --- | --- |
166
+ | `particleCount` | `number` | `800` | Number of flow particles |
167
+ | `colors` | `string[]` | monochrome | Particle stroke colors |
168
+ | `noiseScale` | `number` | `0.004` | Noise scale — lower = larger structures |
169
+ | `curl` | `boolean` | `false` | Add curl noise for swirling flow |
170
+ | `speed` | `number` | `1` | Flow speed multiplier |
168
171
 
169
172
  ---
170
173
 
171
- ### Confetti
174
+ ### GlitchOverlay
175
+
176
+ Digital glitch effect with RGB channel separation, CRT scanlines, block-slice artifacts, and film noise. Designed as an absolute-positioned overlay — zero configuration required.
172
177
 
173
- Burst or continuous confetti cannon.
178
+ **Presets:** `default · crt · cyberpunk · subtle · corrupt`
174
179
 
175
180
  ```tsx
176
- import { Confetti } from 'own-the-canvas';
177
- const [fire, setFire] = useState(false);
181
+ import { GlitchOverlay } from "own-the-canvas";
178
182
 
179
- <Confetti trigger={fire} particleCount={150} />
180
- <button onClick={() => { setFire(false); setTimeout(() => setFire(true), 50); }}>
181
- 🎉
182
- </button>
183
+ <div style={{ position: "relative" }}>
184
+ <YourContent />
185
+ <GlitchOverlay preset="cyberpunk" intensity={0.8} rgbShift={12} />
186
+ </div>
183
187
  ```
184
188
 
185
- | Prop | Type | Default | Description |
186
- | --------------- | ----------------- | ----------- | ----------------------------- |
187
- | `trigger` | `boolean` | `false` | Rising edge fires a burst |
188
- | `particleCount` | `number` | `150` | Pieces per burst |
189
- | `spread` | `number` | `0.8` | Spread angle 0–1 |
190
- | `gravity` | `number` | `0.5` | Gravity strength |
191
- | `colors` | `string[]` | multi-color | Confetti colors |
192
- | `shapes` | `ConfettiShape[]` | all shapes | Shapes to include |
193
- | `duration` | `number` | `4000` | Piece lifetime (ms) |
194
- | `continuous` | `boolean` | `false` | Trickle while trigger is true |
195
- | `wind` | `number` | `0.5` | Horizontal wind |
189
+ | Prop | Type | Default | Description |
190
+ | --- | --- | --- | --- |
191
+ | `intensity` | `number` | `0.6` | Glitch probability 0–1 |
192
+ | `rgbShift` | `number` | `8` | RGB color shift in px |
193
+ | `scanlines` | `boolean` | `true` | CRT scanline overlay |
194
+ | `blockGlitch` | `boolean` | `true` | Block-slice glitch artifacts |
195
+ | `flickerRate` | `number` | `0.02` | Screen flicker rate 0–1 |
196
196
 
197
197
  ---
198
198
 
199
- ### RippleEffect
199
+ ### BubbleUniverse
200
200
 
201
- Expanding ring ripples on click or auto.
201
+ Physics-based soap bubbles that float, collide, merge on contact, and pop on click. Iridescent shimmer and glow included.
202
+
203
+ **Presets:** `default · soap · neon · deep · minimal`
202
204
 
203
205
  ```tsx
204
- import { RippleEffect } from "own-the-canvas";
206
+ import { BubbleUniverse } from "own-the-canvas";
205
207
 
206
- <RippleEffect color="#00cfff" maxRadius={150} interactive />;
208
+ <BubbleUniverse preset="soap" bubbleCount={20} mergeOnCollide glowEffect />
207
209
  ```
208
210
 
209
- | Prop | Type | Default | Description |
210
- | ----------------- | --------- | --------------- | ----------------------------------- |
211
- | `color` | `string` | `"#00cfff"` | Ring stroke color |
212
- | `maxRadius` | `number` | `150` | Max ring radius |
213
- | `speed` | `number` | `2` | Expansion speed |
214
- | `lineWidth` | `number` | `1.5` | Stroke width |
215
- | `decay` | `number` | `0.8` | Opacity decay rate |
216
- | `multiRipple` | `boolean` | `true` | Allow multiple simultaneous ripples |
217
- | `backgroundColor` | `string` | `"transparent"` | Canvas background |
218
- | `interactive` | `boolean` | `true` | Spawn ripple on click |
211
+ | Prop | Type | Default | Description |
212
+ | --- | --- | --- | --- |
213
+ | `bubbleCount` | `number` | `15` | Number of bubbles |
214
+ | `mergeOnCollide` | `boolean` | `true` | Bubbles merge on collision |
215
+ | `popEffect` | `boolean` | `true` | Pop animation on click |
216
+ | `glowEffect` | `boolean` | `true` | Glow on bubbles |
217
+ | `gravity` | `number` | `0.02` | Gravity strength |
219
218
 
220
219
  ---
221
220
 
222
- ### NoiseGradient
221
+ ### Rain
222
+
223
+ Falling rain streaks with sinusoidal wind drift and splash particles on ground impact. Great as a layered overlay.
223
224
 
224
- Animated Perlin noise–driven color gradient.
225
+ **Presets:** `default · storm · drizzle · neon · golden`
225
226
 
226
227
  ```tsx
227
- import { NoiseGradient } from "own-the-canvas";
228
-
229
- <NoiseGradient
230
- colors={["#0d0221", "#2d1b69", "#11998e", "#38ef7d"]}
231
- speed={0.3}
232
- octaves={3}
233
- animated
234
- />;
228
+ import { Rain } from "own-the-canvas";
229
+
230
+ <Rain preset="storm" dropCount={400} wind={0.6} showSplashes />
235
231
  ```
236
232
 
237
- | Prop | Type | Default | Description |
238
- | ----------- | ---------- | --------------- | ---------------------- |
239
- | `colors` | `string[]` | deep space | 2–5 hex gradient stops |
240
- | `speed` | `number` | `0.3` | Animation speed |
241
- | `scale` | `number` | `1` | Noise zoom level |
242
- | `octaves` | `number` | `3` | Fractal detail 1–6 |
243
- | `animated` | `boolean` | `true` | Enable animation |
244
- | `blendMode` | `string` | `"source-over"` | Canvas composite mode |
233
+ | Prop | Type | Default | Description |
234
+ | --- | --- | --- | --- |
235
+ | `dropCount` | `number` | `200` | Number of rain drops |
236
+ | `speed` | `number` | `15` | Drop fall speed px/frame |
237
+ | `wind` | `number` | `0.3` | Horizontal wind drift |
238
+ | `dropColor` | `string` | `"#000000"` | Drop stroke color |
239
+ | `showSplashes` | `boolean` | `true` | Splash particles on impact |
245
240
 
246
241
  ---
247
242
 
248
- ### PixelDissolve
243
+ ### FireEffect
249
244
 
250
- Pixelated dissolve transition overlay for any React content.
245
+ Pixel-level cellular automaton fire. Heat seeds at the bottom row, rises with cooling and wind drift, maps to a palette. Five color themes.
246
+
247
+ **Presets:** `default · inferno · toxic · ice · plasma`
251
248
 
252
249
  ```tsx
253
- import { PixelDissolve } from "own-the-canvas";
250
+ import { FireEffect } from "own-the-canvas";
254
251
 
255
- <PixelDissolve trigger={show} direction="out" pixelSize={8}>
256
- <YourComponent />
257
- </PixelDissolve>;
252
+ <FireEffect palette="inferno" intensity={0.95} windStrength={0.4} />
258
253
  ```
259
254
 
260
- | Prop | Type | Default | Description |
261
- | ------------ | ------------------------- | ----------- | ------------------------------ |
262
- | `children` | `ReactNode` | — | Content to dissolve over |
263
- | `pixelSize` | `number` | `8` | Block size in px |
264
- | `speed` | `number` | `0.5` | Animation speed 0–2 |
265
- | `direction` | `"in" \| "out" \| "both"` | `"out"` | Dissolve direction |
266
- | `trigger` | `boolean` | `false` | Rising edge triggers animation |
267
- | `color` | `string` | `"#0a0a0a"` | Pixel fill color |
268
- | `onComplete` | `() => void` | — | Called when animation finishes |
255
+ | Prop | Type | Default | Description |
256
+ | --- | --- | --- | --- |
257
+ | `palette` | `"smoke" \| "inferno" \| "toxic" \| "ice" \| "plasma"` | `"smoke"` | Color theme |
258
+ | `intensity` | `number` | `0.95` | Flame intensity 0–1 |
259
+ | `windStrength` | `number` | `0.3` | Horizontal wind -1 to 1 |
260
+ | `cooling` | `number` | `0.3` | Cooling rate — higher = shorter flames |
261
+ | `spread` | `number` | `0.7` | Flame spread 0–1 |
269
262
 
270
263
  ---
271
264
 
272
- ### ConstellationMap
265
+ ### ParticleText
273
266
 
274
- Draggable star constellation with animated connections.
267
+ Text rendered from thousands of particles — each springs to its position in the letterform. Mouse cursor repels them; they reform when it leaves.
275
268
 
276
- ```tsx
277
- import { ConstellationMap } from "own-the-canvas";
269
+ **Presets:** `default · neon · fire · frost · gold · minimal`
278
270
 
279
- <ConstellationMap starCount={80} lineColor="#8888ff" interactive glowStars />;
271
+ ```tsx
272
+ import { ParticleText } from "own-the-canvas";
273
+
274
+ <ParticleText
275
+ text="HELLO"
276
+ preset="neon"
277
+ fontSize={140}
278
+ repelRadius={100}
279
+ repelForce={8}
280
+ />
280
281
  ```
281
282
 
282
- | Prop | Type | Default | Description |
283
- | -------------------- | --------------------- | ----------- | ---------------------- |
284
- | `starCount` | `number` | `80` | Number of stars |
285
- | `starColor` | `string` | `"#ffffff"` | Star color |
286
- | `lineColor` | `string` | `"#8888ff"` | Connection line color |
287
- | `backgroundColor` | `string` | `"#050510"` | Background |
288
- | `speed` | `number` | `0.3` | Star drift speed |
289
- | `interactive` | `boolean` | `true` | Drag stars with mouse |
290
- | `lineStyle` | `"solid" \| "dashed"` | `"solid"` | Line style |
291
- | `glowStars` | `boolean` | `true` | Glow on stars |
292
- | `connectionDistance` | `number` | `100` | Max distance for lines |
283
+ | Prop | Type | Default | Description |
284
+ | --- | --- | --- | --- |
285
+ | `text` | `string` | `"hello"` | Text to render as particles |
286
+ | `fontSize` | `number` | `120` | Font size in px |
287
+ | `color` | `string` | `"#ffffff"` | Particle color |
288
+ | `repelRadius` | `number` | `80` | Mouse repulsion radius in px |
289
+ | `repelForce` | `number` | `5` | Mouse repulsion force |
290
+ | `snapSpeed` | `number` | `0.12` | Spring constant for snap-to-target |
293
291
 
294
292
  ---
295
293
 
296
- ## Base Props (all components)
294
+ ## Base Props
297
295
 
298
- Every component accepts these:
296
+ Every component accepts these props:
299
297
 
300
- | Prop | Type | Default |
301
- | ----------- | --------------------- | -------- |
302
- | `width` | `number \| string` | `"100%"` |
303
- | `height` | `number \| string` | `"100%"` |
304
- | `className` | `string` | — |
305
- | `style` | `React.CSSProperties` | — |
298
+ | Prop | Type | Default | Description |
299
+ | --- | --- | --- | --- |
300
+ | `width` | `number \| string` | `"100%"` | Container width |
301
+ | `height` | `number \| string` | `"100%"` | Container height |
302
+ | `className` | `string` | — | CSS class on wrapper `<div>` |
303
+ | `style` | `React.CSSProperties` | — | Inline styles on wrapper `<div>` |
304
+ | `preset` | `string` | `"default"` | Named preset — sets themed defaults |
306
305
 
307
306
  All components use `forwardRef` — the ref is forwarded to the underlying `<canvas>` element.
308
307
 
309
308
  ---
310
309
 
311
- ## Tree-shaking
310
+ ## 42 More Components
312
311
 
313
- Import only what you use:
312
+ > Starfield · Fireworks · Boids · SlimeMold · GameOfLife · Kaleidoscope · ReactionDiffusion · AuroraBorealis · Spirograph · Lightning · ClothSimulation · VoronoiCells · NeuralWeb · Metaballs · AntColony · Wormhole · Mandala · MagneticBlob · WatercolorBloom · InkBleed · CrystalGrowth · SandSimulation · WaveInterference · LSystem · Lissajous · PendulaWave · DiffusionAggregation · TerrainMesh · MagneticField · Spotlight · Shockwave · Confetti · RippleEffect · NoiseGradient · PixelDissolve · AudioVisualizer · ParticleField · LiveChart · GalaxySpiral · SolarFlare · TornadoVortex · SakuraBlossom
314
313
 
315
- ```tsx
316
- import { MatrixRain } from "own-the-canvas"; // ✓ only MatrixRain bundled
317
- import { ParticleField } from "own-the-canvas"; // ✓ only ParticleField bundled
318
- ```
314
+ Full docs, live previews, and interactive playground:
315
+
316
+ **[own-the-canvas.vercel.app](https://own-the-canvas.vercel.app)**
319
317
 
320
318
  ---
321
319
 
@@ -0,0 +1,42 @@
1
+ import { BaseCanvasProps } from '../../types';
2
+
3
+ type AntColonyPreset = "default" | "neon" | "desert" | "jungle" | "minimal" | "swarm";
4
+ export interface AntColonyProps extends BaseCanvasProps {
5
+ /** Number of ants (default: 150) */
6
+ antCount?: number;
7
+ /** Pheromone decay per frame (default: 0.003) */
8
+ evaporationRate?: number;
9
+ /** Pheromone spread to neighbors (default: 0.1) */
10
+ diffusionRate?: number;
11
+ /** Pheromone deposited per step (default: 5) */
12
+ pheromoneStrength?: number;
13
+ /** Pixels per frame per ant (default: 1.5) */
14
+ antSpeed?: number;
15
+ /** Ant sensor angle offset in radians (default: 0.4) */
16
+ sensorAngle?: number;
17
+ /** Pheromone sensor lookahead in px (default: 6) */
18
+ sensorDistance?: number;
19
+ /** Max turn per frame in radians (default: 0.3) */
20
+ turnSpeed?: number;
21
+ /** Ant dot color (default: "#ffffff") */
22
+ antColor?: string;
23
+ /** Pheromone trail color (default: "#6b7280") */
24
+ pheromoneColor?: string;
25
+ /** Food source color (default: "#4ade80") */
26
+ foodColor?: string;
27
+ /** Nest color (default: "#f59e0b") */
28
+ nestColor?: string;
29
+ /** Canvas background (default: "#111111") */
30
+ backgroundColor?: string;
31
+ /** Pheromone grid resolution (default: 0.5) */
32
+ resolution?: number;
33
+ /** Enable animation (default: true) */
34
+ animated?: boolean;
35
+ /** Click to place food (default: true) */
36
+ interactive?: boolean;
37
+ /** Max simultaneous food sources (default: 5) */
38
+ maxFood?: number;
39
+ preset?: AntColonyPreset | string;
40
+ }
41
+ export declare const AntColony: import('react').ForwardRefExoticComponent<AntColonyProps & import('react').RefAttributes<HTMLCanvasElement>>;
42
+ export {};
@@ -0,0 +1,2 @@
1
+ export { AntColony } from './AntColony';
2
+ export type { AntColonyProps } from './AntColony';
@@ -0,0 +1,22 @@
1
+ import { RefObject } from 'react';
2
+
3
+ export interface UseAntColonyOptions {
4
+ antCount: number;
5
+ evaporationRate: number;
6
+ diffusionRate: number;
7
+ pheromoneStrength: number;
8
+ antSpeed: number;
9
+ sensorAngle: number;
10
+ sensorDistance: number;
11
+ turnSpeed: number;
12
+ antColor: string;
13
+ pheromoneColor: string;
14
+ foodColor: string;
15
+ nestColor: string;
16
+ backgroundColor: string;
17
+ resolution: number;
18
+ animated: boolean;
19
+ interactive: boolean;
20
+ maxFood: number;
21
+ }
22
+ export declare function useAntColony(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseAntColonyOptions): void;
@@ -0,0 +1,27 @@
1
+ import { BaseCanvasProps } from '../../types';
2
+
3
+ type AuroraBorealisPreset = "default" | "arctic" | "solar" | "tropical" | "neon" | "midnight";
4
+ export interface AuroraBorealisProps extends BaseCanvasProps {
5
+ /** Aurora band colors (default: monochrome whites/grays) */
6
+ colors?: string[];
7
+ /** Animation speed multiplier (default: 1) */
8
+ speed?: number;
9
+ /** Band brightness/opacity 0–1 (default: 0.8) */
10
+ intensity?: number;
11
+ /** Number of aurora layers (default: 5) */
12
+ layers?: number;
13
+ /** Sky background color (default: "#111111") */
14
+ backgroundColor?: string;
15
+ /** Wave height as fraction of canvas height (default: 0.15) */
16
+ waveAmplitude?: number;
17
+ /** Wave oscillations across canvas width (default: 2) */
18
+ waveFrequency?: number;
19
+ /** Background star count (default: 80) */
20
+ starCount?: number;
21
+ /** Enable animation (default: true) */
22
+ animated?: boolean;
23
+ /** Named preset */
24
+ preset?: AuroraBorealisPreset | string;
25
+ }
26
+ export declare const AuroraBorealis: import('react').ForwardRefExoticComponent<AuroraBorealisProps & import('react').RefAttributes<HTMLCanvasElement>>;
27
+ export {};
@@ -0,0 +1,2 @@
1
+ export { AuroraBorealis } from './AuroraBorealis';
2
+ export type { AuroraBorealisProps } from './AuroraBorealis';
@@ -0,0 +1,14 @@
1
+ import { RefObject } from 'react';
2
+
3
+ export interface UseAuroraBorealisOptions {
4
+ colors: string[];
5
+ speed: number;
6
+ intensity: number;
7
+ layers: number;
8
+ backgroundColor: string;
9
+ waveAmplitude: number;
10
+ waveFrequency: number;
11
+ starCount: number;
12
+ animated: boolean;
13
+ }
14
+ export declare function useAuroraBorealis(canvasRef: RefObject<HTMLCanvasElement | null>, options: UseAuroraBorealisOptions): void;