mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
97 lines
No EOL
1.7 KiB
HTML
97 lines
No EOL
1.7 KiB
HTML
<div class="checkbox">
|
|
<input type="checkbox" id="cbx" />
|
|
<label for="cbx" class="cbx">
|
|
<div class="flip">
|
|
<div class="front"></div>
|
|
<div class="back">
|
|
<svg viewBox="0 0 16 14" height="14" width="16">
|
|
<path d="M2 8.5L6 12.5L14 1.5"></path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</label>
|
|
</div>
|
|
|
|
<style>
|
|
/* From Uiverse.io by elijahgummer - Tags: simple, animation, blue, checkbox, modern, transition, click effect, click animation */
|
|
.checkbox {
|
|
position: relative;
|
|
}
|
|
|
|
.checkbox input[type="checkbox"] {
|
|
display: none;
|
|
visibility: hidden;
|
|
}
|
|
|
|
.checkbox .cbx {
|
|
-webkit-perspective: 20;
|
|
perspective: 20;
|
|
display: inline-block;
|
|
border: 2px solid #e8e8eb;
|
|
background: #e8e8eb;
|
|
border-radius: 4px;
|
|
transform: translate3d(0, 0, 0);
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.checkbox .cbx:hover {
|
|
border-color: #0b76ef;
|
|
}
|
|
|
|
.checkbox .flip {
|
|
display: block;
|
|
transition: all 0.4s ease;
|
|
transform-style: preserve-3d;
|
|
position: relative;
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.checkbox input[type="checkbox"]:checked + .cbx {
|
|
border-color: #0b76ef;
|
|
}
|
|
|
|
.checkbox input[type="checkbox"]:checked + .cbx .flip {
|
|
transform: rotateY(180deg);
|
|
}
|
|
|
|
.checkbox .front,
|
|
.checkbox .back {
|
|
backface-visibility: hidden;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 20px;
|
|
height: 20px;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.checkbox .front {
|
|
background: #fff;
|
|
z-index: 1;
|
|
}
|
|
|
|
.checkbox .back {
|
|
transform: rotateY(180deg);
|
|
background: #0b76ef;
|
|
text-align: center;
|
|
color: #fff;
|
|
line-height: 20px;
|
|
box-shadow: 0 0 0 1px #0b76ef;
|
|
}
|
|
|
|
.checkbox .back svg {
|
|
margin-top: 3px;
|
|
fill: none;
|
|
}
|
|
|
|
.checkbox .back svg path {
|
|
stroke: #fff;
|
|
stroke-width: 2.5;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
}
|
|
|
|
</style>
|
|
|