xxweb app

This commit is contained in:
Omar Najjar 2025-09-25 04:12:20 +10:00
parent 4e58f3a710
commit f51877ea27
3 changed files with 61 additions and 0 deletions

View file

@ -11,6 +11,13 @@
<title>Watermelon Movies 🍉</title>
<link rel="icon" type="image/x-icon" href="favicon_watermelon_icon.ico">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<!-- iOS Meta Tags -->
<link rel="manifest" href="/manifest.json">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="Watermelon Movies 🍉">
<link rel="apple-touch-icon" href="/icon.png">
<style>
/* Custom styles for movie tiles */
.movie-tile {
@ -1647,6 +1654,18 @@
}
});
}
//Web App, Add to homescreen Service Worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
console.log('Service Worker registered with scope:', registration.scope);
}).catch(function(error) {
console.log('Service Worker registration failed:', error);
});
});
}
</script>
</body>
</html>

21
manifest.json Normal file
View file

@ -0,0 +1,21 @@
{
"name": "Watermelon Movies 🍉",
"short_name": "Watermelon Movies",
"description": "The Jews took Hollywood, we're stealing it back",
"start_url": "/",
"display": "standalone",
"background_color": "#32cd32",
"theme_color": "#ff6347",
"icons": [
{
"src": "icon.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icon.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

21
sw.js Normal file
View file

@ -0,0 +1,21 @@
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open('watermelon-movies-cache').then(function(cache) {
return cache.addAll([
'/',
'/index.html',
'/style.css',
'/icon.png',
'/manifest.json'
]);
})
);
});
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request).then(function(response) {
return response || fetch(event.request);
})
);
});