Compare commits

...

10 commits

Author SHA1 Message Date
userquin
47a14fa0bb chore: dev and staging apple touch icons 0.45 padding 2023-05-27 19:13:39 +02:00
userquin
c411850750 chore: public apple touch icon 0.45 padding 2023-05-27 19:02:13 +02:00
userquin
c4be05a747 chore: reduce public apple touch icon padding 2023-05-27 18:53:53 +02:00
userquin
3ad1e292a4 chore: optimize png icons 2023-05-27 17:49:14 +02:00
userquin
b76edfd66e chore: use white color in svg logo mask + update icons 2023-05-27 17:23:15 +02:00
userquin
6b0f83115c Merge branch 'main' into userquin/feat-change-pwa-icons 2023-05-27 16:06:21 +02:00
userquin
e5352af1a6 docs: update pwa icons 2023-05-26 12:08:04 +02:00
userquin
6c8cd72e52 chore: revert baseURL from public assets 2023-05-26 12:00:22 +02:00
userquin
5ce3459f85 chore: increase padding in maskable icon 2023-05-25 19:46:50 +02:00
userquin
cbb4245754 feat(pwa): change default icons 2023-05-25 19:07:39 +02:00
23 changed files with 61 additions and 9 deletions

View file

@ -6,6 +6,8 @@
*.txt
Dockerfile
public/
public-dev/
public-staging/
https-dev-config/localhost.crt
https-dev-config/localhost.key
Dockerfile

View file

