Skip to content

Commit 2448242

Browse files
authored
Small improvement to the loading animation so it moves left to right only (#2012)
1 parent 9c3aeb3 commit 2448242

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

apps/webapp/app/components/primitives/LoadingBarDivider.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type LoadingBarDividerProps = {
77

88
export function LoadingBarDivider({ isLoading }: LoadingBarDividerProps) {
99
return (
10-
<div className="relative h-px w-full bg-grid-bright">
10+
<div className="relative h-px w-full overflow-hidden bg-grid-bright">
1111
<AnimationDivider isLoading={isLoading} />
1212
</div>
1313
);
@@ -21,11 +21,9 @@ export function AnimationDivider({ isLoading }: LoadingBarDividerProps) {
2121
if (isPresent) {
2222
const enterAnimation = async () => {
2323
await animate(
24-
[
25-
[scope.current, { width: "30%", left: "35%" }, { duration: 1, ease: "easeIn" }],
26-
[scope.current, { width: 0, left: "100%" }, { duration: 1, ease: "easeOut" }],
27-
],
28-
{ repeat: Infinity, repeatType: "reverse" }
24+
scope.current,
25+
{ left: ["-100%", "100%"], width: "100%" },
26+
{ duration: 2, ease: "easeOut", repeat: Infinity }
2927
);
3028
};
3129
enterAnimation();

0 commit comments

Comments
 (0)