Added PWA manifest with icons and service. #4

Merged
mastah merged 1 commits from feature/pwa into develop 2026-01-28 00:27:16 +01:00
15 changed files with 107 additions and 5 deletions
Showing only changes of commit 6349d77723 - Show all commits

View File

@@ -30,13 +30,15 @@
"inlineStyleLanguage": "scss", "inlineStyleLanguage": "scss",
"assets": [ "assets": [
"src/favicon.ico", "src/favicon.ico",
"src/assets" "src/assets",
"src/manifest.webmanifest"
], ],
"styles": [ "styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss" "src/styles.scss"
], ],
"scripts": [] "scripts": [],
"serviceWorker": "src/ngsw-config.json"
}, },
"configurations": { "configurations": {
"production": { "production": {
@@ -58,7 +60,8 @@
"with": "src/environments/environment.prod.ts" "with": "src/environments/environment.prod.ts"
} }
], ],
"outputHashing": "all" "outputHashing": "all",
"serviceWorker": "src/ngsw-config.json"
}, },
"development": { "development": {
"optimization": false, "optimization": false,

View File

@@ -17,11 +17,12 @@
"@angular/compiler": "^21.0.0", "@angular/compiler": "^21.0.0",
"@angular/core": "^21.0.0", "@angular/core": "^21.0.0",
"@angular/forms": "^21.0.0", "@angular/forms": "^21.0.0",
"@angular/material": "^21.0.0",
"@angular/localize": "^21.0.0", "@angular/localize": "^21.0.0",
"@angular/material": "^21.0.0",
"@angular/platform-browser": "^21.0.0", "@angular/platform-browser": "^21.0.0",
"@angular/platform-browser-dynamic": "^21.0.0", "@angular/platform-browser-dynamic": "^21.0.0",
"@angular/router": "^21.0.0", "@angular/router": "^21.0.0",
"@angular/service-worker": "^21.1.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tslib": "^2.8.1", "tslib": "^2.8.1",

View File

@@ -13,6 +13,8 @@ import { RegonComponent } from './components/regon/regon.component';
import { IbanComponent } from './components/iban/iban.component'; import { IbanComponent } from './components/iban/iban.component';
import { IdentityCardComponent } from './components/identitycard/identitycard.component'; import { IdentityCardComponent } from './components/identitycard/identitycard.component';
import {NgOptimizedImage} from "@angular/common"; import {NgOptimizedImage} from "@angular/common";
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';
@NgModule({ @NgModule({
declarations: [ declarations: [
@@ -33,6 +35,12 @@ import {NgOptimizedImage} from "@angular/common";
MatSnackBarModule, MatSnackBarModule,
ReactiveFormsModule, ReactiveFormsModule,
NgOptimizedImage, NgOptimizedImage,
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: environment.production,
// Register the ServiceWorker as soon as the application is stable
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000'
}),
], ],
providers: [TranslatePipe], providers: [TranslatePipe],
bootstrap: [AppComponent] bootstrap: [AppComponent]

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 B

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -5,7 +5,9 @@
<title>Generator i walidator identyfikatorów</title> <title>Generator i walidator identyfikatorów</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/png" href="favicon.ico">
<link rel="manifest" href="./manifest.webmanifest">
<meta name="theme-color" content="#3f51b5">
<link rel="preconnect" href="https://fonts.gstatic.com"> <link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

59
src/manifest.webmanifest Normal file
View File

@@ -0,0 +1,59 @@
{
"name": "Generator i walidator identyfikatorów",
"short_name": "Generator",
"theme_color": "#3f51b5",
"background_color": "#fafafa",
"display": "standalone",
"scope": "./",
"start_url": "./",
"icons": [
{
"src": "./assets/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "any"
},
{
"src": "./assets/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "any"
},
{
"src": "./assets/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "any"
},
{
"src": "./assets/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "any"
},
{
"src": "./assets/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "any"
},
{
"src": "./assets/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "./assets/icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "any"
},
{
"src": "./assets/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
}
]
}

29
src/ngsw-config.json Normal file
View File

@@ -0,0 +1,29 @@
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|apple-touch-icon|png|otf|ttf|woff|woff2)"
]
}
}
]
}