mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
73 lines
1.3 KiB
HTML
73 lines
1.3 KiB
HTML
<label class="switch" for="">
|
|
<input type="checkbox">
|
|
|
|
<span class="check"></span>
|
|
</label>
|
|
<style>
|
|
/* From Uiverse.io by misaraadel - Tags: switch, theme-switch, toggle switch, on/off, 3d switch, cool switch, creative switch */
|
|
.switch {
|
|
position: relative;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.switch input {
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
appearance: none;
|
|
opacity: 0;
|
|
position: relative;
|
|
width: 100%;
|
|
height: 100%;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 99;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.switch input:checked ~ .check {
|
|
background-color: #549b60;
|
|
}
|
|
|
|
.switch input:checked ~ .check::after {
|
|
transform: translateX(0px);
|
|
}
|
|
|
|
.switch input:checked ~ .check::before {
|
|
transform: translateX(50px) !important;
|
|
}
|
|
|
|
.switch .check {
|
|
width: 51px;
|
|
height: 30px;
|
|
position: relative;
|
|
display: block;
|
|
background-color: #E92E2E;
|
|
cursor: pointer;
|
|
border-radius: 15px;
|
|
overflow: hidden;
|
|
transition: all 0.5s ease-in;
|
|
}
|
|
|
|
.switch .check::after,
|
|
.switch .check::before {
|
|
content: "";
|
|
position: absolute;
|
|
top: 0;
|
|
width: 30px;
|
|
height: 30px;
|
|
transition: all 0.5s ease-in;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.switch .check::before {
|
|
background-color: #fff;
|
|
right: 0px;
|
|
}
|
|
|
|
.switch .check::after {
|
|
transform: translateX(-60px);
|
|
background-color: #fff;
|
|
left: 0;
|
|
}
|
|
</style>
|