Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | import React from 'react';
import styled, { keyframes } from 'styled-components';
export function LoadingSpinner() {
return (
<LoadingSpinnerWrap viewBox="0 0 50 50">
<LoadingSpinnerCircle cx="25" cy="25" r="20" fill="none" strokeWidth="5" />
</LoadingSpinnerWrap>
);
}
const rotate = keyframes({
'100%': {
transform: 'rotate(360deg)'
}
});
const dash = keyframes({
'0%': {
strokeDasharray: '1, 150',
strokeDashoffset: '0'
},
'50%': {
strokeDasharray: '90, 150',
strokeDashoffset: '-35'
},
'100%': {
strokeDasharray: '90, 150',
strokeDashoffset: '-124'
}
});
const LoadingSpinnerWrap = styled.svg`
animation: ${rotate} 2s linear infinite;
width: 50px;
height: 50px;
`;
const LoadingSpinnerCircle = styled.circle`
stroke: #d8d8d8;
stroke-linecap: round;
animation: ${dash} 1.5s ease-in-out infinite;
`;
|