Created
January 4, 2012 23:30
-
-
Save LeaVerou/1562834 to your computer and use it in GitHub Desktop.
grayscale() and saturate() filters demo
This file contains 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
/** | |
* grayscale() and saturate() filters demo | |
* Webkit-only at the moment (Chrome Canary or Webkit nightlies) | |
*/ | |
img { | |
transition: .5s -webkit-filter; | |
} | |
img:first-of-type { | |
-webkit-filter: grayscale(100%); | |
} | |
img:nth-of-type(2) { | |
-webkit-filter: saturate(0%); | |
} | |
img:nth-of-type(3) { | |
-webkit-filter: saturate(500%); | |
} | |
img:nth-of-type(4) { | |
-webkit-filter: saturate(50000%); | |
} | |
img:hover { | |
-webkit-filter: none; | |
} |
This file contains 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
<h1>Hover over the kittens to see how the original image looked like</h1> | |
<img src="http://placekitten.com/250/220" /> | |
<img src="http://placekitten.com/250/220" /> | |
<img src="http://placekitten.com/250/220" /> | |
<img src="http://placekitten.com/250/220" /> |
This file contains 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
{"view":"split-vertical","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment