I'm new to animations but I want to animate a skeleton loader. I want it to start from the left at at 0% width, then going to the right, at 100% width, and then have the loader go to zero but in reverse so that it ends on the right with 0% width. My problem is that I cannot get the animation to go out from left to right. I am using react with styled-components. here is my code:
const reveal = keyframes`
0% {
width: 0%;
}
50% {
width: 100%;
}
100% {
width: -100%;
}
`;
const StyledSkeleton = styled.div`
height: 40px;
font-size: 64px;
line-height: 70px;
overflow: hidden;
background-color: ${colors.LOADER_BACKGROUND};
background-size: 100%;
animation-name: ${reveal};
animation-duration: 2s;
animation-timing-function: ease-in;
animation-delay: 0s;
animation-iteration-count: infinite;
animation-direction: normal;
`;