Skip to content

Commit

Permalink
Merge pull request #11 from opensource254/ft/full-pwa
Browse files Browse the repository at this point in the history
chore: update the manifest and theme color.
  • Loading branch information
StanleyMasinde authored Jan 10, 2025
2 parents da92cec + 7ae5767 commit fda46a4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PWA generator</title>
<meta name="description" content="Generate your PWA minifest easily.">
<meta name="theme-color" content="#ffe324" />
<link rel="manifest" href="/manifest.json">
</head>

Expand Down
2 changes: 2 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "PWA Generator",
"short_name": "PWA Generator",
"lang": "en",
"description": "This tool helps you quickly generate code for your PWA",
"icons": [
{
"src": "icons/icon-48x48.png",
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<nav class="bg-cyan-900 text-white px-1 sm:px-28 py-4 px-2">
<h1 class="font-bold shadow">PWA generator</h1>
<nav class="bg-primary text-white px-1 sm:px-28 py-4 px-2">
<h1 class="font-bold">PWA generator</h1>
</nav>

<section class="px-2 sm:px-28">
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

@layer components {
.form_input {
@apply w-full focus:border-cyan-900 focus:ring-1 border-2 focus:outline-none rounded-md mb-3 last-of-type:mb-5;
@apply w-full focus:border-primary focus:ring-1 border-2 focus:outline-none rounded-md mb-3 last-of-type:mb-5;
}
}
24 changes: 19 additions & 5 deletions src/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
// const CACHE_NAME = `pwa-cache-${process.env.BUILD_HASH}`
// eslint-disable-next-line no-undef
const CACHE_NAME = `cache-${process.env.BUILD_HASH}`
// Install event - Cache static assets
self.addEventListener('install', () => {
self.skipWaiting()
console.log('The install event will be here')
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME)
.then((cache) => {
cache.addAll([
'/',
])
}),
)
})

// Activate event - Clean up old caches
self.addEventListener('activate', (event) => {
const cacheAllowList = [CACHE_NAME]
event.waitUntil(
self.clients.claim(),
caches.keys().then((allCaches) => {
allCaches.forEach(async (cache) => {
if (!cacheAllowList.includes(cache)) {
await caches.delete(cache)
}
})
}),
)
})

Expand Down
6 changes: 5 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ module.exports = {
'./src/**/*.{vue,js,ts,jsx,tsx}',
],
theme: {
extend: {},
extend: {
colors: {
primary: '#ffe324',
},
},
},
plugins: [
require('@tailwindcss/forms'),
Expand Down

0 comments on commit fda46a4

Please sign in to comment.