Skip to content

Commit 6ca3538

Browse files
committed
feat: add new ios configs
1 parent 5f2a6a6 commit 6ca3538

1 file changed

Lines changed: 82 additions & 33 deletions

File tree

packages/image-comparison-core/src/helpers/constants.ts

Lines changed: 82 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -108,27 +108,32 @@ export const ANDROID_OFFSETS = {
108108
// On the other hand, one pixel is the equivalent of 0.75 points.
109109
//------------------------------------------------------------------
110110
// iPhones
111-
// 6/7/8/SE/2020: 667
112-
// 6/7/8/Plus: 736
113-
// X|XS|11Pro|12Mini|13Mini (notch): 812
114-
// 12|12Pro|13|13Pro|14 (notch): 844
115-
// 14Pro (notch): 852
116-
// XSMax|XR|11|11ProMax (notch): 896
117-
// 12ProMax|13ProMax|14Plus (notch): 926
118-
// 14ProMax (notch): 932
111+
// 6/6s/7/8/SE 2nd/SE 3rd: 667
112+
// 6/6s/7/8 Plus: 736
113+
// X/XS/11 Pro/12 mini/13 mini: 812
114+
// 12/12 Pro/13/13 Pro/14/16e/17e: 844
115+
// 14 Pro/15/15 Pro/16: 852
116+
// 16 Pro/17/17 Pro: 874
117+
// XR/XS Max/11/11 Pro Max: 896
118+
// Air: 912
119+
// 12 Pro Max/13 Pro Max/14 Plus: 926
120+
// 14 Pro Max/15 Plus/15 Pro Max/16 Plus: 932
121+
// 16 Pro Max/17 Pro Max: 956
119122
//------------------------------------------------------------------
120123
// iPads
121-
// 9.7|Air 1/2|Mini 1/2/3/4/2019|Pro 9.7: 1024
122-
// 10.2 1/2019/2020/2021 1080
123-
// Pro 10.5/2017/2019: 1112
124-
// Mini 2021 (notch): 1133
125-
// Air 2020/2022 (notch): 1180
126-
// Pro 11 2018/2021 (notch): 1194
127-
// Pro 12.9 2017 (no notch)/2018/2021 (notch): 1366
124+
// 9.7/5th/6th/Air 1/2/Mini 1-4/2019/Pro 9.7: 1024
125+
// 10.2 7th/8th/9th: 1080
126+
// Pro 10.5/Air 3rd (2019): 1112
127+
// Mini 6th/7th: 1133
128+
// Air 4th/5th/10th/11th/Air 6th/7th/8th 11": 1180
129+
// Pro 11" 1st-4th (2018-2022): 1194
130+
// Pro 11" M4/M5 7th/8th: 1210
131+
// Pro 12.9" 2017-2022/Air 13" M2/M3/M4: 1366
132+
// Pro 13" M4/M5 7th/8th: 1376
128133
//------------------------------------------------------------------
129134
export const IOS_OFFSETS: IosOffsets = {
130135
IPHONE: {
131-
// 6/7/8/SE/2020
136+
// iPhone 6/6s/7/8, iPhone SE 2nd gen, iPhone SE 3rd gen
132137
667: {
133138
LANDSCAPE: {
134139
SAFE_AREA: 0,
@@ -143,7 +148,7 @@ export const IOS_OFFSETS: IosOffsets = {
143148
HOME_BAR: { x: 0, y: 0, height: 0, width: 0 },
144149
},
145150
},
146-
// 6/7/8/Plus
151+
// iPhone 6/6s/7/8 Plus
147152
736: {
148153
LANDSCAPE: {
149154
SAFE_AREA: 0,
@@ -158,7 +163,7 @@ export const IOS_OFFSETS: IosOffsets = {
158163
HOME_BAR: { x: 0, y: 0, height: 0, width: 0 },
159164
},
160165
},
161-
// X|XS|11Pro|12Mini|13Mini (notch)
166+
// iPhone X/XS, iPhone 11 Pro, iPhone 12 mini, iPhone 13 mini
162167
812: {
163168
LANDSCAPE: {
164169
SAFE_AREA: 44,
@@ -173,7 +178,7 @@ export const IOS_OFFSETS: IosOffsets = {
173178
HOME_BAR: { x: 118, y: 796, height: 9, width: 137 },
174179
},
175180
},
176-
// 12|12Pro|13|13Pro|14 (notch)
181+
// iPhone 12/12 Pro, iPhone 13/13 Pro, iPhone 14, iPhone 16e, iPhone 17e
177182
844: {
178183
LANDSCAPE: {
179184
SAFE_AREA: 47,
@@ -188,7 +193,7 @@ export const IOS_OFFSETS: IosOffsets = {
188193
HOME_BAR: { x: 124, y: 829, height: 9, width: 143 },
189194
},
190195
},
191-
// 14Pro|15|16 (dynamic island)
196+
// iPhone 14 Pro, iPhone 15/15 Pro, iPhone 16
192197
852: {
193198
LANDSCAPE: {
194199
SAFE_AREA: 59,
@@ -203,7 +208,7 @@ export const IOS_OFFSETS: IosOffsets = {
203208
HOME_BAR: { x: 125, y: 837, height: 9, width: 143 },
204209
},
205210
},
206-
// 16 Pro (dynamic island)
211+
// iPhone 16 Pro, iPhone 17/17 Pro
207212
874: {
208213
LANDSCAPE: {
209214
SAFE_AREA: 50,
@@ -218,7 +223,7 @@ export const IOS_OFFSETS: IosOffsets = {
218223
HOME_BAR: { x: 129, y: 861, height: 9, width: 152 },
219224
},
220225
},
221-
// XSMax|XR|11|11ProMax (notch)
226+
// iPhone XR, iPhone XS Max, iPhone 11, iPhone 11 Pro Max
222227
896: {
223228
LANDSCAPE: {
224229
SAFE_AREA: 48,
@@ -233,7 +238,22 @@ export const IOS_OFFSETS: IosOffsets = {
233238
HOME_BAR: { x: 131, y: 881, height: 9, width: 152 },
234239
},
235240
},
236-
// 12ProMax|13ProMax|14Plus (notch)
241+
// iPhone Air
242+
912: {
243+
LANDSCAPE: {
244+
SAFE_AREA: 68,
245+
STATUS_BAR: 0,
246+
ADDRESS_BAR: 50,
247+
HOME_BAR: { x: 338, y: 405, height: 9, width: 237 },
248+
},
249+
PORTRAIT: {
250+
SAFE_AREA: 68,
251+
STATUS_BAR: 68,
252+
ADDRESS_BAR: 50,
253+
HOME_BAR: { x: 134, y: 897, height: 9, width: 152 },
254+
},
255+
},
256+
// iPhone 12 Pro Max, iPhone 13 Pro Max, iPhone 14 Plus
237257
926: {
238258
LANDSCAPE: {
239259
SAFE_AREA: 47,
@@ -248,7 +268,7 @@ export const IOS_OFFSETS: IosOffsets = {
248268
HOME_BAR: { x: 136, y: 911, height: 9, width: 156 },
249269
},
250270
},
251-
// 14ProMax|16 Plus (notch)
271+
// iPhone 14 Pro Max, iPhone 15 Plus, iPhone 15 Pro Max, iPhone 16 Plus
252272
932: {
253273
LANDSCAPE: {
254274
SAFE_AREA: 59,
@@ -263,7 +283,7 @@ export const IOS_OFFSETS: IosOffsets = {
263283
HOME_BAR: { x: 137, y: 917, height: 9, width: 158 },
264284
},
265285
},
266-
// 16 Pro Max (dynamic island)
286+
// iPhone 16 Pro Max, iPhone 17 Pro Max
267287
956: {
268288
LANDSCAPE: {
269289
SAFE_AREA: 50,
@@ -280,7 +300,7 @@ export const IOS_OFFSETS: IosOffsets = {
280300
},
281301
},
282302
IPAD: {
283-
// 9.7|Air 1/2|Mini 1/2/3/4/2019|Pro 9.7
303+
// iPad 9.7/5th/6th, iPad Air 1/2, iPad mini 1-4/2019, iPad Pro 9.7, iPad Pro 12.9" (all gens), iPad Air 13" M2/M3/M4
284304
1024: {
285305
LANDSCAPE: {
286306
SAFE_AREA: 0,
@@ -295,7 +315,7 @@ export const IOS_OFFSETS: IosOffsets = {
295315
HOME_BAR: { x: 0, y: 0, height: 0, width: 0 },
296316
},
297317
},
298-
// 10.2 1/2019/2020/2021
318+
// iPad 10.2" 7th/8th/9th gen
299319
1080: {
300320
LANDSCAPE: {
301321
SAFE_AREA: 0,
@@ -310,7 +330,7 @@ export const IOS_OFFSETS: IosOffsets = {
310330
HOME_BAR: { x: 0, y: 0, height: 0, width: 0 },
311331
},
312332
},
313-
// Pro 10.5/2017/2019
333+
// iPad Pro 10.5", iPad Air 3rd gen (2019)
314334
1112: {
315335
LANDSCAPE: {
316336
SAFE_AREA: 0,
@@ -325,8 +345,7 @@ export const IOS_OFFSETS: IosOffsets = {
325345
HOME_BAR: { x: 0, y: 0, height: 0, width: 0 },
326346
},
327347
},
328-
// With Home bar
329-
// Mini 2021
348+
// iPad mini 6th/7th gen
330349
1133: {
331350
LANDSCAPE: {
332351
SAFE_AREA: 0,
@@ -341,7 +360,7 @@ export const IOS_OFFSETS: IosOffsets = {
341360
HOME_BAR: { x: 234, y: 1118, height: 9, width: 276 },
342361
},
343362
},
344-
// Air 2020/2022
363+
// iPad Air 4th/5th gen, iPad 10th/11th gen, iPad Air 6th/7th/8th gen 11"
345364
1180: {
346365
LANDSCAPE: {
347366
SAFE_AREA: 0,
@@ -356,7 +375,7 @@ export const IOS_OFFSETS: IosOffsets = {
356375
HOME_BAR: { x: 272, y: 1165, height: 9, width: 276 },
357376
},
358377
},
359-
// Pro 11 2018/2021
378+
// iPad Pro 11" 1st-4th gen (2018-2022)
360379
1194: {
361380
LANDSCAPE: {
362381
SAFE_AREA: 0,
@@ -371,7 +390,22 @@ export const IOS_OFFSETS: IosOffsets = {
371390
HOME_BAR: { x: 279, y: 1179, height: 9, width: 276 },
372391
},
373392
},
374-
// Pro 12.9 2017/2018/2021
393+
// iPad Pro 11" M4/M5 (7th/8th gen)
394+
1210: {
395+
LANDSCAPE: {
396+
SAFE_AREA: 0,
397+
STATUS_BAR: 24,
398+
ADDRESS_BAR: 50,
399+
HOME_BAR: { x: 444, y: 819, height: 9, width: 322 },
400+
},
401+
PORTRAIT: {
402+
SAFE_AREA: 0,
403+
STATUS_BAR: 24,
404+
ADDRESS_BAR: 50,
405+
HOME_BAR: { x: 279, y: 1195, height: 9, width: 276 },
406+
},
407+
},
408+
// iPad Pro 12.9" 2017-2022, iPad Air 13" M2/M3/M4
375409
1366: {
376410
LANDSCAPE: {
377411
SAFE_AREA: 0,
@@ -388,6 +422,21 @@ export const IOS_OFFSETS: IosOffsets = {
388422
HOME_BAR: { x: 352, y: 1351, height: 9, width: 320 },
389423
},
390424
},
425+
// iPad Pro 13" M4/M5 (7th/8th gen)
426+
1376: {
427+
LANDSCAPE: {
428+
SAFE_AREA: 0,
429+
STATUS_BAR: 24,
430+
ADDRESS_BAR: 50,
431+
HOME_BAR: { x: 512, y: 1017, height: 9, width: 353 },
432+
},
433+
PORTRAIT: {
434+
SAFE_AREA: 0,
435+
STATUS_BAR: 24,
436+
ADDRESS_BAR: 50,
437+
HOME_BAR: { x: 355, y: 1361, height: 9, width: 323 },
438+
},
439+
},
391440
},
392441
}
393442

0 commit comments

Comments
 (0)