diff --git a/CHANGELOG.md b/CHANGELOG.md index c86b3a8..1aedee3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to Previewer are listed here. The format follows ## [Unreleased] +### Changed + +- The toolbar shows each button's shortcut: ⌘1–⌘4 on the devices, ⌘S on Screenshot, ⌘C on copy and Esc on close. The shortcut line under the phone is gone, so the phone gets a little more room. +- iPhone SE is black (Midnight) instead of white. +- iPad Pro 11″ is shown in landscape, 1210 × 834. + ## [1.1.0] - 2026-10-30 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 224ec67..e0b2ec0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,7 +51,7 @@ Everything about a device lives in [`extension/devices.json`](extension/devices. | ------------- | ------------------------------------------------------------------------------- | | `id` | Lower-case slug, used in screenshot file names. | | `name` | What the toolbar shows. | -| `viewport` | CSS pixel size of the full screen in portrait (`screen.width × screen.height`). | +| `viewport` | CSS pixel size of the full screen in the orientation shown (`screen.width × screen.height`). | | `pixelRatio` | The device's `devicePixelRatio`. Informational. | | `userAgent` | The User-Agent the device's default browser sends. | | `headers` | Extra request headers; `null` removes the header (Safari sends no client hints). | diff --git a/README.md b/README.md index 237288d..0e8f455 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ selected. Change the open shortcut at `chrome://extensions/shortcuts`. | iPhone 18 Pro | 402 × 874 | The current iPhone. | | iPhone SE | 375 × 667 | The smallest and shortest screen in common use: shows what falls below the fold. | | Pixel 11 | 412 × 924 | The current Pixel, and the typical Android width. | -| iPad Pro 11″ | 834 × 1210 | Tablet layout. Like Safari on iPad, it asks for the desktop site. | +| iPad Pro 11″ | 1210 × 834 | Tablet layout, in landscape. Like Safari on iPad, it asks for the desktop site. | Switching device keeps your place on the page. The page reloads only when you click the reload button. diff --git a/docs/devices.png b/docs/devices.png index 7960938..34ac190 100644 Binary files a/docs/devices.png and b/docs/devices.png differ diff --git a/docs/overlay.png b/docs/overlay.png index 7802524..4ec314f 100644 Binary files a/docs/overlay.png and b/docs/overlay.png differ diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json index 268bee9..de42657 100644 --- a/extension/_locales/en/messages.json +++ b/extension/_locales/en/messages.json @@ -67,22 +67,6 @@ "message": "Soft shadow around the frame", "description": "Setting hint" }, - "keysDevices": { - "message": "switch device", - "description": "Shortcut help" - }, - "keysSave": { - "message": "save", - "description": "Shortcut help" - }, - "keysCopy": { - "message": "copy", - "description": "Shortcut help" - }, - "keysClose": { - "message": "close", - "description": "Shortcut help" - }, "saved": { "message": "Saved $FILE$ to Downloads", "description": "Toast after saving", diff --git a/extension/_locales/nb/messages.json b/extension/_locales/nb/messages.json index 65dc99f..7431b1a 100644 --- a/extension/_locales/nb/messages.json +++ b/extension/_locales/nb/messages.json @@ -50,18 +50,6 @@ "shadowInScreenshotHint": { "message": "Myk skygge rundt rammen" }, - "keysDevices": { - "message": "bytt enhet" - }, - "keysSave": { - "message": "lagre" - }, - "keysCopy": { - "message": "kopier" - }, - "keysClose": { - "message": "lukk" - }, "saved": { "message": "Lagret $FILE$ i Nedlastinger", "placeholders": { diff --git a/extension/devices.json b/extension/devices.json index 5c72e01..b998874 100644 --- a/extension/devices.json +++ b/extension/devices.json @@ -91,21 +91,21 @@ "bodyRadius": 64, "screenRadius": 0, "rim": 3, - "color": "#e6dccf", - "edge": "#c4b8aa", - "front": "#f6f3ee", + "color": "#2c2f35", + "edge": "#1a1c20", + "front": "#0b0b0c", "statusBar": { "height": 20, "layout": "classic" }, "homeButton": { "radius": 33, - "ring": "#d3cdc4" + "ring": "#3a3d44" }, "earpiece": { "width": 52, "height": 6, - "color": "#d9d4cc" + "color": "#24262b" }, "homeIndicator": false, "buttons": [ @@ -187,8 +187,8 @@ "id": "ipad-pro-11", "name": "iPad Pro 11″", "viewport": { - "width": 834, - "height": 1210 + "width": 1210, + "height": 834 }, "pixelRatio": 2, "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15", @@ -215,21 +215,10 @@ "layout": "tablet" }, "camera": { - "edge": "right" + "edge": "top" }, "homeIndicator": true, - "buttons": [ - { - "side": "right", - "top": 70, - "length": 54 - }, - { - "side": "right", - "top": 136, - "length": 54 - } - ] + "buttons": [] } } ] diff --git a/extension/frame.js b/extension/frame.js index ddfbb2e..8c3428f 100644 --- a/extension/frame.js +++ b/extension/frame.js @@ -58,9 +58,12 @@ shapes.push(rect(cx - e.width / 2, cy - e.height / 2, e.width, e.height, e.height / 2, e.color)); shapes.push({ type: 'circle', cx: cx - e.width / 2 - 26, cy, r: 5, fill: '#2b2f3a' }); } - if (f.camera?.edge === 'right') { - shapes.push({ type: 'circle', cx: x + g.bodyWidth - f.bezel.right / 2, cy: g.bodyHeight / 2, r: 3.5, fill: '#2b2f3a' }); - } + // Tablets have the front camera on one edge, centred in the bezel. + const camera = { + top: [cx, f.bezel.top / 2], + right: [x + g.bodyWidth - f.bezel.right / 2, g.bodyHeight / 2], + }[f.camera?.edge]; + if (camera) shapes.push({ type: 'circle', cx: camera[0], cy: camera[1], r: 3.5, fill: '#2b2f3a' }); if (f.homeButton) { shapes.push({ type: 'circle', diff --git a/extension/overlay.css b/extension/overlay.css index 26c0cc5..fbc7af1 100644 --- a/extension/overlay.css +++ b/extension/overlay.css @@ -147,6 +147,31 @@ input:focus-visible { .icon:hover, .icon[aria-expanded="true"] { background: var(--bar-line); } +/* Icon buttons that also show their shortcut */ +.icon.keyed { + width: auto; + padding: 0 10px 0 11px; + display: inline-flex; + gap: 7px; +} + +/* Shortcut labels on the toolbar buttons */ +.bar kbd { + font: 500 11px/1 var(--mono); + padding: 3px 5px; + border-radius: 4px; + background: var(--bar-line); + color: var(--bar-muted); +} + +.seg kbd { margin-left: 7px; } +.seg button[aria-checked="true"] kbd { color: var(--bar-fg); } + +.primary kbd { + background: rgba(255, 255, 255, 0.2); + color: var(--accent-fg); +} + svg.i { width: 18px; height: 18px; @@ -192,27 +217,6 @@ svg.i { font-size: 12px; } -/* Shortcut line under the phone, on the dark backdrop */ -.shortcuts { - display: flex; - flex-wrap: wrap; - justify-content: center; - gap: 4px 16px; - max-width: 100%; - color: var(--caption); - font-size: 12px; -} - -.shortcuts span { white-space: nowrap; } - -kbd { - font: 500 11px/1 var(--mono); - padding: 2px 5px; - border-radius: 4px; - background: rgba(255, 255, 255, 0.16); - color: #fff; -} - .switch { appearance: none; flex: none; @@ -356,6 +360,14 @@ iframe { .toast[hidden] { display: none; } +/* With the shortcut labels the toolbar is about 940px wide on a Mac and 1100px + with Ctrl+ labels; below that they would wrap it onto two rows. The tooltips + still name the shortcuts. */ +@media (max-width: 1140px) { + .bar kbd { display: none; } + .icon.keyed { width: 40px; padding: 0; } +} + @media (max-width: 720px) { .seg button { padding: 0 9px; font-size: 12px; } } diff --git a/extension/overlay.js b/extension/overlay.js index 9ba8a60..3b86f0a 100644 --- a/extension/overlay.js +++ b/extension/overlay.js @@ -89,7 +89,6 @@
-