Switch by WhiteNervosa
#e8e8e8
1.slider { 2 background-color: #ffffff2b; 3 border-radius: 100px; 4 padding: 1px; 5 margin: 10px; 6 cursor: pointer; 7 transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0s; 8 align-items: center; 9 position: relative; 10 display: block; 11 width: 51px; 12 height: 29px; 13 box-shadow: rgba(0, 0, 0, 0.62) 0px 0px 5px inset, rgba(0, 0, 0, 0.21) 0px 0px 0px 24px inset, 14 #22cc3f 0px 0px 0px 0px inset, rgba(224, 224, 224, 0.45) 0px 1px 0px 0px; 15} 16 17.slider::after { 18 content: ""; 19 display: flex; 20 top: 2.3px; 21 left: 2px; 22 width: 26px; 23 height: 26px; 24 background-color: #e3e3e3; 25 border-radius: 200px; 26 position: absolute; 27 box-shadow: transparent 0px 0px 0px 2px, rgba(0, 0, 0, 0.3) 0px 6px 6px; 28 transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1) 0s, background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0s; 29 will-change: left, background-color; 30} 31 32.switch input[type="checkbox"]:checked + .slider { 33 box-shadow: rgba(0, 0, 0, 0.62) 0px 0px 5px inset, #22cc3f 0px 0px 0px 2px inset, #22cc3f 0px 0px 0px 24px inset, 34 rgba(224, 224, 224, 0.45) 0px 1px 0px 0px; 35} 36 37.switch input[type="checkbox"]:checked + .slider::after { 38 left: 24px; 39} 40 41.switch input[type="checkbox"] { 42 display: none; 43}
5.1K views
5.1K views
Comments
MIT License