omni-slider
Version:
A multirange vanilla js slider
51 lines (50 loc) • 1.22 kB
CSS
.slider {
width: 100%;
height: 0.7rem;
border: 1px solid #000;
position: relative; }
.slider.one-way .handle.handle-left {
visibility: hidden; }
.slider .slider-circle {
width: 0.6rem;
height: 0.6rem;
border-radius: 50%;
background-color: #0a84c1;
position: relative;
display: inline-block;
margin-top: 1rem;
pointer-events: none;
-webkit-user-select: none; }
.slider .handle {
width: 2.6rem;
height: 2.6rem;
border-radius: 2.6rem;
position: absolute;
top: -1rem;
border: 1px solid #000;
background-color: #fff;
text-align: center;
cursor: pointer;
z-index: 1;
-webkit-tap-highlight-color: transparent; }
.slider .handle.ontop {
z-index: 2; }
.slider .handle:active {
border-color: #0a84c1;
box-shadow: 0 0 0.5rem #0a84c1; }
.slider .handle-left {
left: 0; }
.slider .handle-right {
right: 0; }
.slider .slider-fill {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #0a84c1;
pointer-events: none;
-webkit-user-select: none; }
.slider .slider-transition {
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease; }