mock平台

ProjectCard.scss 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. @import '../../styles/mixin.scss';
  2. .card-container {
  3. position: relative;
  4. user-select: none;
  5. transition: all .2s;
  6. .m-card, .card-btns {
  7. transform: translateY(0);
  8. transition: all .2s;
  9. }
  10. &:hover {
  11. .m-card, .card-btns , .copy-btns {
  12. transform: translateY(-4px);
  13. }
  14. .m-card .ant-card-body {
  15. background-color: $color-bg-gray;
  16. box-shadow: 0 4px 8px rgba(50, 50, 93, 0.11), 0 4px 6px rgba(0, 0, 0, 0.08);
  17. }
  18. .card-btns .icon {
  19. color: rgba(39, 56, 72, 0.85);
  20. }
  21. .copy-btns .icon {
  22. color: #2395f1
  23. }
  24. .card-btns .icon.active , .copy-btns .icon.active {
  25. color: #fac200;
  26. }
  27. }
  28. &:active {
  29. .m-card, .card-btns, .copy-btns {
  30. transform: translateY(4px);
  31. }
  32. }
  33. // 覆盖 card 组件 hover 状态的默认阴影样式
  34. .ant-card:not(.ant-card-no-hovering):hover {
  35. box-shadow: none;
  36. }
  37. // 卡片右上角按钮
  38. .card-btns {
  39. position: absolute;
  40. top: 0;
  41. right: 0;
  42. width: .48rem;
  43. height: .48rem;
  44. // background: linear-gradient(225deg, #ccc, #ccc 50%, transparent 0);
  45. border-top-right-radius: 4px;
  46. .icon {
  47. cursor: pointer;
  48. font-size: .16rem;
  49. padding: .06rem;
  50. position: absolute;
  51. right: 0;
  52. top: 0;
  53. color: #fff;
  54. }
  55. .icon.active {
  56. color: #fff;
  57. }
  58. }
  59. // 卡片昨上角按钮
  60. .copy-btns {
  61. position: absolute;
  62. top: 0;
  63. left: 0;
  64. width: .48rem;
  65. height: .48rem;
  66. // background: linear-gradient(225deg, #ccc, #ccc 50%, transparent 0);
  67. border-top-right-radius: 4px;
  68. .icon {
  69. cursor: pointer;
  70. font-size: .16rem;
  71. padding: .06rem;
  72. position: absolute;
  73. right: 0;
  74. top: 3px;
  75. color: #fff;
  76. }
  77. .icon.active {
  78. color: #fff;
  79. }
  80. }
  81. }
  82. .m-card {
  83. cursor: pointer;
  84. text-align: center;
  85. margin-bottom: .16rem;
  86. transition: all .4s;
  87. position: relative;
  88. .ant-card-body {
  89. background-color: transparent;
  90. border-radius: 4px;
  91. padding-top: .24rem + .16rem + 1rem;
  92. box-shadow: 0 4px 6px rgba(255,255,255,.11), 0 1px 3px rgba(255,255,255,.08);
  93. // box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
  94. transition: all .2s;
  95. }
  96. .ui-logo {
  97. width: 1rem;
  98. height: 1rem;
  99. border-radius: 50%;
  100. position: absolute;
  101. left: 50%;
  102. top: 0;
  103. transform: translate(-50%, .24rem);
  104. font-size: .5rem;
  105. color: #fff;
  106. background-color: #2395f1;
  107. line-height: 1rem;
  108. box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
  109. }
  110. .ui-title {
  111. font-size: .19rem;
  112. font-weight: normal;
  113. overflow: hidden;
  114. text-overflow:ellipsis;
  115. white-space: nowrap;
  116. }
  117. .m-card-body {
  118. .icon {
  119. font-size: .8rem;
  120. }
  121. .name {
  122. font-size: .18rem;
  123. margin-top: .16rem;
  124. }
  125. }
  126. }
  127. @media (max-width: 768px) {
  128. .m-card {
  129. .ui-logo {
  130. width: .6rem;
  131. height: .6rem;
  132. line-height: .6rem;
  133. font-size: .3rem;
  134. transform: translate(-50%, 0.08rem);
  135. }
  136. .ant-card-body {
  137. padding-top: .08rem + .08rem + .6rem;
  138. padding-bottom: .08rem;
  139. }
  140. }
  141. }
  142. @media (min-width: 768px) and (max-width: 992px) {
  143. .m-card {
  144. .ui-logo {
  145. width: .8rem;
  146. height: .8rem;
  147. line-height: .8rem;
  148. font-size: .4rem;
  149. transform: translate(-50%, 0.16rem);
  150. }
  151. .ant-card-body {
  152. padding-top: .16rem + .16rem + .8rem;
  153. padding-bottom: .16rem;
  154. }
  155. }
  156. }