Rev 1799 | Rev 3169 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react'
import { Box, styled } from '@mui/material'
const EllipsisContainer = styled(Box)`
margin: 0 auto;
width: 80px;
height: 80px;
border-radius: 100px;
background-color: #fff;
border: 1px solid #e1e1e1;
display: flex;
align-items: center;
justify-content: space-evenly;
.bounce {
width: 13px;
height: 13px;
background-color: #b9b9b9;
border-radius: 100%;
display: inline-block;
transform-origin: center;
-webkit-animation: bounce_delay 1.4s infinite ease-in-out both;
animation: bounce_delay 1.4s infinite ease-in-out both;
}
.bounce:nth-child(1) {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.bounce:nth-child(2) {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
.bounce:nth-child(3) {
-webkit-animation-delay: 0;
animation-delay: 0;
}
@keyframes bounce_delay {
0%,
80%,
100% {
-webkit-transform: scale(0);
transform: scale(0);
}
40% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
`
const Spinner = ({ absolute = false }) => {
if (absolute) {
return (
<Box
sx={{
position: 'absolute',
width: '100%',
height: '100%',
display: 'grid',
placeItems: 'center',
zIndex: 50
}}
>
<EllipsisContainer>
<div className='bounce'></div>
<div className='bounce'></div>
<div className='bounce'></div>
</EllipsisContainer>
</Box>
)
}
return (
<EllipsisContainer>
<div className='bounce'></div>
<div className='bounce'></div>
<div className='bounce'></div>
</EllipsisContainer>
)
}
export default Spinner