index.css 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. .rc-switch {
  2. position: relative;
  3. display: inline-block;
  4. box-sizing: border-box;
  5. width: 44px;
  6. height: 22px;
  7. line-height: 20px;
  8. padding: 0;
  9. vertical-align: middle;
  10. border-radius: 20px 20px;
  11. border: 1px solid #ccc;
  12. background-color: #ccc;
  13. cursor: pointer;
  14. transition: all 0.3s cubic-bezier(0.35, 0, 0.25, 1);
  15. overflow: hidden;
  16. }
  17. .rc-switch-inner-checked,
  18. .rc-switch-inner-unchecked {
  19. color: #fff;
  20. font-size: 12px;
  21. position: absolute;
  22. top: 0;
  23. transition: left 0.3s cubic-bezier(0.35, 0, 0.25, 1);
  24. }
  25. .rc-switch-inner-checked {
  26. left: -14px;
  27. }
  28. .rc-switch-inner-unchecked {
  29. left: 24px;
  30. }
  31. .rc-switch:after {
  32. position: absolute;
  33. width: 18px;
  34. height: 18px;
  35. left: 2px;
  36. top: 1px;
  37. border-radius: 50% 50%;
  38. background-color: #fff;
  39. content: " ";
  40. cursor: pointer;
  41. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
  42. transform: scale(1);
  43. transition: left 0.3s cubic-bezier(0.35, 0, 0.25, 1);
  44. animation-timing-function: cubic-bezier(0.35, 0, 0.25, 1);
  45. animation-duration: 0.3s;
  46. animation-name: rcSwitchOff;
  47. }
  48. .rc-switch:hover:after {
  49. transform: scale(1.1);
  50. animation-name: rcSwitchOn;
  51. }
  52. .rc-switch:focus {
  53. box-shadow: 0 0 0 2px #d5f1fd;
  54. outline: none;
  55. }
  56. .rc-switch-checked {
  57. border: 1px solid #87d068;
  58. background-color: #87d068;
  59. }
  60. .rc-switch-checked .rc-switch-inner-checked {
  61. left: 6px;
  62. }
  63. .rc-switch-checked .rc-switch-inner-unchecked {
  64. left: 44px;
  65. }
  66. .rc-switch-checked:after {
  67. left: 22px;
  68. }
  69. .rc-switch-disabled {
  70. cursor: no-drop;
  71. background: #ccc;
  72. border-color: #ccc;
  73. }
  74. .rc-switch-disabled:after {
  75. background: #9e9e9e;
  76. animation-name: none;
  77. cursor: no-drop;
  78. }
  79. .rc-switch-disabled:hover:after {
  80. transform: scale(1);
  81. animation-name: none;
  82. }
  83. .rc-switch-label {
  84. display: inline-block;
  85. line-height: 20px;
  86. font-size: 14px;
  87. padding-left: 10px;
  88. vertical-align: middle;
  89. white-space: normal;
  90. pointer-events: none;
  91. user-select: text;
  92. }
  93. @keyframes rcSwitchOn {
  94. 0% {
  95. transform: scale(1);
  96. }
  97. 50% {
  98. transform: scale(1.25);
  99. }
  100. 100% {
  101. transform: scale(1.1);
  102. }
  103. }
  104. @keyframes rcSwitchOff {
  105. 0% {
  106. transform: scale(1.1);
  107. }
  108. 100% {
  109. transform: scale(1);
  110. }
  111. }