Skip to content

Commit 54bf5a8

Browse files
committed
loading indication
1 parent 2ab7007 commit 54bf5a8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/routes/tutorial/[slug]/_/Loading.svelte

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1+
<script>
2+
/** @type {boolean} */
3+
export let initial;
4+
</script>
5+
16
<div class="loading">
7+
{#if initial}
8+
<p>Initializing WebContainer. This may take a few seconds</p>
9+
{/if}
10+
211
<svg width="107" height="128" viewBox="0 0 107 128">
312
<path
413
d="M94.1566,22.8189c-10.4-14.8851-30.94-19.2971-45.7914-9.8348L22.2825,29.6078A29.9234,29.9234,0,0,0,8.7639,49.6506a31.5136,31.5136,0,0,0,3.1076,20.2318A30.0061,30.0061,0,0,0,7.3953,81.0653a31.8886,31.8886,0,0,0,5.4473,24.1157c10.4022,14.8865,30.9423,19.2966,45.7914,9.8348L84.7167,98.3921A29.9177,29.9177,0,0,0,98.2353,78.3493,31.5263,31.5263,0,0,0,95.13,58.117a30,30,0,0,0,4.4743-11.1824,31.88,31.88,0,0,0-5.4473-24.1157"
@@ -19,12 +28,17 @@
1928
top: 0;
2029
left: 0;
2130
display: flex;
31+
flex-direction: column;
2232
align-items: center;
2333
justify-content: center;
2434
background: #f9f9f9;
2535
user-select: none;
2636
}
2737
38+
p {
39+
color: #999;
40+
}
41+
2842
svg {
2943
width: 100px;
3044
height: 100px;

src/routes/tutorial/[slug]/index.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
/** @type {HTMLIFrameElement} */
4848
let iframe;
4949
let loading = true;
50+
let initial = true;
5051
5152
/** @type {Record<string, boolean>}*/
5253
let complete_states = {};
@@ -156,6 +157,7 @@
156157
}
157158
158159
set_iframe_src(adapter.base);
160+
initial = false;
159161
});
160162
161163
/** @type {NodeJS.Timeout} */
@@ -372,7 +374,7 @@
372374
<iframe bind:this={iframe} title="Output" />
373375
374376
{#if loading}
375-
<Loading />
377+
<Loading {initial} />
376378
{/if}
377379
</div>
378380
</section>

0 commit comments

Comments
 (0)