mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
86 lines
1.9 KiB
HTML
86 lines
1.9 KiB
HTML
<label class="container">
|
|
<input type="checkbox">
|
|
<div class="checkmark">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</div>
|
|
</label>
|
|
<style>
|
|
/* From Uiverse.io by NAKAMOZ - Tags: checkbox, hamburger */
|
|
/* Hide the default checkbox */
|
|
.container input {
|
|
position: absolute;
|
|
opacity: 0;
|
|
cursor: pointer;
|
|
height: 0;
|
|
width: 0;
|
|
}
|
|
|
|
.container {
|
|
display: block;
|
|
position: relative;
|
|
cursor: pointer;
|
|
font-size: 20px;
|
|
user-select: none;
|
|
}
|
|
|
|
.checkmark {
|
|
position: relative;
|
|
top: 0;
|
|
left: 0;
|
|
height: 1.3em;
|
|
width: 1.3em;
|
|
}
|
|
|
|
.checkmark span {
|
|
width: 32px;
|
|
height: 2px;
|
|
background-color: white;
|
|
position: absolute;
|
|
transition: all 0.3s ease-in-out;
|
|
-webkit-transition: all 0.3s ease-in-out;
|
|
-moz-transition: all 0.3s ease-in-out;
|
|
-ms-transition: all 0.3s ease-in-out;
|
|
-o-transition: all 0.3s ease-in-out;
|
|
}
|
|
|
|
.checkmark span:nth-child(1) {
|
|
top: 10%;
|
|
}
|
|
|
|
.checkmark span:nth-child(2) {
|
|
top: 50%;
|
|
}
|
|
|
|
.checkmark span:nth-child(3) {
|
|
top: 90%;
|
|
}
|
|
|
|
.container input:checked + .checkmark span:nth-child(1) {
|
|
top: 50%;
|
|
transform: translateY(-50%) rotate(45deg);
|
|
-webkit-transform: translateY(-50%) rotate(45deg);
|
|
-moz-transform: translateY(-50%) rotate(45deg);
|
|
-ms-transform: translateY(-50%) rotate(45deg);
|
|
-o-transform: translateY(-50%) rotate(45deg);
|
|
}
|
|
|
|
.container input:checked + .checkmark span:nth-child(2) {
|
|
top: 50%;
|
|
transform: translateY(-50%) rotate(-45deg);
|
|
-webkit-transform: translateY(-50%) rotate(-45deg);
|
|
-moz-transform: translateY(-50%) rotate(-45deg);
|
|
-ms-transform: translateY(-50%) rotate(-45deg);
|
|
-o-transform: translateY(-50%) rotate(-45deg);
|
|
}
|
|
|
|
.container input:checked + .checkmark span:nth-child(3) {
|
|
transform: translateX(-50px);
|
|
-webkit-transform: translateX(-50px);
|
|
-moz-transform: translateX(-50px);
|
|
-ms-transform: translateX(-50px);
|
|
-o-transform: translateX(-50px);
|
|
opacity: 0;
|
|
}
|
|
</style>
|