Switch by gharsh11032000
#e8e8e8
1/* The switch - the box around the slider */ 2.switch { 3 font-size: 17px; 4 position: relative; 5 display: inline-block; 6 width: 3.5em; 7 height: 2em; 8} 9 10/* Hide default HTML checkbox */ 11.switch input { 12 opacity: 0; 13 width: 0; 14 height: 0; 15} 16 17/* The slider */ 18.slider { 19 position: absolute; 20 cursor: pointer; 21 inset: 0; 22 background: #9fccfa; 23 transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 24} 25 26.slider:before { 27 position: absolute; 28 content: ""; 29 height: 1.4em; 30 width: 1.4em; 31 left: 0.3em; 32 bottom: 0.3em; 33 background-color: white; 34 transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 35} 36 37.switch input:checked + .slider { 38 background: #0974f1; 39} 40 41.switch input:focus + .slider { 42 box-shadow: 0 0 1px #0974f1; 43} 44 45.switch input:checked + .slider:before { 46 transform: translateX(1.5em) rotate(90deg); 47}
608 views
608 views
MIT License