This commit is contained in:
mario
2025-03-07 13:47:44 +07:00
commit c4efec5a14
3358 changed files with 303774 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
.loading {
background-color: #091731;
height: 8px;
border-radius: 4px;
overflow: hidden;
position: relative;
width: 100%;
}
.infinite-loading-bar {
animation: side2side 2s ease-in-out infinite;
height: 100%;
position: absolute;
border-radius: 4px;
width: 50%;
}
@keyframes side2side {
0%,
100% {
transform: translateX(-50%);
}
50% {
transform: translateX(150%);
}
}

View File

@@ -0,0 +1,32 @@
import React, { ReactElement } from 'react';
import './ProgressLoadingBar.css';
export type ProgressLoadingBarProps = {
progress?: number;
};
/**
* A React component that renders a loading progress bar.
* If progress is not provided, it will render an infinite loading bar
* If progress is provided, it will render a progress bar
* The progress text can be optionally displayed to the left of the bar.
*/
function ProgressLoadingBar({ progress }: ProgressLoadingBarProps): ReactElement {
return (
<div className="loading">
{progress === undefined || progress === null ? (
<div className="infinite-loading-bar bg-primary-light"></div>
) : (
<div
className="bg-primary-light"
style={{
width: `${progress}%`,
height: '8px',
}}
></div>
)}
</div>
);
}
export default ProgressLoadingBar;

View File

@@ -0,0 +1,2 @@
import ProgressLoadingBar from './ProgressLoadingBar';
export default ProgressLoadingBar;