Skip to content
Merged
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 frontend/favicon_black.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 frontend/favicon_colour.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 frontend/favicon_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
name="description"
content="Fast and free YouTube and Instagram video downloader. Convert to MP3 and MP4 in high quality."
/>
<link rel="manifest" href="manifest.json">

<title>Reelo - YT & Insta Converter</title>
<link rel="stylesheet" href="static/css/style.css?v=1.1" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
Expand Down
46 changes: 46 additions & 0 deletions frontend/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "Reelo | MTYT",
"short_name": "Reelo",
"description": "The awesome video download app!",
"icons": [
{
"sizes": "48x48",
"src": "maskable_icon_x48.png",
"type": "image/png"
},
{
"sizes": "72x72",
"src": "maskable_icon_x72.png",
"type": "image/png"
},
{
"sizes": "96x96",
"src": "maskable_icon_x96.png",
"type": "image/png"
},
{
"sizes": "128x128",
"src": "maskable_icon_x128.png",
"type": "image/png"
},
{
"sizes": "192x192",
"src": "maskable_icon_x192.png",
"type": "image/png"
},
{
"sizes": "384x384",
"src": "maskable_icon_x384.png",
"type": "image/png"
},
{
"sizes": "512x512",
"src": "maskable_icon_x512.png",
"type": "image/png"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#000000"
}
Binary file added frontend/maskable_icon_x128.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 frontend/maskable_icon_x192.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 frontend/maskable_icon_x384.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 frontend/maskable_icon_x48.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 frontend/maskable_icon_x512.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 frontend/maskable_icon_x72.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 frontend/maskable_icon_x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions frontend/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,3 +456,29 @@ if (currentMode === 'audio') {
}
// Set initial active format button
selectFormat(selectedFormat);


function registerService() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register("/static/js/sw.js");
}
}


let installPrompt = null;

window.addEventListener("beforeinstallprompt", (event) => {
event.preventDefault();
installPrompt = event;
});


window.addEventListener('DOMContentLoaded', async() => {
if (!installPrompt) {
return;
}
const result = await installPrompt.prompt();
installPrompt = null;
registerService()

})
45 changes: 45 additions & 0 deletions frontend/static/js/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const cachea = "SreeCache-v1";
list = []
var appshellfiles = [
'/index.html',
'/static/js/app.js',
'/static/js/sw.js',
'/static/css/style.css',
'/maskable_icon_x48.png',
'/maskable_icon_x72.png',
'/maskable_icon_x96.png',
'/maskable_icon_x128.png',
'/maskable_icon_x192.png',
'/maskable_icon_x384.png',
'/maskable_icon_x512.png',
'/favicon_black.png',
'/favicon_white.png',
'/favicon_colour.png'
]
appshellfiles = []
self.addEventListener("install", e => {


e.waitUntil((async () => {

const cache = await caches.open(cachea);
await cache.addAll(appshellfiles);
})());


});
self.addEventListener("activate", event => {
console.log("WE ARE GOOGLY BOOGLY WOOGLY");
});

const cacheFirst = async (request) => {
const responseFromCache = await caches.match(request);
if (responseFromCache) {
return responseFromCache;
}
return fetch(request);
};

self.addEventListener("fetch", (event) => {
event.respondWith(cacheFirst(event.request));
});
Loading