Skip to content

Instantly share code, notes, and snippets.

@btotr
Created June 20, 2013 14:17
Show Gist options
  • Save btotr/5823104 to your computer and use it in GitHub Desktop.
Save btotr/5823104 to your computer and use it in GitHub Desktop.
A CodePen by Colin Meerveld. blur
<svg xmlns="http://www.w3.org/2000/svg"
width="400"
height="400"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="blur">
<feGaussianBlur stdDeviation="10 2"/>
</filter>
</defs>
<rect x="10" y="10"
width="100" height="100"
rx="15" ry="15"/>
</svg>
document.addEventListener("keydown", function(e){
document.getElementsByTagName("svg")[0].classList.toggle("move");
}, false);
svg {
-webkit-transform: translate3D(0, 0, 0);
-webkit-transition: -webkit-transform 320ms ease-out;
}
svg.move {
-webkit-transform: translate3d(400px,0px,0);
}
svg rect {
fill:red;
}
svg.move rect {
filter:url(#blur);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment