liquidglass-ts 0.1.0 → 0.1.3
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 +23 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/bradleyseanf/liquidglass-ts/actions/workflows/browsers.yml"><img alt="Browser checks" src="https://github.com/bradleyseanf/liquidglass-ts/actions/workflows/browsers.yml/badge.svg?branch=dev"></a>
|
|
3
|
+
<a href="https://www.npmjs.com/package/liquidglass-ts"><img alt="npm version" src="https://img.shields.io/npm/v/liquidglass-ts/latest?cacheSeconds=300"></a>
|
|
4
|
+
<a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-blue"></a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://bradleyseanf.github.io/liquidglass-ts/"><picture>
|
|
9
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/bradleyseanf/liquidglass-ts/main/assets/wordmark-dark.svg">
|
|
10
|
+
<img alt="liquidglass-ts" width="232" src="https://raw.githubusercontent.com/bradleyseanf/liquidglass-ts/main/assets/wordmark-light.svg">
|
|
11
|
+
</picture></a>
|
|
12
|
+
</p>
|
|
6
13
|
|
|
7
14
|
A drop-in, TypeScript-only take on glassmorphism, aiming for a 1:1 recreation of Apple’s Liquid Glass. Live lenses bend text and pictures as you drag. Controls expand and spring back when held. Zero runtime dependencies. No WebGL.
|
|
8
15
|
|
|
9
|
-
|
|
16
|
+
<p align="center"><a href="https://bradleyseanf.github.io/liquidglass-ts/"><img width="142" height="42" alt="Try Demo" src="https://raw.githubusercontent.com/bradleyseanf/liquidglass-ts/main/assets/try-demo.svg"></a></p>
|
|
17
|
+
|
|
18
|
+
Install with `npm install liquidglass-ts`.
|
|
10
19
|
|
|
11
20
|
```ts
|
|
12
21
|
import "liquidglass-ts/controls.css";
|
|
@@ -21,8 +30,14 @@ document.body.append(wifi.element);
|
|
|
21
30
|
| --- | --- |
|
|
22
31
|
| Lens over HTML text or pictures | `attachGlass(overlay, material, radius, backdrop)` |
|
|
23
32
|
| Lens over a canvas you draw | `new LiquidGlass().draw(…)` |
|
|
24
|
-
| Tab bar
|
|
33
|
+
| Tab bar | `createTabBar` |
|
|
34
|
+
| Slider | `createGlassSlider` |
|
|
35
|
+
| Switch | `createGlassSwitch` |
|
|
25
36
|
|
|
26
|
-
|
|
37
|
+
| Held control | Live playground capture |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| Tab bar mid-drag | <img width="310" alt="The glass selection refracts the Library and Favorites tabs" src="https://raw.githubusercontent.com/bradleyseanf/liquidglass-ts/main/assets/tab-bar-held.png"> |
|
|
40
|
+
| Slider mid-drag | <img width="205" alt="Expanded glass slider thumb bending the blue track" src="https://raw.githubusercontent.com/bradleyseanf/liquidglass-ts/main/assets/slider-held.png"> |
|
|
41
|
+
| Switch held on | <img width="106" alt="Expanded switch lens revealing the green rail" src="https://raw.githubusercontent.com/bradleyseanf/liquidglass-ts/main/assets/switch-held.png"> |
|
|
27
42
|
|
|
28
43
|
For HTML lenses, position the overlay above a separate backdrop element and pass both to `attachGlass`. For canvas lenses, redraw after the source or lens moves.
|