<style>
.my_radio {
background: transparent; /*Фоновый цвет кнопки*/
border: 2px solid #23A880; /*Толщина границ кнопки, тип, цвет*/
border-radius: 30px; /*Радиус скругления углов кнопки*/
width: auto !important; /*Ширина кнопки*/
margin-right: 10px !important; /*Внешний отступ справа от кнпоки*/
padding: 10px 15px; /*Внутренние отступы кнопки сверху и снизу, слева и справа*/
font-weight: 600; /*Жирность текста внутри кнопки*/
}
.my_radio span {
color: #23A880; /*Цвет текста кнопки*/
font-size: 18px; /*Размер шрифта текста кнопки*/
}
.my_radio:hover {
background: #23A880; /*Фоновый цвет кнопки при наведении*/
border: 2px solid #23A880; /*Толщина границ кнопки, тип, цвет при наведении*/
cursor: pointer;
}
.my_radio:hover span {
color: white; /*Цвет текста кнопки при наведении*/
}
.my_radio.active {
background-color: #23A880; /*Фоновый цвет активной кнопки*/
border: 2px solid #23A880; /*Толщина границ актвиной кнопки, тип, цвет*/
}
.my_radio.active span {
color: white; /*Цвет текста активной кнопки*/
}
.uc-radio-group {
border-radius: 30px;
}
</style>
<script>
const style = document.createElement('style');
style.textContent = `
.t-radio__wrapper {
display: flex;
flex-wrap: wrap;
}
.t-radio__item .t-radio__indicator {
display: none;
}
.t-radio__item {
display: block !important;
text-align: center !important;
white-space: nowrap;
margin-top:0 !important;
}
`;
document.head.appendChild(style);
document.querySelectorAll('.uc-radio-group').forEach(group => {
group.querySelectorAll('.t-radio__item').forEach(item => {
// Добавляем класс my_radio
item.classList.add('my_radio');
item.addEventListener('click', function() {
group.querySelectorAll('.t-radio__item').forEach(el => {
el.classList.remove('active');
});
this.classList.add('active');
});
});
});
</script>