@jayf0x/fluidity-js 0.2.1 → 0.2.2
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 +3 -2
- package/dist/globals.d.ts +7 -2
- package/dist/index.js +782 -740
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
[](https://bundlephobia.com/package/@jayf0x/fluidity-js)
|
|
6
6
|
|
|
7
|
-
<a href="https://
|
|
7
|
+
<a href="https://raw.githubusercontent.com/jayf0x/fluidity/main/assets/preview.gif">
|
|
8
8
|
<p align="center">
|
|
9
9
|
<img src="assets/preview.gif" alt="preview" height="300px"/>
|
|
10
10
|
</p>
|
|
@@ -22,7 +22,7 @@ bun add @jayf0x/fluidity-js
|
|
|
22
22
|
|
|
23
23
|
## React examples
|
|
24
24
|
|
|
25
|
-
**
|
|
25
|
+
**Text that moves with your cursor:**
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
28
|
import { FluidText } from '@jayf0x/fluidity-js';
|
|
@@ -62,6 +62,7 @@ export function Cover() {
|
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
64
|
import { useRef } from 'react';
|
|
65
|
+
|
|
65
66
|
import { FluidText } from '@jayf0x/fluidity-js';
|
|
66
67
|
|
|
67
68
|
export function Interactive() {
|
package/dist/globals.d.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
type FluidAlgorithm = 'standard' | 'glass' | 'ink' | 'aurora' | 'ripple';
|
|
4
4
|
|
|
5
|
+
/** RGB tuple (values 0–1) or a CSS hex string (#RGB, #RRGGBB, #RRGGBBAA — alpha stripped). */
|
|
6
|
+
type FluidColor = [number, number, number] | `#${string}`;
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* Granular performance/quality controls. Both axes are independent — you can
|
|
7
10
|
* run a sharp display at a coarser simulation, or vice versa.
|
|
@@ -24,8 +27,8 @@ interface FluidConfig {
|
|
|
24
27
|
refraction: number;
|
|
25
28
|
specularExp: number;
|
|
26
29
|
shine: number;
|
|
27
|
-
waterColor:
|
|
28
|
-
glowColor:
|
|
30
|
+
waterColor: FluidColor;
|
|
31
|
+
glowColor: FluidColor;
|
|
29
32
|
algorithm: FluidAlgorithm;
|
|
30
33
|
warpStrength: number;
|
|
31
34
|
}
|
|
@@ -55,6 +58,8 @@ interface FluidBaseProps {
|
|
|
55
58
|
backgroundSize?: string | number;
|
|
56
59
|
/** enabled greater performance, but not every browser supports it */
|
|
57
60
|
useWebGPU?: boolean;
|
|
61
|
+
/** Enable transparent canvas (default true). Set false for a minor perf gain when transparency is not needed. */
|
|
62
|
+
enableAlpha?: boolean;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
interface FluidTextProps extends FluidBaseProps {
|