From 8075a49a7b8865cb27873a2e13079d58a0c1ead8 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Tue, 25 Mar 2025 11:30:49 -0500 Subject: [PATCH] Add lens specs for all X-era iPhones --- src/lens/PhotoLens.tsx | 2 +- src/platforms/apple.ts | 79 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/src/lens/PhotoLens.tsx b/src/lens/PhotoLens.tsx index 1e462f0a..3cb5ecfa 100644 --- a/src/lens/PhotoLens.tsx +++ b/src/lens/PhotoLens.tsx @@ -25,7 +25,7 @@ export default function PhotoLens({ href={pathForLens(lens)} icon={} type={type} className={className} diff --git a/src/platforms/apple.ts b/src/platforms/apple.ts index c5a59a1a..419b7bb6 100644 --- a/src/platforms/apple.ts +++ b/src/platforms/apple.ts @@ -47,25 +47,102 @@ export const formatAppleLensText = ( return format('front', false); } else if (side === 'back') { switch (phoneName) { + // X + XS + case 'X': + case 'XS': + case 'XS Max': + switch (aperture) { + case '1.8': return format('Main'); + case '2.4': return format('Telephoto'); + } + // XR + SE (single lens) + case 'XR': + case 'SE': + return format('Main'); + // 11 + case '11': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.8': return format('Main'); + } + case '11 Pro': + case '11 Pro Max': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.8': return format('Main'); + case '2.0': return format('Telephoto'); + } + // 12 + case '12': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.6': return format('Main'); + } + case '12 Pro': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.6': return format('Main'); + case '2.0': return format('Telephoto'); + } + case '12 Pro Max': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.6': return format('Main'); + case '2.2': return format('Telephoto'); + } + // 13 + case '13': + case '13 Plus': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.6': return format('Main'); + } case '13 Pro': + case '13 Pro Max': switch (aperture) { case '1.8': return format('Wide'); case '1.5': return format('Main'); case '2.8': return format('Telephoto'); } + // 14 + case '14': + case '14 Plus': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.5': return format('Main'); + } case '14 Pro': + case '14 Pro Max': switch (aperture) { case '2.2': return format('Wide'); case '1.78': return format('Main'); case '2.8': return format('Telephoto'); } + // 15 + case '15': + case '15 Plus': + switch (aperture) { + case '2.4': return format('Wide'); + case '1.6': return format('Main'); + } case '15 Pro': + case '15 Pro Max': switch (aperture) { case '2.2': return format('Wide'); case '1.78': return format('Main'); case '2.8': return format('Telephoto'); } + // 16 (single lens) + case '16e': + return format('Main'); + case '16': + case '16 Plus': + switch (aperture) { + case '2.2': return format('Wide'); + case '1.6': return format('Main'); + } case '16 Pro': + case '16 Pro Max': switch (aperture) { case '2.2': return format('Wide'); case '1.78': return format('Main'); @@ -77,4 +154,4 @@ export const formatAppleLensText = ( } return model; -}; \ No newline at end of file +};