Skip to content

Commit

Permalink
Added support for latest Apple Splash-Screens
Browse files Browse the repository at this point in the history
Added support for latest iOS Splash-Screens

* added support for splashscrens: iPhone 14 Pro, iPhone 15 Pro, iPhone 15, iPhone 14 Pro Max, iPhone 15 Pro Max, iPhone 15 Plus, 8.3” iPad Mini, 10.9” iPad Air
  • Loading branch information
Martin Metodiev committed Feb 16, 2024
1 parent 1b7ecf5 commit e31c3d5
Show file tree
Hide file tree
Showing 12 changed files with 473 additions and 13 deletions.
10 changes: 9 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,15 @@ The default sources are as follow (groupped by platform):
"apple-touch-startup-image-2732x2048.png",
"apple-touch-startup-image-640x1136.png",
"apple-touch-startup-image-750x1334.png",
"apple-touch-startup-image-828x1792.png"
"apple-touch-startup-image-828x1792.png",
"apple-touch-startup-image-1179x2556.png",
"apple-touch-startup-image-2556x1179.png",
"apple-touch-startup-image-1290x2796.png",
"apple-touch-startup-image-2796x1290.png",
"apple-touch-startup-image-1488x2266.png",
"apple-touch-startup-image-2266x1488.png",
"apple-touch-startup-image-1640x2360.png",
"apple-touch-startup-image-2360x1640.png"
],
"favicons": [
"favicon-16x16.png",
Expand Down
6 changes: 5 additions & 1 deletion src/platforms/appleStartup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ const SCREEN_SIZES: ScreenSize[] = [
{ deviceWidth: 375, deviceHeight: 667, pixelRatio: 2 }, // iPhone 8, iPhone 7, iPhone 6s, iPhone 6, 4.7" iPhone SE
{ deviceWidth: 375, deviceHeight: 812, pixelRatio: 3 }, // iPhone 12 mini, iPhone 11 Pro, iPhone XS, iPhone X
{ deviceWidth: 390, deviceHeight: 844, pixelRatio: 3 }, // iPhone 12, iPhone 12 Pro
{ deviceWidth: 393, deviceHeight: 852, pixelRatio: 3 }, // iPhone 14 Pro, iPhone 15 Pro, iPhone 15
{ deviceWidth: 414, deviceHeight: 896, pixelRatio: 2 }, // iPhone 11, iPhone XR
{ deviceWidth: 414, deviceHeight: 896, pixelRatio: 3 }, // iPhone 11 Pro Max, iPhone XS Max
{ deviceWidth: 414, deviceHeight: 736, pixelRatio: 3 }, // iPhone 8 Plus, iPhone 7 Plus
{ deviceWidth: 414, deviceHeight: 736, pixelRatio: 3 }, // iPhone 6 Plus, iPhone 6s Plus
{ deviceWidth: 428, deviceHeight: 926, pixelRatio: 3 }, // iPhone 12 Pro Max
{ deviceWidth: 428, deviceHeight: 926, pixelRatio: 3 }, // iPhone 12 Pro Max, iPhone 13 Pro Max, iPhone 14 Plus
{ deviceWidth: 430, deviceHeight: 932, pixelRatio: 3 }, // iPhone 14 Pro Max, iPhone 15 Pro Max, iPhone 15 Plus
{ deviceWidth: 744, deviceHeight: 1133, pixelRatio: 2 }, // 8.3" iPad Mini
{ deviceWidth: 768, deviceHeight: 1024, pixelRatio: 2 }, // 9.7" iPad Pro. 7.9" iPad mini, 9.7" iPad Air, 9.7" iPad
{ deviceWidth: 810, deviceHeight: 1080, pixelRatio: 2 }, // 10.2" iPad
{ deviceWidth: 820, deviceHeight: 1080, pixelRatio: 2 }, // 10.9" iPad Air
{ deviceWidth: 834, deviceHeight: 1194, pixelRatio: 2 }, // 11" iPad Pro, 10.5" iPad Pro
{ deviceWidth: 834, deviceHeight: 1112, pixelRatio: 2 }, // 10.5" iPad Air
{ deviceWidth: 1024, deviceHeight: 1366, pixelRatio: 2 }, // 12.9" iPad Pro
Expand Down
84 changes: 82 additions & 2 deletions test/__snapshots__/array.test.mjs.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should accept an array of either buffers or paths to source images 63`] = `
exports[`should accept an array of either buffers or paths to source images 71`] = `
{
"files": [
{
Expand Down Expand Up @@ -133,6 +133,8 @@ exports[`should accept an array of either buffers or paths to source images 63`]
"<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2436x1125.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1170x2532.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2532x1170.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1179x2556.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2556x1179.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-828x1792.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-1792x828.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1242x2688.png">",
Expand All @@ -141,10 +143,16 @@ exports[`should accept an array of either buffers or paths to source images 63`]
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2208x1242.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1284x2778.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2778x1284.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1290x2796.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2796x1290.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1488x2266.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2266x1488.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1536x2048.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2048x1536.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1620x2160.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2160x1620.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1640x2160.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2160x1640.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1668x2388.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2388x1668.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1668x2224.png">",
Expand Down Expand Up @@ -293,6 +301,14 @@ exports[`should accept an array of either buffers or paths to source images 63`]
"contents": null,
"name": "apple-touch-startup-image-2532x1170.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1179x2556.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2556x1179.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-828x1792.png",
Expand Down Expand Up @@ -325,6 +341,22 @@ exports[`should accept an array of either buffers or paths to source images 63`]
"contents": null,
"name": "apple-touch-startup-image-2778x1284.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1290x2796.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2796x1290.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1488x2266.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2266x1488.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1536x2048.png",
Expand All @@ -341,6 +373,14 @@ exports[`should accept an array of either buffers or paths to source images 63`]
"contents": null,
"name": "apple-touch-startup-image-2160x1620.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1640x2160.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2160x1640.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1668x2388.png",
Expand Down Expand Up @@ -393,7 +433,7 @@ exports[`should accept an array of either buffers or paths to source images 63`]
}
`;

exports[`should select best source image by its size 63`] = `
exports[`should select best source image by its size 71`] = `
{
"files": [
{
Expand Down Expand Up @@ -526,6 +566,8 @@ exports[`should select best source image by its size 63`] = `
"<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2436x1125.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1170x2532.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2532x1170.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1179x2556.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2556x1179.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-828x1792.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-1792x828.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1242x2688.png">",
Expand All @@ -534,10 +576,16 @@ exports[`should select best source image by its size 63`] = `
"<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2208x1242.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1284x2778.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2778x1284.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-touch-startup-image-1290x2796.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-touch-startup-image-2796x1290.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1488x2266.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2266x1488.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1536x2048.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2048x1536.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1620x2160.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2160x1620.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1640x2160.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 820px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2160x1640.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1668x2388.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-touch-startup-image-2388x1668.png">",
"<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-touch-startup-image-1668x2224.png">",
Expand Down Expand Up @@ -686,6 +734,14 @@ exports[`should select best source image by its size 63`] = `
"contents": null,
"name": "apple-touch-startup-image-2532x1170.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1179x2556.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2556x1179.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-828x1792.png",
Expand Down Expand Up @@ -718,6 +774,22 @@ exports[`should select best source image by its size 63`] = `
"contents": null,
"name": "apple-touch-startup-image-2778x1284.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1290x2796.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2796x1290.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1488x2266.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2266x1488.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1536x2048.png",
Expand All @@ -734,6 +806,14 @@ exports[`should select best source image by its size 63`] = `
"contents": null,
"name": "apple-touch-startup-image-2160x1620.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1640x2160.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-2160x1640.png",
},
{
"contents": null,
"name": "apple-touch-startup-image-1668x2388.png",
Expand Down
Loading

0 comments on commit e31c3d5

Please sign in to comment.