css - html input range thumb smooth movement -
i have html input range set bunch of css changes appearance, , wondering if there way make smoothly change wherever user changes?
input[type=range] { -webkit-appearance: none; width: 100%; height: 20px; border-radius: 5px; border: 1px solid; background: none; box-shadow: 0px 0px 8px 0px #555, 0px 0px 25px 0px #555 inset; transition: 0.4s ease-out; outline: none; } input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; background-color: #ccc; border: solid 1px #333; border-radius: 4px; box-shadow: 0px 0px 8px 0px #555, 0px 0px 25px 0px #555 inset; cursor: pointer; transition: 0.4s ease-out; } input[type=range]:hover { background: rgba(255, 255, 255, 0.2); box-shadow: 0px 0px 13px 0px #444, 0px 0px 20px 0px #444 inset; } input[type=range]:hover::-webkit-slider-thumb { border: solid 1px #444; box-shadow: 0px 0px 15px 0px #444, 0px 0px 20px 0px #444 inset; } input[type=range]:focus { background: rgba(255, 255, 255, 0.4); box-shadow: 0px 0px 18px 0px #333, 0px 0px 15px 0px #333 inset; } input[type=range]:focus::-webkit-slider-thumb { border: solid 1px #333; box-shadow: 0px 0px 22px 0px #333, 0px 0px 15px 0px #333 inset; }
<input type="range" id="brightness_slider" value="90" step="1" min="30" max="100">
these things affect smoothness:
- the width of banner
- the min/max range
- the size of steps
so if have:
- 1000px wide range input
- 0 - 1000 range
- step size of 1
each step 1px, , quite smooth.
if have:
- 1000px wide range input
- 0 -100 range
- step size of 25
it snap between allowable values, appearing less fluid.
this feature of interaction between step size , range, , provides useful feedback user on values acceptable.
Comments
Post a Comment