cube-transition.css 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. @-webkit-keyframes cube-transition {
  2. 25% {
  3. -webkit-transform : translateX(-50px) scale(0.5) rotate(90deg);
  4. transform : translateX(-50px) scale(0.5) rotate(90deg);
  5. }
  6. 50% {
  7. -webkit-transform : translate(-50px, 50px) rotate(180deg);
  8. transform : translate(-50px, 50px) rotate(180deg);
  9. }
  10. 75% {
  11. -webkit-transform : translateY(50px) scale(0.5) rotate(270deg);
  12. transform : translateY(50px) scale(0.5) rotate(270deg);
  13. }
  14. 100% {
  15. -webkit-transform : rotate(360deg);
  16. transform : rotate(360deg);
  17. }
  18. }
  19. @-moz-keyframes cube-transition {
  20. 25% {
  21. -moz-transform : translateX(-50px) scale(0.5) rotate(90deg);
  22. transform : translateX(-50px) scale(0.5) rotate(90deg);
  23. }
  24. 50% {
  25. -moz-transform : translate(-50px, 50px) rotate(180deg);
  26. transform : translate(-50px, 50px) rotate(180deg);
  27. }
  28. 75% {
  29. -moz-transform : translateY(50px) scale(0.5) rotate(270deg);
  30. transform : translateY(50px) scale(0.5) rotate(270deg);
  31. }
  32. 100% {
  33. -moz-transform : rotate(360deg);
  34. transform : rotate(360deg);
  35. }
  36. }
  37. @-o-keyframes cube-transition {
  38. 25% {
  39. -o-transform : translateX(-50px) scale(0.5) rotate(90deg);
  40. transform : translateX(-50px) scale(0.5) rotate(90deg);
  41. }
  42. 50% {
  43. -o-transform : translate(-50px, 50px) rotate(180deg);
  44. transform : translate(-50px, 50px) rotate(180deg);
  45. }
  46. 75% {
  47. -o-transform : translateY(50px) scale(0.5) rotate(270deg);
  48. transform : translateY(50px) scale(0.5) rotate(270deg);
  49. }
  50. 100% {
  51. -o-transform : rotate(360deg);
  52. transform : rotate(360deg);
  53. }
  54. }
  55. @keyframes cube-transition {
  56. 25% {
  57. -webkit-transform : translateX(-50px) scale(0.5) rotate(90deg);
  58. -moz-transform : translateX(-50px) scale(0.5) rotate(90deg);
  59. -o-transform : translateX(-50px) scale(0.5) rotate(90deg);
  60. transform : translateX(-50px) scale(0.5) rotate(90deg);
  61. }
  62. 50% {
  63. -webkit-transform : translate(-50px, 50px) rotate(180deg);
  64. -moz-transform : translate(-50px, 50px) rotate(180deg);
  65. -o-transform : translate(-50px, 50px) rotate(180deg);
  66. transform : translate(-50px, 50px) rotate(180deg);
  67. }
  68. 75% {
  69. -webkit-transform : translateY(50px) scale(0.5) rotate(270deg);
  70. -moz-transform : translateY(50px) scale(0.5) rotate(270deg);
  71. -o-transform : translateY(50px) scale(0.5) rotate(270deg);
  72. transform : translateY(50px) scale(0.5) rotate(270deg);
  73. }
  74. 100% {
  75. -webkit-transform : rotate(360deg);
  76. -moz-transform : rotate(360deg);
  77. -o-transform : rotate(360deg);
  78. transform : rotate(360deg);
  79. }
  80. }
  81. .cube-transition {
  82. position : relative;
  83. -webkit-transform : translate(25px, -25px);
  84. -moz-transform : translate(25px, -25px);
  85. -ms-transform : translate(25px, -25px);
  86. -o-transform : translate(25px, -25px);
  87. transform : translate(25px, -25px);
  88. }
  89. .cube-transition > div {
  90. -webkit-animation-fill-mode : both;
  91. -moz-animation-fill-mode : both;
  92. -o-animation-fill-mode : both;
  93. animation-fill-mode : both;
  94. width : 10px;
  95. height : 10px;
  96. position : absolute;
  97. top : -5px;
  98. right : -5px;
  99. background-color : #55595C;
  100. -webkit-animation : cube-transition 1.6s 0s infinite ease-in-out;
  101. -moz-animation : cube-transition 1.6s 0s infinite ease-in-out;
  102. -o-animation : cube-transition 1.6s 0s infinite ease-in-out;
  103. animation : cube-transition 1.6s 0s infinite ease-in-out;
  104. }
  105. .cube-transition > div:last-child {
  106. -webkit-animation-delay : -0.8s;
  107. -moz-animation-delay : -0.8s;
  108. -o-animation-delay : -0.8s;
  109. animation-delay : -0.8s;
  110. }