viewport-truth 1.0.6 → 1.0.7
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 +9 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
Stop guessing mobile viewport sizes. viewport-truth delivers stable, keyboard-aware visible viewport metrics (VisualViewport-first) across iOS Safari, Android Chrome, PWAs, and webviews—framework adapters included, SSR-safe, zero runtime deps.
|
|
13
13
|
|
|
14
|
+
<p align="center">
|
|
15
|
+
<img src="./assets/demo.min.gif" width="900" alt="Demo: stable visible viewport when keyboard opens">
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
*Demo: tracks the **visible** viewport (VisualViewport), keeping UI stable when the URL bar / keyboard changes the viewport.*
|
|
19
|
+
|
|
20
|
+
|
|
14
21
|
```bash
|
|
15
22
|
npm i viewport-truth
|
|
16
23
|
# or: yarn add viewport-truth
|
|
@@ -39,11 +46,8 @@ const unsub = vt.subscribe((v) => {
|
|
|
39
46
|
// vt.destroy();
|
|
40
47
|
```
|
|
41
48
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
> Run it in a real page (Vite/Parcel/Next) — the snippet won’t execute inside README.
|
|
46
|
-
> On mobile: scroll a bit (URL bar), then focus the input (keyboard).
|
|
49
|
+
## Demo snippet (keyboard + URL bar)
|
|
50
|
+
Use this in a real page (Vite/Parcel/Next). On mobile: scroll a bit (URL bar), then focus the input (keyboard).
|
|
47
51
|
|
|
48
52
|
```html
|
|
49
53
|
<div id="app" style="padding:16px 16px 96px">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viewport-truth",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Tiny zero‑config VisualViewport-first store for accurate visible viewport size in CSS pixels. Detects virtual keyboard, stabilizes resize/scroll jitter, and is SSR-safe across frameworks.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "AntonVoronezh",
|