mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
50 lines
978 B
HTML
50 lines
978 B
HTML
<div class="toggle-switch">
|
|
<input class="toggle-input" id="toggle" type="checkbox">
|
|
<label class="toggle-label" for="toggle"></label>
|
|
</div>
|
|
<style>
|
|
/* From Uiverse.io by ozgeozkaraa01 - Tags: switch, toggle switch, 3d switch */
|
|
.toggle-switch {
|
|
position: relative;
|
|
display: inline-block;
|
|
width: 60px;
|
|
height: 34px;
|
|
}
|
|
|
|
.toggle-input {
|
|
display: none;
|
|
}
|
|
|
|
.toggle-label {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 60px;
|
|
height: 34px;
|
|
border-radius: 17px;
|
|
background-color: #ccc;
|
|
cursor: pointer;
|
|
transition: background-color 0.4s ease;
|
|
}
|
|
|
|
.toggle-label:before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 3px;
|
|
left: 3px;
|
|
width: 28px;
|
|
height: 28px;
|
|
border-radius: 50%;
|
|
background-color: #fff;
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
transition: transform 0.4s ease;
|
|
}
|
|
|
|
.toggle-input:checked + .toggle-label {
|
|
background-color: #86d993;
|
|
}
|
|
|
|
.toggle-input:checked + .toggle-label:before {
|
|
transform: translateX(26px);
|
|
}
|
|
</style>
|