@ -103,6 +103,50 @@ Elk will generate 2 web manifests per locale, one for light theme and one for da
You can check web manifest generation on [modules/pwa/i18n.ts](https://github.com/elk-zone/elk/blob/main/modules/pwa/i18n.ts) module.
### PWA Icons
::alert{type="info"}
**WIP:** We are working to generate PWA icons using a Node script.
::
Elk icons have been generated using [PWA Builder Image Generator](https://www.pwabuilder.com/imageGenerator), we generate the icons 3 times per environment: transparent, apple touch and maskable icons.
To generate transparent icons:
- upload `logo.svg` from `public` folders: `public`, ` public-dev` and `public-staging`
- configure `0,1` as padding
- check `Transparent` in background color
- check `Windows 11` and `Android` in platforms
- click on `Generate` button
Once generated, we use the following icons:
- `windows11/Square44x44Logo.altform-lightunplated_targetsize-64.png` for `pwa-windows-44x44-64.png`
- `android/android-launchericon-192x192.png` for `pwa-192x192.png`
- `android/android-launchericon-512x512.png` for `pwa-512x512.png`
To generate apple touch icons:
- upload `logo.svg` from `public` folders: `public`, ` public-dev` and `public-staging`
- configure `0,45` as padding
- check `Custom` in background color and set `#ffffff` as color
- check only `iOS` in platforms
- click on `Generate` button
Once generated, we use the following icons:
- `ios/180.png` for `apple-touch-icon.png`
To generate maskable icons:
- upload `logo.svg` from `public` folders: `public`, ` public-dev` and `public-staging`
- configure `0,6` as padding
- check `Custom` in background color and set `#ffffff` as color
- check only `Android` in platforms
- click on `Generate` button
Once generated, we use the following icons:
- `android/android-launchericon-512x512.png` for `maskable-icon.png`
::alert{type="info"}
**Note:** to generate `favicon.ico` icons, we use [RealFaviconGenerator](https://realfavicongenerator.net/) providing `logo.svg` from `public` folders: `public`, ` public-dev` and `public-staging` (transparent 64x64 32 bit).
::
### PWA UI Components
Elk will provide a set of UI components to allow you to customize the PWA installation prompt on browsers with [beforeinstallprompt](https://web.dev/customize-install/) support.

View file

@ -78,6 +78,11 @@ export async function createI18n(): Promise<LocalizedWebManifest> {
display_override: ['window-controls-overlay'],
categories: ['social', 'social networking'],
icons: [
{
src: 'pwa-windows-44x44-64.png',
sizes: '64x64',
type: 'image/png',
},
{
src: 'pwa-192x192.png',
sizes: '192x192',
@ -87,7 +92,6 @@ export async function createI18n(): Promise<LocalizedWebManifest> {
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
{
src: 'maskable-icon.png',
@ -114,6 +118,8 @@ export async function createI18n(): Promise<LocalizedWebManifest> {
},
}
// TODO: add related_applications, only when env === 'release'
const locales: RequiredWebManifestEntry[] = await Promise.all(
pwaLocales
.filter(l => l.code !== 'en-US')

View file

@ -94,7 +94,7 @@
"ufo": "^1.1.1",
"ultrahtml": "^1.2.0",
"unimport": "^3.0.6",
"vite-plugin-pwa": "^0.15.0",
"vite-plugin-pwa": "^0.15.1",
"vue-advanced-cropper": "^2.8.8",
"vue-virtual-scroller": "2.0.0-beta.8",
"workbox-build": "^6.5.4",

View file

@ -208,8 +208,8 @@ importers:
specifier: ^3.0.6
version: 3.0.6(rollup@2.79.1)
vite-plugin-pwa:
specifier: ^0.15.0
version: 0.15.0(vite@4.3.4)(workbox-build@6.5.4)(workbox-window@6.5.4)
specifier: ^0.15.1
version: 0.15.1(vite@4.3.4)(workbox-build@6.5.4)(workbox-window@6.5.4)
vue-advanced-cropper:
specifier: ^2.8.8
version: 2.8.8(vue@3.2.45)
@ -13387,8 +13387,8 @@ packages:
- supports-color
dev: false
/vite-plugin-pwa@0.15.0(vite@4.3.4)(workbox-build@6.5.4)(workbox-window@6.5.4):
resolution: {integrity: sha512-gpmx3BeubsRIXRBkjPToOTJbo8fknNmZFQs24i0TPZyaNVa0n27YHDo0Y72amnO70WvHKGE3e1fn8SYUP7e8SA==}
/vite-plugin-pwa@0.15.1(vite@4.3.4)(workbox-build@6.5.4)(workbox-window@6.5.4):
resolution: {integrity: sha512-lJVzEYda/Y9AfwxFzX0rV+QCQ2+WdBoEGtR1RBZKWxvrJ4NWEH1VZaHOMyzvRiYhWQsi7aFhewsp1CDvN/R1Og==}
peerDependencies:
vite: ^3.1.0 || ^4.0.0
workbox-build: ^6.5.4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -18,7 +18,7 @@
maskUnits="userSpaceOnUse"
style="mask-type:alpha">
<path
fill="#D9D9D9"
fill="white"
d="M244 123c0 64.617-38.383 112-103 112-64.617 0-103-30.883-103-95.5C38 111.194-8.729 36.236 8 16 29.46-9.959 88.689 6 125 6c64.617 0 119 52.383 119 117Z"
id="path19" />
</mask>

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -18,7 +18,7 @@
maskUnits="userSpaceOnUse"
style="mask-type:alpha">
<path
fill="#D9D9D9"
fill="white"
d="M244 123c0 64.617-38.383 112-103 112-64.617 0-103-30.883-103-95.5C38 111.194-8.729 36.236 8 16 29.46-9.959 88.689 6 125 6c64.617 0 119 52.383 119 117Z"
id="path19" />
</mask>

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -18,7 +18,7 @@
maskUnits="userSpaceOnUse"
style="mask-type:alpha">
<path
fill="#D9D9D9"
fill="white"
d="M244 123c0 64.617-38.383 112-103 112-64.617 0-103-30.883-103-95.5C38 111.194-8.729 36.236 8 16 29.46-9.959 88.689 6 125 6c64.617 0 119 52.383 119 117Z"
id="path19" />
</mask>

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB