celebrate-js 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,599 @@
1
+ // src/effects/confetti.ts
2
+ function confetti(options = {}) {
3
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
4
+ return;
5
+ }
6
+ const duration = options.duration ?? 2e3;
7
+ const particleCount = options.particleCount ?? 150;
8
+ const colors = options.colors && options.colors.length > 0 ? options.colors : ["#FFC700", "#FF0000", "#2E3191", "#46c741ff"];
9
+ const canvas = document.createElement("canvas");
10
+ const ctx = canvas.getContext("2d");
11
+ canvas.style.position = "fixed";
12
+ canvas.style.top = "0";
13
+ canvas.style.left = "0";
14
+ canvas.style.pointerEvents = "none";
15
+ canvas.style.zIndex = "9999";
16
+ document.body.appendChild(canvas);
17
+ const resize = () => {
18
+ canvas.width = window.innerWidth;
19
+ canvas.height = window.innerHeight;
20
+ };
21
+ resize();
22
+ window.addEventListener("resize", resize);
23
+ const particles = Array.from({ length: particleCount }).map(() => ({
24
+ x: Math.random() * canvas.width,
25
+ y: Math.random() * canvas.height - canvas.height,
26
+ size: Math.random() * 6 + 4,
27
+ color: colors[Math.floor(Math.random() * colors.length)],
28
+ velocityX: Math.random() * 4 - 2,
29
+ velocityY: Math.random() * 6 + 4,
30
+ rotation: Math.random() * 360
31
+ }));
32
+ const start = performance.now();
33
+ function draw(now) {
34
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
35
+ for (const p of particles) {
36
+ p.x += p.velocityX;
37
+ p.y += p.velocityY;
38
+ p.rotation += 5;
39
+ ctx.save();
40
+ ctx.translate(p.x, p.y);
41
+ ctx.rotate(p.rotation * Math.PI / 180);
42
+ ctx.fillStyle = p.color;
43
+ ctx.fillRect(-p.size / 2, -p.size / 2, p.size, p.size);
44
+ ctx.restore();
45
+ }
46
+ if (now - start < duration) {
47
+ requestAnimationFrame(draw);
48
+ } else {
49
+ cleanup();
50
+ }
51
+ }
52
+ function cleanup() {
53
+ window.removeEventListener("resize", resize);
54
+ canvas.remove();
55
+ }
56
+ requestAnimationFrame(draw);
57
+ }
58
+
59
+ // src/effects/balloons.ts
60
+ function balloons(options = {}) {
61
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
62
+ return;
63
+ }
64
+ const duration = options.duration ?? 3e3;
65
+ const count = options.particleCount ?? 20;
66
+ const colors = options.colors && options.colors.length > 0 ? options.colors : ["#ff6b6b", "#ffd93d", "#6bcb77", "#4d96ff", "#c77dff"];
67
+ const canvas = document.createElement("canvas");
68
+ const ctx = canvas.getContext("2d");
69
+ canvas.style.position = "fixed";
70
+ canvas.style.top = "0";
71
+ canvas.style.left = "0";
72
+ canvas.style.pointerEvents = "none";
73
+ canvas.style.zIndex = "9999";
74
+ document.body.appendChild(canvas);
75
+ const resize = () => {
76
+ canvas.width = window.innerWidth;
77
+ canvas.height = window.innerHeight;
78
+ };
79
+ resize();
80
+ window.addEventListener("resize", resize);
81
+ const balloons2 = Array.from({ length: count }).map(() => ({
82
+ x: Math.random() * canvas.width,
83
+ y: canvas.height + Math.random() * canvas.height,
84
+ radius: Math.random() * 20 + 20,
85
+ color: colors[Math.floor(Math.random() * colors.length)],
86
+ speed: Math.random() * 2 + 1.2,
87
+ sway: Math.random() * 2 + 1
88
+ }));
89
+ const start = performance.now();
90
+ function draw(now) {
91
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
92
+ balloons2.forEach((b, i) => {
93
+ b.y -= b.speed;
94
+ b.x += Math.sin(now / 300 + i) * b.sway;
95
+ const gradient = ctx.createRadialGradient(
96
+ b.x - b.radius * 0.3,
97
+ b.y - b.radius * 0.3,
98
+ b.radius * 0.2,
99
+ b.x,
100
+ b.y,
101
+ b.radius
102
+ );
103
+ gradient.addColorStop(0, "#ffffffaa");
104
+ gradient.addColorStop(0.3, b.color);
105
+ gradient.addColorStop(1, "#00000022");
106
+ ctx.beginPath();
107
+ ctx.ellipse(b.x, b.y, b.radius * 0.8, b.radius, 0, 0, Math.PI * 2);
108
+ ctx.fillStyle = gradient;
109
+ ctx.fill();
110
+ const stringLength = 35;
111
+ const swayOffset = Math.sin(now / 150 + i) * b.sway * 4;
112
+ ctx.beginPath();
113
+ ctx.moveTo(b.x, b.y + b.radius);
114
+ ctx.quadraticCurveTo(
115
+ b.x + swayOffset,
116
+ b.y + b.radius + stringLength / 2,
117
+ b.x,
118
+ b.y + b.radius + stringLength
119
+ );
120
+ ctx.strokeStyle = "#555";
121
+ ctx.lineWidth = 1;
122
+ ctx.stroke();
123
+ });
124
+ if (now - start < duration) {
125
+ requestAnimationFrame(draw);
126
+ } else {
127
+ cleanup();
128
+ }
129
+ }
130
+ function cleanup() {
131
+ window.removeEventListener("resize", resize);
132
+ canvas.remove();
133
+ }
134
+ requestAnimationFrame(draw);
135
+ }
136
+
137
+ // src/effects/popper.ts
138
+ function popper(options = {}) {
139
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
140
+ return;
141
+ }
142
+ const duration = options.duration ?? 1800;
143
+ const particleCount = options.particleCount ?? 120;
144
+ const colors = options.colors && options.colors.length > 0 ? options.colors : ["#FFC700", "#FF0000", "#2E3191", "#41BBC7", "#7CFFCB"];
145
+ const canvas = document.createElement("canvas");
146
+ const ctx = canvas.getContext("2d");
147
+ canvas.style.position = "fixed";
148
+ canvas.style.top = "0";
149
+ canvas.style.left = "0";
150
+ canvas.style.pointerEvents = "none";
151
+ canvas.style.zIndex = "9999";
152
+ document.body.appendChild(canvas);
153
+ const resize = () => {
154
+ canvas.width = window.innerWidth;
155
+ canvas.height = window.innerHeight;
156
+ };
157
+ resize();
158
+ window.addEventListener("resize", resize);
159
+ const particles = [];
160
+ const createSide = (side) => {
161
+ for (let i = 0; i < particleCount / 2; i++) {
162
+ particles.push({
163
+ x: side === "left" ? 0 : canvas.width,
164
+ y: canvas.height * 0.6,
165
+ size: Math.random() * 6 + 4,
166
+ color: colors[Math.floor(Math.random() * colors.length)],
167
+ vx: side === "left" ? Math.random() * 4 + 2 : -(Math.random() * 4 + 2),
168
+ vy: Math.random() * -14 - 10,
169
+ rotation: Math.random() * 360,
170
+ rotationSpeed: Math.random() * 10 - 5
171
+ });
172
+ }
173
+ };
174
+ createSide("left");
175
+ createSide("right");
176
+ const gravity = 0.45;
177
+ const start = performance.now();
178
+ function draw(now) {
179
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
180
+ particles.forEach((p) => {
181
+ p.vy += gravity;
182
+ p.vx *= 0.99;
183
+ p.vy *= 0.99;
184
+ p.x += p.vx;
185
+ p.y += p.vy;
186
+ p.rotation += p.rotationSpeed;
187
+ ctx.save();
188
+ ctx.translate(p.x, p.y);
189
+ ctx.rotate(p.rotation * Math.PI / 180);
190
+ ctx.fillStyle = p.color;
191
+ ctx.fillRect(-p.size / 2, -p.size / 2, p.size, p.size);
192
+ ctx.fillStyle = "#ffffff55";
193
+ ctx.fillRect(
194
+ -p.size / 2,
195
+ -p.size / 2,
196
+ p.size * 0.4,
197
+ p.size * 0.4
198
+ );
199
+ ctx.restore();
200
+ });
201
+ if (now - start < duration) {
202
+ requestAnimationFrame(draw);
203
+ } else {
204
+ cleanup();
205
+ }
206
+ }
207
+ function cleanup() {
208
+ window.removeEventListener("resize", resize);
209
+ canvas.remove();
210
+ }
211
+ requestAnimationFrame(draw);
212
+ }
213
+
214
+ // src/effects/fireworks.ts
215
+ function fireworks(options = {}) {
216
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
217
+ return;
218
+ }
219
+ const duration = options.duration ?? 4e3;
220
+ const burstCount = options.count ?? 5;
221
+ const interval = options.interval ?? 500;
222
+ const colors = options.colors && options.colors.length > 0 ? options.colors : ["#ff5252", "#ffd740", "#40c4ff", "#69f0ae", "#e040fb"];
223
+ const canvas = document.createElement("canvas");
224
+ const ctx = canvas.getContext("2d");
225
+ canvas.style.position = "fixed";
226
+ canvas.style.top = "0";
227
+ canvas.style.left = "0";
228
+ canvas.style.pointerEvents = "none";
229
+ canvas.style.zIndex = "9999";
230
+ document.body.appendChild(canvas);
231
+ const resize = () => {
232
+ canvas.width = window.innerWidth;
233
+ canvas.height = window.innerHeight;
234
+ };
235
+ resize();
236
+ window.addEventListener("resize", resize);
237
+ let particles = [];
238
+ let bursts = 0;
239
+ function createBurst() {
240
+ const x = Math.random() * canvas.width;
241
+ const y = Math.random() * canvas.height * 0.5;
242
+ const color = colors[Math.floor(Math.random() * colors.length)];
243
+ const count = 60;
244
+ for (let i = 0; i < count; i++) {
245
+ const angle = Math.PI * 2 * i / count;
246
+ const speed = Math.random() * 4 + 2;
247
+ particles.push({
248
+ x,
249
+ y,
250
+ vx: Math.cos(angle) * speed,
251
+ vy: Math.sin(angle) * speed,
252
+ alpha: 1,
253
+ color
254
+ });
255
+ }
256
+ }
257
+ const start = performance.now();
258
+ let lastBurst = 0;
259
+ function draw(now) {
260
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
261
+ if (bursts < burstCount && now - lastBurst > interval) {
262
+ createBurst();
263
+ bursts++;
264
+ lastBurst = now;
265
+ }
266
+ particles.forEach((p) => {
267
+ p.x += p.vx;
268
+ p.y += p.vy;
269
+ p.vy += 0.04;
270
+ p.alpha -= 0.015;
271
+ ctx.beginPath();
272
+ ctx.arc(p.x, p.y, 2, 0, Math.PI * 2);
273
+ ctx.fillStyle = p.color.replace(")", `, ${p.alpha})`).startsWith("rgb") ? p.color : p.color;
274
+ ctx.globalAlpha = Math.max(p.alpha, 0);
275
+ ctx.fill();
276
+ });
277
+ ctx.globalAlpha = 1;
278
+ particles = particles.filter((p) => p.alpha > 0);
279
+ if (now - start < duration || particles.length > 0) {
280
+ requestAnimationFrame(draw);
281
+ } else {
282
+ cleanup();
283
+ }
284
+ }
285
+ function cleanup() {
286
+ window.removeEventListener("resize", resize);
287
+ canvas.remove();
288
+ }
289
+ requestAnimationFrame(draw);
290
+ }
291
+
292
+ // src/effects/bubbles.ts
293
+ function bubbles(options) {
294
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
295
+ return;
296
+ }
297
+ const duration = options.duration ?? 3e3;
298
+ const count = options.particleCount ?? 25;
299
+ const canvas = document.createElement("canvas");
300
+ const ctx = canvas.getContext("2d");
301
+ canvas.style.position = "fixed";
302
+ canvas.style.top = "0";
303
+ canvas.style.left = "0";
304
+ canvas.style.pointerEvents = "none";
305
+ canvas.style.zIndex = "9999";
306
+ document.body.appendChild(canvas);
307
+ const resize = () => {
308
+ canvas.width = window.innerWidth;
309
+ canvas.height = window.innerHeight;
310
+ };
311
+ resize();
312
+ window.addEventListener("resize", resize);
313
+ const bubbles2 = Array.from({ length: count }).map(() => ({
314
+ x: Math.random() * canvas.width,
315
+ y: canvas.height + Math.random() * 100,
316
+ radius: Math.random() * 15 + 10,
317
+ speed: Math.random() * 2.1 + 1.4,
318
+ drift: Math.random() * 1.5 - 0.75,
319
+ alpha: Math.random() * 0.4 + 0.4
320
+ }));
321
+ const start = performance.now();
322
+ function draw(now) {
323
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
324
+ bubbles2.forEach((b) => {
325
+ b.y -= b.speed;
326
+ b.x += Math.sin(now / 500) * b.drift;
327
+ if (b.y < canvas.height * 0.3) {
328
+ b.alpha = Math.max(0, b.alpha - 0.01);
329
+ }
330
+ ctx.beginPath();
331
+ ctx.arc(b.x, b.y, b.radius, 0, Math.PI * 2);
332
+ ctx.fillStyle = `rgba(180, 220, 255, ${b.alpha * 0.4})`;
333
+ ctx.fill();
334
+ ctx.strokeStyle = `rgba(255,255,255,${b.alpha})`;
335
+ ctx.lineWidth = 2;
336
+ ctx.stroke();
337
+ ctx.beginPath();
338
+ ctx.arc(
339
+ b.x - b.radius / 3,
340
+ b.y - b.radius / 3,
341
+ b.radius / 4,
342
+ 0,
343
+ Math.PI * 2
344
+ );
345
+ ctx.strokeStyle = `rgba(255,255,255,${b.alpha * 0.6})`;
346
+ ctx.stroke();
347
+ });
348
+ if (now - start < duration) {
349
+ requestAnimationFrame(draw);
350
+ } else {
351
+ cleanup();
352
+ }
353
+ }
354
+ function cleanup() {
355
+ window.removeEventListener("resize", resize);
356
+ canvas.remove();
357
+ }
358
+ requestAnimationFrame(draw);
359
+ }
360
+
361
+ // src/effects/emojis.ts
362
+ function emojis(options) {
363
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
364
+ return;
365
+ }
366
+ const duration = options.duration ?? 3e3;
367
+ const count = options.particleCount ?? 30;
368
+ const emojiSet = options.emojis ?? ["\u{1F389}", "\u2728", "\u{1F525}", "\u{1F4AF}", "\u{1F60D}"];
369
+ const canvas = document.createElement("canvas");
370
+ const ctx = canvas.getContext("2d");
371
+ canvas.style.position = "fixed";
372
+ canvas.style.top = "0";
373
+ canvas.style.left = "0";
374
+ canvas.style.pointerEvents = "none";
375
+ canvas.style.zIndex = "9999";
376
+ document.body.appendChild(canvas);
377
+ const resize = () => {
378
+ canvas.width = window.innerWidth;
379
+ canvas.height = window.innerHeight;
380
+ };
381
+ resize();
382
+ window.addEventListener("resize", resize);
383
+ const emojis2 = Array.from({ length: count }).map(() => ({
384
+ x: Math.random() * canvas.width,
385
+ y: Math.random() * -canvas.height,
386
+ char: emojiSet[Math.floor(Math.random() * emojiSet.length)],
387
+ size: Math.random() * 20 + 20,
388
+ speed: Math.random() * 2.5 + 1.5,
389
+ drift: Math.random() * 1.5 - 0.75,
390
+ rotation: Math.random() * 360,
391
+ rotationSpeed: Math.random() * 4 - 2,
392
+ alpha: 1
393
+ }));
394
+ const start = performance.now();
395
+ function draw(now) {
396
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
397
+ emojis2.forEach((e) => {
398
+ e.y += e.speed;
399
+ e.x += Math.sin(now / 400) * e.drift;
400
+ e.rotation += e.rotationSpeed;
401
+ if (e.y > canvas.height * 0.8) {
402
+ e.alpha = Math.max(0, e.alpha - 0.02);
403
+ }
404
+ ctx.save();
405
+ ctx.translate(e.x, e.y);
406
+ ctx.rotate(e.rotation * Math.PI / 180);
407
+ ctx.globalAlpha = e.alpha;
408
+ ctx.font = `${e.size}px serif`;
409
+ ctx.textAlign = "center";
410
+ ctx.textBaseline = "middle";
411
+ ctx.fillText(e.char, 0, 0);
412
+ ctx.restore();
413
+ });
414
+ if (now - start < duration) {
415
+ requestAnimationFrame(draw);
416
+ } else {
417
+ cleanup();
418
+ }
419
+ }
420
+ function cleanup() {
421
+ window.removeEventListener("resize", resize);
422
+ canvas.remove();
423
+ }
424
+ requestAnimationFrame(draw);
425
+ }
426
+
427
+ // src/effects/stars.ts
428
+ function stars(options) {
429
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
430
+ return;
431
+ }
432
+ const duration = options.duration ?? 3e3;
433
+ const count = options.count ?? 5;
434
+ const interval = options.interval ?? 500;
435
+ const canvas = document.createElement("canvas");
436
+ const ctx = canvas.getContext("2d");
437
+ canvas.style.position = "fixed";
438
+ canvas.style.top = "0";
439
+ canvas.style.left = "0";
440
+ canvas.style.pointerEvents = "none";
441
+ canvas.style.zIndex = "9999";
442
+ document.body.appendChild(canvas);
443
+ const resize = () => {
444
+ canvas.width = window.innerWidth;
445
+ canvas.height = window.innerHeight;
446
+ };
447
+ resize();
448
+ window.addEventListener("resize", resize);
449
+ const stars2 = [];
450
+ const start = performance.now();
451
+ let spawned = 0;
452
+ let lastSpawn = 0;
453
+ function spawnStar() {
454
+ const fromLeft = Math.random() > 0.5;
455
+ stars2.push({
456
+ x: fromLeft ? -100 : canvas.width + 100,
457
+ y: Math.random() * canvas.height * 0.4,
458
+ vx: fromLeft ? Math.random() * 12 + 8 : -(Math.random() * 12 + 8),
459
+ vy: Math.random() * 6 + 4,
460
+ length: Math.random() * 80 + 60,
461
+ alpha: 1
462
+ });
463
+ }
464
+ function draw(now) {
465
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
466
+ if (spawned < count && now - lastSpawn > interval) {
467
+ spawnStar();
468
+ spawned++;
469
+ lastSpawn = now;
470
+ }
471
+ stars2.forEach((s, i) => {
472
+ s.x += s.vx;
473
+ s.y += s.vy;
474
+ s.alpha -= 0.015;
475
+ ctx.beginPath();
476
+ ctx.moveTo(s.x, s.y);
477
+ ctx.lineTo(
478
+ s.x - s.vx * 4,
479
+ s.y - s.vy * 4
480
+ );
481
+ ctx.strokeStyle = `rgba(255,255,120,${s.alpha})`;
482
+ ctx.lineWidth = 2;
483
+ ctx.lineCap = "round";
484
+ ctx.stroke();
485
+ if (s.alpha <= 0) {
486
+ stars2.splice(i, 1);
487
+ }
488
+ });
489
+ if (now - start < duration || stars2.length > 0) {
490
+ requestAnimationFrame(draw);
491
+ } else {
492
+ cleanup();
493
+ }
494
+ }
495
+ function cleanup() {
496
+ window.removeEventListener("resize", resize);
497
+ canvas.remove();
498
+ }
499
+ requestAnimationFrame(draw);
500
+ }
501
+
502
+ // src/effects/snowfall.ts
503
+ function snowfall(options) {
504
+ if (options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
505
+ return;
506
+ }
507
+ const duration = options.duration ?? 5e3;
508
+ const count = options.particleCount ?? 60;
509
+ const canvas = document.createElement("canvas");
510
+ const ctx = canvas.getContext("2d");
511
+ canvas.style.position = "fixed";
512
+ canvas.style.top = "0";
513
+ canvas.style.left = "0";
514
+ canvas.style.pointerEvents = "none";
515
+ canvas.style.zIndex = "9999";
516
+ document.body.appendChild(canvas);
517
+ const resize = () => {
518
+ canvas.width = window.innerWidth;
519
+ canvas.height = window.innerHeight;
520
+ };
521
+ resize();
522
+ window.addEventListener("resize", resize);
523
+ const flakes = Array.from({ length: count }).map(() => ({
524
+ x: Math.random() * canvas.width,
525
+ y: Math.random() * -canvas.height,
526
+ radius: Math.random() * 2.5 + 1,
527
+ speed: Math.random() * 0.6 + 0.3,
528
+ drift: Math.random() * 0.6 - 0.3,
529
+ alpha: Math.random() * 0.5 + 0.4
530
+ }));
531
+ const start = performance.now();
532
+ function draw(now) {
533
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
534
+ flakes.forEach((f) => {
535
+ f.y += f.speed;
536
+ f.x += Math.sin(now / 800) * f.drift;
537
+ if (f.y > canvas.height) {
538
+ f.y = -10;
539
+ f.x = Math.random() * canvas.width;
540
+ }
541
+ ctx.beginPath();
542
+ ctx.arc(f.x, f.y, f.radius, 0, Math.PI * 2);
543
+ ctx.fillStyle = `rgba(255,255,255,${f.alpha})`;
544
+ ctx.fill();
545
+ });
546
+ if (now - start < duration) {
547
+ requestAnimationFrame(draw);
548
+ } else {
549
+ cleanup();
550
+ }
551
+ }
552
+ function cleanup() {
553
+ window.removeEventListener("resize", resize);
554
+ canvas.remove();
555
+ }
556
+ requestAnimationFrame(draw);
557
+ }
558
+
559
+ // src/index.ts
560
+ function celebrate(options = {}) {
561
+ const effect = options.effect ?? "confetti";
562
+ switch (effect) {
563
+ case "confetti":
564
+ confetti(options);
565
+ break;
566
+ case "balloons":
567
+ balloons(options);
568
+ break;
569
+ case "popper":
570
+ popper(options);
571
+ break;
572
+ case "fireworks":
573
+ fireworks(options);
574
+ break;
575
+ case "bubbles":
576
+ bubbles(options);
577
+ break;
578
+ case "emojis":
579
+ emojis(options);
580
+ break;
581
+ case "stars":
582
+ stars(options);
583
+ break;
584
+ case "snowfall":
585
+ snowfall(options);
586
+ break;
587
+ }
588
+ }
589
+ celebrate.confetti = (o) => celebrate({ ...o, effect: "confetti" });
590
+ celebrate.balloons = (o) => celebrate({ ...o, effect: "balloons" });
591
+ celebrate.popper = (o) => celebrate({ ...o, effect: "popper" });
592
+ celebrate.fireworks = (o) => celebrate({ ...o, effect: "fireworks" });
593
+ celebrate.bubbles = (o) => celebrate({ ...o, effect: "bubbles" });
594
+ celebrate.emojis = (o) => celebrate({ ...o, effect: "emojis" });
595
+ celebrate.stars = (o) => celebrate({ ...o, effect: "stars" });
596
+ celebrate.snowfall = (o) => celebrate({ ...o, effect: "snowfall" });
597
+ export {
598
+ celebrate
599
+ };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "celebrate-js",
3
+ "version": "0.1.0",
4
+ "description": "Delightful UI celebration effects (confetti, balloons, fireworks, and more)",
5
+ "keywords": [
6
+ "celebration",
7
+ "confetti",
8
+ "balloons",
9
+ "animations",
10
+ "effects",
11
+ "ui",
12
+ "canvas",
13
+ "frontend",
14
+ "micro-interactions"
15
+ ],
16
+ "homepage": "https://github.com/akshaywritescode/celebrate-js",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/akshaywritescode/celebrate-js.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/akshaywritescode/celebrate-js/issues"
23
+ },
24
+ "license": "MIT",
25
+ "author": "Akshay <debugwithakshay@gmail.com>",
26
+ "type": "module",
27
+ "main": "./dist/index.cjs",
28
+ "module": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.js",
34
+ "require": "./dist/index.cjs"
35
+ }
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "sideEffects": false,
41
+ "scripts": {
42
+ "dev": "vite",
43
+ "build": "tsup src/index.ts --format esm,cjs --dts --clean",
44
+ "prepublishOnly": "npm run build"
45
+ },
46
+ "devDependencies": {
47
+ "eslint": "^8.56.0",
48
+ "tsup": "^8.5.1",
49
+ "typescript": "^5.9.3",
50
+ "vite": "^7.3.0",
51
+ "vitest": "^1.2.0"
52
+ },
53
+ "engines": {
54
+ "node": ">=18"
55
+ }
56
+ }