Skip to content

Commit fda46a4

Browse files
Merge pull request #11 from opensource254/ft/full-pwa
chore: update the manifest and theme color.
2 parents da92cec + 7ae5767 commit fda46a4

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
88
<title>PWA generator</title>
99
<meta name="description" content="Generate your PWA minifest easily.">
10+
<meta name="theme-color" content="#ffe324" />
1011
<link rel="manifest" href="/manifest.json">
1112
</head>
1213

public/manifest.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "PWA Generator",
33
"short_name": "PWA Generator",
4+
"lang": "en",
5+
"description": "This tool helps you quickly generate code for your PWA",
46
"icons": [
57
{
68
"src": "icons/icon-48x48.png",

src/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<nav class="bg-cyan-900 text-white px-1 sm:px-28 py-4 px-2">
3-
<h1 class="font-bold shadow">PWA generator</h1>
2+
<nav class="bg-primary text-white px-1 sm:px-28 py-4 px-2">
3+
<h1 class="font-bold">PWA generator</h1>
44
</nav>
55

66
<section class="px-2 sm:px-28">

src/index.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
@layer components {
66
.form_input {
7-
@apply w-full focus:border-cyan-900 focus:ring-1 border-2 focus:outline-none rounded-md mb-3 last-of-type:mb-5;
7+
@apply w-full focus:border-primary focus:ring-1 border-2 focus:outline-none rounded-md mb-3 last-of-type:mb-5;
88
}
99
}

src/service-worker.js

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1-
// const CACHE_NAME = `pwa-cache-${process.env.BUILD_HASH}`
1+
// eslint-disable-next-line no-undef
2+
const CACHE_NAME = `cache-${process.env.BUILD_HASH}`
23
// Install event - Cache static assets
3-
self.addEventListener('install', () => {
4-
self.skipWaiting()
5-
console.log('The install event will be here')
4+
self.addEventListener('install', (event) => {
5+
event.waitUntil(
6+
caches.open(CACHE_NAME)
7+
.then((cache) => {
8+
cache.addAll([
9+
'/',
10+
])
11+
}),
12+
)
613
})
714

815
// Activate event - Clean up old caches
916
self.addEventListener('activate', (event) => {
17+
const cacheAllowList = [CACHE_NAME]
1018
event.waitUntil(
11-
self.clients.claim(),
19+
caches.keys().then((allCaches) => {
20+
allCaches.forEach(async (cache) => {
21+
if (!cacheAllowList.includes(cache)) {
22+
await caches.delete(cache)
23+
}
24+
})
25+
}),
1226
)
1327
})
1428

tailwind.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ module.exports = {
66
'./src/**/*.{vue,js,ts,jsx,tsx}',
77
],
88
theme: {
9-
extend: {},
9+
extend: {
10+
colors: {
11+
primary: '#ffe324',
12+
},
13+
},
1014
},
1115
plugins: [
1216
require('@tailwindcss/forms'),

0 commit comments

Comments
 (0)