@votax572002/fluxfx 0.0.0-stage → 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/fluxfx.min.js +1297 -0
- package/dist/index.cjs +1297 -0
- package/dist/index.d.cts +206 -0
- package/dist/index.d.ts +206 -0
- package/dist/index.js +1297 -0
- package/dist/react.cjs +1298 -0
- package/dist/react.d.cts +127 -0
- package/dist/react.d.ts +127 -0
- package/dist/react.js +1298 -0
- package/package.json +55 -4
- package/README.md +0 -3
package/dist/react.d.cts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type QualityLevel = 'low' | 'medium' | 'high';
|
|
4
|
+
interface PerformanceOptions {
|
|
5
|
+
/** Enable adaptive DPR scaling when FPS drops (default: true) */
|
|
6
|
+
dynamicResolution?: boolean;
|
|
7
|
+
/** Minimum DPR floor (default based on quality) */
|
|
8
|
+
minDpr?: number;
|
|
9
|
+
/** Maximum DPR cap (default based on quality) */
|
|
10
|
+
maxDpr?: number;
|
|
11
|
+
/** Run WebGL2 on a background thread via OffscreenCanvas (default: true) */
|
|
12
|
+
offscreen?: boolean;
|
|
13
|
+
/** Automatically pause rendering when scrolled out of view (default: true) */
|
|
14
|
+
pauseWhenHidden?: boolean;
|
|
15
|
+
/** Render a static frame & stop loop when OS Reduce Motion is enabled (default: true) */
|
|
16
|
+
respectReducedMotion?: boolean;
|
|
17
|
+
/** Track container scroll progress (uScroll) and velocity (uScrollVel) (default: false) */
|
|
18
|
+
trackScroll?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface FXOptions extends PerformanceOptions {
|
|
21
|
+
speed?: number;
|
|
22
|
+
quality?: QualityLevel;
|
|
23
|
+
colors?: string | [string, string, string] | string[];
|
|
24
|
+
color1?: string;
|
|
25
|
+
color2?: string;
|
|
26
|
+
color3?: string;
|
|
27
|
+
interactive?: boolean;
|
|
28
|
+
maxTilt?: number;
|
|
29
|
+
scale?: number;
|
|
30
|
+
perspective?: number;
|
|
31
|
+
glare?: boolean;
|
|
32
|
+
strength?: number;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function useFX<T extends HTMLElement = HTMLDivElement>(effect: string | string[], options?: FXOptions, disabled?: boolean): React.RefObject<T | null>;
|
|
37
|
+
interface AuroraProps extends React.HTMLAttributes<HTMLElement> {
|
|
38
|
+
as?: React.ElementType;
|
|
39
|
+
speed?: number;
|
|
40
|
+
quality?: 'low' | 'medium' | 'high';
|
|
41
|
+
colors?: [string, string, string];
|
|
42
|
+
interactive?: boolean;
|
|
43
|
+
respectReducedMotion?: boolean;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
}
|
|
46
|
+
declare function Aurora({ as, speed, quality, colors, interactive, respectReducedMotion, disabled, children, ...rest }: AuroraProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
47
|
+
interface LiquidMetalProps extends React.HTMLAttributes<HTMLElement> {
|
|
48
|
+
as?: React.ElementType;
|
|
49
|
+
speed?: number;
|
|
50
|
+
quality?: 'low' | 'medium' | 'high';
|
|
51
|
+
colors?: [string, string, string];
|
|
52
|
+
interactive?: boolean;
|
|
53
|
+
respectReducedMotion?: boolean;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare function LiquidMetal({ as, speed, quality, colors, interactive, respectReducedMotion, disabled, children, ...rest }: LiquidMetalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
57
|
+
interface FluidProps extends React.HTMLAttributes<HTMLElement> {
|
|
58
|
+
as?: React.ElementType;
|
|
59
|
+
speed?: number;
|
|
60
|
+
quality?: 'low' | 'medium' | 'high';
|
|
61
|
+
colors?: [string, string, string];
|
|
62
|
+
/** How long trails stay visible: 0.90 (fast fade) to 0.995 (long ink trails) */
|
|
63
|
+
dissipation?: number;
|
|
64
|
+
/** Brush size of cursor splash (default: 0.0045) */
|
|
65
|
+
radius?: number;
|
|
66
|
+
/** Vorticity / swirl strength (default: 1.4) */
|
|
67
|
+
swirl?: number;
|
|
68
|
+
interactive?: boolean;
|
|
69
|
+
respectReducedMotion?: boolean;
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
}
|
|
72
|
+
declare function Fluid({ as, speed, quality, colors, dissipation, radius, swirl, interactive, respectReducedMotion, disabled, children, ...rest }: FluidProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
73
|
+
interface TiltCardProps extends React.HTMLAttributes<HTMLElement> {
|
|
74
|
+
as?: React.ElementType;
|
|
75
|
+
maxTilt?: number;
|
|
76
|
+
scale?: number;
|
|
77
|
+
perspective?: number;
|
|
78
|
+
glare?: boolean;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare function TiltCard({ as, maxTilt, scale, perspective, glare, disabled, children, ...rest }: TiltCardProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
82
|
+
interface MagneticProps extends React.HTMLAttributes<HTMLElement> {
|
|
83
|
+
as?: React.ElementType;
|
|
84
|
+
strength?: number;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
}
|
|
87
|
+
declare function Magnetic({ as, strength, disabled, style, children, ...rest }: MagneticProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
88
|
+
interface InkProps extends React.HTMLAttributes<HTMLElement> {
|
|
89
|
+
as?: React.ElementType;
|
|
90
|
+
speed?: number;
|
|
91
|
+
quality?: 'low' | 'medium' | 'high';
|
|
92
|
+
colors?: [string, string, string];
|
|
93
|
+
/** Ink dispersion / fade retention: 0.92 to 0.996 (default: 0.982) */
|
|
94
|
+
dissipation?: number;
|
|
95
|
+
/** Brush radius for cursor ink strokes (default: 0.004) */
|
|
96
|
+
radius?: number;
|
|
97
|
+
/** Curl / tendril swirl intensity (default: 1.75) */
|
|
98
|
+
curl?: number;
|
|
99
|
+
interactive?: boolean;
|
|
100
|
+
respectReducedMotion?: boolean;
|
|
101
|
+
disabled?: boolean;
|
|
102
|
+
}
|
|
103
|
+
declare function Ink({ as, speed, quality, colors, dissipation, radius, curl, interactive, respectReducedMotion, disabled, children, ...rest }: InkProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
104
|
+
interface AetheriaProps extends React.HTMLAttributes<HTMLElement> {
|
|
105
|
+
as?: React.ElementType;
|
|
106
|
+
speed?: number;
|
|
107
|
+
quality?: 'low' | 'medium' | 'high';
|
|
108
|
+
colors?: [string, string, string];
|
|
109
|
+
/** Water backdrop hex (e.g., '#F5F3EE' for Sumi-e, '#060913' for Abyss) */
|
|
110
|
+
bgColor?: string;
|
|
111
|
+
/** Auto-detected from bgColor luminance, or pass explicitly (0 = dark abyss, 1 = light water) */
|
|
112
|
+
lightMode?: boolean | number;
|
|
113
|
+
/** Pigment absorption/luminance strength (default: 1.45) */
|
|
114
|
+
absorptionGain?: number;
|
|
115
|
+
/** Ink trail retention (default: 0.978) */
|
|
116
|
+
dissipation?: number;
|
|
117
|
+
/** Brush radius (default: 0.0032) */
|
|
118
|
+
radius?: number;
|
|
119
|
+
/** Curl swirl intensity (default: 1.85) */
|
|
120
|
+
curl?: number;
|
|
121
|
+
interactive?: boolean;
|
|
122
|
+
respectReducedMotion?: boolean;
|
|
123
|
+
disabled?: boolean;
|
|
124
|
+
}
|
|
125
|
+
declare function Aetheria({ as, speed, quality, colors, bgColor, lightMode, absorptionGain, dissipation, radius, curl, interactive, respectReducedMotion, disabled, children, ...rest }: AetheriaProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
126
|
+
|
|
127
|
+
export { Aetheria, type AetheriaProps, Aurora, type AuroraProps, Fluid, type FluidProps, Ink, type InkProps, LiquidMetal, type LiquidMetalProps, Magnetic, type MagneticProps, TiltCard, type TiltCardProps, useFX };
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type QualityLevel = 'low' | 'medium' | 'high';
|
|
4
|
+
interface PerformanceOptions {
|
|
5
|
+
/** Enable adaptive DPR scaling when FPS drops (default: true) */
|
|
6
|
+
dynamicResolution?: boolean;
|
|
7
|
+
/** Minimum DPR floor (default based on quality) */
|
|
8
|
+
minDpr?: number;
|
|
9
|
+
/** Maximum DPR cap (default based on quality) */
|
|
10
|
+
maxDpr?: number;
|
|
11
|
+
/** Run WebGL2 on a background thread via OffscreenCanvas (default: true) */
|
|
12
|
+
offscreen?: boolean;
|
|
13
|
+
/** Automatically pause rendering when scrolled out of view (default: true) */
|
|
14
|
+
pauseWhenHidden?: boolean;
|
|
15
|
+
/** Render a static frame & stop loop when OS Reduce Motion is enabled (default: true) */
|
|
16
|
+
respectReducedMotion?: boolean;
|
|
17
|
+
/** Track container scroll progress (uScroll) and velocity (uScrollVel) (default: false) */
|
|
18
|
+
trackScroll?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface FXOptions extends PerformanceOptions {
|
|
21
|
+
speed?: number;
|
|
22
|
+
quality?: QualityLevel;
|
|
23
|
+
colors?: string | [string, string, string] | string[];
|
|
24
|
+
color1?: string;
|
|
25
|
+
color2?: string;
|
|
26
|
+
color3?: string;
|
|
27
|
+
interactive?: boolean;
|
|
28
|
+
maxTilt?: number;
|
|
29
|
+
scale?: number;
|
|
30
|
+
perspective?: number;
|
|
31
|
+
glare?: boolean;
|
|
32
|
+
strength?: number;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function useFX<T extends HTMLElement = HTMLDivElement>(effect: string | string[], options?: FXOptions, disabled?: boolean): React.RefObject<T | null>;
|
|
37
|
+
interface AuroraProps extends React.HTMLAttributes<HTMLElement> {
|
|
38
|
+
as?: React.ElementType;
|
|
39
|
+
speed?: number;
|
|
40
|
+
quality?: 'low' | 'medium' | 'high';
|
|
41
|
+
colors?: [string, string, string];
|
|
42
|
+
interactive?: boolean;
|
|
43
|
+
respectReducedMotion?: boolean;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
}
|
|
46
|
+
declare function Aurora({ as, speed, quality, colors, interactive, respectReducedMotion, disabled, children, ...rest }: AuroraProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
47
|
+
interface LiquidMetalProps extends React.HTMLAttributes<HTMLElement> {
|
|
48
|
+
as?: React.ElementType;
|
|
49
|
+
speed?: number;
|
|
50
|
+
quality?: 'low' | 'medium' | 'high';
|
|
51
|
+
colors?: [string, string, string];
|
|
52
|
+
interactive?: boolean;
|
|
53
|
+
respectReducedMotion?: boolean;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare function LiquidMetal({ as, speed, quality, colors, interactive, respectReducedMotion, disabled, children, ...rest }: LiquidMetalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
57
|
+
interface FluidProps extends React.HTMLAttributes<HTMLElement> {
|
|
58
|
+
as?: React.ElementType;
|
|
59
|
+
speed?: number;
|
|
60
|
+
quality?: 'low' | 'medium' | 'high';
|
|
61
|
+
colors?: [string, string, string];
|
|
62
|
+
/** How long trails stay visible: 0.90 (fast fade) to 0.995 (long ink trails) */
|
|
63
|
+
dissipation?: number;
|
|
64
|
+
/** Brush size of cursor splash (default: 0.0045) */
|
|
65
|
+
radius?: number;
|
|
66
|
+
/** Vorticity / swirl strength (default: 1.4) */
|
|
67
|
+
swirl?: number;
|
|
68
|
+
interactive?: boolean;
|
|
69
|
+
respectReducedMotion?: boolean;
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
}
|
|
72
|
+
declare function Fluid({ as, speed, quality, colors, dissipation, radius, swirl, interactive, respectReducedMotion, disabled, children, ...rest }: FluidProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
73
|
+
interface TiltCardProps extends React.HTMLAttributes<HTMLElement> {
|
|
74
|
+
as?: React.ElementType;
|
|
75
|
+
maxTilt?: number;
|
|
76
|
+
scale?: number;
|
|
77
|
+
perspective?: number;
|
|
78
|
+
glare?: boolean;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare function TiltCard({ as, maxTilt, scale, perspective, glare, disabled, children, ...rest }: TiltCardProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
82
|
+
interface MagneticProps extends React.HTMLAttributes<HTMLElement> {
|
|
83
|
+
as?: React.ElementType;
|
|
84
|
+
strength?: number;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
}
|
|
87
|
+
declare function Magnetic({ as, strength, disabled, style, children, ...rest }: MagneticProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
88
|
+
interface InkProps extends React.HTMLAttributes<HTMLElement> {
|
|
89
|
+
as?: React.ElementType;
|
|
90
|
+
speed?: number;
|
|
91
|
+
quality?: 'low' | 'medium' | 'high';
|
|
92
|
+
colors?: [string, string, string];
|
|
93
|
+
/** Ink dispersion / fade retention: 0.92 to 0.996 (default: 0.982) */
|
|
94
|
+
dissipation?: number;
|
|
95
|
+
/** Brush radius for cursor ink strokes (default: 0.004) */
|
|
96
|
+
radius?: number;
|
|
97
|
+
/** Curl / tendril swirl intensity (default: 1.75) */
|
|
98
|
+
curl?: number;
|
|
99
|
+
interactive?: boolean;
|
|
100
|
+
respectReducedMotion?: boolean;
|
|
101
|
+
disabled?: boolean;
|
|
102
|
+
}
|
|
103
|
+
declare function Ink({ as, speed, quality, colors, dissipation, radius, curl, interactive, respectReducedMotion, disabled, children, ...rest }: InkProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
104
|
+
interface AetheriaProps extends React.HTMLAttributes<HTMLElement> {
|
|
105
|
+
as?: React.ElementType;
|
|
106
|
+
speed?: number;
|
|
107
|
+
quality?: 'low' | 'medium' | 'high';
|
|
108
|
+
colors?: [string, string, string];
|
|
109
|
+
/** Water backdrop hex (e.g., '#F5F3EE' for Sumi-e, '#060913' for Abyss) */
|
|
110
|
+
bgColor?: string;
|
|
111
|
+
/** Auto-detected from bgColor luminance, or pass explicitly (0 = dark abyss, 1 = light water) */
|
|
112
|
+
lightMode?: boolean | number;
|
|
113
|
+
/** Pigment absorption/luminance strength (default: 1.45) */
|
|
114
|
+
absorptionGain?: number;
|
|
115
|
+
/** Ink trail retention (default: 0.978) */
|
|
116
|
+
dissipation?: number;
|
|
117
|
+
/** Brush radius (default: 0.0032) */
|
|
118
|
+
radius?: number;
|
|
119
|
+
/** Curl swirl intensity (default: 1.85) */
|
|
120
|
+
curl?: number;
|
|
121
|
+
interactive?: boolean;
|
|
122
|
+
respectReducedMotion?: boolean;
|
|
123
|
+
disabled?: boolean;
|
|
124
|
+
}
|
|
125
|
+
declare function Aetheria({ as, speed, quality, colors, bgColor, lightMode, absorptionGain, dissipation, radius, curl, interactive, respectReducedMotion, disabled, children, ...rest }: AetheriaProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
126
|
+
|
|
127
|
+
export { Aetheria, type AetheriaProps, Aurora, type AuroraProps, Fluid, type FluidProps, Ink, type InkProps, LiquidMetal, type LiquidMetalProps, Magnetic, type MagneticProps, TiltCard, type TiltCardProps, useFX };
|