@marcosdemik/liquidglass 2.0.4 → 2.0.5
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 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ The component includes a `"use client"` directive, so it works out of the box wi
|
|
|
71
71
|
| `intensity` | `number` | `0.7` | Refraction intensity at the glass edge (0-1) |
|
|
72
72
|
| `edgeSize` | `number` | `30` | Thickness of the glass edge refraction zone in pixels |
|
|
73
73
|
| `specularWidth` | `number` | `0.02` | Specular rim thickness relative to the smallest dimension (0-1) |
|
|
74
|
+
| `quality` | `number` | `2` | Supersampling multiplier for the displacement map (higher = smoother gradients) |
|
|
74
75
|
|
|
75
76
|
### Hover Animation
|
|
76
77
|
|
|
@@ -189,7 +190,7 @@ All standard `<button>` HTML attributes (`onClick`, `disabled`, `aria-label`, et
|
|
|
189
190
|
|
|
190
191
|
The effect is built from three layers:
|
|
191
192
|
|
|
192
|
-
1. **WebGL Displacement + Specular Maps** - A GLSL fragment shader computes a displacement map and a specular highlight map from a signed distance field (SDF) of a rounded rectangle. 3D surface normals are derived from the SDF to create realistic light refraction at the edges.
|
|
193
|
+
1. **WebGL Displacement + Specular Maps** - A GLSL fragment shader (highp precision) computes a displacement map and a specular highlight map from a signed distance field (SDF) of a rounded rectangle. 3D surface normals are derived from the SDF to create realistic light refraction at the edges. Maps are rendered at `quality`x resolution (default 2x) for smoother gradients, output as Blob URLs via `toBlob()`, and cached by parameters so multiple instances with the same props share a single set of maps.
|
|
193
194
|
|
|
194
195
|
2. **SVG Filter Chain** - The displacement map feeds into an SVG `<filter>` with `feDisplacementMap` for background refraction, `feColorMatrix` for saturation control, and `feBlend` to composite the specular highlight layer on top. A `brightness()` function in the backdrop-filter adds a subtle glow.
|
|
195
196
|
|
|
@@ -208,6 +209,7 @@ New props added:
|
|
|
208
209
|
|
|
209
210
|
- `brightness` - controls backdrop brightness (default `1.1`)
|
|
210
211
|
- `specularWidth` - controls the specular rim thickness (default `0.02`)
|
|
212
|
+
- `quality` - supersampling multiplier for smoother displacement maps (default `2`)
|
|
211
213
|
|
|
212
214
|
Changed defaults: `displacement` (35 -> 55), `blur` (2 -> 1), `saturation` (1.2 -> 150), `hoverScale` (1.05 -> 1.08), `hoverDisplacement` (65 -> 125), `hoverDuration` (0.4 -> 0.25), `glassColor` ("rgba(255,255,255,0.05)" -> "transparent").
|
|
213
215
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marcosdemik/liquidglass",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Liquid Glass UI effect for React - glassmorphism refraction with SVG filters, WebGL and GSAP animations",
|
|
5
5
|
"author": "Marcos Demik <marcosdemik>",
|
|
6
6
|
"license": "MIT",
|