Advertisement
Guest User

Untitled

a guest
May 25th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. /**
  2. * The cicada principle in animations
  3. * Remember the cicada principle that used prime numbers to make multiple overlaid repeated backgrounds seem more random?
  4. * There’s no reason it can’t be applied to repeating linear animations too (using primes for the durations, divided by 10)
  5. */
  6.  
  7. @keyframes spin { to { transform: rotate(1turn); } }
  8. @keyframes radius { 50% { border-radius: 50%; } }
  9. @keyframes color { 33% { color: orange; } 66% { color: deeppink } }
  10. @keyframes width { 50% { border-width: .3em; } }
  11.  
  12. .loading:before {
  13. content: '';
  14. display: block;
  15. width: 4em;
  16. height: 4em;
  17. margin: 0 auto 1em;
  18. border: 1.5em solid;
  19. color: yellowgreen;
  20. box-sizing: border-box;
  21. animation: .7s radius, 1.1s color, 1.3s width;
  22. animation-timing-function: linear;
  23. animation-iteration-count: infinite;
  24. }
  25.  
  26. .loading {
  27. margin: auto;
  28. }
  29.  
  30. body {
  31. margin: 0;
  32. display: flex;
  33. min-height: 100vh;
  34. text-align: center;
  35. background: #655;
  36. color: white;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement