xxweb app
This commit is contained in:
parent
4e58f3a710
commit
f51877ea27
3 changed files with 61 additions and 0 deletions
19
index.html
19
index.html
|
|
@ -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
21
manifest.json
Normal 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
21
sw.js
Normal 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);
|
||||
})
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue