Switch by gharsh11032000
#212121
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 border: 2px solid #414141; 23 border-radius: 50px; 24 transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 25} 26 27.slider:before { 28 position: absolute; 29 content: ""; 30 height: 1.4em; 31 width: 1.4em; 32 left: 0.2em; 33 bottom: 0.2em; 34 background-color: white; 35 border-radius: inherit; 36 transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1); 37} 38 39.switch input:checked + .slider { 40 box-shadow: 0 0 20px rgba(9, 117, 241, 0.8); 41 border: 2px solid #0974f1; 42} 43 44.switch input:checked + .slider:before { 45 transform: translateX(1.5em); 46}
6.3K views
6.3K views
MIT License