File: /var/www/quadcode/one-time-popup/src/scss/components/popup-form/amount-step-range.scss
@use '../../utils/media';
.amount-step-range {
--steps: 5;
}
.amount-step-range__wrap {
position: relative;
}
.amount-step-range__title {
display: block;
font-weight: 500;
font-size: 18px;
line-height: 1.44444;
color: #141414;
margin-bottom: 4px;
}
.amount-step-range__radio {
position: absolute;
opacity: 0;
&:nth-child(1):checked {
~ .amount-step-range__slider {
--value: 0;
}
~ .amount-step-range__amounts {
& .amount-step-range__amounts-label {
&:nth-child(-n + 1):before {
--background: #445667;
}
}
}
}
&:nth-child(2):checked {
~ .amount-step-range__slider {
--value: 1;
}
~ .amount-step-range__amounts {
& .amount-step-range__amounts-label {
&:nth-child(-n + 2):before {
--background: #445667;
}
}
}
}
&:nth-child(3):checked {
~ .amount-step-range__slider {
--value: 2;
}
~ .amount-step-range__amounts {
& .amount-step-range__amounts-label {
&:nth-child(-n + 3):before {
--background: #445667;
}
}
}
}
&:nth-child(4):checked {
~ .amount-step-range__slider {
--value: 3;
}
~ .amount-step-range__amounts {
& .amount-step-range__amounts-label {
&:nth-child(-n + 4):before {
--background: #445667;
}
}
}
}
&:nth-child(5):checked {
~ .amount-step-range__slider {
--value: 4;
}
~ .amount-step-range__amounts {
& .amount-step-range__amounts-label {
&:nth-child(-n + 5):before {
--background: #445667;
}
}
}
}
&:nth-child(6):checked {
~ .amount-step-range__slider {
--value: 5;
}
~ .amount-step-range__amounts {
& .amount-step-range__amounts-label {
&:nth-child(-n + 6):before {
--background: #445667;
}
}
}
}
&:nth-child(7):checked {
~ .amount-step-range__slider {
--value: 6;
}
~ .amount-step-range__amounts {
& .amount-step-range__amounts-label {
&:nth-child(-n + 7):before {
--background: #445667;
}
}
}
}
}
.amount-step-range__amounts {
position: relative;
display: flex;
justify-content: space-between;
z-index: 2;
}
.amount-step-range__amounts-label {
position: relative;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding-top: 24px;
font-weight: 400;
font-size: 12px;
line-height: 1.16667;
color: #445667;
text-align: center;
cursor: pointer;
user-select: none;
@include media.breakpoint-down('tabM') {
font-size: 11px;
}
&::before {
--background: #cfdae1;
content: '';
display: block;
position: absolute;
left: 50%;
top: 10px;
transform: translate(-50%, -50%);
width: 6px;
height: 6px;
border-radius: 10px;
background: var(--background);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
transition:
transform 0.2s ease-out,
background 0.15s ease;
}
&:hover {
&::before {
transform: translate(-50%, -50%) scale(1.4);
}
}
}
.amount-step-range__slider {
pointer-events: none;
position: absolute;
top: 0;
left: 0;
right: 0;
height: 20px;
z-index: 1;
}
.amount-step-range__slider-circle {
position: absolute;
top: 50%;
left: calc(100% / var(--steps) * var(--value));
transform: translateY(-50%);
display: flex;
width: calc(100% / var(--steps));
height: inherit;
border-radius: 10px;
background: transparent;
z-index: 2;
transition: left 0.15s ease-in-out;
&:before,
&:after {
content: '';
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 100px;
border: 1px solid #cfdae1;
}
&:before {
width: 20px;
height: 20px;
background: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
&:after {
width: 10px;
height: 10px;
background: #445667;
}
}
.amount-step-range__slider-line {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
width: 100%;
height: 2px;
border-radius: 10px;
background: #cfdae1;
z-index: 1;
&:before {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: calc(100% / var(--steps) * var(--value) + 100% / var(--steps) / 2);
background: #445667;
border-radius: inherit;
transition: width 0.15s ease-in-out;
}
}