Music bars animation
This demo is hand-crafted using the mighty magic of CSS3 animation & CSS3 filters.
HTML
<div class="main">
<h1>Music bars animation</h1>
<p>This demo is hand-crafted using the mighty magic of <strong>CSS3 animation</strong> & <strong>CSS3 filters.</strong></p><p><small> Currently can be run in <strong>webkit based browsers</strong> as it strongly depends on CSS3 filters support. You can crosscheck <a href="http://caniuse.com/#feat=css-filters">compatibility table</a> for CSS3 filters on caniuse.com<br/><br/></small></p>
<p class="hue"><small>Author <a href="http://profile.idesigned.cz/marakoss">Marek Králík</a> @ <a href="http://www.idesigned.cz/">Image Design</a></small><br/><br/></p>
<div class="show">
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
<div class="bar bounce"></div>
</div>
</div>
CSS
.show{
position: relative;
width: 450px;
height: 400px;
border: 2px solid #111;
/*
* colors of image must be inverted, because filter "difference" produces black color.
*/
-webkit-filter: invert(100%);
}
.show:before, .show:after{
content:"";
display: block;
position: absolute;
/*
* Make it full size of parent element
*/
left:0;
top:0;
right:0;
bottom:0;
z-index:-1;
/*
* defined background
*/
background: white url('http://img1.mxstatic.com/wallpapers/13499fe35124f362588fb75280a9a188_large.jpeg') 0 0 no-repeat;
background-size: cover;
/*
* colors of image must be inverted, because filter "difference" produces black color.
*/
-webkit-filter: invert(100%);
/*
* Avoid clicking for this layers
*/
/*pointer-events: none;*/
}
.show:after{
z-index: 999;
/* the magic */
mix-blend-mode: difference;
}
.bar{
width: 20px;
height: 200px;
margin: 120px 10px 0 10px;
background: black;
float: left;
position: relative;
}
.bounce {
bottom:0;
animation: bounce 1s ease -5s infinite;
-webkit-animation: bounce 1s ease -5s infinite;
}
@-webkit-keyframes bounce {
0% { bottom:5px; }
25% { bottom:25px; }
50% { bottom:50px; }
75% { bottom:25px; }
98% {bottom:0;}
100% {bottom:5px;}
}
.bounce:nth-child(1){
-webkit-animation-delay: -1s;
animation-delay: -1s;
}
.bounce:nth-child(2){
-webkit-animation-delay: -1.2s;
animation-delay: -1.2s;
}
.bounce:nth-child(3){
-webkit-animation-delay: -1.4s;
animation-delay: -1.4s;
}
.bounce:nth-child(4){
-webkit-animation-delay: -1.6s;
animation-delay: -1.6s;
}
.bounce:nth-child(5){
-webkit-animation-delay: -1.8s;
animation-delay: -1.8s;
}
.bounce:nth-child(6){
-webkit-animation-delay: -2s;
animation-delay:...