@present-day/device 0.2.0 → 0.2.1
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 +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,15 @@ Phone and tablet frames for screenshots, embedded pages and live content. Every
|
|
|
4
4
|
|
|
5
5
|
The frame takes its shape from the content: the phone screen is 390 × 844 CSS pixels (an iPhone 12 to 14), so a screenshot or a page laid out at that size fills it exactly. The real-phone presets also draw the status bar and tell the content where the cutout is, the way a phone's safe area does.
|
|
6
6
|
|
|
7
|
+
<table>
|
|
8
|
+
<tr>
|
|
9
|
+
<td align="center"><img src="https://raw.githubusercontent.com/present-day/device/main/.github/readme/phone.webp" alt="The phone preset showing a screenshot" width="160"><br><code>phone</code></td>
|
|
10
|
+
<td align="center"><img src="https://raw.githubusercontent.com/present-day/device/main/.github/readme/iphone-16-pro.webp" alt="The iPhone 16 Pro preset with its Dynamic Island and status bar" width="160"><br><code>iphone-16-pro</code></td>
|
|
11
|
+
<td align="center"><img src="https://raw.githubusercontent.com/present-day/device/main/.github/readme/pixel-9.webp" alt="The Pixel 9 preset with its punch-hole camera" width="160"><br><code>pixel-9</code></td>
|
|
12
|
+
<td align="center"><img src="https://raw.githubusercontent.com/present-day/device/main/.github/readme/tablet.webp" alt="The tablet preset showing a screenshot" width="320"><br><code>tablet</code></td>
|
|
13
|
+
</tr>
|
|
14
|
+
</table>
|
|
15
|
+
|
|
7
16
|
```sh
|
|
8
17
|
npm i @present-day/device
|
|
9
18
|
```
|
|
@@ -65,6 +74,14 @@ On a preset with a safe area, `safeArea` decides how the content meets the cutou
|
|
|
65
74
|
| `expose` | | Content runs edge to edge under a transparent status bar and gets the insets, so it can clear the cutout itself |
|
|
66
75
|
| `none` | `src` | No status bar or insets; a screenshot carries its own |
|
|
67
76
|
|
|
77
|
+
<table>
|
|
78
|
+
<tr>
|
|
79
|
+
<td align="center"><img src="https://raw.githubusercontent.com/present-day/device/main/.github/readme/safe-area-reserve.webp" alt="Reserve: solid status bar and home bands around the content" width="180"><br><code>reserve</code></td>
|
|
80
|
+
<td align="center"><img src="https://raw.githubusercontent.com/present-day/device/main/.github/readme/iphone-16-pro.webp" alt="Expose: content runs edge to edge and clears the Dynamic Island itself" width="180"><br><code>expose</code></td>
|
|
81
|
+
<td align="center"><img src="https://raw.githubusercontent.com/present-day/device/main/.github/readme/safe-area-none.webp" alt="None: no status bar or insets, so the header sits under the Dynamic Island" width="180"><br><code>none</code></td>
|
|
82
|
+
</tr>
|
|
83
|
+
</table>
|
|
84
|
+
|
|
68
85
|
In `expose`, content reads four CSS variables, `--pd-safe-top`, `--pd-safe-right`, `--pd-safe-bottom` and `--pd-safe-left`. Fall back to `env()` and the same CSS works on a real phone:
|
|
69
86
|
|
|
70
87
|
```css
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@present-day/device",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Phone and tablet frames for screenshots, embedded pages and live content, drawn in CSS from one set of proportions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|