mirror of
https://github.com/NotAShelf/nix-evaluator-stats.git
synced 2026-04-12 22:37:42 +00:00
index: add loading spinner
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I383f790b11f2b350ebe4b51a81af1d286a6a6964
This commit is contained in:
parent
288eb9ca54
commit
1850ac135f
2 changed files with 25 additions and 2 deletions
|
|
@ -192,7 +192,13 @@ function App() {
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="main">
|
<main class="main">
|
||||||
<Suspense fallback={<div class="loading">Loading analysis...</div>}>
|
<Show when={isLoading()}>
|
||||||
|
<div class="loading">
|
||||||
|
<div class="spinner"></div>
|
||||||
|
<span>Loading saved data...</span>
|
||||||
|
</div>
|
||||||
|
</Show>
|
||||||
|
<Show when={!isLoading()}>
|
||||||
<Show when={view() === 'analysis'}>
|
<Show when={view() === 'analysis'}>
|
||||||
<Show when={!currentStats()}>
|
<Show when={!currentStats()}>
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
|
@ -238,7 +244,7 @@ function App() {
|
||||||
onDelete={deleteSnapshot}
|
onDelete={deleteSnapshot}
|
||||||
/>
|
/>
|
||||||
</Show>
|
</Show>
|
||||||
</Suspense>
|
</Show>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
|
|
|
||||||
|
|
@ -63,13 +63,30 @@ body {
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
|
gap: 1rem;
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border: 3px solid var(--border-color);
|
||||||
|
border-top-color: var(--accent);
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.header-left {
|
.header-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue