2
How to do this effect on the text inside the progress bar where the text changes color according to bar fill, and when the bar reaches the text, only a part of the text changes color?
See that when you’re in 50% half of the text color turns white in contrast to the black background and the other half black in contrast to the white background. When the background below the text is white, the text is totally black and vice versa.
How to do this using CSS and Javascript for the bar to go from 0% to 100% in a given period of time, say, in 10 seconds?
The bar code would be this below, but can be changed at will so that you can achieve the desired effect:
#barra{
display: block;
width: 298px;
height: 28px;
line-height: 28px;
text-align: center;
color: #000;
border: 1px solid #000;
position: relative;
}
#progresso{
display: block;
width: 15%;
height: 100%;
background: #000;
position: absolute;
top: 0;
left: 0;
}
<div id="barra">
<div id="progresso">
</div>
<strong>15%</strong>
</div>
Related to Soen: https://stackoverflow.com/q/16981763/1452488
– Woss