css3hover.css 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. .button {
  2. position: relative;
  3. float:left;
  4. overflow: hidden;
  5. position: relative;
  6. z-index: 0;
  7. cursor: pointer;
  8. }
  9. .button.raised {
  10. -moz-transition: all 0.8s;
  11. -o-transition: all 0.8s;
  12. -webkit-transition: all 0.8s;
  13. transition: all 0.8s;
  14. }
  15. .button.raised:active {
  16. }
  17. .anim {
  18. -moz-transform: translateY(-50%) translateX(-50%);
  19. -ms-transform: translateY(-50%) translateX(-50%);
  20. -webkit-transform: translateY(-50%) translateX(-50%);
  21. transform: translateY(-50%) translateX(-50%);
  22. position: absolute;
  23. top: 50%;
  24. left: 50%;
  25. z-index: -1;
  26. }
  27. .anim:before {
  28. position: relative;
  29. content: '';
  30. display: block;
  31. margin-top: 100%;
  32. }
  33. .anim:after {
  34. content: '';
  35. position: absolute;
  36. top: 0;
  37. bottom: 0;
  38. left: 0;
  39. right: 0;
  40. border-radius: 50%;
  41. }
  42. .clickable .toggle:checked + .anim {
  43. -moz-animation: anim-in 1.0s;
  44. -webkit-animation: anim-in 1.0s;
  45. animation: anim-in 1.0s;
  46. }
  47. .clickable .toggle:checked + .anim:after {
  48. -moz-animation: anim-in-pseudo 1.0s;
  49. -webkit-animation: anim-in-pseudo 1.0s;
  50. animation: anim-in-pseudo 1.0s;
  51. }
  52. .clickable .toggle:not(:checked) + .anim {
  53. -moz-animation: anim-out 1.0s;
  54. -webkit-animation: anim-out 1.0s;
  55. animation: anim-out 1.0s;
  56. }
  57. .clickable .toggle:not(:checked) + .anim:after {
  58. -moz-animation: anim-out-pseudo 1.0s;
  59. -webkit-animation: anim-out-pseudo 1.0s;
  60. animation: anim-out-pseudo 1.0s;
  61. }
  62. .hoverable:hover > .anim {
  63. -moz-animation: anim-out 1.0s;
  64. -webkit-animation: anim-out 1.0s;
  65. animation: anim-out 1.0s;
  66. }
  67. .hoverable:hover > .anim:after {
  68. -moz-animation: anim-out-pseudo 1.0s;
  69. -webkit-animation: anim-out-pseudo 1.0s;
  70. animation: anim-out-pseudo 1.0s;
  71. }
  72. @-webkit-keyframes anim-in {
  73. 0% {
  74. width: 0%;
  75. }
  76. 100% {
  77. width: 100%;
  78. }
  79. }
  80. @-moz-keyframes anim-in {
  81. 0% {
  82. width: 0%;
  83. }
  84. 100% {
  85. width: 100%;
  86. }
  87. }
  88. @-ms-keyframes anim-in {
  89. 0% {
  90. width: 0%;
  91. }
  92. 100% {
  93. width: 100%;
  94. }
  95. }
  96. @keyframes anim-in {
  97. 0% {
  98. width: 0%;
  99. }
  100. 100% {
  101. width: 100%;
  102. }
  103. }
  104. @-webkit-keyframes anim-in-pseudo {
  105. 0% {
  106. background: rgba(0, 0, 0, 0.2);
  107. }
  108. 100% {
  109. background: transparent;
  110. }
  111. }
  112. @-moz-keyframes anim-in-pseudo {
  113. 0% {
  114. background: rgba(0, 0, 0, 0.2);
  115. }
  116. 100% {
  117. background: transparent;
  118. }
  119. }
  120. @-ms-keyframes anim-in-pseudo {
  121. 0% {
  122. background: rgba(0, 0, 0, 0.2);
  123. }
  124. 100% {
  125. background: transparent;
  126. }
  127. }
  128. @keyframes anim-in-pseudo {
  129. 0% {
  130. background: rgba(0, 0, 0, 0.2);
  131. }
  132. 100% {
  133. background: transparent;
  134. }
  135. }
  136. @-webkit-keyframes anim-out {
  137. 0% {
  138. width: 0%;
  139. }
  140. 100% {
  141. width: 100%;
  142. }
  143. }
  144. @-moz-keyframes anim-out {
  145. 0% {
  146. width: 0%;
  147. }
  148. 100% {
  149. width: 100%;
  150. }
  151. }
  152. @-ms-keyframes anim-out {
  153. 0% {
  154. width: 0%;
  155. }
  156. 100% {
  157. width: 100%;
  158. }
  159. }
  160. @keyframes anim-out {
  161. 0% {
  162. width: 0%;
  163. }
  164. 100% {
  165. width: 100%;
  166. }
  167. }
  168. @-webkit-keyframes anim-out-pseudo {
  169. 0% {
  170. background: rgba(0, 0, 0, 0.2);
  171. }
  172. 100% {
  173. background: transparent;
  174. }
  175. }
  176. @-moz-keyframes anim-out-pseudo {
  177. 0% {
  178. background: rgba(0, 0, 0, 0.2);
  179. }
  180. 100% {
  181. background: transparent;
  182. }
  183. }
  184. @-ms-keyframes anim-out-pseudo {
  185. 0% {
  186. background: rgba(0, 0, 0, 0.2);
  187. }
  188. 100% {
  189. background: transparent;
  190. }
  191. }
  192. @keyframes anim-out-pseudo {
  193. 0% {
  194. background: rgba(0, 0, 0, 0.2);
  195. }
  196. 100% {
  197. background: transparent;
  198. }
  199. }