I need to take a grayscale shot on rgba using CSS. I know I can change it with CSS3, but I need smooth animation. I need to fill the color from bottom to top using animation. I attach the image to make it clear.

Please check this fiddle , this is what I have done so far.
HTML :
<img src="http://static.wallpedes.com/wallpaper/resolution/resolution-of-wallpaper-pictures-with-green-eyes-hd-best-girls-full-hd-wallpapers-wallpaper-site-for-mobile-android-download-facebook-2012-app-in-the-world.jpg"/>
CSS :
img {
-webkit-animation: mymove 5s;
-moz-animation: mymove 5s;
-ms-animation: mymove 5s;
animation: mymove 5s;
width: 400px;
}
@-webkit-keyframes mymove {
0% {
-webkit-filter: grayscale(100%);
-mos-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
100% {
-webkit-filter: grayscale(0%);
-mos-filter: grayscale(0%);
-moz-filter: grayscale(0%);
filter: grayscale(0%);
}
}
@-moz-keyframes mymove {
0% {
-webkit-filter: grayscale(100%);
-mos-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
100% {
-webkit-filter: grayscale(0%);
-mos-filter: grayscale(0%);
-moz-filter: grayscale(0%);
filter: grayscale(0%);
}
}
@-ms-keyframes mymove {
0% {
-webkit-filter: grayscale(100%);
-mos-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
100% {
-webkit-filter: grayscale(0%);
-mos-filter: grayscale(0%);
-moz-filter: grayscale(0%);
filter: grayscale(0%);
}
}
@keyframes mymove {
0% {
-webkit-filter: grayscale(100%);
-mos-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
100% {
-webkit-filter: grayscale(0%);
-mos-filter: grayscale(0%);
-moz-filter: grayscale(0%);
filter: grayscale(0%);
}
}
Thanks in advance.
source
share