0

I need help with volume slider. I am building a player based on wavesurfer.js but don't know how to customize the look of the slider to look like the image below. I am not a coder and tried customizing this example here https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_rangeslider

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.slidecontainer {
  width: 100%;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 25px;
  background: #d3d3d3;
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
}

.slider:hover {
  opacity: 1;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  background: #4CAF50;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 25px;
  height: 25px;
  background: #4CAF50;
  cursor: pointer;
}
</style>
</head>
<body>

<h1>Custom Range Slider</h1>

  
  <p>Custom range slider:</p>
  <input type="range" min="1" max="100" value="50" class="slider" id="myRange">
</div>

</body>
</html>

This is what I am looking to build:

Dashed volume slider

dim4ny
  • 11
  • 1

1 Answers1

0

Add this property snippet:

background: repeating-linear-gradient( 
to right,
#f6ba52,
#f6ba52 10px,
#ffd180 10px,
#ffd180 20px
);

in your .volumeBar{} you can play around with color

Nompumelelo
  • 929
  • 3
  • 17
  • 28
  • Thanks so much Lelo. I got the dotted pattern going but is there a way to create a fill effect? Basically changing the dotted line from black to green and if the user adjusts by hovering or clicking on it? I almost feel like creating individual buttons and have a hover and on click type of structure because I can control the width of the dotted line but then I don't know how to pair them to the script so they act as "volume adjuster". I am so lost. – dim4ny Aug 13 '19 at 00:12