@hdcodedev/snowfall 1.0.4 → 1.0.6

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 CHANGED
@@ -1,8 +1,13 @@
1
- # @hdcodedev/snowfall
1
+ # [@hdcodedev/snowfall](https://next-snowfall.vercel.app)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@hdcodedev/snowfall.svg)](https://www.npmjs.com/package/@hdcodedev/snowfall)
4
+
2
5
 
3
6
  A realistic snowfall effect for React with physics-based accumulation on surfaces. Features melting, wind, and smart surface detection.
4
7
 
5
- ![ScreenRecording2025-12-22at21 55 51-ezgif com-optimize-2](https://github.com/user-attachments/assets/e8e6b910-d996-4386-b76e-43d087440708)
8
+ ![ScreenRecording2025-12-23at00 07 30-ezgif com-optimize](https://github.com/user-attachments/assets/49c4a537-7f04-4043-806e-21478f419dd7)
9
+
10
+
6
11
 
7
12
  ## Features
8
13
 
@@ -135,10 +140,6 @@ Hook to access snowfall controls. Must be used within `SnowfallProvider`.
135
140
  }
136
141
  ```
137
142
 
138
- ## Demo
139
-
140
- Check out the [live demo](https://snowfall-2026.vercel.app)
141
-
142
143
  ## Tips
143
144
 
144
145
  - The snowfall canvas has `pointer-events: none`, so it won't interfere with user interactions
package/dist/index.d.mts CHANGED
@@ -21,18 +21,41 @@ interface PhysicsConfig {
21
21
  MIN: number;
22
22
  MAX: number;
23
23
  };
24
+ MAX_SURFACES: number;
24
25
  }
25
26
  declare const DEFAULT_PHYSICS: PhysicsConfig;
27
+ interface PerformanceMetrics {
28
+ fps: number;
29
+ frameTime: number;
30
+ scanTime: number;
31
+ rectUpdateTime: number;
32
+ surfaceCount: number;
33
+ flakeCount: number;
34
+ maxFlakes: number;
35
+ rafGap: number;
36
+ clearTime: number;
37
+ physicsTime: number;
38
+ drawTime: number;
39
+ }
26
40
  interface SnowfallContextType {
27
41
  isEnabled: boolean;
28
42
  toggleSnow: () => void;
29
43
  physicsConfig: PhysicsConfig;
30
44
  updatePhysicsConfig: (config: Partial<PhysicsConfig>) => void;
31
45
  resetPhysics: () => void;
46
+ debugMode: boolean;
47
+ toggleDebug: () => void;
48
+ metrics: PerformanceMetrics | null;
49
+ setMetrics: (metrics: PerformanceMetrics) => void;
32
50
  }
33
- declare function SnowfallProvider({ children }: {
51
+ declare function SnowfallProvider({ children, initialDebug }: {
34
52
  children: ReactNode;
53
+ initialDebug?: boolean;
35
54
  }): react_jsx_runtime.JSX.Element;
36
55
  declare function useSnowfall(): SnowfallContextType;
37
56
 
38
- export { DEFAULT_PHYSICS, type PhysicsConfig, Snowfall, SnowfallProvider, useSnowfall };
57
+ declare function DebugPanel({ defaultOpen }: {
58
+ defaultOpen?: boolean;
59
+ }): react_jsx_runtime.JSX.Element | null;
60
+
61
+ export { DEFAULT_PHYSICS, DebugPanel, type PerformanceMetrics, type PhysicsConfig, Snowfall, SnowfallProvider, useSnowfall };
package/dist/index.d.ts CHANGED
@@ -21,18 +21,41 @@ interface PhysicsConfig {
21
21
  MIN: number;
22
22
  MAX: number;
23
23
  };
24
+ MAX_SURFACES: number;
24
25
  }
25
26
  declare const DEFAULT_PHYSICS: PhysicsConfig;
27
+ interface PerformanceMetrics {
28
+ fps: number;
29
+ frameTime: number;
30
+ scanTime: number;
31
+ rectUpdateTime: number;
32
+ surfaceCount: number;
33
+ flakeCount: number;
34
+ maxFlakes: number;
35
+ rafGap: number;
36
+ clearTime: number;
37
+ physicsTime: number;
38
+ drawTime: number;
39
+ }
26
40
  interface SnowfallContextType {
27
41
  isEnabled: boolean;
28
42
  toggleSnow: () => void;
29
43
  physicsConfig: PhysicsConfig;
30
44
  updatePhysicsConfig: (config: Partial<PhysicsConfig>) => void;
31
45
  resetPhysics: () => void;
46
+ debugMode: boolean;
47
+ toggleDebug: () => void;
48
+ metrics: PerformanceMetrics | null;
49
+ setMetrics: (metrics: PerformanceMetrics) => void;
32
50
  }
33
- declare function SnowfallProvider({ children }: {
51
+ declare function SnowfallProvider({ children, initialDebug }: {
34
52
  children: ReactNode;
53
+ initialDebug?: boolean;
35
54
  }): react_jsx_runtime.JSX.Element;
36
55
  declare function useSnowfall(): SnowfallContextType;
37
56
 
38
- export { DEFAULT_PHYSICS, type PhysicsConfig, Snowfall, SnowfallProvider, useSnowfall };
57
+ declare function DebugPanel({ defaultOpen }: {
58
+ defaultOpen?: boolean;
59
+ }): react_jsx_runtime.JSX.Element | null;
60
+
61
+ export { DEFAULT_PHYSICS, DebugPanel, type PerformanceMetrics, type PhysicsConfig, Snowfall, SnowfallProvider, useSnowfall };