Improved pre-app loading experience

This commit is contained in:
Alicia Sykes 2022-04-01 23:55:54 +01:00
parent d9e04564a0
commit ad677de933
2 changed files with 16 additions and 6 deletions

View File

@ -21,14 +21,18 @@
<!-- Loading screen, will be replaced when app loaded -->
<div class="loading-placeholder" id="loader">
<h1>Dashy</h1>
<p class="loading">Loading...</p>
<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
This is likely caused by the app source not being found at the current domain
</p>
<p class="err-l2">
If you need additional support, check the browser console then
<a href="https://github.com/Lissy93/dashy/blob/master/.github/SUPPORT.md">
raise a ticket
</a>
</p>
</div>
</div>
@ -43,7 +47,6 @@
setTimeout(() => {
const loaderElem = document.getElementById('loader');
if (loaderElem) loaderElem.classList.add('still-not-loaded');
console.log('Will display error message');
}, 7500);
</script>
</body>

View File

@ -17,6 +17,7 @@ body { margin: 0; }
}
#app .loading-placeholder h1 {
font-size: 20vh;
margin: 1rem auto;
font-family: Tahoma, monospace;
cursor: progress;
color: #0c0c0c;
@ -24,9 +25,13 @@ body { margin: 0; }
}
#app .loading-placeholder p.loading {
font-size: 2rem;
opacity: 0.75;
font-family: monospace;
cursor: progress;
color: #0c0c0c;
display: flex;
flex-direction: column;
align-items: center;
text-shadow: 0 1px 1px #090909, 0 0 0 #000, 0 1px 1px #000000;
}
#app .loading-placeholder .catastrophic-error p {
@ -39,8 +44,10 @@ body { margin: 0; }
text-shadow: 1px 2px 1px #090909, 0 0 0 #000, 0 1px 1px #000000
}
#app .loading-placeholder .catastrophic-error p.err-l2 {
opacity: 0.75;
font-size: 2vh;
font-weight: normal;
padding: 0 1rem;
}
#app .loading-placeholder .catastrophic-error p.err-l2 a {
color: #e11a4bfc;
@ -53,4 +60,4 @@ body { margin: 0; }
#app .loading-placeholder .catastrophic-error p { font-size: 2.5vh !important; }
#app .loading-placeholder .catastrophic-error p.err-l2 { font-size: 1.2vh !important; }
}
::selection { background-color: #db78fc; color: #121212; }
::selection { background-color: #e11a4bfc; color: #121212; }