range slider style : demo 6

0
0
0

HTML

                        
0

CSS

                        .demo{ background: #612a05; }
                        .range-slider{ margin: 50px 0 0 0; }
                        .range-slider input[type="range"]{
                            width: calc(100% - (68px));
                            height: 8px;
                            background: rgba(195, 195, 195, 0.4);
                            outline: none;
                            float: left;
                            -webkit-appearance: none;
                            position: relative;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb{
                            width: 35px;
                            height: 35px;
                            background: #fab403;
                            cursor: pointer;
                            -webkit-appearance: none;
                            appearance: none;
                            -webkit-clip-path: polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%);
                            clip-path: polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%);
                            transition: all 0.15s ease-in-out 0s;
                        }
                        .range-slider input[type="range"]::-webkit-slider-thumb:hover,
                        .range-slider input[type="range"]:active::-webkit-slider-thumb{ background: #0deccf; }
                        .range-slider input[type="range"]::-moz-range-thumb{
                            width: 35px;
                            height: 35px;
                            background: #fab403;
                            cursor: pointer;
                            -webkit-clip-path: polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%);
                            clip-path: polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%);
                            transition: all 0.15s ease-in-out 0s;
                        }
                        .range-slider input[type="range"]::-moz-range-thumb:hover,
                        .range-slider input[type="range"]:active::-moz-range-thumb{ background: #0deccf; }
                        .range-slider .range-value{
                            display: inline-block;
                            width: 50px;
                            height: 50px;
                            background: #0a0a0a;
                            margin-left: 8px;
                            font-size: 18px;
                            font-weight: 600;
                            color: #fff;
                            line-height: 40px;
                            text-align: center;
                            position: relative;
                            top: -13px;
                            -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
                            clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
                        }
                        ::-moz-range-track{
                            background: transparent;
                            border: 0;
                        }
                    

JavaScript

(Range Slider depend on jQuery.)
                        

                        $(document).ready(function(){
                            var rangeSlider = function(){
                                var slider = $('.range-slider'),
                                    range = $('.range-slider input[type="range"]'),
                                    value = $('.range-value');
                                slider.each(function(){
                                    value.each(function(){
                                        var value = $(this).prev().attr('value');
                                        $(this).html(value);
                                    });
                                    range.on('input', function(){
                                        $(this).next(value).html(this.value);
                                    });
                                });
                            };
                            rangeSlider();
                        });
                    
License Terms