Skip to content

Commit

Permalink
Merge pull request #222 from Shifin-Malik/loading-animation
Browse files Browse the repository at this point in the history
feat(loading-animation): add loading-animation
  • Loading branch information
Muhammed-Rahif authored Nov 16, 2024
2 parents e5eeb18 + a9743b1 commit 4a27357
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
import LicenseDialog from '@/components/LicenseDialog.svelte';
import GoToDialog from '@/components/GoToDialog.svelte';
import FindDialog from '@/components/FindDialog.svelte';
import Loading from '@/components/Loading.svelte';
</script>

{#await Notpad.init() then}
{#await Notpad.init()}
<!-- Loading Animation -->
<Loading />
{:then}
<!-- Actual UI -->
<div class="flex h-full flex-col">
<MenuBar />
<EditorTabs />
</div>

<!-- Procedually -->
<!-- Additional Components -->
<FontDialog />
<LicenseDialog />
<AboutDialog />
Expand Down
5 changes: 4 additions & 1 deletion src/lib/components/DownloadButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
.flatMap((release) => release.assets)
.sort((a, b) => a.name.localeCompare(b.name))}

<div transition:slide|global class="absolute right-1 top-1/2 -translate-y-1/2 transform">
<div
transition:slide|global
class="absolute right-1 top-1/2 -translate-y-1/2 transform max-lg:hidden"
>
<Menubar.Menu>
<Menubar.Trigger>Download</Menubar.Trigger>
<Menubar.Content>
Expand Down
14 changes: 14 additions & 0 deletions src/lib/components/Loading.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script lang="ts">
import { mode } from 'mode-watcher';
import { fade } from 'svelte/transition';
import appIconLight from '@/src/assets/images/Notpad Logo Light.svg';
import appIconDark from '@/src/assets/images/Notpad Logo Dark.svg';
</script>

<div
transition:fade
class="fixed inset-0 bottom-0 left-0 right-0 top-0 z-50 flex
flex-col items-center justify-center bg-primary-foreground"
>
<img class="w-20 animate-pulse" alt="icon" src={$mode == 'dark' ? appIconDark : appIconLight} />
</div>

0 comments on commit 4a27357

Please sign in to comment.