diff --git a/frontend/public/img/icons/apple-touch-icon-120x120.png b/frontend/public/img/icons/apple-touch-icon-120x120.png new file mode 100644 index 0000000..1427cf6 Binary files /dev/null and b/frontend/public/img/icons/apple-touch-icon-120x120.png differ diff --git a/frontend/public/img/icons/apple-touch-icon-152x152.png b/frontend/public/img/icons/apple-touch-icon-152x152.png new file mode 100644 index 0000000..f24d454 Binary files /dev/null and b/frontend/public/img/icons/apple-touch-icon-152x152.png differ diff --git a/frontend/public/img/icons/apple-touch-icon-180x180.png b/frontend/public/img/icons/apple-touch-icon-180x180.png new file mode 100644 index 0000000..404e192 Binary files /dev/null and b/frontend/public/img/icons/apple-touch-icon-180x180.png differ diff --git a/frontend/public/img/icons/apple-touch-icon-60x60.png b/frontend/public/img/icons/apple-touch-icon-60x60.png new file mode 100644 index 0000000..cf10a56 Binary files /dev/null and b/frontend/public/img/icons/apple-touch-icon-60x60.png differ diff --git a/frontend/public/img/icons/apple-touch-icon-76x76.png b/frontend/public/img/icons/apple-touch-icon-76x76.png new file mode 100644 index 0000000..c500769 Binary files /dev/null and b/frontend/public/img/icons/apple-touch-icon-76x76.png differ diff --git a/frontend/public/img/icons/apple-touch-icon.png b/frontend/public/img/icons/apple-touch-icon.png new file mode 100644 index 0000000..03c0c5d Binary files /dev/null and b/frontend/public/img/icons/apple-touch-icon.png differ diff --git a/frontend/public/img/icons/favicon-16x16.png b/frontend/public/img/icons/favicon-16x16.png new file mode 100644 index 0000000..42af009 Binary files /dev/null and b/frontend/public/img/icons/favicon-16x16.png differ diff --git a/frontend/public/img/icons/favicon-32x32.png b/frontend/public/img/icons/favicon-32x32.png new file mode 100644 index 0000000..46ca04d Binary files /dev/null and b/frontend/public/img/icons/favicon-32x32.png differ diff --git a/frontend/public/img/icons/msapplication-icon-144x144.png b/frontend/public/img/icons/msapplication-icon-144x144.png new file mode 100644 index 0000000..7808237 Binary files /dev/null and b/frontend/public/img/icons/msapplication-icon-144x144.png differ diff --git a/frontend/public/img/icons/mstile-150x150.png b/frontend/public/img/icons/mstile-150x150.png new file mode 100644 index 0000000..3b37a43 Binary files /dev/null and b/frontend/public/img/icons/mstile-150x150.png differ diff --git a/frontend/public/img/icons/safari-pinned-tab.svg b/frontend/public/img/icons/safari-pinned-tab.svg new file mode 100644 index 0000000..e44c0d5 --- /dev/null +++ b/frontend/public/img/icons/safari-pinned-tab.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/main.js b/frontend/src/main.js index 1ac6ce4..f11a45d 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -25,9 +25,7 @@ const i18n = new VueI18n({ messages }) -import wb from "./registerServiceWorker"; - -Vue.prototype.$workbox = wb; +import './registerServiceWorker' new Vue({ i18n, diff --git a/frontend/src/registerServiceWorker.js b/frontend/src/registerServiceWorker.js index 1c3d1f3..76cede0 100644 --- a/frontend/src/registerServiceWorker.js +++ b/frontend/src/registerServiceWorker.js @@ -1,84 +1,32 @@ -import { Workbox } from 'workbox-window'; -if ('serviceWorker' in navigator) { +/* eslint-disable no-console */ - const wb = new Workbox('/service-worker.js'); - wb.addEventListener('activated', event => { - // `event.isUpdate` will be true if another version of the service - // worker was controlling the page when this version was registered. - if (!event.isUpdate) { - console.log('Service worker activated for the first time!'); +import { register } from 'register-service-worker' - // If your service worker is configured to precache assets, those - // assets should all be available now. - } - }); - - wb.addEventListener('waiting', () => { - console.log( - `A new service worker has installed, but it can't activate` + - `until all tabs running the current version have fully unloaded.`, - ); - }); - - wb.addEventListener('message', event => { - if (event.data.type === 'CACHE_UPDATE') { - const { updatedURL } = event.data.payload; - - console.log(`A newer version of ${updatedURL} is available!`); - } - }); - - wb.addEventListener('installed', event => { - if (!event.isUpdate) { - console.log('First install'); - } else { - console.log('updated install'); - } - }); - - wb.addEventListener('controlling', event => { - if (!event.isUpdate) { - console.log('First control'); - } else { - console.log('updated control'); - } - }); - - wb.addEventListener('externalinstalled', event => { - if (!event.isUpdate) { - console.log('external first install'); - } else { - console.log('external update install'); - } - }); - - wb.addEventListener('externalwaiting', event => { - if (!event.isUpdate) { - console.log('external first waiting'); - } else { - console.log('external update waiting'); - } - }); - - wb.addEventListener('externalactivated', event => { - if (!event.isUpdate) { - console.log('external first acvtive'); - } else { - console.log('external update acvtive'); - } - }); - - wb.addEventListener('redundant', event => { - // `event.isUpdate` will be true if another version of the service - // worker was controlling the page when this version was registered. - if (!event.isUpdate) { - console.log('Service worker redundant for the first time!'); - - // If your service worker is configured to precache assets, those - // assets should all be available now. - } - console.log(event); - }); - - wb.register(); -} \ No newline at end of file +if (process.env.NODE_ENV === 'production') { + register(`${process.env.BASE_URL}service-worker.js`, { + ready () { + console.log( + 'App is being served from cache by a service worker.\n' + + 'For more details, visit https://goo.gl/AFskqB' + ) + }, + registered () { + console.log('Service worker has been registered.') + }, + cached () { + console.log('Content has been cached for offline use.') + }, + updatefound () { + console.log('New content is downloading.') + }, + updated () { + console.log('New content is available; please refresh.') + }, + offline () { + console.log('No internet connection found. App is running in offline mode.') + }, + error (error) { + console.error('Error during service worker registration:', error) + } + }) +} diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 5ad4e56..147db28 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -6,6 +6,7 @@ module.exports = { name: 'PewPew!', appleMobileWebAppCache: "yes", manifestOptions: { + display: 'standalone', } }, configureWebpack: {