small-box.less 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. Component: Small boxes
  3. */
  4. .small-box {
  5. position: relative;
  6. display: block;
  7. .border-radius(2px);
  8. margin-bottom: 15px;
  9. // content wrapper
  10. > .inner {
  11. padding: 10px;
  12. }
  13. > .small-box-footer {
  14. position: relative;
  15. text-align: center;
  16. padding: 3px 0;
  17. color: #fff;
  18. color: rgba(255, 255, 255, 0.8);
  19. display: block;
  20. z-index: 10;
  21. background: rgba(0,0,0,0.1);
  22. text-decoration: none;
  23. &:hover {
  24. color: #fff;
  25. background: rgba(0,0,0,0.15);
  26. }
  27. }
  28. h3 {
  29. font-size: 38px;
  30. font-weight: bold;
  31. margin: 0 0 10px 0;
  32. white-space: nowrap;
  33. padding: 0;
  34. }
  35. p {
  36. font-size: 15px;
  37. > small {
  38. display: block;
  39. color: #f9f9f9;
  40. font-size: 13px;
  41. margin-top: 5px;
  42. }
  43. }
  44. h3, p {
  45. z-index: 5px;
  46. }
  47. // the icon
  48. .icon {
  49. position: absolute;
  50. top: auto;
  51. bottom: 5px;
  52. right: 5px;
  53. z-index: 0;
  54. font-size: 90px;
  55. color: rgba(0, 0, 0, 0.15);
  56. }
  57. // Small box hover state
  58. &:hover {
  59. text-decoration: none;
  60. color: #f9f9f9;
  61. // Animate icons on small box hover
  62. .icon {
  63. animation-name: tansformAnimation;
  64. animation-duration:.5s;
  65. animation-iteration-count: 1;
  66. animation-timing-function: ease;
  67. animation-fill-mode: forwards;
  68. -webkit-animation-name: tansformAnimation;
  69. -webkit-animation-duration:.5s;
  70. -webkit-animation-iteration-count: 1;
  71. -webkit-animation-timing-function: ease;
  72. -webkit-animation-fill-mode: forwards;
  73. -moz-animation-name: tansformAnimation;
  74. -moz-animation-duration:.5s;
  75. -moz-animation-iteration-count: 1;
  76. -moz-animation-timing-function: ease;
  77. -moz-animation-fill-mode: forwards;
  78. }
  79. }
  80. }
  81. // Transform: rotate -10 degrees within 500 milliseconds
  82. @keyframes tansformAnimation {
  83. from {
  84. font-size: 90px;
  85. }
  86. to {
  87. font-size: 100px;
  88. }
  89. }
  90. @-webkit-keyframes tansformAnimation {
  91. from {
  92. font-size: 90px;
  93. }
  94. to {
  95. font-size: 100px;
  96. }
  97. }
  98. @media screen and (max-width: @screen-xs) {
  99. // No need for icons on very small devices
  100. .small-box {
  101. text-align: center;
  102. .icon {
  103. display: none;
  104. }
  105. p {
  106. font-size: 12px;
  107. }
  108. }
  109. }