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.
@@ -0,0 +1,15 @@
1
+ export { ChristmasEffect, generateChristmasParticles, CHRISTMAS_CONFIG } from './ChristmasEffect';
2
+ export { NewYearEffect, generateNewYearParticles, NEWYEAR_CONFIG } from './NewYearEffect';
3
+ export { ValentineEffect, generateValentineParticles, VALENTINE_CONFIG } from './ValentineEffect';
4
+ export { EasterEffect, generateEasterParticles, EASTER_CONFIG } from './EasterEffect';
5
+ export { HalloweenEffect, generateHalloweenParticles, HALLOWEEN_CONFIG } from './HalloweenEffect';
6
+ export { ThanksgivingEffect, generateThanksgivingParticles, THANKSGIVING_CONFIG } from './ThanksgivingEffect';
7
+ export { DiwaliEffect, generateDiwaliParticles, DIWALI_CONFIG } from './DiwaliEffect';
8
+ export { ChineseNewYearEffect, generateChineseNewYearParticles, CHINESENEWYEAR_CONFIG } from './ChineseNewYearEffect';
9
+ export { HoliEffect, generateHoliParticles, HOLI_CONFIG } from './HoliEffect';
10
+ export { EidEffect, generateEidParticles, EID_CONFIG } from './EidEffect';
11
+ export { StPatricksEffect, generateStPatricksParticles, STPATRICKS_CONFIG } from './StPatricksEffect';
12
+ export { IndependenceEffect, generateIndependenceParticles, INDEPENDENCE_CONFIG } from './IndependenceEffect';
13
+ import type { FestivalType, ParticleData, Viewport } from '../types';
14
+ export type EffectGenerator = (count: number, viewport: Viewport, colors?: string[]) => ParticleData[];
15
+ export declare const EFFECT_GENERATORS: Record<FestivalType, EffectGenerator>;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Hook to detect if the user prefers reduced motion
3
+ * Listens to the prefers-reduced-motion media query
4
+ *
5
+ * @returns boolean - true if user prefers reduced motion, false otherwise
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * const prefersReducedMotion = useReducedMotion();
10
+ * if (prefersReducedMotion) {
11
+ * // Don't render animations
12
+ * return null;
13
+ * }
14
+ * ```
15
+ */
16
+ export declare function useReducedMotion(): boolean;
17
+ /**
18
+ * Hook to detect document visibility changes
19
+ * Returns true when the document is visible, false when hidden
20
+ *
21
+ * This is useful for pausing animations when the user switches tabs
22
+ * to save resources and improve performance.
23
+ *
24
+ * @returns boolean - true if document is visible, false if hidden
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * const isVisible = useDocumentVisibility();
29
+ * if (!isVisible) {
30
+ * // Pause animations
31
+ * }
32
+ * ```
33
+ */
34
+ export declare function useDocumentVisibility(): boolean;
35
+ /**
36
+ * Hook to manage cleanup of timeouts
37
+ * Returns a function to set a timeout that will be automatically cleared on unmount
38
+ *
39
+ * @returns Object with setTimeout and clearAllTimeouts functions
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * const { setTimeout: setManagedTimeout, clearAllTimeouts } = useTimeoutManager();
44
+ * setManagedTimeout(() => console.log('done'), 1000);
45
+ * // Timeout will be automatically cleared on unmount
46
+ * ```
47
+ */
48
+ export declare function useTimeoutManager(): {
49
+ setTimeout: (callback: () => void, delay: number) => NodeJS.Timeout;
50
+ clearTimeout: (timeoutId: ReturnType<typeof setTimeout>) => void;
51
+ clearAllTimeouts: () => void;
52
+ };
53
+ /**
54
+ * Hook to manage cleanup of animation frame requests
55
+ * Returns a function to request animation frame that will be automatically cancelled on unmount
56
+ *
57
+ * @returns Object with requestAnimationFrame and cancelAllAnimationFrames functions
58
+ *
59
+ * @example
60
+ * ```tsx
61
+ * const { requestAnimationFrame: requestFrame, cancelAllAnimationFrames } = useAnimationFrameManager();
62
+ * requestFrame(() => console.log('frame'));
63
+ * // Animation frame will be automatically cancelled on unmount
64
+ * ```
65
+ */
66
+ export declare function useAnimationFrameManager(): {
67
+ requestAnimationFrame: (callback: FrameRequestCallback) => number;
68
+ cancelAnimationFrame: (frameId: number) => void;
69
+ cancelAllAnimationFrames: () => void;
70
+ };