Skip to content

Commit cf7a57f

Browse files
iPhone Duo: fit the Mac list on the outer display, add Duo App Store screenshots
1 parent 0154c67 commit cf7a57f

20 files changed

Lines changed: 14 additions & 8 deletions
1 MB
Loading

‎design/appstore/duo/de-2-panel.png‎

1.03 MB
Loading

‎design/appstore/duo/de-3-home.png‎

630 KB
Loading
563 KB
Loading
1 MB
Loading

‎design/appstore/duo/en-2-panel.png‎

1.03 MB
Loading

‎design/appstore/duo/en-3-home.png‎

625 KB
Loading
551 KB
Loading

‎design/appstore/frame.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<script>
1111
const q=new URLSearchParams(location.search);const W=innerWidth,H=innerHeight;const ipad=q.get('kind')==='ipad';
1212
const t=document.getElementById('t');t.innerHTML=q.get('title');
13-
const head=ipad?H*.17:H*.22;t.style.fontSize=(ipad?H*.052:H*.075)+'px';t.style.marginTop=(ipad?H*.055:H*.06)+'px';
13+
const head=ipad?H*.17:H*.22;t.style.fontSize=(ipad?H*.052:q.get('kind')==='duo'?H*.062:H*.075)+'px';t.style.marginTop=(ipad?H*.055:H*.06)+'px';
1414
const sw=+q.get('sw'),sh=+q.get('sh');const availH=H-head-(ipad?H*.06:H*.07),availW=W*(ipad?.86:.84);
1515
let s=Math.min(availW/sw,availH/sh);const w=sw*s,h=sh*s;const bez=ipad?H*.018:H*.022;
1616
const d=document.getElementById('d');d.style.width=(w+bez*2)+'px';d.style.height=(h+bez*2)+'px';d.style.padding=bez+'px';d.style.marginTop=(ipad?H*.035:H*.04)+'px';

‎design/appstore/frame.mjs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ const titles = {
44
'en-US': ['Your iPhone, now a <span>second Mac display</span>', 'Extend or mirror. <span>Wi-Fi or USB.</span>', 'Connects in <span>seconds</span>', 'Only the Macs <span>you allow</span>'],
55
'de-DE': ['Dein iPhone als <span>zweiter Mac-Bildschirm</span>', 'Erweitern oder spiegeln. <span>WLAN oder USB.</span>', 'In Sekunden <span>verbunden</span>', 'Nur Macs, die <span>du erlaubst</span>'],
66
};
7-
const sets = { pm: { w: 2868, h: 1320, files: ['pm-1-stream', 'pm-2-panel', 'pm-3-home', 'pm-4-approval'] }, ipad: { w: 2752, h: 2064, files: ['ipad-1-stream', 'ipad-2-panel', 'ipad-3-home', 'ipad-4-approval'] } };
7+
const sets = { pm: { w: 2868, h: 1320, files: ['pm-1-stream', 'pm-2-panel', 'pm-3-home', 'pm-4-approval'] }, ipad: { w: 2752, h: 2064, files: ['ipad-1-stream', 'ipad-2-panel', 'ipad-3-home', 'ipad-4-approval'] }, duo: { w: 2034, h: 1398, files: ['1-stream', '2-panel', '3-home', '4-approval'], localized: true } };
8+
const only = process.argv[2];
89
const b = await chromium.launch({ executablePath: exe });
910
for (const [kind, set] of Object.entries(sets)) {
11+
if (only && kind !== only) continue;
1012
const p = await b.newPage({ viewport: { width: set.w / 2, height: set.h / 2 }, deviceScaleFactor: 2 });
1113
for (const [locale, list] of Object.entries(titles)) {
1214
for (let i = 0; i < set.files.length; i++) {
13-
const src = `file://${process.cwd()}/${set.files[i]}.png`;
14-
const title = kind === 'ipad' ? list[i].replace('iPhone', 'iPad') : list[i];
15+
const src = `file://${process.cwd()}/${set.localized ? `${kind}/${locale.slice(0, 2)}-` : ''}${set.files[i]}.png`;
16+
const title = kind === 'ipad' ? list[i].replace('iPhone', 'iPad') : kind === 'duo' ? list[i].replace('iPhone', 'iPhone Duo') : list[i];
1517
const url = `file://${process.cwd()}/frame.html?kind=${kind}&sw=${set.w}&sh=${set.h}&src=${encodeURIComponent(src)}&title=${encodeURIComponent(title)}`;
1618
await p.goto(url); await p.waitForTimeout(250);
1719
await p.screenshot({ path: `framed/${locale}-${kind}-${i + 1}.png` });

0 commit comments

Comments
 (0)