Skip to content
Permalink
Browse files
added PWA files
  • Loading branch information
aa7401 committed Nov 22, 2020
1 parent e30991f commit 488e8ab2c0d48b98a1d822abd8d3c7bf01a3d44e
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 2 deletions.
@@ -5,7 +5,7 @@ It only runs on Codio boxes.
To install, run the following command from inside the Codio box:

```
$ curl -sL https://bit.ly/XXXXXXX | sudo -E bash -
$ curl -sL https://bit.ly/3kZ56Kd | sudo -E bash -
```

> Note this will delete ALL the existing content from your Codio Box.
@@ -8,7 +8,7 @@ It only runs on Codio boxes.
To install, run the following command from inside the Codio box:

```
$ curl -sL https://bit.ly/XXXXXXX | sudo -E bash -
$ curl -sL https://bit.ly/3kZ56Kd | sudo -E bash -
```

> Note this will delete ALL the existing content from your Codio Box.
BIN +75 KB icons/icon-1024.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +8.88 KB icons/icon-120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +8.32 KB icons/icon-128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +9.38 KB icons/icon-144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +9.97 KB icons/icon-152.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +1.79 KB icons/icon-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +10.9 KB icons/icon-167.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +11.6 KB icons/icon-180.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +12.6 KB icons/icon-192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +26 KB icons/icon-384.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +35.5 KB icons/icon-512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +5.27 KB icons/icon-72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +6.71 KB icons/icon-96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -8,6 +8,18 @@
<meta name="description" content="Simple SPA">
<meta name="author" content="Mark J Tyers">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="white"/>
<meta http-equiv="ScreenOrientation" content="autoRotate:disabled">
<link rel="apple-touch-icon" href="images/icon-1024.png">
<link rel="apple-touch-icon" sizes="152x152" href="images/icon-152.png">
<link rel="apple-touch-icon" sizes="180x180" href="images/icon-180.png">
<link rel="apple-touch-icon" sizes="167x167" href="images/icon-167.png">
<meta name="description" content="Nursing collaborative simulation game for Coventry University.">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Hello World">
<meta name="msapplication-TileImage" content="images/hello-icon-144.png">
<link rel="stylesheet" href="css/style.css">
<script type="module" src="js/script.js"></script>
</head>
@@ -0,0 +1,18 @@

{
"name": "PWA",
"short_name": "Simple PWA",
"lang": "en-GB",
"start_url": "index.html",
"display": "standalone",
"background_color": "#005EB8",
"theme_color": "#005EB8",
"icons": [
{
"src": "icons/maskable_icon.png",
"type": "image/png",
"purpose": "any maskable",
"sizes": "72x72 96x96 120x120 128x128 144x144 152x152 180x180 192x192 256x256 384x384 512x512 1024x1024"
}
]
}
35 sw.js
@@ -0,0 +1,35 @@

const cacheName = 'hello-pwa'
const filesToCache = ['index.html']

/* Start the service worker and cache all of the app's content */
self.addEventListener('install', event => {
console.log('service worker installing')
event.waitUntil(
caches.open(cacheName).then( cache => cache.addAll(filesToCache))
)
})

/* Serve cached content when offline */
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request).then( response => response || fetch(event.request))
)
})

self.addEventListener('activate', function(event) {

var cacheAllowlist = ['pages-cache-v1', 'blog-posts-cache-v1'];

event.waitUntil(
caches.keys().then(function(cacheNames) {
return Promise.all(
cacheNames.map(function(cacheName) {
if (cacheAllowlist.indexOf(cacheName) === -1) {
return caches.delete(cacheName)
}
})
)
})
)
})

0 comments on commit 488e8ab

Please sign in to comment.