Canlı Önizleme
Nasıl Kullanılır?
Neumorphism tasarım akımının güzel bir örneği. JS ile tetikletip sitenizin temasını değiştirebilirsiniz.
Kaynak Kodlar
HTML
<label class="switch">
<input type="checkbox">
<span class="slider"></span>
</label>
CSS
.switch { position: relative; display: inline-block; width: 80px; height: 40px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #2a2a35; transition: .4s; border-radius: 40px; box-shadow: inset 4px 4px 10px rgba(0,0,0,0.5), inset -4px -4px 10px rgba(255,255,255,0.05); }
.slider:before { position: absolute; content: ""; height: 32px; width: 32px; left: 4px; bottom: 4px; background-color: #4d5bf9; transition: .4s; border-radius: 50%; box-shadow: inset -2px -2px 5px rgba(0,0,0,0.3); }
input:checked + .slider { background-color: #00cec9; }
input:checked + .slider:before { transform: translateX(40px); background-color: #fff; }