Browse Source

Updated the app to be PWA

main
kj1352 1 year ago
parent
commit
aa09e9e74e
16 changed files with 147 additions and 20 deletions
  1. +7
    -3
      angular.json
  2. +30
    -0
      ngsw-config.json
  3. +27
    -0
      package-lock.json
  4. +2
    -1
      package.json
  5. +8
    -2
      src/app/app.module.ts
  6. BIN
      src/assets/icons/icon-128x128.png
  7. BIN
      src/assets/icons/icon-144x144.png
  8. BIN
      src/assets/icons/icon-152x152.png
  9. BIN
      src/assets/icons/icon-192x192.png
  10. BIN
      src/assets/icons/icon-384x384.png
  11. BIN
      src/assets/icons/icon-48x48.png
  12. BIN
      src/assets/icons/icon-512x512.png
  13. BIN
      src/assets/icons/icon-72x72.png
  14. BIN
      src/assets/icons/icon-96x96.png
  15. +14
    -14
      src/index.html
  16. +59
    -0
      src/manifest.webmanifest

+ 7
- 3
angular.json View File

@@ -29,10 +29,13 @@
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
},
"src/manifest.webmanifest"
],
"styles": ["src/theme/variables.scss", "src/global.scss"],
"scripts": []
"scripts": [],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"configurations": {
"production": {
@@ -109,7 +112,8 @@
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
},
"src/manifest.webmanifest"
],
"styles": ["src/theme/variables.scss", "src/global.scss"],
"scripts": []


+ 30
- 0
ngsw-config.json View File

@@ -0,0 +1,30 @@
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"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|gif|otf|ttf|woff|woff2)"
]
}
}
]
}

+ 27
- 0
package-lock.json View File

@@ -16,6 +16,7 @@
"@angular/platform-browser": "^17.0.2",
"@angular/platform-browser-dynamic": "^17.0.2",
"@angular/router": "^17.0.2",
"@angular/service-worker": "^17.0.2",
"@ionic/angular": "^7.0.0",
"ionicons": "^7.0.0",
"rxjs": "~7.8.0",
@@ -579,6 +580,24 @@
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/service-worker": {
"version": "17.0.6",
"resolved": "https://registry.npmjs.org/@angular/service-worker/-/service-worker-17.0.6.tgz",
"integrity": "sha512-sJpO3LuITWX0+Z71m47CcS2vJAqqflMh72Ou46pPguA5ewCW8GsSaohHNYuqSlkmTBxg1HRd61pv3e9dj/U2jA==",
"dependencies": {
"tslib": "^2.3.0"
},
"bin": {
"ngsw-config": "ngsw-config.js"
},
"engines": {
"node": "^18.13.0 || >=20.9.0"
},
"peerDependencies": {
"@angular/common": "17.0.6",
"@angular/core": "17.0.6"
}
},
"node_modules/@assemblyscript/loader": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
@@ -16959,6 +16978,14 @@
"tslib": "^2.3.0"
}
},
"@angular/service-worker": {
"version": "17.0.6",
"resolved": "https://registry.npmjs.org/@angular/service-worker/-/service-worker-17.0.6.tgz",
"integrity": "sha512-sJpO3LuITWX0+Z71m47CcS2vJAqqflMh72Ou46pPguA5ewCW8GsSaohHNYuqSlkmTBxg1HRd61pv3e9dj/U2jA==",
"requires": {
"tslib": "^2.3.0"
}
},
"@assemblyscript/loader": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",


+ 2
- 1
package.json View File

@@ -21,6 +21,7 @@
"@angular/platform-browser": "^17.0.2",
"@angular/platform-browser-dynamic": "^17.0.2",
"@angular/router": "^17.0.2",
"@angular/service-worker": "^17.0.2",
"@ionic/angular": "^7.0.0",
"ionicons": "^7.0.0",
"rxjs": "~7.8.0",
@@ -56,4 +57,4 @@
"typescript": "~5.2.2"
},
"description": "Sripuram Temple App"
}
}

+ 8
- 2
src/app/app.module.ts View File

@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { NgModule, isDevMode } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

@@ -6,10 +6,16 @@ import { IonicModule, IonicRouteStrategy } from '@ionic/angular';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { ServiceWorkerModule } from '@angular/service-worker';

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, ServiceWorkerModule.register('ngsw-worker.js', {
enabled: !isDevMode(),
// Register the ServiceWorker as soon as the application is stable
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000'
})],
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
bootstrap: [AppComponent],
})


BIN
src/assets/icons/icon-128x128.png View File

Before After
Width: 128  |  Height: 128  |  Size: 4.8 KiB

BIN
src/assets/icons/icon-144x144.png View File

Before After
Width: 144  |  Height: 144  |  Size: 5.4 KiB

BIN
src/assets/icons/icon-152x152.png View File

Before After
Width: 152  |  Height: 152  |  Size: 5.9 KiB

BIN
src/assets/icons/icon-192x192.png View File

Before After
Width: 192  |  Height: 192  |  Size: 8.5 KiB

BIN
src/assets/icons/icon-384x384.png View File

Before After
Width: 284  |  Height: 284  |  Size: 16 KiB

BIN
src/assets/icons/icon-48x48.png View File

Before After
Width: 48  |  Height: 48  |  Size: 1.3 KiB

BIN
src/assets/icons/icon-512x512.png View File

Before After
Width: 512  |  Height: 512  |  Size: 42 KiB

BIN
src/assets/icons/icon-72x72.png View File

Before After
Width: 72  |  Height: 72  |  Size: 2.1 KiB

BIN
src/assets/icons/icon-96x96.png View File

Before After
Width: 96  |  Height: 96  |  Size: 3.1 KiB

+ 14
- 14
src/index.html View File

@@ -1,27 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8"/>
<title>Sripuram App</title>

<base href="/" />
<base href="/"/>

<meta name="color-scheme" content="light dark" />
<meta
name="viewport"
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="color-scheme" content="light dark"/>
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="msapplication-tap-highlight" content="no"/>

<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
<link rel="icon" type="image/png" href="assets/icon/favicon.png"/>

<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<link rel="manifest" href="manifest.webmanifest">
<meta name="theme-color" content="#1976d2">
</head>

<body>
<app-root></app-root>
</body>
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body>
</html>

+ 59
- 0
src/manifest.webmanifest View File

@@ -0,0 +1,59 @@
{
"name": "Sripuram App",
"short_name": "Sripuram",
"theme_color": "#6f1a0d",
"background_color": "#6f1a0d",
"display": "fullscreen",
"scope": "./",
"start_url": "./",
"icons": [
{
"src": "assets/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
}
]
}

Loading…
Cancel
Save