Skip to content

Instantly share code, notes, and snippets.

@kogakure
Last active December 20, 2015 16:39
Show Gist options
  • Select an option

  • Save kogakure/6163186 to your computer and use it in GitHub Desktop.

Select an option

Save kogakure/6163186 to your computer and use it in GitHub Desktop.
CSS: Create Masks in WebKit (with pulse)
<img class="cutout pulse" src="http://jedidiah.eu/code/css/masks/images/periwinkle.jpg" alt="">
/**
* 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