Skip to content

Commit

Permalink
add screen_shots for mobile and desktop experiences
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaughachukwuma committed Dec 3, 2024
1 parent 08094c4 commit 9227068
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 42 deletions.
18 changes: 17 additions & 1 deletion app/static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"id": "/",
"name": "Audiora",
"short_name": "Audiora",
"description": "Listen to anything, anytime, leveraging AI",
Expand Down Expand Up @@ -36,7 +37,7 @@
"src": "/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
"purpose": "maskable"
},
{
"src": "/icons/icon-384x384.png",
Expand All @@ -48,5 +49,20 @@
"sizes": "512x512",
"type": "image/png"
}
],
"screenshots": [
{
"src": "/screenshots/desktop.png",
"sizes": "1280x800",
"type": "image/png",
"form_factor": "wide",
"label": "Audiora Desktop Experience"
},
{
"src": "/screenshots/mobile.png",
"sizes": "390x844",
"type": "image/png",
"label": "Audiora Mobile Experience"
}
]
}
Binary file added app/static/screenshots/desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/screenshots/mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 39 additions & 41 deletions app/static/sw.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,51 @@
const CACHE_NAME = 'audiora-v1';
const urlsToCache = [
'/',
'/manifest.json',
'/icons/icon-72x72.png',
'/icons/icon-96x96.png',
'/icons/icon-128x128.png',
'/icons/icon-144x144.png',
'/icons/icon-152x152.png',
'/icons/icon-192x192.png',
'/icons/icon-384x384.png',
'/icons/icon-512x512.png'
'/',
'/manifest.json',
'/icons/icon-72x72.png',
'/icons/icon-96x96.png',
'/icons/icon-128x128.png',
'/icons/icon-144x144.png',
'/icons/icon-152x152.png',
'/icons/icon-192x192.png',
'/icons/icon-384x384.png',
'/icons/icon-512x512.png'
];

self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => cache.addAll(urlsToCache))
);
event.waitUntil(caches.open(CACHE_NAME).then((cache) => cache.addAll(urlsToCache)));
});

self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((cacheNames) => {
return Promise.all(
cacheNames.map((cacheName) => {
if (cacheName !== CACHE_NAME) {
return caches.delete(cacheName);
}
})
);
})
);
event.waitUntil(
caches.keys().then((cacheNames) => {
return Promise.all(
cacheNames.map((cacheName) => {
if (cacheName !== CACHE_NAME) {
return caches.delete(cacheName);
}
})
);
})
);
});

self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((response) => {
if (response) {
return response;
}
return fetch(event.request).then((response) => {
if (!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
const responseToCache = response.clone();
caches.open(CACHE_NAME).then((cache) => {
cache.put(event.request, responseToCache);
});
return response;
});
})
);
event.respondWith(
caches.match(event.request).then((response) => {
if (response) {
return response;
}
return fetch(event.request).then((response) => {
if (!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
const responseToCache = response.clone();
caches.open(CACHE_NAME).then((cache) => {
cache.put(event.request, responseToCache);
});
return response;
});
})
);
});

0 comments on commit 9227068

Please sign in to comment.