Skip to content

Commit

Permalink
🎨 updated progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
pouyio committed May 12, 2024
1 parent ec147a5 commit 9d15a24
Show file tree
Hide file tree
Showing 5 changed files with 392 additions and 315 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const App: React.FC<React.PropsWithChildren<unknown>> = () => {
<Emoji emoji="📺" /> P
</li>
</ul>
<nav className="w-full flex flex-col fixed bottom-0 z-20 justify-around text-2xl lg:top-0 lg:bottom-auto select-none">
<nav className="w-full flex flex-col lg:flex-col-reverse fixed bottom-0 z-20 justify-around text-2xl lg:top-0 lg:bottom-auto select-none">
<ProgressBar />
<NavigationTabs logged={isLoggedIn} />
</nav>
Expand Down
18 changes: 18 additions & 0 deletions src/components/ProgressBar/ProgressBar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.animated-background {
background-size: 400%;

-webkit-animation: animation 3s ease infinite;
-moz-animation: animation 3s ease infinite;
animation: animation 3s ease infinite;
}

@keyframes animation {
0%,
100% {
background-position: 0% 50%;
}

50% {
background-position: 100% 50%;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React from 'react';
import { useAppSelector } from 'state/store';
import Emoji from './Emoji';
import './ProgressBar.css';

export const ProgressBar: React.FC<React.PropsWithChildren<unknown>> = () => {
const shows = useAppSelector((state) => state.shows.totalRequestsPending);
const movies = useAppSelector((state) => state.movies.totalRequestsPending);

return movies + shows > 0 ? (
<div className="absolute right-0 flex justify-end text-sm pr-1">
<Emoji emoji="⏳" rotating={true} className="inline-block" />
</div>
<div className="h-1 w-full animated-background bg-gradient-to-r from-gray-200 via-black to-gray-200"></div>
) : (
<></>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/ProgressBar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ProgressBar } from './ProgressBar';
Loading

0 comments on commit 9d15a24

Please sign in to comment.