Last active
December 20, 2015 16:39
-
-
Save kogakure/6163186 to your computer and use it in GitHub Desktop.
CSS: Create Masks in WebKit (with pulse)
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
| <img class="cutout pulse" src="http://jedidiah.eu/code/css/masks/images/periwinkle.jpg" alt=""> |
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
| /** | |
| * Create Masks in WebKit (with pulse) | |
| * http://jedidiah.eu/code/css/masks/ | |
| */ | |
| .cutout{ | |
| -webkit-mask:url(http://jedidiah.eu/code/css/masks/images/heartmask.png) no-repeat center center; | |
| } | |
| .cutout.pulse:hover{ | |
| -webkit-animation-name: pulsed; | |
| -webkit-animation-duration: 1s; | |
| -webkit-animation-timing-function: ease-in-out; | |
| -webkit-animation-iteration-count: infinite; | |
| -webkit-animation-direction: alternate; | |
| -webkit-mask-size: auto 100%; | |
| } | |
| @-webkit-keyframes pulsed { | |
| 0% { -webkit-mask-size: auto 100%; } | |
| 100% { -webkit-mask-size: auto 90%; } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment