JSFiddle - React, Tailwind, and code Playground
by Cone
HTML
<div class="demo2">
<div id="progressBar" class="default">
<div></div>
</div> <span class="img">
<img src="http://www.mrwallpaper.com/wallpapers/Yamaha-Motorcycle-YZF-R6.jpg?1373742338" />
<img src="http://www.usabobbers.com/wp-content/uploads/2012/01/Yamaha-XS650-Lime-Green-Bobber-Motorcycle.jpeg?1373742338" />
<img src="http://wallpoper.com/images/00/38/49/40/american-cars_00384940.jpg?1373742338" />
<img src="http://wallpoper.com/images/00/26/14/38/cars-saleen_00261438.jpg?1373742338" />
</span>
</div>
CSS
.default {
background: #292929;
border: 1px solid #111;
border-radius: 5px;
overflow: hidden;
box-shadow: 0 0 5px #333;
}
.default div {
background-color: #1a82f7;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0099FF), to(#1a82f7));
background: -webkit-linear-gradient(top, #0099FF, #1a82f7);
background: -moz-linear-gradient(top, #0099FF, #1a82f7);
background: -ms-linear-gradient(top, #0099FF, #1a82f7);
background: -o-linear-gradient(top, #0099FF, #1a82f7);
}
#progressBar {
margin-left: 100px;
width: 400px;
height: 22px;
}
#progressBar div {
height: 100%;
color: #fff;
text-align: right;
font-size: 12px;
line-height: 22px;
width: 0;
}
#page {
margin: 0 auto;
width: 600px;
}
a {
color: #777;
text-decoration: none;
display: inline-block;
}
a:hover {
color: #333;
}
.bar {
background-color: #f4f4f4;
color: #333;
box-shadow: 0px 0px 2px #333;
line-height: 22px;
padding: 2px 20px 0;
font-family:'Josefin Sans', sans-serif;
font-weight: 400;
font-size: 13px;
overflow: hidden;
}
.bar:hover {
opacity: 1;
}
.bar a {
color: #333;
}
.bar a:hover {
color: #000;
text-decoration: underline;
}
h1 {
padding: 0;
margin: 60px 0 60px;
color: #282828;
font-family:'Josefin Sans', sans-serif;
font-weight: 400;
text-align: center;
font-size: 45px;
line-height: 40px;
text-align: center;
}
p {
font-size: 20px;
font-family:'Josefin Sans', sans-serif;
line-height: 26px;
}
.steps {
margin: 20px 0;
text-align: center;
}
.steps a {
padding: 3px 0px;
margin: 0 10px;
text-decoration: none;
font-size: 15px;
color: #777;
}
.steps a:hover {
color: #111;
}
small {
font-weight: 100;
}
#ad {
width: 468px;
padding: 5px 5px 0 5px;
background-color: #e3e3e3;
float: left;
box-shadow: 0 0 3px #999;
margin-top: 30px;
margin-left:...
JavaScript
function progressBar(percent, $element) {
var progressBarWidth = percent * $element.width() / 100;
$element.find('div').animate({
width: progressBarWidth
}, 500).html(percent + "% ");
}
var numberOfImages = $('.img img').length,
numberOfLoaded = 0,
step = 100 / numberOfImages;
$('.img img').each( function (i, item) {
$(item).load( function () {
numberOfLoaded++;
progressBar(step * numberOfLoaded, $('#progressBar'));
});
});