rate.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. .m-rate{
  2. display: inline-block;
  3. vertical-align: middle;
  4. .m-rate-star{
  5. display: inline-block;
  6. margin: 0;
  7. padding: 0;
  8. margin-right: 8px;
  9. transition: all .3s ease;
  10. position: relative;
  11. &:hover {
  12. transform: scale(1);
  13. }
  14. .favorite{
  15. position: relative;
  16. color: #c0c4cc;
  17. &::before{
  18. font-size: 20px;
  19. cursor: pointer;
  20. content: "\e6fb";
  21. transition: all .2s ease-in-out;
  22. display: block;
  23. }
  24. }
  25. .favorite-half{
  26. position: absolute;
  27. left: 0;
  28. top: 0;
  29. width: 50%;
  30. height: 100%;
  31. overflow: hidden;
  32. color: transparent;
  33. &::before{
  34. font-size: 20px;
  35. cursor: pointer;
  36. content: "\e6fb";
  37. transition: all .2s ease-in-out;
  38. display: block;
  39. }
  40. }
  41. .m-rate-star-first{
  42. position: absolute;
  43. left: 0;
  44. top: 0;
  45. width: 50%;
  46. height: 100%;
  47. overflow: hidden;
  48. opacity: 0;
  49. cursor: pointer;
  50. transition: all .3s ease;
  51. }
  52. .m-rate-star-second{
  53. user-select: none;
  54. transition: all .3s ease;
  55. color: #c0c4cc;
  56. cursor: pointer;
  57. }
  58. .other-icon{
  59. position: relative;
  60. display: block;
  61. color: #c0c4cc;
  62. font-size: 20px;
  63. cursor: pointer;
  64. transition: all .2s ease-in-out;
  65. }
  66. .other-icon-half{
  67. position: absolute;
  68. left: 0;
  69. top: 0;
  70. width: 50%;
  71. height: 100%;
  72. overflow: hidden;
  73. color: transparent;
  74. font-size: 20px;
  75. cursor: pointer;
  76. display: block;
  77. transition: all .2s ease-in-out;
  78. }
  79. }
  80. .m-rate-text{
  81. display: inline-block;
  82. margin-left: 8px;
  83. font-size: 13px;
  84. }
  85. // 满的
  86. .m-rate-star-full{
  87. &:hover {
  88. transform: scale(1.1);
  89. }
  90. .favorite,
  91. .m-rate-star-second,
  92. .other-icon{
  93. color:#f5a623;
  94. }
  95. }
  96. // 半
  97. .m-rate-star-half{
  98. .favorite-half{
  99. color:#f5a623;
  100. }
  101. .m-rate-star-first{
  102. color:#f5a623;
  103. opacity: 1;
  104. }
  105. .other-icon-half{
  106. color:#f5a623;
  107. }
  108. }
  109. }
  110. .m-rate-disabled{
  111. .m-rate-star{
  112. .favorite{
  113. &::before{
  114. cursor: default;
  115. }
  116. }
  117. .favorite-half{
  118. &::before{
  119. cursor: default;
  120. }
  121. }
  122. }
  123. }