Last active
December 15, 2015 06:19
-
-
Save felipecabargas/5214983 to your computer and use it in GitHub Desktop.
grayScale + opacity CSS Transition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.class{ | |
opacity: 0.8; | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */ | |
filter: gray; /* IE6-9 */ | |
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */ | |
/*CSS Transition*/ | |
-webkit-transition: all 0,2s ; | |
-moz-transition: all 0,2s ; | |
-ms-transition: all 0,2s ; | |
-o-transition: all 0,2s ; | |
transition: all 0,2s ; | |
} | |
.class:hover{ | |
opacity: 1; | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); | |
-webkit-filter: grayscale(0%); | |
/*CSS Transition*/ | |
-webkit-transition: all 0,2s ; | |
-moz-transition: all 0,2s ; | |
-ms-transition: all 0,2s ; | |
-o-transition: all 0,2s ; | |
transition: all 0,2s ; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code was used on http://www.quierocambiarmedepega.cl/us