index.module.scss 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. input {
  2. display: none;
  3. }
  4. .slider {
  5. position: absolute;
  6. width: 80px;
  7. height: 30px;
  8. bottom: -30px;
  9. margin-bottom: 15px;
  10. box-shadow: 0 2px 5px rgba(18, 80, 105, 0.25), 0 5px 5px rgba(0, 0, 0, 0.22);
  11. z-index: 1;
  12. overflow: hidden;
  13. background-color: #315870;
  14. border-radius: 50px;
  15. cursor: pointer;
  16. transition: all 1.4s;
  17. &:before,
  18. &:after {
  19. content: '';
  20. position: absolute;
  21. bottom: -25px;
  22. left: 5px;
  23. bottom: 5px;
  24. width: 20px;
  25. height: 20px;
  26. background-color: #ffffff;
  27. border-radius: 30px;
  28. }
  29. &:before {
  30. transition: 0.4s;
  31. }
  32. &:after {
  33. transition: 0.5s;
  34. }
  35. }
  36. .wave {
  37. position: absolute;
  38. width: 80px;
  39. height: 30px;
  40. bottom: -30px;
  41. margin-bottom: 15px;
  42. border-radius: 50px;
  43. transition: all 1.4s;
  44. }
  45. input:checked + .slider {
  46. background-color: transparent;
  47. &:before,
  48. &:after {
  49. transform: translateX(50px);
  50. }
  51. }
  52. input:checked ~ .wave {
  53. background-color: #a5c1d1;
  54. }
  55. @media screen and (max-width: 768px) {
  56. .slider {
  57. position: absolute;
  58. width: 50px;
  59. height: 30px;
  60. bottom: -30px;
  61. &:before,
  62. &:after {
  63. content: '';
  64. position: absolute;
  65. left: 5px;
  66. bottom: 5px;
  67. width: 20px;
  68. height: 20px;
  69. background-color: #ffffff;
  70. border-radius: 30px;
  71. }
  72. }
  73. .wave {
  74. position: absolute;
  75. width: 50px;
  76. height: 30px;
  77. }
  78. input:checked + .slider {
  79. background-color: transparent;
  80. &:before,
  81. &:after {
  82. transform: translateX(20px);
  83. }
  84. }
  85. }