progressive web app
This commit is contained in:
		| @ -2,9 +2,9 @@ | ||||
|     <link rel="stylesheet" type="text/css" href="style.css"> | ||||
| 	<head> | ||||
|         <meta name="viewport" content="width=device-width, user-scalable=no" /> | ||||
|         <!-- <link rel="manifest" href="manifest.json" /> --> | ||||
|         <link rel="manifest" href="manifest.json" /> | ||||
|         <link rel="icon" href="icon.png" type="image/png"/> | ||||
|         <!-- <script defer src="site.js"></script> --> | ||||
|         <script defer src="site.js"></script> | ||||
| 		<title>ultimate tictactoe</title> | ||||
| 	</head> | ||||
| 	<body> | ||||
|  | ||||
							
								
								
									
										15
									
								
								manifest.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								manifest.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | ||||
| { | ||||
|     "name": "Ultimate TicTacToe", | ||||
|     "short_name": "Ultimate TicTacToe", | ||||
|     "display": "standalone", | ||||
|     "start_url": "/", | ||||
|     "theme_color": "#4650e2", | ||||
|     "background_color": "#1e2477", | ||||
|     "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); | ||||
| }); | ||||
							
								
								
									
										33
									
								
								sw.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								sw.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,33 @@ | ||||
|  | ||||
| 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', | ||||
|           '/game_server_connection.js', | ||||
|           '/sidebar.js', | ||||
|           '/settings.js', | ||||
|           '/subgrid.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); | ||||
|       }) | ||||
|     ); | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user