Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import React from "react";
  2. import styled, { keyframes } from "styled-components";
  3.  
  4. const Jump = keyframes`
  5. 0% {
  6. transform: translateY(0px);
  7. }
  8. 20% {
  9. transform: translateY(-16px);
  10. }
  11. 40% {
  12. transform: translateY(0px);
  13. }
  14. `;
  15.  
  16. const Wrapper = styled.div`
  17. position: absolute;
  18. top: 0;
  19. bottom: 0;
  20. left: 0;
  21. right: 0;
  22. display: flex;
  23. align-items: center;
  24. justify-content: center;
  25. `;
  26.  
  27. const Circle = styled.div`
  28. width: 16px;
  29. height: 16px;
  30. margin: 16px;
  31. border-radius: 100%;
  32. background-color: lightgrey;
  33. animation: ${Jump} 1.5s ease-in-out infinite
  34. ${props => 0.2 * props.delay}s;
  35. `;
  36.  
  37. export default function Loader() {
  38. return (
  39. <Wrapper>
  40. <Circle delay={0} />
  41. <Circle delay={1} />
  42. <Circle delay={2} />
  43. </Wrapper>
  44. );
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement