rectangle-bounce.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <style>
  2. body, html, #<%= globals.id %> {
  3. background: <%= options.background %>;
  4. width: 100%;
  5. height: 100%;
  6. display: flex;
  7. justify-content: center;
  8. align-items: center;
  9. margin: 0;
  10. padding: 0;
  11. }
  12. .spinner {
  13. width: 50px;
  14. height: 40px;
  15. text-align: center;
  16. font-size: 10px;
  17. }
  18. .spinner > div {
  19. background-color: <%= options.color %>;
  20. height: 100%;
  21. width: 6px;
  22. display: inline-block;
  23. -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
  24. animation: sk-stretchdelay 1.2s infinite ease-in-out;
  25. }
  26. .spinner .rect2 {
  27. -webkit-animation-delay: -1.1s;
  28. animation-delay: -1.1s;
  29. }
  30. .spinner .rect3 {
  31. -webkit-animation-delay: -1.0s;
  32. animation-delay: -1.0s;
  33. }
  34. .spinner .rect4 {
  35. -webkit-animation-delay: -0.9s;
  36. animation-delay: -0.9s;
  37. }
  38. .spinner .rect5 {
  39. -webkit-animation-delay: -0.8s;
  40. animation-delay: -0.8s;
  41. }
  42. @-webkit-keyframes sk-stretchdelay {
  43. 0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
  44. 20% { -webkit-transform: scaleY(1.0) }
  45. }
  46. @keyframes sk-stretchdelay {
  47. 0%, 40%, 100% {
  48. transform: scaleY(0.4);
  49. -webkit-transform: scaleY(0.4);
  50. } 20% {
  51. transform: scaleY(1.0);
  52. -webkit-transform: scaleY(1.0);
  53. }
  54. }
  55. </style>
  56. <div class="spinner">
  57. <div class="rect1"></div>
  58. <div class="rect2"></div>
  59. <div class="rect3"></div>
  60. <div class="rect4"></div>
  61. <div class="rect5"></div>
  62. </div>
  63. <%= options.dev ? '<!-- http://tobiasahlin.com/spinkit -->' : '' %>