From 420f4c54b758670370d21226f2f851a85d05167f Mon Sep 17 00:00:00 2001 From: atjn Date: Thu, 28 Apr 2022 13:26:59 +0200 Subject: [PATCH] Update app manifest icons --- images/friendica-maskable-192.png | Bin 0 -> 1152 bytes images/friendica-maskable-512.png | Bin 0 -> 5278 bytes images/friendica-maskable.svg | 4 ++ src/Module/Manifest.php | 73 ++++++++++++++++++++++++------ 4 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 images/friendica-maskable-192.png create mode 100644 images/friendica-maskable-512.png create mode 100644 images/friendica-maskable.svg diff --git a/images/friendica-maskable-192.png b/images/friendica-maskable-192.png new file mode 100644 index 0000000000000000000000000000000000000000..9acfb80f3069ea14b1c28c06675b62e592327c18 GIT binary patch literal 1152 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE8Azrw%`pX1jKx9jP7LeL$-D%zQv-ZLT>tHt z{JmHD=U(X_du2cFR{Xe2@xv~~N87X>Z`FLbRqOs%oqJn!?}Cudoz1$pH|yQlWN>+d z(Xq8wN7mRJTxEM;mF@mjcKcS@?^)@vd!^&<6^=VsIBi(!v3`livPHg27Wyq(7_ewT zz{2@~^X3Q7o)5ff)cbH6LJbByzSGgZoFE0@hyDxITPI#;1|u3YJSxsrLZB@1MW=gSn&mo8o)RlHELXrV;W zqNx>m`3ww9Cp}#pLn>~)y%SkH$x)#7;o?F?HMffzYyzSzfex-bJM>Sc3&lKkDu{n1 zc2u;aZohKOs|d}xaxbq`{y!LeHN3VkVG8?V8>Tyg4h>x#1?~)tT1p3G8Ch0zFqE?h zEKtHKahT_Y$*G@LSoUl!J%3PnYng#Vh(xP{G~XOvrWI<6*WM*RYRHpXv~>5T2937* zbw9Fy3*9zP3ecIv67oRt_)_`%jgF$04!lJSw@-@vy1Ilxw}UCC{la=x<`+kgGCupG zcH@z)po7>WhG>~>YgiU^DKwm`y0MC>Aw{CWk~#X4y@HcMgXSTzN_LSZ##tLgYnZJT zA7n`5I*@VPctKx5L*|WF^B9*lFc>o}cp^E0n^S^)!e<_j78V~Sj|#S)R+bcoo=P?a zl?5Eqj4T2U3?QPx?110qSsV%t3`}UmALf0f`|JMQsNDYP+0{?o%lqYRckD0u{%x-G z_4TIW&z`Sy*=#&rf9`L)BMqTfFZ2CaB>TbB`ayHqf$Fyn+ix*y-(u9?$~-Td-R3f1 z1yC-)dcj)R4NGJT{H+rLtshJ)JK+1aVf8IW?putXZ!s3%Vw_lZU`^S9p0We3ZyUIs zc`p3FV+wO51LOWoB^3qcghR#(qCy6o3Qr{`@PmB!okydcrH4VIn$3iX$?xzr0cq9= z>~E$@uo|=`G`LQTWD`Eg^rYR;$4KD8iVG&4E87_N#HpL|C0}x6n4Rb?&FNsS#vgHy zEqaYMlfgub2O_^*gOn3RBONw()QRq#xowt0LKRnY)+Fc3wLj)F9^J2PY-!iz_;K2s zkVJj%i<@lwT-W{Fd2W8`tEDkXJoj#G%KraQIM?smsvbNE2qR@ZsQ=Eany*qb*ZAHI QV3ES$>FVdQ&MBb@0KXU5SO5S3 literal 0 HcmV?d00001 diff --git a/images/friendica-maskable-512.png b/images/friendica-maskable-512.png new file mode 100644 index 0000000000000000000000000000000000000000..b454089f86df5ec4d129694127b59b849c60422a GIT binary patch literal 5278 zcmeHLc|26@+rMWF#+E@L>!1k5*q4OIo~SGjLPjaODEm4mJ$QO7iInW2>`U3lHo}md z?6OW-vRBB`_zivD_rLeA_xE}Kct5}M$GOkBuj~5W-|Ks>b3WI(A78(!%S6vb4*+1g ztfyrR0Gx6O2gsu#kV~_OGQd2Ibu~b756=<+CoL{({bA}izA|Cx!uuyr+h%-=isOKa z?nmp#M(53hh?VrGvO_O&=;K*WVndNP>DN9*CO1I$tQRx2QRY6g`Xo)uRk2~??r6)8 zEiDtomh$`K-rhoU^*cMe9-QI+uKQ^I;R8pxSJvcz=1E4_%)X%{H@+<(a z5CHuQfWKG)bp1cZf4>NWH^a=fZ4ZYc_DZ65_2_U zbz?P^GNt&*M!bxNcP*|6zh=5ql~(A=gex-=FFy}+l!^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gIUIOcG&_EN9g&9sm34f%qGSHazZiaEe(3_g4C{C@fkz#bmJ8jwpb*z6Jlrv4 zVI>5DF!q}lO9JA7EuBMV$R)|chZc78w*pJ+P%oTo71Q2jdcqr z2S2DSeGpa$exEh4!&^-VID~WC;yqN|EqEm0){^ud_269*1Yk3%w_62P=&Ak0OfvCl zL83PfVl8C47-A-aUr>yBj|@f1Ws>O#VXgm^FML+Jc^S_mn3(-VaUdutsOJUYo(gj1 ze8H<+h1zGpnpx%tf3%}2*RVmSZ{1endz1zQHj?_qY`Lz#@OcQViO%66#IfQOY`7f~ z1w{Jn7&{I~Ucq|{h?$jbSH2*TI`39ZHIn9C^3X#qN@Y6zNXowGe8oK{A!1)e805qY zuJy*{4#4*_wVTW7-4#OmZXwUwqCroKU1_QNzDO{h9#+@ zm>$6ncV#78b~cqTpqRchLC^QHHAirn4q{fBWN+opp{jdBMczHBR-1UMn56aSwxmo^ znAP55W{jqe_=!E=T&96JdU!;j`xR1~lpF$RO`kXuoUNihW%RP%?&jqB(p3}GxS7fH?T*CP8UhoD(8N$|7>5JCXOzR7UuDQpOiwI*73>fj&n;UQq{kqBbR9*^N1*C(Yg?9xr^~FmDS`B;lQ67wN zg40{U3-J$CZbS@D=z)W`rHf`okq+VHfVz&S%_zV}c@^eAD6?S$T7K9juXDmY5~c)A zx$bl|(AalOtMTd)+;COC>tb&;VVq$fd6*-RB4M^t7K>Dh>xb+%V%*%4(OFTsf18{x zT)A+ja9t?7o$Ai&*J*eurT{mw=aBP+h{R^50Y`>8ULEzS=+3 zIZJqeB)m(FN+xa2&a98fcTUxP{N`46cir3O{^^;v#-BNpa>eDBDk3{~7+h5(L9VqFZZN#;o=L O<+!YURjXLTHuPUrZVuuA literal 0 HcmV?d00001 diff --git a/images/friendica-maskable.svg b/images/friendica-maskable.svg new file mode 100644 index 0000000000..77864d1a55 --- /dev/null +++ b/images/friendica-maskable.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/Module/Manifest.php b/src/Module/Manifest.php index 2ae8009e25..a554f77526 100644 --- a/src/Module/Manifest.php +++ b/src/Module/Manifest.php @@ -31,8 +31,6 @@ class Manifest extends BaseModule { $config = DI::config(); - $touch_icon = $config->get('system', 'touch_icon') ?: 'images/friendica-192.png'; - $theme = DI::config()->get('system', 'theme'); $manifest = [ @@ -44,18 +42,6 @@ class Manifest extends BaseModule 'lang' => $config->get('system', 'language'), 'dir' => 'auto', 'categories' => ['social network', 'internet'], - 'icons' => [ - [ - 'src' => DI::baseUrl()->get() . '/' . $touch_icon, - 'sizes' => '192x192', - 'type' => 'image/png', - ], - [ - 'src' => DI::baseUrl()->get() . '/' . $touch_icon, - 'sizes' => '512x512', - 'type' => 'image/png', - ], - ], 'shortcuts' => [ [ 'name' => 'Latest posts', @@ -80,6 +66,65 @@ class Manifest extends BaseModule ] ]; + /// @TODO If the admin provides their own touch icon, the manifest will regress + /// to a smaller set of icons that do not follow the web app manifest spec. + /// There should be a mechanism to allow the admin to provide all of the 6 + /// different images that are required for a fully valid web app manifest. + $touch_icon = $config->get('system', 'touch_icon'); + if($touch_icon){ + $manifest['icons'] = [ + [ + 'src' => DI::baseUrl()->get() . '/' . $touch_icon, + 'sizes' => '192x192', + 'type' => 'image/png', + ], + [ + 'src' => DI::baseUrl()->get() . '/' . $touch_icon, + 'sizes' => '512x512', + 'type' => 'image/png', + ], + ]; + } else { + $manifest['icons'] = [ + [ + 'src' => DI::baseUrl()->get() . '/images/friendica.svg', + 'sizes' => 'any', + 'type' => 'image/svg+xml', + 'purpose' => 'any', + ], + [ + 'src' => DI::baseUrl()->get() . '/images/friendica-192.png', + 'sizes' => '192x192', + 'type' => 'image/png', + 'purpose' => 'any', + ], + [ + 'src' => DI::baseUrl()->get() . '/images/friendica-512.png', + 'sizes' => '512x512', + 'type' => 'image/png', + 'purpose' => 'any', + ], + [ + 'src' => DI::baseUrl()->get() . '/images/friendica-maskable.svg', + 'sizes' => 'any', + 'type' => 'image/svg+xml', + 'purpose' => 'maskable', + ], + [ + 'src' => DI::baseUrl()->get() . '/images/friendica-maskable-192.png', + 'sizes' => '192x192', + 'type' => 'image/png', + 'purpose' => 'maskable', + ], + [ + 'src' => DI::baseUrl()->get() . '/images/friendica-maskable-512.png', + 'sizes' => '512x512', + 'type' => 'image/png', + 'purpose' => 'maskable', + ], + ]; + } + if ($background_color = Core\Theme::getBackgroundColor($theme)) { $manifest['background_color'] = $background_color; } -- 2.39.5