Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions frontend/app/components/MainLoading/MainLoading.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
function MainLoading() {
return (
<main className="flex flex-col items-center justify-center gap-4">
<p>Welcome to Readr!</p>
<p>Loading...</p>
<img
src={`${import.meta.env.BASE_URL}favicon/android-chrome-192x192.png`}
alt="Readr logo"
className="size-12"
/>
{/* Progress bar that never fills up. Hidden with reduced motion, where it would look stuck at a third */}
{/* Div used for a non-interactive and decorative-only element */}
<div
aria-hidden="true"
className="h-1 w-32 overflow-hidden rounded-full bg-foreground/15 motion-reduce:hidden"
>
<div className="h-full w-1/3 rounded-full bg-foreground motion-safe:animate-loading-bar" />
</div>
<p role="status">Loading...</p>
</main>
);
}
Expand Down
12 changes: 12 additions & 0 deletions frontend/app/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@
transform: translateY(-0.75rem);
}
}

--animate-loading-bar: loading-bar 1.5s ease-in-out infinite;

/* Slides a bar that is a third of its track's width from fully outside the left edge to fully outside the right edge */
@keyframes loading-bar {
from {
transform: translateX(-100%);
}
to {
transform: translateX(300%);
}
}
}

:root {
Expand Down