mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 13:10:21 +08:00
88 lines
1.8 KiB
HTML
88 lines
1.8 KiB
HTML
<label class="container">
|
|
<input checked="checked" type="checkbox">
|
|
<div class="checkmark"></div>
|
|
<div class="glass-effect"></div>
|
|
</label>
|
|
<style>
|
|
/* From Uiverse.io by TechByElijah - Tags: glassmorphism, blue, checkbox, pulse */
|
|
/* Hide the default checkbox */
|
|
.container input {
|
|
position: absolute;
|
|
opacity: 0;
|
|
cursor: pointer;
|
|
height: 0;
|
|
width: 0;
|
|
}
|
|
|
|
.container {
|
|
display: inline-block;
|
|
position: relative;
|
|
cursor: pointer;
|
|
font-size: 20px;
|
|
user-select: none;
|
|
width: 24px;
|
|
height: 24px;
|
|
}
|
|
|
|
/* Create a custom checkbox */
|
|
.checkmark {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
height: 100%;
|
|
width: 100%;
|
|
background-color: #fff;
|
|
border-radius: 50%;
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
transition: background-color 0.3s ease;
|
|
z-index: 1;
|
|
}
|
|
|
|
.glass-effect {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%) scale(0);
|
|
height: 14px;
|
|
width: 14px;
|
|
background-color: rgba(255, 255, 255, 0.2);
|
|
border-radius: 50%;
|
|
transition: transform 0.3s ease;
|
|
z-index: 2;
|
|
}
|
|
|
|
/* When the checkbox is checked, add a blue background */
|
|
.container input:checked ~ .checkmark {
|
|
background-color: #2196F3;
|
|
}
|
|
|
|
/* Show the glass effect when checked */
|
|
.container input:checked ~ .glass-effect {
|
|
transform: translate(-50%, -50%) scale(1);
|
|
}
|
|
|
|
/* Create the checkmark/indicator (hidden when not checked) */
|
|
.checkmark:after {
|
|
content: "";
|
|
position: absolute;
|
|
display: none;
|
|
}
|
|
|
|
/* Show the checkmark when checked */
|
|
.container input:checked ~ .checkmark:after {
|
|
display: block;
|
|
}
|
|
|
|
/* Style the checkmark/indicator */
|
|
.container .checkmark:after {
|
|
content: "";
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
width: 5px;
|
|
height: 10px;
|
|
border: solid white;
|
|
border-width: 0 2px 2px 0;
|
|
transform: translate(-50%, -50%) rotate(45deg);
|
|
}
|
|
</style>
|