mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 13:10:21 +08:00
63 lines
1.2 KiB
HTML
63 lines
1.2 KiB
HTML
<label class="container">
|
|
<input type="checkbox" checked="checked">
|
|
<div class="checkmark"></div>
|
|
</label>
|
|
<style>
|
|
/* From Uiverse.io by shreyasm-dev - Tags: neumorphism, checkbox */
|
|
/* 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;
|
|
}
|
|
|
|
/* Create a custom checkbox */
|
|
.checkmark {
|
|
position: relative;
|
|
top: 0;
|
|
left: 0;
|
|
height: 1.3em;
|
|
width: 1.3em;
|
|
background-color: #ccc;
|
|
border-radius: 100%;
|
|
background: #e8e8e8;
|
|
box-shadow: 3px 3px 5px #c5c5c5,
|
|
-3px -3px 5px #ffffff;
|
|
transition-duration: 0.5s;
|
|
}
|
|
|
|
.container input:checked ~ .checkmark {
|
|
box-shadow: inset 3px 3px 5px #c5c5c5,
|
|
inset -3px -3px 5px #ffffff;
|
|
}
|
|
|
|
.checkmark:after {
|
|
content: "";
|
|
position: absolute;
|
|
opacity: 0;
|
|
}
|
|
|
|
.container input:checked ~ .checkmark:after {
|
|
opacity: 1;
|
|
}
|
|
|
|
.container .checkmark:after {
|
|
left: 0.45em;
|
|
top: 0.25em;
|
|
width: 0.25em;
|
|
height: 0.5em;
|
|
border: solid darkgray;
|
|
border-width: 0 0.15em 0.15em 0;
|
|
transform: rotate(45deg);
|
|
}
|
|
</style>
|