Skip to content

Commit

Permalink
Better loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Mar 29, 2024
1 parent 38ee8be commit 14e7c70
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
25 changes: 25 additions & 0 deletions web/src/common/Loading.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
export let msg: string | null = null;
</script>

{#if msg}
<div>{msg}</div>
{/if}

<style>
div {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
color: white;
font-size: 32px;
}
</style>
5 changes: 3 additions & 2 deletions web/src/common/import/ImportControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
} from "../store";
import { bbox, downloadGeneratedFile } from "../utils";
import Osm2streetsSettings from "./Osm2streetsSettings.svelte";
import { Loading } from "../";
// This component manages a state machine for importing OSM data (from
// Overpass or built-in files) and letting the user change import settings. It
Expand Down Expand Up @@ -151,9 +152,9 @@
</legend>

{#if imported.kind === "nothing"}
<p>Use the polygon tool to select an area to import</p>
<p>Choose an option above to import somewhere</p>
{:else if imported.kind === "loading"}
<p>{imported.msg}</p>
<Loading msg={imported.msg} />
{:else if imported.kind === "done"}
<div>
<button type="button" on:click={update}>Update OSM data</button>
Expand Down
1 change: 1 addition & 0 deletions web/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export { default as BasemapPicker } from "./BasemapPicker.svelte";
export { default as Geocoder } from "./Geocoder.svelte";
export { default as Layout } from "./Layout.svelte";
export { default as Legend } from "./Legend.svelte";
export { default as Loading } from "./Loading.svelte";
export { default as Map } from "./Map.svelte";
export { default as StreetView } from "./StreetView.svelte";
export { default as ThemePicker } from "./ThemePicker.svelte";
Expand Down

0 comments on commit 14e7c70

Please sign in to comment.