Add splash screen

This gives us something prettier than a blank page while the app
is loading (although, of course, it could also prove a bit more
cryptic to debug if something goes wrong).

Closes #5
This commit is contained in:
Badri Sunderarajan 2022-09-27 17:54:25 +05:30
parent 301b72b488
commit 1dbe3183c0
5 changed files with 69 additions and 1 deletions

View File

@ -3,3 +3,19 @@ body {
font-size: 1.7em;
font-weight: 400;
}
#splash {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #6800a5;
display: flex;
}
#splash img {
margin: auto;
width: 50vw;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 512 512"
version="1.1"
id="svg4"
sodipodi:docname="icon-white.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
inkscape:export-filename="../Code/jab/public/images/icon-48.png"
inkscape:export-xdpi="9"
inkscape:export-ydpi="9"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="0.65186406"
inkscape:cx="39.118586"
inkscape:cy="381.98148"
inkscape:window-width="1366"
inkscape:window-height="736"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. -->
<path
id="path2"
style="fill:#ffffff;fill-opacity:1"
d="M 256 32 C 114.60042 32 0 125.10033 0 240 C 4.7369374e-15 285.09985 17.699309 326.8009 47.699219 360.80078 C 45.799225 385.30072 36.300751 407.09928 26.300781 423.69922 C 20.700799 432.89919 15.199597 440.30081 11.099609 445.30078 C 8.9996165 447.90078 7.2992154 449.8 6.1992188 451 C 5.5992204 451.7 5.2003897 452.10039 4.9003906 452.40039 L 4.5996094 452.69922 C 0.099622825 457.29919 -1.300774 464.09964 1.1992188 470.09961 C 3.6992113 476.09958 9.5000195 480 16 480 C 44.699913 480 73.599681 471.09919 97.599609 460.69922 C 120.59955 450.69925 140.00042 438.79958 151.90039 430.09961 C 183.7003 441.59958 218.90012 448 256 448 C 397.39958 448 512 354.89967 512 240 C 512 125.10033 397.39958 32 256 32 z M 92.001953 143.12695 C 92.247487 143.11535 92.496404 143.1168 92.746094 143.13281 C 93.316813 143.16941 93.897219 143.27824 94.474609 143.4707 L 181.4375 172.45703 C 184.13368 173.35798 185.91643 175.86577 185.99023 178.70312 C 188.41746 280.11553 268.07833 356.55056 321.28906 361.91602 C 324.64416 362.25893 327.125 365.18334 327.125 368.55859 L 327.125 368.77344 C 327.125 372.5521 324.00631 375.67981 320.23438 375.51172 C 203.27022 370.30764 94.104127 234.32015 85.605469 150.47656 C 85.202838 146.50544 88.318948 143.30097 92.001953 143.12695 z M 400.87305 143.14844 C 404.55965 143.31722 407.65757 146.51908 407.27148 150.49023 C 401.62363 206.22913 351.46535 285.03151 284.02734 333.10547 C 274.41254 326.9197 264.73119 318.85142 255.6543 309.37109 C 283.82629 276.69427 305.60922 231.04031 306.88672 178.73047 C 306.95402 175.83931 308.76955 173.35064 311.45898 172.47656 L 398.39648 143.49805 C 398.9764 143.30474 399.55713 143.19368 400.12891 143.15625 C 400.37906 143.13988 400.62727 143.13719 400.87305 143.14844 z M 208.45312 349.10742 C 215.71465 353.94844 223.11128 358.52049 230.70898 362.55469 C 211.88281 370.01791 192.38384 374.65717 172.68359 375.53125 C 168.85112 375.66573 165.75781 372.57269 165.75781 368.74023 L 165.75781 368.53906 C 165.75781 365.17725 168.2456 362.28542 171.60742 361.94922 C 183.0376 360.80622 195.61098 356.36895 208.45312 349.10742 z " />
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -17,6 +17,10 @@
<script src="/startup.js"></script>
</head>
<body></body>
<body>
<div id="splash">
<img src="/images/icon-white-256.png"/>
</div>
</body>
</html>

View File

@ -1,4 +1,5 @@
<script lang="ts">
import { onMount } from 'svelte'
import Router, { location, pop } from 'svelte-spa-router'
import SoftKey from './components/SoftKey.svelte'
@ -85,6 +86,12 @@
document
.activeElement
.addEventListener('keydown', handleKeydown)
// Get rid of the splash screen
onMount(() => {
let splash = document.getElementById('splash')
if (splash) splash.remove()
})
</script>
<main id="app">