diff --git a/images/icon/maskable_icon_x192.png b/images/icon/maskable_icon_x192.png new file mode 100644 index 0000000..0102510 Binary files /dev/null and b/images/icon/maskable_icon_x192.png differ diff --git a/images/icon/maskable_icon_x512.png b/images/icon/maskable_icon_x512.png new file mode 100644 index 0000000..6e385f5 Binary files /dev/null and b/images/icon/maskable_icon_x512.png differ diff --git a/includes/header.php b/includes/header.php index 35f3359..6a342dd 100644 --- a/includes/header.php +++ b/includes/header.php @@ -30,13 +30,15 @@ Wallos - Subscription Tracker + "/> - + > +
diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..6f3fe47 --- /dev/null +++ b/manifest.json @@ -0,0 +1,37 @@ +{ + "short_name": "Wallos", + "name": "Wallos - Subscription Tracker", + "icons": [ + { + "src": "images/icon/android-chrome-192x192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "images/icon/android-chrome-512x512.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "images/icon/maskable_icon_x192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "maskable" + }, + { + "src": "images/icon/maskable_icon_x512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + } + ], + "start_url": "/", + "id": "com.wallos.app", + "background_color": "#FFFFFF", + "display": "standalone", + "scope": "/", + "theme_color": "#FFFFFF", + "description": "Wallos is a personal subscription tracker that helps you keep track of your subscriptions and save money.", + "orientation": "portrait-primary", + "display_override": ["window-controls-overlay"] +} \ No newline at end of file diff --git a/registration.php b/registration.php index 6efd121..fad62b2 100644 --- a/registration.php +++ b/registration.php @@ -90,13 +90,16 @@ if (isset($_POST['username'])) { + "/> Wallos - Subscription Tracker - + > + +
diff --git a/scripts/all.js b/scripts/all.js new file mode 100644 index 0000000..159234b --- /dev/null +++ b/scripts/all.js @@ -0,0 +1,9 @@ +if ('serviceWorker' in navigator) { + window.addEventListener('load', function() { + navigator.serviceWorker.register('service-worker.js').then(function(registration) { + //console.log('ServiceWorker registration successful with scope: ', registration.scope); + }, function(err) { + console.log('ServiceWorker registration failed: ', err); + }); + }); +} \ No newline at end of file diff --git a/scripts/dashboard.js b/scripts/dashboard.js index d2b2596..b0a235b 100644 --- a/scripts/dashboard.js +++ b/scripts/dashboard.js @@ -316,4 +316,4 @@ document.addEventListener('DOMContentLoaded', function() { document.querySelector('#sort-options').addEventListener('focus', function() { isSortOptionsOpen = true; }); -}); +}); \ No newline at end of file diff --git a/service-worker.js b/service-worker.js new file mode 100644 index 0000000..32b0d90 --- /dev/null +++ b/service-worker.js @@ -0,0 +1,44 @@ +self.addEventListener('install', function(event) { + event.waitUntil( + caches.open('my-cache').then(function(cache) { + return cache.addAll([ + '.', + 'index.php', + 'stats.php', + 'settings.php', + 'about.php', + 'endpoints/subscriptions/get.php', + 'styles/styles.css', + 'styles/dark-theme.css', + 'styles/login.css', + 'scripts/common.js', + 'scripts/dashboard.js', + 'scripts/stats.js', + 'scripts/settings.js', + 'scripts/registration.js', + 'scripts/i18n/en.js', + 'scripts/i18n/de.js', + 'scripts/i18n/el.js', + 'scripts/i18n/es.js', + 'scripts/i18n/fr.js', + 'scripts/i18n/jp.js', + 'scripts/i18n/pt.js', + 'scripts/i18n/tr.js', + 'scripts/i18n/zh_cn.js', + 'scripts/i18n/zh_tw.js', + 'scripts/i18n/getlang.js', + 'images/icon/favicon.ico', + 'images/wallossolid.png', + 'images/wallossolidwhite.png', + ]); + }) + ); +}); + +self.addEventListener('fetch', function(event) { + event.respondWith( + caches.match(event.request).then(function(response) { + return response || fetch(event.request); + }) + ); +}); \ No newline at end of file