mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
92 lines
3.1 KiB
HTML
92 lines
3.1 KiB
HTML
<div class="radio-input">
|
|
<input checked="" value="color-1" name="color" id="color-1" type="radio">
|
|
<label for="color-1">
|
|
<span>
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><g stroke-width="0" id="SVGRepo_bgCarrier"></g><g stroke-linejoin="round" stroke-linecap="round" id="SVGRepo_tracerCarrier"></g><g id="SVGRepo_iconCarrier"> <g id="Interface / Check"> <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="#ffffff" d="M6 12L10.2426 16.2426L18.727 7.75732" id="Vector"></path> </g> </g></svg>
|
|
</span>
|
|
</label>
|
|
|
|
<input value="color-2" name="color" id="color-2" type="radio">
|
|
<label for="color-2">
|
|
<span>
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><g stroke-width="0" id="SVGRepo_bgCarrier"></g><g stroke-linejoin="round" stroke-linecap="round" id="SVGRepo_tracerCarrier"></g><g id="SVGRepo_iconCarrier"> <g id="Interface / Check"> <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="#ffffff" d="M6 12L10.2426 16.2426L18.727 7.75732" id="Vector"></path> </g> </g></svg>
|
|
</span>
|
|
</label>
|
|
|
|
<input value="color-3" name="color" id="color-3" type="radio">
|
|
<label for="color-3">
|
|
<span>
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><g stroke-width="0" id="SVGRepo_bgCarrier"></g><g stroke-linejoin="round" stroke-linecap="round" id="SVGRepo_tracerCarrier"></g><g id="SVGRepo_iconCarrier"> <g id="Interface / Check"> <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="#ffffff" d="M6 12L10.2426 16.2426L18.727 7.75732" id="Vector"></path> </g> </g></svg>
|
|
</span>
|
|
</label>
|
|
|
|
</div>
|
|
<style>
|
|
/* From Uiverse.io by Yaya12085 - Tags: radio */
|
|
.radio-input {
|
|
background-color: #fff;
|
|
padding: 20px;
|
|
border-radius: 20px;
|
|
display: flex;
|
|
}
|
|
|
|
.radio-input input[type=radio] {
|
|
display: none;
|
|
}
|
|
|
|
.radio-input input[type=radio] + label {
|
|
color: #333;
|
|
font-family: Arial, sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.radio-input input[type=radio] + label span {
|
|
display: inline-block;
|
|
width: 40px;
|
|
height: 40px;
|
|
margin: -1px 4px 0 0;
|
|
vertical-align: middle;
|
|
cursor: pointer;
|
|
border-radius: 50%;
|
|
border: 2px solid #FFFFFF;
|
|
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33);
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
text-align: center;
|
|
line-height: 44px;
|
|
}
|
|
|
|
.radio-input input[type=radio] + label span svg {
|
|
opacity: 0;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.radio-input input[type=radio]#color-1 + label span {
|
|
background-color: #2ecc71;
|
|
}
|
|
|
|
.radio-input input[type=radio]#color-2 + label span {
|
|
background-color: #3498db;
|
|
}
|
|
|
|
.radio-input input[type=radio]#color-3 + label span {
|
|
background-color: #f1c40f;
|
|
}
|
|
|
|
.radio-input input[type=radio]:checked + label span svg {
|
|
opacity: 1;
|
|
}
|
|
|
|
.radio-input:has(input[type=radio]#color-1:checked) {
|
|
background-color: #2ecc71;
|
|
}
|
|
|
|
.radio-input:has(input[type=radio]#color-2:checked) {
|
|
background-color: #3498db;
|
|
}
|
|
|
|
.radio-input:has(input[type=radio]#color-3:checked) {
|
|
background-color: #f1c40f;
|
|
}
|
|
|
|
</style>
|