This commit is contained in:
Jack 2021-12-13 17:52:34 +00:00
commit 5050904352
4 changed files with 36 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -54,6 +54,7 @@
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link rel="manifest" href="manifest.json" />
<meta name="name" content="Monkeytype" />
<meta name="image" content="https://monkeytype.com/mtsocial.png" />
<meta
@ -94,6 +95,11 @@
id="adScript"
async
></script>
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("sw.js");
}
</script>
</head>
<div class="customBackground"></div>

15
static/manifest.json Normal file
View file

@ -0,0 +1,15 @@
{
"short_name": "MT",
"name": "Monkeytype",
"start_url": "/",
"icons": [
{
"src": "/images/mt-icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"background_color": "#323437",
"display": "standalone",
"theme_color": "#323437"
}

15
static/sw.js Normal file
View file

@ -0,0 +1,15 @@
self.addEventListener("install", function (event) {
event.waitUntil(
caches.open("sw-cache").then(function (cache) {
return cache.add("index.html");
})
);
});
self.addEventListener("fetch", function (event) {
event.respondWith(
caches.match(event.request).then(function (response) {
return response || fetch(event.request);
})
);
});