💄 Loading screen shows message on error

This commit is contained in:
Alicia Sykes
2022-02-18 03:17:10 +00:00
parent c7758e8873
commit 6a88f4725b
2 changed files with 80 additions and 37 deletions

View File

@@ -10,6 +10,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="web-icons/favicon-32x32.png">
<link rel="icon" href="/favicon.ico" />
<link rel="icon" type="image/png" href="<%= BASE_URL %>favicon.ico" />
<link rel="stylesheet" type="text/css" href="loading-screen.css" />
<!-- Default Page Title -->
<title>Dashy</title>
</head>
@@ -18,46 +19,32 @@
<!-- built files will be auto injected -->
<div id="app">
<!-- Loading screen, will be replaced when app loaded -->
<div class="loading-placeholder" id="loader"><h1>Dashy</h1><p>Loading...</p></div>
<div class="loading-placeholder" id="loader">
<h1>Dashy</h1>
<p class="loading">Loading...</p>
<!-- Error message, only visible if app not mounted within 5 secs -->
<div class="catastrophic-error" id="err-wrap" style="display:none;">
<p class="err-l1">It looks like something's gone wrong...</p>
<p class="err-l2">
Check the browser console, and
<a href="https://github.com/Lissy93/dashy/blob/master/.github/SUPPORT.md">raise a ticket</a>
if you need additional support
</p>
</div>
</div>
</div>
<!-- Devices without JS enabled -->
<noscript>
<strong>Sorry, JavaScript needs to be enabled to run Dashy 😥</strong>
</noscript>
<!-- Styles for loading screen -->
<style type="text/css">
body { margin: 0; }
#app .loading-placeholder {
position: absolute;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
cursor: progress;
background: #121212;
}
#app .loading-placeholder h1 {
font-size: 20vh;
font-family: Tahoma, monospace;
cursor: progress;
color: #0c0c0c;
text-shadow: 0px 4px 4px #090909, 0 0 0 #000, 0px 2px 2px #000000;
}
@media (max-width: 780px) {
.loading-placeholder h1 { font-size: 12vh !important; }
}
#app .loading-placeholder p {
font-size: 2rem;
font-family: monospace;
cursor: progress;
color: #0c0c0c;
text-shadow: 0 1px 1px #090909, 0 0 0 #000, 0 1px 1px #000000;
}
::selection { background-color: #db78fc; color: #121212; }
</style>
<!-- Show error message if app not mounted within reasonable time frame -->
<script>
setTimeout(() => {
const loaderElem = document.getElementById('loader');
if (loaderElem) loaderElem.classList.add('still-not-loaded');
console.log('Will display error message');
}, 7500);
</script>
</body>
</html>
</html>