All files / src/components/loading SmallLoading.tsx

0% Statements 0/31
100% Branches 1/1
100% Functions 1/1
0% Lines 0/31

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76                                                                                                                                                       
import { FC } from 'react';
import styled, { keyframes } from 'styled-components';
 
const StyledBox = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: center;
`;
 
const LoadingText = styled.p`
  margin: 0;
  padding: 0;
  font-size: 1.6rem;
  text-align: center;
`;
 
const Gigantization = keyframes`
    from {
        opacity: 1;
        scale:0;
    }
    to {
        opacity: 0;
        scale:1;
    }
`;
 
const CircleBox = styled.div`
  height: 90px;
  width: 90px;
  margin: 20px auto 20px;
  position: relative;
`;
 
const Circle = styled.div`
  height: 90px;
  width: 90px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background-color: #c7d01c;
  animation-duration: 8s;
  animation-iteration-count: infinite;
  position: absolute;
  animation-name: ${Gigantization};
  opacity: 0;
`;
 
const Circle1 = styled(Circle)`
  animation-delay: 0s;
`;
const Circle2 = styled(Circle)`
  animation-delay: 2s;
`;
const Circle3 = styled(Circle)`
  animation-delay: 4s;
`;
const Circle4 = styled(Circle)`
  animation-delay: 6s;
`;
 
const SmallLoading: FC = (_props) => {
  return (
    <StyledBox>
      <CircleBox>
        <Circle1></Circle1>
        <Circle2></Circle2>
        <Circle3></Circle3>
        <Circle4></Circle4>
      </CircleBox>
      <LoadingText data-testid="waiting-animation">処理を実行中</LoadingText>
    </StyledBox>
  );
};
 
export default SmallLoading;