| 1 | import styled, { keyframes } from "styled-components"; |
| 2 | |
| 3 | const ellipsisAnimation = keyframes` |
| 4 | 0% { width: 0; } |
| 5 | 33% { width: 0.33em; } |
| 6 | 66% { width: 0.66em; } |
| 7 | 100% { width: 1em; } |
| 8 | `; |
| 9 | |
| 10 | export const AnimatedEllipsis = styled.span` |
| 11 | display: inline-block; |
| 12 | width: 1em; /* Fixed width to match the maximum animation width */ |
| 13 | |
| 14 | &::after { |
| 15 | content: "..."; |
| 16 | display: inline-block; |
| 17 | overflow: hidden; |
| 18 | vertical-align: bottom; |
| 19 | animation: ${ellipsisAnimation} 2s infinite; |
| 20 | width: 0; |
| 21 | } |
| 22 | `; |
| 23 | |
| 24 | export default AnimatedEllipsis; |