Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added freetar/static/guitar-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions freetar/static/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Freetar",
"short_name": "Freetar",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#ffffff",
"icons": [
{
"src": "/static/guitar-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/static/guitar.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
8 changes: 8 additions & 0 deletions freetar/static/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// not doing anything, just there for the Progressive Web App
self.addEventListener('install', () => {
self.skipWaiting();
});

self.addEventListener('activate', () => {
self.clients.claim();
});
12 changes: 12 additions & 0 deletions freetar/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<meta property="og:type" content=website>
<meta property="og:image" content=https://freetar.de/static/guitar.png>

<link rel="manifest" href="/static/manifest.json">
<link rel="apple-touch-icon" href="/static/icons/icon-192.png">

<link href="/static/bootstrap/bootstrap.min.css" rel="stylesheet">
<title>{{ title or "Freetar - guitar chords from Ultimate Guitar" }}</title>
Expand Down Expand Up @@ -70,6 +72,16 @@
</div>

<script src="/static/custom.js"></script>

<script>
// just used for the Progressive Web App - not doing anything
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/static/sw.js')
.then(() => console.log('Service worker registered'))
.catch(err => console.error(err));
}
</script>

</body>

</html>