@sarthak03dot/romantic-animations 1.2.0 โ 1.2.3
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 +332 -327
- package/dist/romantic-animations.es.js.map +1 -1
- package/dist/romantic-animations.umd.js.map +1 -1
- package/package.json +54 -54
- package/src/animations/butterfly.js +92 -92
- package/src/animations/confetti.js +92 -92
- package/src/animations/fireworks.js +112 -112
- package/src/animations/floatingHearts.js +89 -89
- package/src/animations/floatingOrbs.js +76 -76
- package/src/animations/heartBurst.js +113 -113
- package/src/animations/heartTrail.js +85 -85
- package/src/animations/loveRain.js +71 -71
- package/src/animations/magicDust.js +87 -87
- package/src/animations/shootingStars.js +82 -82
- package/src/animations/sparkles.js +93 -93
- package/src/animations/starField.js +100 -100
- package/src/core/engine.js +77 -77
- package/src/index.js +224 -224
package/README.md
CHANGED
|
@@ -1,327 +1,332 @@
|
|
|
1
|
-
# ๐ Romantic Animations v1.2.0
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<b>A premium, lightweight, zero-dependency JavaScript canvas particle library for gorgeous romantic & celebratory effects.</b>
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
Perfect for Valentine's Day, weddings, anniversaries, landing pages, or any celebratory web application needing high-quality hardware-accelerated visual particle overlays.
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/@sarthak03dot/romantic-animations">
|
|
13
|
-
<img src="https://img.shields.io/npm/v/@sarthak03dot/romantic-animations.svg" alt="NPM Version" />
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://opensource.org/licenses/MIT">
|
|
16
|
-
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" />
|
|
17
|
-
</a>
|
|
18
|
-
<a href="https://sarthak03dot.github.io/romantic-animations/">
|
|
19
|
-
<img src="https://img.shields.io/badge/Demo-Interactive%20Showcase-ff4d6d.svg" alt="Interactive Showcase" />
|
|
20
|
-
</a>
|
|
21
|
-
</p>
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<h3
|
|
38
|
-
<img
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* **
|
|
82
|
-
*
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
* **
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
|
269
|
-
|
|
|
270
|
-
| `
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
```bash
|
|
309
|
-
npm run
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
1
|
+
# ๐ Romantic Animations v1.2.0
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<b>A premium, lightweight, zero-dependency JavaScript canvas particle library for gorgeous romantic & celebratory effects.</b>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Perfect for Valentine's Day, weddings, anniversaries, landing pages, or any celebratory web application needing high-quality hardware-accelerated visual particle overlays.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/@sarthak03dot/romantic-animations">
|
|
13
|
+
<img src="https://img.shields.io/npm/v/@sarthak03dot/romantic-animations.svg" alt="NPM Version" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://opensource.org/licenses/MIT">
|
|
16
|
+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://sarthak03dot.github.io/romantic-animations/">
|
|
19
|
+
<img src="https://img.shields.io/badge/Demo-Interactive%20Showcase-ff4d6d.svg" alt="Interactive Showcase" />
|
|
20
|
+
</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Live Demo
|
|
26
|
+
|
|
27
|
+
[](https://sarthak03dot.github.io/romantic-animations/)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Gallery & Screenshots (Placeholder Previews)
|
|
32
|
+
|
|
33
|
+
Here is a sneak peek at the gorgeous, performance-tuned particle renderers in action.
|
|
34
|
+
*(You can swap these placeholders with your actual screenshots in `docs/screenshots/`)*
|
|
35
|
+
|
|
36
|
+
<div align="center">
|
|
37
|
+
<h3>โจ Floating Hearts & Live Tweaks</h3>
|
|
38
|
+
<img width="1874" height="859" alt="Image" src="https://github.com/user-attachments/assets/08516f1e-c943-4cc5-9749-78f13a6af47b" />
|
|
39
|
+
|
|
40
|
+
<h3>๐ Starry Fireworks Celebration</h3>
|
|
41
|
+
<img width="1880" height="853" alt="Image" src="https://github.com/user-attachments/assets/5642cd49-8908-417b-8cc0-12d00e8a6eda" />
|
|
42
|
+
|
|
43
|
+
<h3>๐ Integrated Live Customizer & Developer Portal</h3>
|
|
44
|
+
<img width="1864" height="855" alt="Image" src="https://github.com/user-attachments/assets/a676f240-0502-4cd7-896d-7ceb8994478c" />
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## ๐ Key Features
|
|
50
|
+
|
|
51
|
+
* ๐ **High Performance & Zero Dependencies**: Built directly on raw HTML5 `<canvas>` API with optimal mathematical loop calculations (`requestAnimationFrame`), keeping your bundle size extremely small.
|
|
52
|
+
* ๐ **Responsive Dual-Theme Customizer**: Fully styled and responsive landing page that seamlessly toggles between a neon-drenched **Dark Mode** and a clean, high-contrast **Light Mode** for accessibility.
|
|
53
|
+
* ๐ฑ **Touch & Mobile Optimizations**: Fully responsive drawer nav overlays, click-burst triggers for tapping screens, and custom mobile menu structures.
|
|
54
|
+
* ๐ **Collapsible Developer Portal**: Hash-routed playground switcher containing dynamic CDN, Vanilla, React, and Next.js SSR setups.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
## ๐ฆ Installation
|
|
58
|
+
|
|
59
|
+
To begin adding romantic canvas overlays to your codebase:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Using npm
|
|
63
|
+
npm install @sarthak03dot/romantic-animations
|
|
64
|
+
|
|
65
|
+
# Using pnpm
|
|
66
|
+
pnpm add @sarthak03dot/romantic-animations
|
|
67
|
+
|
|
68
|
+
# Using yarn
|
|
69
|
+
yarn add @sarthak03dot/romantic-animations
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## โจ Available Animations & API reference
|
|
75
|
+
|
|
76
|
+
Each animation function returns a unique **`sessionId`** string. Keep this reference to stop or update the animation loops when pages change.
|
|
77
|
+
|
|
78
|
+
### 1. `startFloatingHearts(container, options)`
|
|
79
|
+
Rises hearts from the bottom edge of the container that drift sideways via a sinusoidal wave.
|
|
80
|
+
* **Best for**: Romantic background ambient atmosphere.
|
|
81
|
+
* **Special options**:
|
|
82
|
+
* `count`: Particle spawning density multiplier (`0.01` to `1.0`, default `0.15`).
|
|
83
|
+
|
|
84
|
+
### 2. `startHeartTrail(container, options)`
|
|
85
|
+
Leaves a beautiful floating heart trail trailing directly behind the mouse pointer or fingertip touches.
|
|
86
|
+
* **Best for**: High-user-interaction sections.
|
|
87
|
+
* **Special options**:
|
|
88
|
+
* `maxSize`: Tail sizing bounds.
|
|
89
|
+
|
|
90
|
+
### 3. `startHeartBurst(container, options)`
|
|
91
|
+
Spawns explosive, colorful shockwaves of hearts, stars, or sparkles radiating outwards from a click/tap coordinate.
|
|
92
|
+
* **Best for**: Interactive buttons, click rewards, and anniversary triggers.
|
|
93
|
+
|
|
94
|
+
### 4. `startSparkles(container, options)`
|
|
95
|
+
Twinkling 4-point cross sparkles that gently float down, simulating glowing fairy dust.
|
|
96
|
+
* **Best for**: Mystical theme overlays.
|
|
97
|
+
|
|
98
|
+
### 5. `startLoveRain(container, options)`
|
|
99
|
+
A falling downpour of romantic emojis (`๐`, `๐`, `๐ธ`, etc.) and hearts drifting on wind vectors.
|
|
100
|
+
* **Best for**: Wedding banners and celebration announcements.
|
|
101
|
+
|
|
102
|
+
### 6. `startConfetti(container, options)`
|
|
103
|
+
Celebration ribbons and flakes launched from the screen edges falling under the influence of gravity, rotational twist, and drag.
|
|
104
|
+
* **Best for**: Checkout success, checkout completions, or birthday triggers.
|
|
105
|
+
|
|
106
|
+
### 7. `startFireworks(container, options)`
|
|
107
|
+
Auto-firing rockets launching upwards, leaving trail paths before bursting into colorful star coordinate arrays.
|
|
108
|
+
* **Best for**: Festivities and new-year celebrations.
|
|
109
|
+
|
|
110
|
+
### 8. `startStarField(container, options)`
|
|
111
|
+
An interactive warp speed stellar coordinate system drawing sleek geometric line links to nearby stars.
|
|
112
|
+
* **Best for**: Interactive hero pages.
|
|
113
|
+
|
|
114
|
+
### 9. `startButterflies(container, options)`
|
|
115
|
+
Wing-flapping glowing butterfly paths that hover organically with realistic flight drift algorithms.
|
|
116
|
+
* **Best for**: Spring-time landing themes.
|
|
117
|
+
|
|
118
|
+
### 10. `startMagicDust(container, options)`
|
|
119
|
+
Swirling trails of glittering particles that drift slowly on the screen.
|
|
120
|
+
|
|
121
|
+
### 11. `startFloatingOrbs(container, options)`
|
|
122
|
+
Large, soft bokeh globes bouncing gently off the screen boundaries.
|
|
123
|
+
|
|
124
|
+
### 12. `startShootingStars(container, options)`
|
|
125
|
+
Cosmic meteor streaks flashing randomly across the dark skyline.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## ๐ป Integration Guides
|
|
130
|
+
|
|
131
|
+
### 1. Vanilla JavaScript ESM Setup
|
|
132
|
+
Ensure your container is structured to overlap the viewport properly:
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<!-- Main Overlay Wrapper -->
|
|
136
|
+
<div id="romantic-canvas-container" style="position: fixed; inset: 0; pointer-events: none; z-index: 9999;"></div>
|
|
137
|
+
|
|
138
|
+
<script type="module">
|
|
139
|
+
import { startFloatingHearts } from '@sarthak03dot/romantic-animations';
|
|
140
|
+
|
|
141
|
+
// Spawn romantic drifting hearts
|
|
142
|
+
const sessionId = startFloatingHearts('romantic-canvas-container', {
|
|
143
|
+
count: 0.2,
|
|
144
|
+
minSize: 10,
|
|
145
|
+
maxSize: 30,
|
|
146
|
+
colors: ['#ff4d6d', '#ff85a1', '#e8c1a0'],
|
|
147
|
+
glow: true
|
|
148
|
+
});
|
|
149
|
+
</script>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### 2. React Components (Zero-Leak Hooks)
|
|
155
|
+
Always clean up your active canvas sessions when components unmount to prevent memory leaks in single-page apps:
|
|
156
|
+
|
|
157
|
+
```jsx
|
|
158
|
+
import React, { useEffect, useRef } from 'react';
|
|
159
|
+
import { startConfetti, stopAnimation } from '@sarthak03dot/romantic-animations';
|
|
160
|
+
|
|
161
|
+
export const ConfettiCelebration = () => {
|
|
162
|
+
const containerRef = useRef(null);
|
|
163
|
+
const sessionRef = useRef(null);
|
|
164
|
+
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (containerRef.current) {
|
|
167
|
+
sessionRef.current = startConfetti(containerRef.current, {
|
|
168
|
+
count: 0.35,
|
|
169
|
+
colors: ['#ff4d6d', '#ff85a1', '#c77dff', '#48cae4']
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Stop active canvas loops immediately on unmount
|
|
174
|
+
return () => {
|
|
175
|
+
if (sessionRef.current) {
|
|
176
|
+
stopAnimation(sessionRef.current);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}, []);
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<div
|
|
183
|
+
ref={containerRef}
|
|
184
|
+
style={{
|
|
185
|
+
position: 'fixed',
|
|
186
|
+
inset: 0,
|
|
187
|
+
pointerEvents: 'none',
|
|
188
|
+
zIndex: 9999
|
|
189
|
+
}}
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### 3. Next.js Client Integrations (SSR Protection)
|
|
198
|
+
Canvas rendering references the global browser `window` object. Guard imports using a client-side execution block:
|
|
199
|
+
|
|
200
|
+
```jsx
|
|
201
|
+
'use client';
|
|
202
|
+
|
|
203
|
+
import React, { useEffect } from 'react';
|
|
204
|
+
|
|
205
|
+
export default function LandingPage() {
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
// Dynamic import inside useEffect to safely isolate client-only UMD scripts
|
|
208
|
+
import('@sarthak03dot/romantic-animations').then((lib) => {
|
|
209
|
+
lib.startShootingStars('shooting-stars-overlay', {
|
|
210
|
+
speed: 2.5,
|
|
211
|
+
count: 0.15
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}, []);
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<div style={{ position: 'relative', minHeight: '100vh', background: '#0b0c10' }}>
|
|
218
|
+
<div
|
|
219
|
+
id="shooting-stars-overlay"
|
|
220
|
+
style={{
|
|
221
|
+
position: 'absolute',
|
|
222
|
+
inset: 0,
|
|
223
|
+
pointerEvents: 'none',
|
|
224
|
+
zIndex: 10
|
|
225
|
+
}}
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### 4. Direct Browser UMD CDN Script Integration
|
|
235
|
+
Excellent for quick testing inside simple HTML static assets:
|
|
236
|
+
|
|
237
|
+
```html
|
|
238
|
+
<!DOCTYPE html>
|
|
239
|
+
<html lang="en">
|
|
240
|
+
<head>
|
|
241
|
+
<meta charset="UTF-8">
|
|
242
|
+
<title>Romantic Page</title>
|
|
243
|
+
</head>
|
|
244
|
+
<body>
|
|
245
|
+
<!-- Canvas overlay -->
|
|
246
|
+
<div id="overlay-container" style="position: fixed; inset: 0; pointer-events: none; z-index: 9999;"></div>
|
|
247
|
+
|
|
248
|
+
<!-- UMD script loading -->
|
|
249
|
+
<script src="https://cdn.jsdelivr.net/npm/@sarthak03dot/romantic-animations@1.2.0/dist/romantic-animations.umd.js"></script>
|
|
250
|
+
|
|
251
|
+
<script>
|
|
252
|
+
// Access via global window namespace
|
|
253
|
+
RomanticAnimations.startSparkles('overlay-container', {
|
|
254
|
+
count: 0.25,
|
|
255
|
+
glow: true
|
|
256
|
+
});
|
|
257
|
+
</script>
|
|
258
|
+
</body>
|
|
259
|
+
</html>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## โ๏ธ Configuration Properties
|
|
265
|
+
|
|
266
|
+
The second parameter supports rich custom tokens:
|
|
267
|
+
|
|
268
|
+
| Property | Type | Default | Description |
|
|
269
|
+
| :--- | :--- | :--- | :--- |
|
|
270
|
+
| `count` | `Number` | `0.2` | Particle spawn density rate (range: `0.01` to `1.0`). |
|
|
271
|
+
| `minSize` | `Number` | `10` | Minimum particle rendering size in pixels. |
|
|
272
|
+
| `maxSize` | `Number` | `30` | Maximum particle rendering size in pixels. |
|
|
273
|
+
| `colors` | `Array` | `['#ff4d6d']` | List of color hex/rgb strings chosen randomly for particles. |
|
|
274
|
+
| `glow` | `Boolean` | `true` | Enables/disables radial neon drop shadows. |
|
|
275
|
+
| `speed` | `Number` | `1.5` | Particle speed modifier multiplier. |
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## ๐งน Session Management & Lifecycle Cleansing
|
|
280
|
+
|
|
281
|
+
Stop active loops cleanly with the lifecycle triggers:
|
|
282
|
+
|
|
283
|
+
```javascript
|
|
284
|
+
import { startFloatingHearts, stopAnimation, stopAll } from '@sarthak03dot/romantic-animations';
|
|
285
|
+
|
|
286
|
+
// Start session
|
|
287
|
+
const session = startFloatingHearts('canvas-wrapper');
|
|
288
|
+
|
|
289
|
+
// Clean up just this single session
|
|
290
|
+
stopAnimation(session);
|
|
291
|
+
|
|
292
|
+
// Clean up all running canvas loops on the page at once
|
|
293
|
+
stopAll();
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## ๐ค Contributing & Running Locally
|
|
299
|
+
|
|
300
|
+
We welcome bug fixes, enhancement requests, and brand new canvas effect implementations!
|
|
301
|
+
|
|
302
|
+
1. **Fork the Repository** and clone it.
|
|
303
|
+
2. Install all dev packages:
|
|
304
|
+
```bash
|
|
305
|
+
npm install
|
|
306
|
+
```
|
|
307
|
+
3. Boot the local development server:
|
|
308
|
+
```bash
|
|
309
|
+
npm run dev
|
|
310
|
+
```
|
|
311
|
+
4. Write your gorgeous animation source codes inside `src/animations/` and wire them into the global entry inside `src/index.js`.
|
|
312
|
+
5. Run the production build validation:
|
|
313
|
+
```bash
|
|
314
|
+
npm run build
|
|
315
|
+
npm run build:demo
|
|
316
|
+
```
|
|
317
|
+
6. Submit a **Pull Request** detailing your upgrades!
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## ๐งโ๐ป Author
|
|
322
|
+
|
|
323
|
+
**Sarthak Singh ๐**
|
|
324
|
+
* Passionate front-end developer crafting interactive canvas web experiences.
|
|
325
|
+
* **Email**: [sarthak03december@gmail.com](mailto:sarthak03december@gmail.com)
|
|
326
|
+
* **GitHub**: [@sarthak03dot](https://github.com/sarthak03dot)
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## ๐ License
|
|
331
|
+
|
|
332
|
+
This repository is licensed under the [MIT License](LICENSE).
|