festive-effects 1.0.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/README.md +163 -0
- package/dist/animations/index.d.ts +91 -0
- package/dist/components/FestiveEffects.d.ts +19 -0
- package/dist/config/index.d.ts +18 -0
- package/dist/effects/ChineseNewYearEffect.d.ts +32 -0
- package/dist/effects/ChristmasEffect.d.ts +32 -0
- package/dist/effects/DiwaliEffect.d.ts +32 -0
- package/dist/effects/EasterEffect.d.ts +32 -0
- package/dist/effects/EidEffect.d.ts +32 -0
- package/dist/effects/HalloweenEffect.d.ts +32 -0
- package/dist/effects/HoliEffect.d.ts +32 -0
- package/dist/effects/IndependenceEffect.d.ts +32 -0
- package/dist/effects/NewYearEffect.d.ts +31 -0
- package/dist/effects/StPatricksEffect.d.ts +32 -0
- package/dist/effects/ThanksgivingEffect.d.ts +32 -0
- package/dist/effects/ValentineEffect.d.ts +32 -0
- package/dist/effects/index.d.ts +15 -0
- package/dist/hooks/index.d.ts +70 -0
- package/dist/index.d.ts +754 -0
- package/dist/index.esm.js +2009 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2074 -0
- package/dist/index.js.map +1 -0
- package/dist/particles/index.d.ts +37 -0
- package/dist/registry/index.d.ts +69 -0
- package/dist/types/index.d.ts +144 -0
- package/package.json +85 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,754 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants, Transition } from 'framer-motion';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Union type of all supported festival effects
|
|
6
|
+
*/
|
|
7
|
+
type FestivalType = 'christmas' | 'newyear' | 'valentine' | 'easter' | 'halloween' | 'thanksgiving' | 'diwali' | 'chinesenewyear' | 'holi' | 'eid' | 'stpatricks' | 'independence';
|
|
8
|
+
/**
|
|
9
|
+
* Array of all valid festival types for validation
|
|
10
|
+
*/
|
|
11
|
+
declare const FESTIVAL_TYPES: FestivalType[];
|
|
12
|
+
/**
|
|
13
|
+
* Intensity levels for particle effects
|
|
14
|
+
*/
|
|
15
|
+
type IntensityLevel = 'low' | 'medium' | 'high';
|
|
16
|
+
/**
|
|
17
|
+
* Props for the main FestiveEffects component
|
|
18
|
+
*/
|
|
19
|
+
interface FestiveEffectsProps {
|
|
20
|
+
/** The festival effect to display */
|
|
21
|
+
festival: FestivalType;
|
|
22
|
+
/** Intensity of the effect (particle count) */
|
|
23
|
+
intensity?: IntensityLevel;
|
|
24
|
+
/** Duration in milliseconds before effect stops */
|
|
25
|
+
duration?: number;
|
|
26
|
+
/** CSS z-index for the overlay */
|
|
27
|
+
zIndex?: number;
|
|
28
|
+
/** Whether to respect prefers-reduced-motion setting */
|
|
29
|
+
respectReducedMotion?: boolean;
|
|
30
|
+
/** Custom colors to override default festival colors */
|
|
31
|
+
colors?: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Settings for each intensity level
|
|
35
|
+
*/
|
|
36
|
+
interface IntensitySettings {
|
|
37
|
+
/** Multiplier for base particle count */
|
|
38
|
+
particleMultiplier: number;
|
|
39
|
+
/** Maximum number of particles allowed */
|
|
40
|
+
maxParticles: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Physics configuration for particle animations
|
|
44
|
+
*/
|
|
45
|
+
interface PhysicsConfig {
|
|
46
|
+
/** Base animation speed */
|
|
47
|
+
speed: number;
|
|
48
|
+
/** Horizontal drift amount in pixels */
|
|
49
|
+
drift: number;
|
|
50
|
+
/** Rotation amount in degrees */
|
|
51
|
+
rotation: number;
|
|
52
|
+
/** Min/max scale range */
|
|
53
|
+
scale: [number, number];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* All particle types available for effects
|
|
57
|
+
*/
|
|
58
|
+
type ParticleType = 'snowflake' | 'firework' | 'confetti' | 'spark' | 'heart' | 'egg' | 'flower' | 'bat' | 'pumpkin' | 'spider' | 'leaf' | 'diya' | 'rangoli' | 'lantern' | 'dragon' | 'color-splash' | 'moon' | 'star' | 'shamrock' | 'rainbow';
|
|
59
|
+
/**
|
|
60
|
+
* Animation types for particle effects
|
|
61
|
+
*/
|
|
62
|
+
type AnimationType = 'fall' | 'rise' | 'explode' | 'float' | 'scatter';
|
|
63
|
+
/**
|
|
64
|
+
* Configuration for a festival effect
|
|
65
|
+
*/
|
|
66
|
+
interface FestivalConfig {
|
|
67
|
+
/** Base number of particles before intensity multiplier */
|
|
68
|
+
baseParticleCount: number;
|
|
69
|
+
/** Color palette for the effect */
|
|
70
|
+
colors: string[];
|
|
71
|
+
/** Types of particles used in this effect */
|
|
72
|
+
particleTypes: ParticleType[];
|
|
73
|
+
/** Primary animation type */
|
|
74
|
+
animationType: AnimationType;
|
|
75
|
+
/** Physics settings for animations */
|
|
76
|
+
physics: PhysicsConfig;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Viewport dimensions
|
|
80
|
+
*/
|
|
81
|
+
interface Viewport {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Data for a single particle instance
|
|
87
|
+
*/
|
|
88
|
+
interface ParticleData {
|
|
89
|
+
/** Unique identifier */
|
|
90
|
+
id: string;
|
|
91
|
+
/** Initial X position */
|
|
92
|
+
x: number;
|
|
93
|
+
/** Initial Y position */
|
|
94
|
+
y: number;
|
|
95
|
+
/** Particle size in pixels */
|
|
96
|
+
size: number;
|
|
97
|
+
/** Particle color */
|
|
98
|
+
color: string;
|
|
99
|
+
/** Type of particle shape */
|
|
100
|
+
type: ParticleType;
|
|
101
|
+
/** Animation delay in seconds */
|
|
102
|
+
delay: number;
|
|
103
|
+
/** Animation duration in seconds */
|
|
104
|
+
duration: number;
|
|
105
|
+
/** Additional custom properties for animation */
|
|
106
|
+
custom: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Framer Motion animation configuration
|
|
110
|
+
*/
|
|
111
|
+
interface AnimationConfig {
|
|
112
|
+
/** Animation target values */
|
|
113
|
+
animate: {
|
|
114
|
+
x?: number | number[];
|
|
115
|
+
y?: number | number[];
|
|
116
|
+
rotate?: number | number[];
|
|
117
|
+
scale?: number | number[];
|
|
118
|
+
opacity?: number | number[];
|
|
119
|
+
};
|
|
120
|
+
/** Transition settings */
|
|
121
|
+
transition: {
|
|
122
|
+
duration: number;
|
|
123
|
+
ease?: string | number[];
|
|
124
|
+
repeat?: number;
|
|
125
|
+
repeatType?: 'loop' | 'reverse' | 'mirror';
|
|
126
|
+
delay?: number;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Props for individual particle components
|
|
131
|
+
*/
|
|
132
|
+
interface ParticleProps {
|
|
133
|
+
/** Unique identifier */
|
|
134
|
+
id: string;
|
|
135
|
+
/** Initial X position */
|
|
136
|
+
initialX: number;
|
|
137
|
+
/** Initial Y position */
|
|
138
|
+
initialY: number;
|
|
139
|
+
/** Particle size */
|
|
140
|
+
size: number;
|
|
141
|
+
/** Particle color */
|
|
142
|
+
color: string;
|
|
143
|
+
/** Type of particle */
|
|
144
|
+
type: ParticleType;
|
|
145
|
+
/** Animation configuration */
|
|
146
|
+
animationConfig: AnimationConfig;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* FestiveEffects - Main component for rendering festival-themed visual effects
|
|
151
|
+
*
|
|
152
|
+
* Renders a full-screen overlay with animated particles for various festivals.
|
|
153
|
+
* Uses Framer Motion for smooth, GPU-accelerated animations.
|
|
154
|
+
*
|
|
155
|
+
* Features:
|
|
156
|
+
* - Automatic cleanup of timeouts and event listeners on unmount
|
|
157
|
+
* - Pauses animations when browser tab is not visible (performance optimization)
|
|
158
|
+
* - Respects user's reduced motion preferences
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```tsx
|
|
162
|
+
* <FestiveEffects festival="christmas" intensity="medium" />
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
declare const FestiveEffects: React.FC<FestiveEffectsProps>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Intensity configuration for particle effects
|
|
169
|
+
* Defines particle multipliers and max counts for each intensity level
|
|
170
|
+
*/
|
|
171
|
+
declare const INTENSITY_CONFIG: Record<IntensityLevel, IntensitySettings>;
|
|
172
|
+
/**
|
|
173
|
+
* Calculate the actual particle count based on base count and intensity
|
|
174
|
+
* @param baseCount - The base particle count from festival config
|
|
175
|
+
* @param intensity - The intensity level
|
|
176
|
+
* @returns The calculated particle count, capped at maxParticles
|
|
177
|
+
*/
|
|
178
|
+
declare function getParticleCount(baseCount: number, intensity?: IntensityLevel): number;
|
|
179
|
+
/**
|
|
180
|
+
* Festival configurations for all 12 supported festivals
|
|
181
|
+
* Each config defines colors, particle types, animation style, and physics
|
|
182
|
+
*/
|
|
183
|
+
declare const FESTIVAL_CONFIGS: Record<FestivalType, FestivalConfig>;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* SVG definitions for all 18 particle types
|
|
187
|
+
* Each SVG is designed to work with currentColor for dynamic coloring
|
|
188
|
+
*/
|
|
189
|
+
declare const PARTICLE_SVGS: Record<ParticleType, string>;
|
|
190
|
+
/**
|
|
191
|
+
* Props for the Particle component
|
|
192
|
+
*/
|
|
193
|
+
interface ParticleComponentProps {
|
|
194
|
+
particle: ParticleData;
|
|
195
|
+
animationType: AnimationType;
|
|
196
|
+
physics: PhysicsConfig;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Particle component that renders an SVG particle with Framer Motion animations
|
|
200
|
+
*/
|
|
201
|
+
declare const Particle: React.FC<ParticleComponentProps>;
|
|
202
|
+
/**
|
|
203
|
+
* Generate particles for a festival effect
|
|
204
|
+
* @param count - Number of particles to generate
|
|
205
|
+
* @param viewport - Viewport dimensions
|
|
206
|
+
* @param particleTypes - Array of particle types to use
|
|
207
|
+
* @param colors - Array of colors to use
|
|
208
|
+
* @param physics - Physics configuration
|
|
209
|
+
* @param animationType - Type of animation
|
|
210
|
+
* @returns Array of ParticleData objects
|
|
211
|
+
*/
|
|
212
|
+
declare function generateParticles(count: number, viewport: Viewport, particleTypes: ParticleType[], colors: string[], physics: PhysicsConfig, animationType: AnimationType): ParticleData[];
|
|
213
|
+
/**
|
|
214
|
+
* Calculate the actual particle count based on base count and intensity
|
|
215
|
+
* @param baseCount - The base particle count from festival config
|
|
216
|
+
* @param intensity - The intensity level
|
|
217
|
+
* @returns The calculated particle count, capped at maxParticles
|
|
218
|
+
*/
|
|
219
|
+
declare function calculateParticleCount(baseCount: number, intensity?: IntensityLevel): number;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Custom data passed to animation variants
|
|
223
|
+
*/
|
|
224
|
+
interface AnimationCustomData {
|
|
225
|
+
/** Horizontal drift amount */
|
|
226
|
+
drift: number;
|
|
227
|
+
/** Rotation amount in degrees */
|
|
228
|
+
rotation: number;
|
|
229
|
+
/** Animation delay in seconds */
|
|
230
|
+
delay: number;
|
|
231
|
+
/** Animation duration in seconds */
|
|
232
|
+
duration: number;
|
|
233
|
+
/** Angle for radial animations (explode, scatter) */
|
|
234
|
+
angle: number;
|
|
235
|
+
/** Distance for radial animations */
|
|
236
|
+
distance: number;
|
|
237
|
+
/** Initial X position */
|
|
238
|
+
x: number;
|
|
239
|
+
/** Initial Y position */
|
|
240
|
+
y: number;
|
|
241
|
+
/** Viewport height for calculations */
|
|
242
|
+
viewportHeight: number;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Fall animation variants - used for snow, leaves, shamrocks
|
|
246
|
+
* Particles fall from top to bottom with horizontal drift and rotation
|
|
247
|
+
*/
|
|
248
|
+
declare const fallVariants: Variants;
|
|
249
|
+
/**
|
|
250
|
+
* Get transition for fall animation
|
|
251
|
+
*/
|
|
252
|
+
declare function getFallTransition(custom: AnimationCustomData): Transition;
|
|
253
|
+
/**
|
|
254
|
+
* Rise animation variants - used for hearts, lanterns
|
|
255
|
+
* Particles rise from bottom to top with gentle sway
|
|
256
|
+
*/
|
|
257
|
+
declare const riseVariants: Variants;
|
|
258
|
+
/**
|
|
259
|
+
* Get transition for rise animation
|
|
260
|
+
*/
|
|
261
|
+
declare function getRiseTransition(custom: AnimationCustomData): Transition;
|
|
262
|
+
/**
|
|
263
|
+
* Explode animation variants - used for fireworks, confetti
|
|
264
|
+
* Particles burst outward from center point
|
|
265
|
+
*/
|
|
266
|
+
declare const explodeVariants: Variants;
|
|
267
|
+
/**
|
|
268
|
+
* Get transition for explode animation
|
|
269
|
+
*/
|
|
270
|
+
declare function getExplodeTransition(custom: AnimationCustomData): Transition;
|
|
271
|
+
/**
|
|
272
|
+
* Float animation variants - used for bats, diyas, moons
|
|
273
|
+
* Particles float with gentle bobbing motion
|
|
274
|
+
*/
|
|
275
|
+
declare const floatVariants: Variants;
|
|
276
|
+
/**
|
|
277
|
+
* Get transition for float animation
|
|
278
|
+
*/
|
|
279
|
+
declare function getFloatTransition(custom: AnimationCustomData): Transition;
|
|
280
|
+
/**
|
|
281
|
+
* Scatter animation variants - used for holi colors
|
|
282
|
+
* Particles scatter outward with fading effect
|
|
283
|
+
*/
|
|
284
|
+
declare const scatterVariants: Variants;
|
|
285
|
+
/**
|
|
286
|
+
* Get transition for scatter animation
|
|
287
|
+
*/
|
|
288
|
+
declare function getScatterTransition(custom: AnimationCustomData): Transition;
|
|
289
|
+
/**
|
|
290
|
+
* Map of animation types to their variants
|
|
291
|
+
*/
|
|
292
|
+
declare const ANIMATION_VARIANTS: Record<AnimationType, Variants>;
|
|
293
|
+
/**
|
|
294
|
+
* Get the appropriate transition function for an animation type
|
|
295
|
+
*/
|
|
296
|
+
declare function getTransitionForType(animationType: AnimationType, custom: AnimationCustomData): Transition;
|
|
297
|
+
/**
|
|
298
|
+
* Create custom animation data from particle properties
|
|
299
|
+
*/
|
|
300
|
+
declare function createAnimationCustomData(x: number, y: number, physics: PhysicsConfig, delay: number, duration: number, viewportHeight: number): AnimationCustomData;
|
|
301
|
+
/**
|
|
302
|
+
* Get animation props for a particle based on animation type
|
|
303
|
+
* Returns initial, animate, and transition properties for Framer Motion
|
|
304
|
+
*/
|
|
305
|
+
declare function getAnimationPropsForType(animationType: AnimationType, custom: AnimationCustomData): {
|
|
306
|
+
initial: Record<string, unknown>;
|
|
307
|
+
animate: Record<string, unknown>;
|
|
308
|
+
transition: Transition;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Hook to detect if the user prefers reduced motion
|
|
313
|
+
* Listens to the prefers-reduced-motion media query
|
|
314
|
+
*
|
|
315
|
+
* @returns boolean - true if user prefers reduced motion, false otherwise
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```tsx
|
|
319
|
+
* const prefersReducedMotion = useReducedMotion();
|
|
320
|
+
* if (prefersReducedMotion) {
|
|
321
|
+
* // Don't render animations
|
|
322
|
+
* return null;
|
|
323
|
+
* }
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
declare function useReducedMotion(): boolean;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Interface for a festival effect
|
|
330
|
+
* Each effect provides particle generation and rendering capabilities
|
|
331
|
+
*/
|
|
332
|
+
interface FestivalEffect {
|
|
333
|
+
/** The festival type identifier */
|
|
334
|
+
name: FestivalType;
|
|
335
|
+
/** Generate particles for this effect */
|
|
336
|
+
generateParticles(count: number, viewport: Viewport): ParticleData[];
|
|
337
|
+
/** Get the festival configuration */
|
|
338
|
+
getConfig(): FestivalConfig;
|
|
339
|
+
/** Render a single particle */
|
|
340
|
+
renderParticle(particle: ParticleData): React.ReactNode;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Create a festival effect from a festival type
|
|
344
|
+
* @param festivalType - The type of festival
|
|
345
|
+
* @returns A FestivalEffect instance
|
|
346
|
+
*/
|
|
347
|
+
declare function createFestivalEffect(festivalType: FestivalType): FestivalEffect;
|
|
348
|
+
/**
|
|
349
|
+
* Registry for managing festival effects
|
|
350
|
+
* Provides methods to register, retrieve, and list festival effects
|
|
351
|
+
*/
|
|
352
|
+
declare class FestivalRegistry {
|
|
353
|
+
private effects;
|
|
354
|
+
/**
|
|
355
|
+
* Register a festival effect
|
|
356
|
+
* @param effect - The festival effect to register
|
|
357
|
+
*/
|
|
358
|
+
register(effect: FestivalEffect): void;
|
|
359
|
+
/**
|
|
360
|
+
* Get a festival effect by type
|
|
361
|
+
* @param festival - The festival type to retrieve
|
|
362
|
+
* @returns The festival effect or undefined if not found
|
|
363
|
+
*/
|
|
364
|
+
get(festival: FestivalType): FestivalEffect | undefined;
|
|
365
|
+
/**
|
|
366
|
+
* Check if a festival effect is registered
|
|
367
|
+
* @param festival - The festival type to check
|
|
368
|
+
* @returns True if the effect is registered
|
|
369
|
+
*/
|
|
370
|
+
has(festival: FestivalType): boolean;
|
|
371
|
+
/**
|
|
372
|
+
* List all registered festival types
|
|
373
|
+
* @returns Array of registered festival types
|
|
374
|
+
*/
|
|
375
|
+
list(): FestivalType[];
|
|
376
|
+
/**
|
|
377
|
+
* Get the number of registered effects
|
|
378
|
+
* @returns The count of registered effects
|
|
379
|
+
*/
|
|
380
|
+
get size(): number;
|
|
381
|
+
/**
|
|
382
|
+
* Clear all registered effects
|
|
383
|
+
*/
|
|
384
|
+
clear(): void;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Default registry instance with all 12 festival effects pre-registered
|
|
388
|
+
*/
|
|
389
|
+
declare const defaultRegistry: FestivalRegistry;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Christmas effect configuration
|
|
393
|
+
*/
|
|
394
|
+
declare const CHRISTMAS_CONFIG: {
|
|
395
|
+
baseParticleCount: number;
|
|
396
|
+
colors: string[];
|
|
397
|
+
particleTypes: readonly ["snowflake"];
|
|
398
|
+
animationType: "fall";
|
|
399
|
+
physics: {
|
|
400
|
+
speed: number;
|
|
401
|
+
drift: number;
|
|
402
|
+
rotation: number;
|
|
403
|
+
scale: [number, number];
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Generate snowflake particles for Christmas effect
|
|
408
|
+
*/
|
|
409
|
+
declare function generateChristmasParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
410
|
+
interface ChristmasEffectProps {
|
|
411
|
+
particles: ParticleData[];
|
|
412
|
+
viewport: Viewport;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Christmas Effect Component
|
|
416
|
+
* Renders falling snowflakes with drift and rotation
|
|
417
|
+
* White/blue color palette
|
|
418
|
+
*/
|
|
419
|
+
declare const ChristmasEffect: React.FC<ChristmasEffectProps>;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* New Year effect configuration
|
|
423
|
+
*/
|
|
424
|
+
declare const NEWYEAR_CONFIG: {
|
|
425
|
+
baseParticleCount: number;
|
|
426
|
+
colors: string[];
|
|
427
|
+
particleTypes: ParticleType[];
|
|
428
|
+
animationType: "explode";
|
|
429
|
+
physics: {
|
|
430
|
+
speed: number;
|
|
431
|
+
drift: number;
|
|
432
|
+
rotation: number;
|
|
433
|
+
scale: [number, number];
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* Generate particles for New Year effect
|
|
438
|
+
*/
|
|
439
|
+
declare function generateNewYearParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
440
|
+
interface NewYearEffectProps {
|
|
441
|
+
particles: ParticleData[];
|
|
442
|
+
viewport: Viewport;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* New Year Effect Component
|
|
446
|
+
* Renders exploding fireworks with sparks and falling confetti
|
|
447
|
+
*/
|
|
448
|
+
declare const NewYearEffect: React.FC<NewYearEffectProps>;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Valentine effect configuration
|
|
452
|
+
*/
|
|
453
|
+
declare const VALENTINE_CONFIG: {
|
|
454
|
+
baseParticleCount: number;
|
|
455
|
+
colors: string[];
|
|
456
|
+
particleTypes: readonly ["heart"];
|
|
457
|
+
animationType: "rise";
|
|
458
|
+
physics: {
|
|
459
|
+
speed: number;
|
|
460
|
+
drift: number;
|
|
461
|
+
rotation: number;
|
|
462
|
+
scale: [number, number];
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* Generate heart particles for Valentine effect
|
|
467
|
+
*/
|
|
468
|
+
declare function generateValentineParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
469
|
+
interface ValentineEffectProps {
|
|
470
|
+
particles: ParticleData[];
|
|
471
|
+
viewport: Viewport;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Valentine Effect Component
|
|
475
|
+
* Renders rising hearts with gentle sway
|
|
476
|
+
* Pink/red color palette
|
|
477
|
+
*/
|
|
478
|
+
declare const ValentineEffect: React.FC<ValentineEffectProps>;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Easter effect configuration
|
|
482
|
+
*/
|
|
483
|
+
declare const EASTER_CONFIG: {
|
|
484
|
+
baseParticleCount: number;
|
|
485
|
+
colors: string[];
|
|
486
|
+
particleTypes: ParticleType[];
|
|
487
|
+
animationType: "float";
|
|
488
|
+
physics: {
|
|
489
|
+
speed: number;
|
|
490
|
+
drift: number;
|
|
491
|
+
rotation: number;
|
|
492
|
+
scale: [number, number];
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Generate particles for Easter effect
|
|
497
|
+
*/
|
|
498
|
+
declare function generateEasterParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
499
|
+
interface EasterEffectProps {
|
|
500
|
+
particles: ParticleData[];
|
|
501
|
+
viewport: Viewport;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Easter Effect Component
|
|
505
|
+
* Renders floating eggs and spring flowers
|
|
506
|
+
* Pastel color palette
|
|
507
|
+
*/
|
|
508
|
+
declare const EasterEffect: React.FC<EasterEffectProps>;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Halloween effect configuration
|
|
512
|
+
*/
|
|
513
|
+
declare const HALLOWEEN_CONFIG: {
|
|
514
|
+
baseParticleCount: number;
|
|
515
|
+
colors: string[];
|
|
516
|
+
particleTypes: ParticleType[];
|
|
517
|
+
animationType: "float";
|
|
518
|
+
physics: {
|
|
519
|
+
speed: number;
|
|
520
|
+
drift: number;
|
|
521
|
+
rotation: number;
|
|
522
|
+
scale: [number, number];
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Generate particles for Halloween effect
|
|
527
|
+
*/
|
|
528
|
+
declare function generateHalloweenParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
529
|
+
interface HalloweenEffectProps {
|
|
530
|
+
particles: ParticleData[];
|
|
531
|
+
viewport: Viewport;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Halloween Effect Component
|
|
535
|
+
* Renders flying bats with erratic movement, floating pumpkins and spiders
|
|
536
|
+
* Orange/purple/black color palette
|
|
537
|
+
*/
|
|
538
|
+
declare const HalloweenEffect: React.FC<HalloweenEffectProps>;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Thanksgiving effect configuration
|
|
542
|
+
*/
|
|
543
|
+
declare const THANKSGIVING_CONFIG: {
|
|
544
|
+
baseParticleCount: number;
|
|
545
|
+
colors: string[];
|
|
546
|
+
particleTypes: readonly ["leaf"];
|
|
547
|
+
animationType: "fall";
|
|
548
|
+
physics: {
|
|
549
|
+
speed: number;
|
|
550
|
+
drift: number;
|
|
551
|
+
rotation: number;
|
|
552
|
+
scale: [number, number];
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Generate leaf particles for Thanksgiving effect
|
|
557
|
+
*/
|
|
558
|
+
declare function generateThanksgivingParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
559
|
+
interface ThanksgivingEffectProps {
|
|
560
|
+
particles: ParticleData[];
|
|
561
|
+
viewport: Viewport;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Thanksgiving Effect Component
|
|
565
|
+
* Renders falling autumn leaves with tumbling rotation
|
|
566
|
+
* Orange/brown color palette
|
|
567
|
+
*/
|
|
568
|
+
declare const ThanksgivingEffect: React.FC<ThanksgivingEffectProps>;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Diwali effect configuration
|
|
572
|
+
*/
|
|
573
|
+
declare const DIWALI_CONFIG: {
|
|
574
|
+
baseParticleCount: number;
|
|
575
|
+
colors: string[];
|
|
576
|
+
particleTypes: ParticleType[];
|
|
577
|
+
animationType: "float";
|
|
578
|
+
physics: {
|
|
579
|
+
speed: number;
|
|
580
|
+
drift: number;
|
|
581
|
+
rotation: number;
|
|
582
|
+
scale: [number, number];
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
/**
|
|
586
|
+
* Generate particles for Diwali effect
|
|
587
|
+
*/
|
|
588
|
+
declare function generateDiwaliParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
589
|
+
interface DiwaliEffectProps {
|
|
590
|
+
particles: ParticleData[];
|
|
591
|
+
viewport: Viewport;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Diwali Effect Component
|
|
595
|
+
* Renders glowing diyas with flickering, golden sparkles and rangoli patterns
|
|
596
|
+
* Golden/orange color palette
|
|
597
|
+
*/
|
|
598
|
+
declare const DiwaliEffect: React.FC<DiwaliEffectProps>;
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Chinese New Year effect configuration
|
|
602
|
+
*/
|
|
603
|
+
declare const CHINESENEWYEAR_CONFIG: {
|
|
604
|
+
baseParticleCount: number;
|
|
605
|
+
colors: string[];
|
|
606
|
+
particleTypes: ParticleType[];
|
|
607
|
+
animationType: "rise";
|
|
608
|
+
physics: {
|
|
609
|
+
speed: number;
|
|
610
|
+
drift: number;
|
|
611
|
+
rotation: number;
|
|
612
|
+
scale: [number, number];
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* Generate particles for Chinese New Year effect
|
|
617
|
+
*/
|
|
618
|
+
declare function generateChineseNewYearParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
619
|
+
interface ChineseNewYearEffectProps {
|
|
620
|
+
particles: ParticleData[];
|
|
621
|
+
viewport: Viewport;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Chinese New Year Effect Component
|
|
625
|
+
* Renders rising red lanterns and golden fireworks
|
|
626
|
+
* Red/gold color palette
|
|
627
|
+
*/
|
|
628
|
+
declare const ChineseNewYearEffect: React.FC<ChineseNewYearEffectProps>;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Holi effect configuration
|
|
632
|
+
*/
|
|
633
|
+
declare const HOLI_CONFIG: {
|
|
634
|
+
baseParticleCount: number;
|
|
635
|
+
colors: string[];
|
|
636
|
+
particleTypes: readonly ["color-splash"];
|
|
637
|
+
animationType: "scatter";
|
|
638
|
+
physics: {
|
|
639
|
+
speed: number;
|
|
640
|
+
drift: number;
|
|
641
|
+
rotation: number;
|
|
642
|
+
scale: [number, number];
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* Generate particles for Holi effect
|
|
647
|
+
*/
|
|
648
|
+
declare function generateHoliParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
649
|
+
interface HoliEffectProps {
|
|
650
|
+
particles: ParticleData[];
|
|
651
|
+
viewport: Viewport;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Holi Effect Component
|
|
655
|
+
* Renders scattered color powder bursts
|
|
656
|
+
* Vibrant multi-color palette
|
|
657
|
+
*/
|
|
658
|
+
declare const HoliEffect: React.FC<HoliEffectProps>;
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Eid effect configuration
|
|
662
|
+
*/
|
|
663
|
+
declare const EID_CONFIG: {
|
|
664
|
+
baseParticleCount: number;
|
|
665
|
+
colors: string[];
|
|
666
|
+
particleTypes: ParticleType[];
|
|
667
|
+
animationType: "float";
|
|
668
|
+
physics: {
|
|
669
|
+
speed: number;
|
|
670
|
+
drift: number;
|
|
671
|
+
rotation: number;
|
|
672
|
+
scale: [number, number];
|
|
673
|
+
};
|
|
674
|
+
};
|
|
675
|
+
/**
|
|
676
|
+
* Generate particles for Eid effect
|
|
677
|
+
*/
|
|
678
|
+
declare function generateEidParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
679
|
+
interface EidEffectProps {
|
|
680
|
+
particles: ParticleData[];
|
|
681
|
+
viewport: Viewport;
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Eid Effect Component
|
|
685
|
+
* Renders floating crescent moons and twinkling stars
|
|
686
|
+
* Gold/silver/green color palette
|
|
687
|
+
*/
|
|
688
|
+
declare const EidEffect: React.FC<EidEffectProps>;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* St. Patrick's effect configuration
|
|
692
|
+
*/
|
|
693
|
+
declare const STPATRICKS_CONFIG: {
|
|
694
|
+
baseParticleCount: number;
|
|
695
|
+
colors: string[];
|
|
696
|
+
particleTypes: ParticleType[];
|
|
697
|
+
animationType: "fall";
|
|
698
|
+
physics: {
|
|
699
|
+
speed: number;
|
|
700
|
+
drift: number;
|
|
701
|
+
rotation: number;
|
|
702
|
+
scale: [number, number];
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
/**
|
|
706
|
+
* Generate particles for St. Patrick's effect
|
|
707
|
+
*/
|
|
708
|
+
declare function generateStPatricksParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
709
|
+
interface StPatricksEffectProps {
|
|
710
|
+
particles: ParticleData[];
|
|
711
|
+
viewport: Viewport;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* St. Patrick's Effect Component
|
|
715
|
+
* Renders falling shamrocks with spin
|
|
716
|
+
* Green color palette with gold accents
|
|
717
|
+
*/
|
|
718
|
+
declare const StPatricksEffect: React.FC<StPatricksEffectProps>;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Independence Day effect configuration
|
|
722
|
+
*/
|
|
723
|
+
declare const INDEPENDENCE_CONFIG: {
|
|
724
|
+
baseParticleCount: number;
|
|
725
|
+
colors: string[];
|
|
726
|
+
particleTypes: ParticleType[];
|
|
727
|
+
animationType: "explode";
|
|
728
|
+
physics: {
|
|
729
|
+
speed: number;
|
|
730
|
+
drift: number;
|
|
731
|
+
rotation: number;
|
|
732
|
+
scale: [number, number];
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
/**
|
|
736
|
+
* Generate particles for Independence Day effect
|
|
737
|
+
*/
|
|
738
|
+
declare function generateIndependenceParticles(count: number, viewport: Viewport, colors?: string[]): ParticleData[];
|
|
739
|
+
interface IndependenceEffectProps {
|
|
740
|
+
particles: ParticleData[];
|
|
741
|
+
viewport: Viewport;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Independence Day Effect Component
|
|
745
|
+
* Renders customizable color fireworks and patriotic confetti
|
|
746
|
+
* Default US colors (red, white, blue), customizable via colors prop
|
|
747
|
+
*/
|
|
748
|
+
declare const IndependenceEffect: React.FC<IndependenceEffectProps>;
|
|
749
|
+
|
|
750
|
+
type EffectGenerator = (count: number, viewport: Viewport, colors?: string[]) => ParticleData[];
|
|
751
|
+
declare const EFFECT_GENERATORS: Record<FestivalType, EffectGenerator>;
|
|
752
|
+
|
|
753
|
+
export { ANIMATION_VARIANTS, CHINESENEWYEAR_CONFIG, CHRISTMAS_CONFIG, ChineseNewYearEffect, ChristmasEffect, DIWALI_CONFIG, DiwaliEffect, EASTER_CONFIG, EFFECT_GENERATORS, EID_CONFIG, EasterEffect, EidEffect, FESTIVAL_CONFIGS, FESTIVAL_TYPES, FestivalRegistry, FestiveEffects, HALLOWEEN_CONFIG, HOLI_CONFIG, HalloweenEffect, HoliEffect, INDEPENDENCE_CONFIG, INTENSITY_CONFIG, IndependenceEffect, NEWYEAR_CONFIG, NewYearEffect, PARTICLE_SVGS, Particle, STPATRICKS_CONFIG, StPatricksEffect, THANKSGIVING_CONFIG, ThanksgivingEffect, VALENTINE_CONFIG, ValentineEffect, calculateParticleCount, createAnimationCustomData, createFestivalEffect, defaultRegistry, explodeVariants, fallVariants, floatVariants, generateChineseNewYearParticles, generateChristmasParticles, generateDiwaliParticles, generateEasterParticles, generateEidParticles, generateHalloweenParticles, generateHoliParticles, generateIndependenceParticles, generateNewYearParticles, generateParticles, generateStPatricksParticles, generateThanksgivingParticles, generateValentineParticles, getAnimationPropsForType, getExplodeTransition, getFallTransition, getFloatTransition, getParticleCount, getRiseTransition, getScatterTransition, getTransitionForType, riseVariants, scatterVariants, useReducedMotion };
|
|
754
|
+
export type { AnimationConfig, AnimationCustomData, AnimationType, EffectGenerator, FestivalConfig, FestivalEffect, FestivalType, FestiveEffectsProps, IntensityLevel, IntensitySettings, ParticleComponentProps, ParticleData, ParticleProps, ParticleType, PhysicsConfig, Viewport };
|