@zakisheriff/liquid-glass 0.3.16 → 0.3.18
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/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -271,6 +271,12 @@ interface GlassShape {
|
|
|
271
271
|
* so content the rim draws in is styled like the rest of the copy.
|
|
272
272
|
*/
|
|
273
273
|
copy?: boolean | 'refract';
|
|
274
|
+
/**
|
|
275
|
+
* With a copied lens, never refract the live backdrop too (Chromium would):
|
|
276
|
+
* the glass behind the copy stays clear in every browser, so the lens looks
|
|
277
|
+
* the same everywhere.
|
|
278
|
+
*/
|
|
279
|
+
copyOnly?: boolean;
|
|
274
280
|
}
|
|
275
281
|
/** Only Chromium runs SVG filters inside `backdrop-filter`. */
|
|
276
282
|
declare function canRefractBackdrop(): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -271,6 +271,12 @@ interface GlassShape {
|
|
|
271
271
|
* so content the rim draws in is styled like the rest of the copy.
|
|
272
272
|
*/
|
|
273
273
|
copy?: boolean | 'refract';
|
|
274
|
+
/**
|
|
275
|
+
* With a copied lens, never refract the live backdrop too (Chromium would):
|
|
276
|
+
* the glass behind the copy stays clear in every browser, so the lens looks
|
|
277
|
+
* the same everywhere.
|
|
278
|
+
*/
|
|
279
|
+
copyOnly?: boolean;
|
|
274
280
|
}
|
|
275
281
|
/** Only Chromium runs SVG filters inside `backdrop-filter`. */
|
|
276
282
|
declare function canRefractBackdrop(): boolean;
|
package/dist/index.js
CHANGED
|
@@ -992,7 +992,8 @@ function resolve(shape, width, height) {
|
|
|
992
992
|
strength: shape.strength ?? 1,
|
|
993
993
|
inset: shape.inset ?? 0,
|
|
994
994
|
stretch: shape.stretch ?? 0,
|
|
995
|
-
copy: shape.copy ?? false
|
|
995
|
+
copy: shape.copy ?? false,
|
|
996
|
+
copyOnly: shape.copyOnly ?? false
|
|
996
997
|
};
|
|
997
998
|
}
|
|
998
999
|
function glassFor(width, height, radius, shape = {}, pad = 0, simple = false, fringe = false, box = false) {
|
|
@@ -1084,7 +1085,7 @@ function useRefraction(ref, shape = {}, enabled = true, mirror, mirrorActive) {
|
|
|
1084
1085
|
applyCopyFilter();
|
|
1085
1086
|
}
|
|
1086
1087
|
}
|
|
1087
|
-
if (live || bendCopy && chromium) {
|
|
1088
|
+
if (live || bendCopy && chromium && !shape.copyOnly) {
|
|
1088
1089
|
const backdrop = live ? baked.filter : glassFor(width, height, radius, { ...shape, zoom: 1, zoomX: 1, strength: (shape.strength ?? 1) * 0.45 }).filter;
|
|
1089
1090
|
element.style.setProperty("--lg-refraction", backdrop);
|
|
1090
1091
|
element.setAttribute("data-lg-refract", shape.kind ?? "surface");
|
|
@@ -2150,7 +2151,7 @@ function LensTrack({
|
|
|
2150
2151
|
const overhang = tabbar ? 14 : 12;
|
|
2151
2152
|
useRefraction(
|
|
2152
2153
|
lens,
|
|
2153
|
-
{ kind: "lens", strength: 1, stretch: 1, bezel: tabbar ? 24 : 16, zoom, dispersion: 1, copy: "refract" },
|
|
2154
|
+
{ kind: "lens", strength: 1, stretch: 1, bezel: tabbar ? 24 : 16, zoom, dispersion: 1, copy: "refract", copyOnly: true },
|
|
2154
2155
|
true,
|
|
2155
2156
|
bar,
|
|
2156
2157
|
() => bar.current?.hasAttribute("data-lifted") ?? false
|
|
@@ -2166,8 +2167,8 @@ function LensTrack({
|
|
|
2166
2167
|
contentZoom: zoom,
|
|
2167
2168
|
copied: true,
|
|
2168
2169
|
swell: tabbar ? 8 : 14,
|
|
2169
|
-
//
|
|
2170
|
-
pull:
|
|
2170
|
+
// Neither bar stretches or moves up and down.
|
|
2171
|
+
pull: false
|
|
2171
2172
|
}
|
|
2172
2173
|
);
|
|
2173
2174
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|