Last active
July 15, 2020 15:21
-
-
Save neocris/fb05a9488913dabd249e72e1b0528117 to your computer and use it in GitHub Desktop.
app shell template from https://developers.google.com/web/fundamentals/architecture/app-shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>App Shell</title> | |
<link rel="manifest" href="/manifest.json"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" type="text/css" href="styles/inline.css"> | |
</head> | |
<body> | |
<header class="header"> | |
<h1 class="header__title">App Shell</h1> | |
</header> | |
<nav class="nav"> | |
... | |
</nav> | |
<main class="main"> | |
... | |
</main> | |
<div class="dialog-container"> | |
... | |
</div> | |
<div class="loader"> | |
<!-- Show a spinner or placeholders for content --> | |
</div> | |
<script src="app.js" async></script> | |
<script> | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('/sw.js').then(function(registration) { | |
// Registration was successful | |
console.log('ServiceWorker registration successful with scope: ', registration.scope); | |
}).catch(function(err) { | |
// registration failed :( | |
console.log('ServiceWorker registration failed: ', err); | |
}); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment