Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
feat: show loading animation on project screen
Browse files Browse the repository at this point in the history
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
  • Loading branch information
rudolfs committed Oct 13, 2021
1 parent 324bbb2 commit e5f7753
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ui/App/LoadingScreen.svelte
Expand Up @@ -6,7 +6,7 @@
LICENSE file.
-->
<script lang="ts">
import EmptyState from "ui/App/ScreenLayout/EmptyState.svelte";
import { Loading } from "ui/DesignSystem";
</script>

<style>
Expand All @@ -21,5 +21,5 @@
</style>

<div class="container">
<EmptyState headerText="Loading" emoji="🕵️" />
<Loading />
</div>
2 changes: 1 addition & 1 deletion ui/App/OnboardingModal/EnterName.svelte
Expand Up @@ -99,7 +99,7 @@
<div>
<h1>
Hey
<Emoji emoji="👋 " size="big" style="display: inline;" />
<Emoji emoji="👋 " size="large" style="display: inline;" />
what should we call you?
</h1>
<p>
Expand Down
15 changes: 14 additions & 1 deletion ui/App/ProjectScreen/Source.svelte
Expand Up @@ -30,7 +30,7 @@
import * as screen from "ui/src/screen";
import * as wallet from "ui/src/wallet";
import { Icon } from "ui/DesignSystem";
import { Icon, Loading } from "ui/DesignSystem";
import ActionBar from "ui/App/ScreenLayout/ActionBar.svelte";
import TabBar from "ui/App/ScreenLayout/TabBar.svelte";
Expand Down Expand Up @@ -186,6 +186,15 @@
}
</script>

<style>
.loading-container {
display: flex;
justify-content: center;
align-items: center;
height: calc(100vh - var(--bigheader-height));
}
</style>

{#if $store.status === remote.Status.Success}
<ActionBar>
<div slot="left">
Expand Down Expand Up @@ -239,4 +248,8 @@
{:else}
{unreachable(activeView)}
{/if}
{:else if $store.status === remote.Status.Loading}
<div class="loading-container">
<Loading />
</div>
{/if}
13 changes: 4 additions & 9 deletions ui/DesignSystem/Emoji.svelte
Expand Up @@ -10,7 +10,7 @@
export let emoji: string;
type EmojiSize = "small" | "regular" | "medium" | "big" | "huge";
type EmojiSize = "small" | "regular" | "large" | "huge";
export let size: EmojiSize = "regular";
export let style: string | undefined = undefined;
Expand All @@ -33,14 +33,9 @@
width: 1rem;
}
:global(.emoji.medium) {
height: 1.125rem;
width: 1.125rem;
}
:global(.emoji.big) {
height: 2.25rem;
width: 2.25rem;
:global(.emoji.large) {
height: 2rem;
width: 2rem;
}
:global(.emoji.huge) {
Expand Down
35 changes: 35 additions & 0 deletions ui/DesignSystem/Loading.svelte
@@ -0,0 +1,35 @@
<!--
Copyright © 2021 The Radicle Upstream Contributors
This file is part of radicle-upstream, distributed under the GPLv3
with Radicle Linking Exception. For full terms see the included
LICENSE file.
-->
<script lang="typescript">
import Emoji from "./Emoji.svelte";
</script>

<style>
.animation {
animation: rotate, rotate-back;
animation-iteration-count: infinite;
animation-timing-function: cubic-bezier(0.45, 1.45, 0.8, 1);
animation-duration: 1400ms;
}
@keyframes rotate {
0%,
15%,
85%,
100% {
transform: rotate(0deg);
}
35%,
65% {
transform: rotate(180deg);
}
}
</style>

<div class="animation">
<Emoji emoji="" size="large" />
</div>
2 changes: 2 additions & 0 deletions ui/DesignSystem/index.ts
Expand Up @@ -19,6 +19,7 @@ import Icon from "./Icon";
import IdentifierLink from "./IdentifierLink.svelte";
import KeyHint from "./KeyHint.svelte";
import List from "./List.svelte";
import Loading from "./Loading.svelte";
import Markdown from "./Markdown.svelte";
import Notification from "./Notification.svelte";
import Overlay from "./Overlay.svelte";
Expand Down Expand Up @@ -51,6 +52,7 @@ export {
IdentifierLink,
KeyHint,
List,
Loading,
Markdown,
Notification,
Overlay,
Expand Down

0 comments on commit e5f7753

Please sign in to comment.