How to generate gradient as the image that I attached in a sound wave
var elem = $('div');
var count = elem.length;
var loop = function(){
setTimeout(function(){
elem.each(function(){
var $this = $(this);
var height = (Math.random() * 30) + 1;
$this.css({
'background': 'rgba(0, 0, 0,'+(.75-($this.index()/count)/2)+')',
'bottom': height,
'height': height
});
});
loop();
}, 300);
}
loop();
body {
padding: 100px 0 0 100px;
}
div {
background: #000;
float: left;
height: 1px;
margin: 0 1px 0 0;
position: relative;
transition: all linear 300ms;
width: 2px;
-webkit-box-reflect:below -1px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.35, transparent), to(white));
}
/*estilos que probe yo pero no me funciono*/
background: #000;
float: left;
height: 4px;
margin: 0 1px 0 0;
position: relative;
transition: all linear 300ms;
width: 3px;
z-index: 20;
-webkit-box-reflect:below -1px -webkit-gradient(linear, left top, left bottom, from(#febf0d), color-stop(0.35, #febf0d), to(#febf0d));
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>