add loading ellipsis component

This commit is contained in:
plebeius.eth
2024-03-22 14:12:13 +01:00
parent e52176054a
commit 08458c0c93
3 changed files with 36 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
export { default } from './loading-ellipsis';
@@ -0,0 +1,24 @@
.ellipsis {
display: inline-block;
}
.ellipsis:after {
content: '...';
position: absolute;
-webkit-animation: ellipsis steps(4, end) 1200ms infinite;
animation: ellipsis steps(4, end) 1500ms infinite;
width: 0px;
overflow: hidden;
}
@keyframes ellipsis {
to {
width: 1.3em;
}
}
@-webkit-keyframes ellipsis {
to {
width: 1.3em;
}
}
@@ -0,0 +1,11 @@
import styles from './loading-ellipsis.module.css';
interface LoadingEllipsisProps {
string: string;
}
const LoadingEllipsis = ({ string }: LoadingEllipsisProps) => {
return <span className={styles.ellipsis}>{string}</span>;
};
export default LoadingEllipsis;