made it a progressive web app
This commit is contained in:
parent
414a24ed17
commit
79abc853f8
@ -1,11 +1,13 @@
|
||||
<html>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<head>
|
||||
<title>Simon Says</title>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<link rel="icon" href="icon.png" type="image/png"/>
|
||||
<script defer src="site.js"></script>
|
||||
<title>Patterns</title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- <canvas id="myCanvas"></canvas> -->
|
||||
<div id="main-container" class="main-container">
|
||||
<div id="sidebar-container" class="sidebar-container">
|
||||
<div id="control-container" class="control-container"></div>
|
||||
|
15
manifest.json
Normal file
15
manifest.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "Patterns",
|
||||
"short_name": "Patterns",
|
||||
"display": "minimal-ui",
|
||||
"start_url": "/",
|
||||
"theme_color": "#422B42",
|
||||
"background_color": "#272227",
|
||||
"icons": [
|
||||
{
|
||||
"src": "icon.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
3
site.js
Normal file
3
site.js
Normal file
@ -0,0 +1,3 @@
|
||||
navigator.serviceWorker && navigator.serviceWorker.register('./sw.js').then(function(registration) {
|
||||
console.log('Excellent, registered with scope: ', registration.scope);
|
||||
});
|
29
sw.js
Normal file
29
sw.js
Normal file
@ -0,0 +1,29 @@
|
||||
self.addEventListener('install', function(e) {
|
||||
e.waitUntil(
|
||||
caches.open('your-magic-cache').then(function(cache) {
|
||||
return cache.addAll([
|
||||
'/',
|
||||
'/index.html',
|
||||
'/manifest.json',
|
||||
'/icon.png',
|
||||
'/LICENSE',
|
||||
'/main.js',
|
||||
'/grid.js',
|
||||
'/game_manager.js',
|
||||
'/sidebar.js',
|
||||
'/tile.js',
|
||||
'/README.md',
|
||||
'/site.js',
|
||||
'/style.css',
|
||||
]);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', function(event) {
|
||||
event.respondWith(
|
||||
caches.match(event.request).then(function(response) {
|
||||
return response || fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
Loading…
Reference in New Issue
Block a user