-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
Offline mode: turn Chord Chart Studio into a PWA
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "Chord Chart Studio", | ||
"short_name": "ChordChartStudio", | ||
"start_url": ".", | ||
"display": "standalone", | ||
"background_color": "#1e2324", | ||
"description": "Create and manage chord charts", | ||
"icons": [ | ||
{ | ||
"src": "favicon.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// serving an empty service worker for development as suggested here: | ||
// https://github.com/GoogleChrome/workbox/issues/1790#issuecomment-544982014 | ||
// the real service worker is generated by workbox in webpack production mode |
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!doctype html><html class="no-js" lang="en_EN"><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><title>Chord Chart Studio</title><meta name="description" content="Build chord charts easily for all musicians. The official editor of ChordMark."><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Roboto+Mono:400,700" rel="stylesheet"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><link rel="“icon”" href="”favicon.ico”" type="“image/x-icon”"><script async src="https://www.googletagmanager.com/gtag/js?id=G-EGKBT2J600"></script><script>window.dataLayer = window.dataLayer || []; | ||
<!doctype html><html class="no-js" lang="en_EN"><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><title>Chord Chart Studio</title><meta name="description" content="Build chord charts easily for all musicians. The official editor of ChordMark."><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Roboto+Mono:400,700" rel="stylesheet"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><link rel="“icon”" href="”favicon.ico”" type="“image/x-icon”"><link rel="manifest" href="manifest.json"/><script async src="https://www.googletagmanager.com/gtag/js?id=G-EGKBT2J600"></script><script>window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
|
||
gtag('config', 'G-EGKBT2J600');</script><link rel="icon" href="favicon.png"><script defer="defer" src="vendors.99948aaa068d066cd116.js"></script><script defer="defer" src="main.99948aaa068d066cd116.js"></script><link href="css/main.99948aaa068d066cd116.css" rel="stylesheet"></head><body><div id="app" class="theme-dark"></div></body></html> | ||
gtag('config', 'G-EGKBT2J600');</script><link rel="icon" href="favicon.png"><script defer="defer" src="vendors.a392a146987c4951f596.js"></script><script defer="defer" src="main.a392a146987c4951f596.js"></script><link href="css/main.a392a146987c4951f596.css" rel="stylesheet"></head><body><div id="app" class="theme-dark"></div></body></html> |
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "Chord Chart Studio", | ||
"short_name": "ChordChartStudio", | ||
"start_url": ".", | ||
"display": "standalone", | ||
"background_color": "#1e2324", | ||
"description": "Create and manage chord charts", | ||
"icons": [ | ||
{ | ||
"src": "favicon.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const serviceWorkerPath = './service-worker.js'; | ||
|
||
export default function registerSW() { | ||
if ('serviceWorker' in navigator) { | ||
navigator.serviceWorker | ||
.register(serviceWorkerPath) | ||
.catch((err) => console.log('Cannot register service worker', err)); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Used to serve the `build` folder locally, mainly to check the service worker behavior | ||
const express = require('express'); | ||
const app = express(); | ||
const PORT = 9000; | ||
|
||
const path = require('path'); | ||
const buildDir = path.resolve(__dirname, '../build'); | ||
|
||
app.use(express.static(buildDir)); | ||
|
||
app.listen(PORT, () => | ||
console.log(`Server listening at http://localhost:${PORT}`) | ||
); |